
char fgets_trim_sanitize(FILE *fp,char *fmt)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  byte *pbVar4;
  byte bVar5;
  byte *pbVar6;
  int iVar7;
  
  iVar7 = *(int *)PTR_ptr_to_globals_0012a304;
  pbVar6 = (byte *)(iVar7 + 0x58);
  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp);
  if (iVar2 == 0) {
    (*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);
  }
  pcVar3 = (char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);
  bVar5 = *(byte *)(iVar7 + 0x58);
  cVar1 = *pcVar3;
  pbVar4 = pbVar6;
  if (bVar5 == 0) {
LAB_00052f50:
    *pbVar4 = 0;
  }
  else {
    do {
      if (bVar5 < 0x20) {
        if (bVar5 != 9) goto LAB_00052f50;
        *pbVar4 = 0x20;
      }
      pbVar4 = pbVar4 + 1;
      bVar5 = *pbVar4;
    } while (bVar5 != 0);
    *pbVar4 = 0;
  }
  if ((fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)) {
    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);
  }
  return cVar1;
}



uint FUN_00052eb0(undefined4 param_1,int param_2)

{
  byte bVar1;
  int iVar2;
  uint uVar3;
  byte *pbVar4;
  byte bVar5;
  byte *pbVar6;
  int iVar7;
  
  iVar7 = *(int *)PTR_DAT_0012a304;
  pbVar6 = (byte *)(iVar7 + 0x58);
  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);
  if (iVar2 == 0) {
    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);
    return uVar3;
  }
  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);
  bVar5 = *(byte *)(iVar7 + 0x58);
  bVar1 = *pbVar4;
  pbVar4 = pbVar6;
  if (bVar5 == 0) {
LAB_00052f50:
    *pbVar4 = 0;
  }
  else {
    do {
      if (bVar5 < 0x20) {
        if (bVar5 != 9) goto LAB_00052f50;
        *pbVar4 = 0x20;
      }
      pbVar4 = pbVar4 + 1;
      bVar5 = *pbVar4;
    } while (bVar5 != 0);
    *pbVar4 = 0;
  }
  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {
    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);
  }
  return (uint)bVar1;
}


lui gp,0xe
addiu gp,gp,-0xd60
addu gp,gp,t9
lw v0,-0x7e4c(gp)
addiu sp,sp,-0x28
lw t9,-0x7428(gp)
or a2,a0,zero
sw s2,0x20(sp)
sw s0,0x18(sp)
sw s1,0x1c(sp)
or s1,a1,zero
lw s2,0x0(v0)
lui a1,0x1
sw gp,0x10(sp)
sw ra,0x24(sp)
addiu s0,s2,0x58
jalr t9
_or a0,s0,zero
bne v0,zero,0x00052f10
_lw gp,0x10(sp)
lw a0,-0x7fc4(gp)
lw t9,-0x7f64(gp)
jalr t9
_addiu a0,a0,0x4d94
lw t9,-0x6ff0(gp)
li a1,0xa
jalr t9
_or a0,s0,zero
or v1,s0,zero
lbu a0,0x58(s2)
lw gp,0x10(sp)
beq a0,zero,0x00052f50
_lbu s2,0x0(v0)
li a1,0x9
li v0,0x20
sltiu a2,a0,0x20
beq a2,zero,0x00052fa4
_nop
beq a0,a1,0x00052fa0
_nop
beq s1,zero,0x00052f84
_sb zero,0x0(v1)
lw v0,-0x7e1c(gp)
lw v0,0x0(v0)
andi v0,v0,0x4
beq v0,zero,0x00052f84
_lw v0,-0x6fcc(gp)
li a1,0x1
lw t9,-0x7444(gp)
or a3,s0,zero
or a2,s1,zero
jalr t9
_lw a0,0x0(v0)
lw ra,0x24(sp)
or v0,s2,zero
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
sb v0,0x0(v1)
addiu v1,v1,0x1
lbu a0,0x0(v1)
bne a0,zero,0x00052f40
_sltiu a2,a0,0x20
beq s1,zero,0x00052f84
_sb zero,0x0(v1)
b 0x00052f5c
_lw v0,-0x7e1c(gp)
(translation_unit "uint FUN_00052eb0(undefined4 param_1,int param_2)\n\n{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}\n\n" (function_definition "uint FUN_00052eb0(undefined4 param_1,int param_2)\n\n{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}" type_identifier (function_declarator "FUN_00052eb0(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar7 = *(int *)PTR_DAT_0012a304;" (assignment_expression "iVar7 = *(int *)PTR_DAT_0012a304" identifier = (pointer_expression "*(int *)PTR_DAT_0012a304" * (cast_expression "(int *)PTR_DAT_0012a304" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "pbVar6 = (byte *)(iVar7 + 0x58);" (assignment_expression "pbVar6 = (byte *)(iVar7 + 0x58)" identifier = (cast_expression "(byte *)(iVar7 + 0x58)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x58)" ( (binary_expression "iVar7 + 0x58" identifier + number_literal) )))) ;) (expression_statement "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);" (assignment_expression "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1)" identifier = (call_expression "(*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1)" (parenthesized_expression "(*(code *)PTR_fgets_unlocked_0012ad28)" ( (pointer_expression "*(code *)PTR_fgets_unlocked_0012ad28" * (cast_expression "(code *)PTR_fgets_unlocked_0012ad28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pbVar6,0x10000,param_1)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }" { (expression_statement "uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);" (assignment_expression "uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" identifier = (call_expression "(*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" (parenthesized_expression "(*(code *)PTR_FUN_0012a1ec)" ( (pointer_expression "*(code *)PTR_FUN_0012a1ec" * (cast_expression "(code *)PTR_FUN_0012a1ec" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_UINT_0012a18c + 0x4d94)" ( (binary_expression "PTR_UINT_0012a18c + 0x4d94" identifier + number_literal) )))) ;) (return_statement "return uVar3;" return identifier ;) })) (expression_statement "pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);" (assignment_expression "pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" identifier = (cast_expression "(byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" (parenthesized_expression "(*(code *)PTR_strchrnul_0012b160)" ( (pointer_expression "*(code *)PTR_strchrnul_0012b160" * (cast_expression "(code *)PTR_strchrnul_0012b160" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pbVar6,10)" ( identifier , number_literal ))))) ;) (expression_statement "bVar5 = *(byte *)(iVar7 + 0x58);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 0x58)" identifier = (pointer_expression "*(byte *)(iVar7 + 0x58)" * (cast_expression "(byte *)(iVar7 + 0x58)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x58)" ( (binary_expression "iVar7 + 0x58" identifier + number_literal) ))))) ;) (expression_statement "bVar1 = *pbVar4;" (assignment_expression "bVar1 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) (expression_statement "pbVar4 = pbVar6;" (assignment_expression "pbVar4 = pbVar6" identifier = identifier) ;) (if_statement "if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" if (parenthesized_expression "(bVar5 == 0)" ( (binary_expression "bVar5 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_00052f50:\n    *pbVar4 = 0;\n  }" { (labeled_statement "LAB_00052f50:\n    *pbVar4 = 0;" statement_identifier : (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" * identifier) = number_literal) ;)) }) (else_clause "else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" else (compound_statement "{\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" { (do_statement "do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);" do (compound_statement "{\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    }" { (if_statement "if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" if (parenthesized_expression "(bVar5 < 0x20)" ( (binary_expression "bVar5 < 0x20" identifier < number_literal) )) (compound_statement "{\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" { (if_statement "if (bVar5 != 9) goto LAB_00052f50;" if (parenthesized_expression "(bVar5 != 9)" ( (binary_expression "bVar5 != 9" identifier != number_literal) )) (goto_statement "goto LAB_00052f50;" goto statement_identifier ;)) (expression_statement "*pbVar4 = 0x20;" (assignment_expression "*pbVar4 = 0x20" (pointer_expression "*pbVar4" * identifier) = number_literal) ;) })) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) }) while (parenthesized_expression "(bVar5 != 0)" ( (binary_expression "bVar5 != 0" identifier != number_literal) )) ;) (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" * identifier) = number_literal) ;) }))) (if_statement "if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }" if (parenthesized_expression "((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0))" ( (binary_expression "(param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)" (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) && (parenthesized_expression "((*(uint *)PTR_DAT_0012a334 & 4) != 0)" ( (binary_expression "(*(uint *)PTR_DAT_0012a334 & 4) != 0" (parenthesized_expression "(*(uint *)PTR_DAT_0012a334 & 4)" ( (binary_expression "*(uint *)PTR_DAT_0012a334 & 4" (pointer_expression "*(uint *)PTR_DAT_0012a334" * (cast_expression "(uint *)PTR_DAT_0012a334" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }" { (expression_statement "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);" (call_expression "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6)" (parenthesized_expression "(*(code *)PTR___fprintf_chk_0012ad0c)" ( (pointer_expression "*(code *)PTR___fprintf_chk_0012ad0c" * (cast_expression "(code *)PTR___fprintf_chk_0012ad0c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6)" ( (pointer_expression "*(undefined4 *)PTR_stderr_0012b184" * (cast_expression "(undefined4 *)PTR_stderr_0012b184" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) , number_literal , identifier , identifier ))) ;) })) (return_statement "return (uint)bVar1;" return (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier) ;) })))
(translation_unit "char fgets_trim_sanitize(FILE *fp,char *fmt)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_ptr_to_globals_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp);\n  if (iVar2 == 0) {\n    (*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n  }\n  pcVar3 = (char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  cVar1 = *pcVar3;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);\n  }\n  return cVar1;\n}\n\n" (function_definition "char fgets_trim_sanitize(FILE *fp,char *fmt)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_ptr_to_globals_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp);\n  if (iVar2 == 0) {\n    (*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n  }\n  pcVar3 = (char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  cVar1 = *pcVar3;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);\n  }\n  return cVar1;\n}" primitive_type (function_declarator "fgets_trim_sanitize(FILE *fp,char *fmt)" identifier (parameter_list "(FILE *fp,char *fmt)" ( (parameter_declaration "FILE *fp" type_identifier (pointer_declarator "*fp" * identifier)) , (parameter_declaration "char *fmt" primitive_type (pointer_declarator "*fmt" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_ptr_to_globals_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp);\n  if (iVar2 == 0) {\n    (*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n  }\n  pcVar3 = (char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  cVar1 = *pcVar3;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);\n  }\n  return cVar1;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar7 = *(int *)PTR_ptr_to_globals_0012a304;" (assignment_expression "iVar7 = *(int *)PTR_ptr_to_globals_0012a304" identifier = (pointer_expression "*(int *)PTR_ptr_to_globals_0012a304" * (cast_expression "(int *)PTR_ptr_to_globals_0012a304" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "pbVar6 = (byte *)(iVar7 + 0x58);" (assignment_expression "pbVar6 = (byte *)(iVar7 + 0x58)" identifier = (cast_expression "(byte *)(iVar7 + 0x58)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x58)" ( (binary_expression "iVar7 + 0x58" identifier + number_literal) )))) ;) (expression_statement "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp);" (assignment_expression "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp)" identifier = (call_expression "(*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,fp)" (parenthesized_expression "(*(code *)PTR_fgets_unlocked_0012ad28)" ( (pointer_expression "*(code *)PTR_fgets_unlocked_0012ad28" * (cast_expression "(code *)PTR_fgets_unlocked_0012ad28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pbVar6,0x10000,fp)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar2 == 0) {\n    (*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    (*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n  }" { (expression_statement "(*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);" (call_expression "(*(code *)PTR_bb_perror_msg_and_die_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" (parenthesized_expression "(*(code *)PTR_bb_perror_msg_and_die_0012a1ec)" ( (pointer_expression "*(code *)PTR_bb_perror_msg_and_die_0012a1ec" * (cast_expression "(code *)PTR_bb_perror_msg_and_die_0012a1ec" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_UINT_0012a18c + 0x4d94)" ( (binary_expression "PTR_UINT_0012a18c + 0x4d94" identifier + number_literal) ))) ;) })) (expression_statement "pcVar3 = (char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);" (assignment_expression "pcVar3 = (char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" identifier = (cast_expression "(char *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" (parenthesized_expression "(*(code *)PTR_strchrnul_0012b160)" ( (pointer_expression "*(code *)PTR_strchrnul_0012b160" * (cast_expression "(code *)PTR_strchrnul_0012b160" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pbVar6,10)" ( identifier , number_literal ))))) ;) (expression_statement "bVar5 = *(byte *)(iVar7 + 0x58);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 0x58)" identifier = (pointer_expression "*(byte *)(iVar7 + 0x58)" * (cast_expression "(byte *)(iVar7 + 0x58)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x58)" ( (binary_expression "iVar7 + 0x58" identifier + number_literal) ))))) ;) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" identifier = (pointer_expression "*pcVar3" * identifier)) ;) (expression_statement "pbVar4 = pbVar6;" (assignment_expression "pbVar4 = pbVar6" identifier = identifier) ;) (if_statement "if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" if (parenthesized_expression "(bVar5 == 0)" ( (binary_expression "bVar5 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_00052f50:\n    *pbVar4 = 0;\n  }" { (labeled_statement "LAB_00052f50:\n    *pbVar4 = 0;" statement_identifier : (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" * identifier) = number_literal) ;)) }) (else_clause "else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" else (compound_statement "{\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" { (do_statement "do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);" do (compound_statement "{\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    }" { (if_statement "if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" if (parenthesized_expression "(bVar5 < 0x20)" ( (binary_expression "bVar5 < 0x20" identifier < number_literal) )) (compound_statement "{\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" { (if_statement "if (bVar5 != 9) goto LAB_00052f50;" if (parenthesized_expression "(bVar5 != 9)" ( (binary_expression "bVar5 != 9" identifier != number_literal) )) (goto_statement "goto LAB_00052f50;" goto statement_identifier ;)) (expression_statement "*pbVar4 = 0x20;" (assignment_expression "*pbVar4 = 0x20" (pointer_expression "*pbVar4" * identifier) = number_literal) ;) })) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) }) while (parenthesized_expression "(bVar5 != 0)" ( (binary_expression "bVar5 != 0" identifier != number_literal) )) ;) (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" * identifier) = number_literal) ;) }))) (if_statement "if ((fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);\n  }" if (parenthesized_expression "((fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0))" ( (binary_expression "(fmt != (char *)0x0) && ((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)" (parenthesized_expression "(fmt != (char *)0x0)" ( (binary_expression "fmt != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "((*(uint *)PTR_option_mask32_0012a334 & 4) != 0)" ( (binary_expression "(*(uint *)PTR_option_mask32_0012a334 & 4) != 0" (parenthesized_expression "(*(uint *)PTR_option_mask32_0012a334 & 4)" ( (binary_expression "*(uint *)PTR_option_mask32_0012a334 & 4" (pointer_expression "*(uint *)PTR_option_mask32_0012a334" * (cast_expression "(uint *)PTR_option_mask32_0012a334" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);\n  }" { (expression_statement "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6);" (call_expression "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6)" (parenthesized_expression "(*(code *)PTR___fprintf_chk_0012ad0c)" ( (pointer_expression "*(code *)PTR___fprintf_chk_0012ad0c" * (cast_expression "(code *)PTR___fprintf_chk_0012ad0c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(*(undefined4 *)PTR_stderr_0012b184,1,fmt,pbVar6)" ( (pointer_expression "*(undefined4 *)PTR_stderr_0012b184" * (cast_expression "(undefined4 *)PTR_stderr_0012b184" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) , number_literal , identifier , identifier ))) ;) })) (return_statement "return cVar1;" return identifier ;) })))
(translation_unit "uint FUN_00052eb0(undefined4 param_1,int param_2)\n\n{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}\n\n" (function_definition "uint FUN_00052eb0(undefined4 param_1,int param_2)\n\n{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}" type_identifier (function_declarator "FUN_00052eb0(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar7 = *(int *)PTR_DAT_0012a304;" (assignment_expression "iVar7 = *(int *)PTR_DAT_0012a304" identifier = (pointer_expression "*(int *)PTR_DAT_0012a304" * (cast_expression "(int *)PTR_DAT_0012a304" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "pbVar6 = (byte *)(iVar7 + 0x58);" (assignment_expression "pbVar6 = (byte *)(iVar7 + 0x58)" identifier = (cast_expression "(byte *)(iVar7 + 0x58)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x58)" ( (binary_expression "iVar7 + 0x58" identifier + number_literal) )))) ;) (expression_statement "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);" (assignment_expression "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1)" identifier = (call_expression "(*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1)" (parenthesized_expression "(*(code *)PTR_fgets_unlocked_0012ad28)" ( (pointer_expression "*(code *)PTR_fgets_unlocked_0012ad28" * (cast_expression "(code *)PTR_fgets_unlocked_0012ad28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pbVar6,0x10000,param_1)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }" { (expression_statement "uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);" (assignment_expression "uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" identifier = (call_expression "(*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" (parenthesized_expression "(*(code *)PTR_FUN_0012a1ec)" ( (pointer_expression "*(code *)PTR_FUN_0012a1ec" * (cast_expression "(code *)PTR_FUN_0012a1ec" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_UINT_0012a18c + 0x4d94)" ( (binary_expression "PTR_UINT_0012a18c + 0x4d94" identifier + number_literal) )))) ;) (return_statement "return uVar3;" return identifier ;) })) (expression_statement "pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);" (assignment_expression "pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" identifier = (cast_expression "(byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" (parenthesized_expression "(*(code *)PTR_strchrnul_0012b160)" ( (pointer_expression "*(code *)PTR_strchrnul_0012b160" * (cast_expression "(code *)PTR_strchrnul_0012b160" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pbVar6,10)" ( identifier , number_literal ))))) ;) (expression_statement "bVar5 = *(byte *)(iVar7 + 0x58);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 0x58)" identifier = (pointer_expression "*(byte *)(iVar7 + 0x58)" * (cast_expression "(byte *)(iVar7 + 0x58)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x58)" ( (binary_expression "iVar7 + 0x58" identifier + number_literal) ))))) ;) (expression_statement "bVar1 = *pbVar4;" (assignment_expression "bVar1 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) (expression_statement "pbVar4 = pbVar6;" (assignment_expression "pbVar4 = pbVar6" identifier = identifier) ;) (if_statement "if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" if (parenthesized_expression "(bVar5 == 0)" ( (binary_expression "bVar5 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_00052f50:\n    *pbVar4 = 0;\n  }" { (labeled_statement "LAB_00052f50:\n    *pbVar4 = 0;" statement_identifier : (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" * identifier) = number_literal) ;)) }) (else_clause "else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" else (compound_statement "{\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" { (do_statement "do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);" do (compound_statement "{\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    }" { (if_statement "if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" if (parenthesized_expression "(bVar5 < 0x20)" ( (binary_expression "bVar5 < 0x20" identifier < number_literal) )) (compound_statement "{\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" { (if_statement "if (bVar5 != 9) goto LAB_00052f50;" if (parenthesized_expression "(bVar5 != 9)" ( (binary_expression "bVar5 != 9" identifier != number_literal) )) (goto_statement "goto LAB_00052f50;" goto statement_identifier ;)) (expression_statement "*pbVar4 = 0x20;" (assignment_expression "*pbVar4 = 0x20" (pointer_expression "*pbVar4" * identifier) = number_literal) ;) })) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) }) while (parenthesized_expression "(bVar5 != 0)" ( (binary_expression "bVar5 != 0" identifier != number_literal) )) ;) (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" * identifier) = number_literal) ;) }))) (if_statement "if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }" if (parenthesized_expression "((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0))" ( (binary_expression "(param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)" (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) && (parenthesized_expression "((*(uint *)PTR_DAT_0012a334 & 4) != 0)" ( (binary_expression "(*(uint *)PTR_DAT_0012a334 & 4) != 0" (parenthesized_expression "(*(uint *)PTR_DAT_0012a334 & 4)" ( (binary_expression "*(uint *)PTR_DAT_0012a334 & 4" (pointer_expression "*(uint *)PTR_DAT_0012a334" * (cast_expression "(uint *)PTR_DAT_0012a334" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }" { (expression_statement "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);" (call_expression "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6)" (parenthesized_expression "(*(code *)PTR___fprintf_chk_0012ad0c)" ( (pointer_expression "*(code *)PTR___fprintf_chk_0012ad0c" * (cast_expression "(code *)PTR___fprintf_chk_0012ad0c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6)" ( (pointer_expression "*(undefined4 *)PTR_stderr_0012b184" * (cast_expression "(undefined4 *)PTR_stderr_0012b184" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) , number_literal , identifier , identifier ))) ;) })) (return_statement "return (uint)bVar1;" return (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) )))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;)) }) (else_clause else (compound_statement { (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) & LIT) )) != LIT) ))) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) , LIT , IDENT , IDENT ))) ;) })) (return_statement return (cast_expression ( (type_descriptor TYPE) ) IDENT) ;) })))
(function_definition "uint FUN_00052eb0(undefined4 param_1,int param_2)\n\n{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}" (type_identifier "uint") (function_declarator "FUN_00052eb0(undefined4 param_1,int param_2)" (identifier "FUN_00052eb0") (parameter_list "(undefined4 param_1,int param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  uint uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  int iVar7;\n  \n  iVar7 = *(int *)PTR_DAT_0012a304;\n  pbVar6 = (byte *)(iVar7 + 0x58);\n  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);\n  if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }\n  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);\n  bVar5 = *(byte *)(iVar7 + 0x58);\n  bVar1 = *pbVar4;\n  pbVar4 = pbVar6;\n  if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }\n  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }\n  return (uint)bVar1;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "byte *pbVar4;" (type_identifier "byte") (pointer_declarator "*pbVar4" (* "*") (identifier "pbVar4")) (; ";")) (declaration "byte bVar5;" (type_identifier "byte") (identifier "bVar5") (; ";")) (declaration "byte *pbVar6;" (type_identifier "byte") (pointer_declarator "*pbVar6" (* "*") (identifier "pbVar6")) (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (expression_statement "iVar7 = *(int *)PTR_DAT_0012a304;" (assignment_expression "iVar7 = *(int *)PTR_DAT_0012a304" (identifier "iVar7") (= "=") (pointer_expression "*(int *)PTR_DAT_0012a304" (* "*") (cast_expression "(int *)PTR_DAT_0012a304" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_DAT_0012a304")))) (; ";")) (expression_statement "pbVar6 = (byte *)(iVar7 + 0x58);" (assignment_expression "pbVar6 = (byte *)(iVar7 + 0x58)" (identifier "pbVar6") (= "=") (cast_expression "(byte *)(iVar7 + 0x58)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x58)" (( "(") (binary_expression "iVar7 + 0x58" (identifier "iVar7") (+ "+") (number_literal "0x58")) () ")")))) (; ";")) (expression_statement "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);" (assignment_expression "iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1)" (parenthesized_expression "(*(code *)PTR_fgets_unlocked_0012ad28)" (( "(") (pointer_expression "*(code *)PTR_fgets_unlocked_0012ad28" (* "*") (cast_expression "(code *)PTR_fgets_unlocked_0012ad28" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fgets_unlocked_0012ad28"))) () ")")) (argument_list "(pbVar6,0x10000,param_1)" (( "(") (identifier "pbVar6") (, ",") (number_literal "0x10000") (, ",") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);\n    return uVar3;\n  }" ({ "{") (expression_statement "uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);" (assignment_expression "uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" (identifier "uVar3") (= "=") (call_expression "(*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94)" (parenthesized_expression "(*(code *)PTR_FUN_0012a1ec)" (( "(") (pointer_expression "*(code *)PTR_FUN_0012a1ec" (* "*") (cast_expression "(code *)PTR_FUN_0012a1ec" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_0012a1ec"))) () ")")) (argument_list "(PTR_UINT_0012a18c + 0x4d94)" (( "(") (binary_expression "PTR_UINT_0012a18c + 0x4d94" (identifier "PTR_UINT_0012a18c") (+ "+") (number_literal "0x4d94")) () ")")))) (; ";")) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}"))) (expression_statement "pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);" (assignment_expression "pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" (identifier "pbVar4") (= "=") (cast_expression "(byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_strchrnul_0012b160)(pbVar6,10)" (parenthesized_expression "(*(code *)PTR_strchrnul_0012b160)" (( "(") (pointer_expression "*(code *)PTR_strchrnul_0012b160" (* "*") (cast_expression "(code *)PTR_strchrnul_0012b160" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strchrnul_0012b160"))) () ")")) (argument_list "(pbVar6,10)" (( "(") (identifier "pbVar6") (, ",") (number_literal "10") () ")"))))) (; ";")) (expression_statement "bVar5 = *(byte *)(iVar7 + 0x58);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 0x58)" (identifier "bVar5") (= "=") (pointer_expression "*(byte *)(iVar7 + 0x58)" (* "*") (cast_expression "(byte *)(iVar7 + 0x58)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x58)" (( "(") (binary_expression "iVar7 + 0x58" (identifier "iVar7") (+ "+") (number_literal "0x58")) () ")"))))) (; ";")) (expression_statement "bVar1 = *pbVar4;" (assignment_expression "bVar1 = *pbVar4" (identifier "bVar1") (= "=") (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4"))) (; ";")) (expression_statement "pbVar4 = pbVar6;" (assignment_expression "pbVar4 = pbVar6" (identifier "pbVar4") (= "=") (identifier "pbVar6")) (; ";")) (if_statement "if (bVar5 == 0) {\nLAB_00052f50:\n    *pbVar4 = 0;\n  }\n  else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" (if "if") (parenthesized_expression "(bVar5 == 0)" (( "(") (binary_expression "bVar5 == 0" (identifier "bVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_00052f50:\n    *pbVar4 = 0;\n  }" ({ "{") (labeled_statement "LAB_00052f50:\n    *pbVar4 = 0;" (statement_identifier "LAB_00052f50") (: ":") (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4")) (= "=") (number_literal "0")) (; ";"))) (} "}")) (else_clause "else {\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" (else "else") (compound_statement "{\n    do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);\n    *pbVar4 = 0;\n  }" ({ "{") (do_statement "do {\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    } while (bVar5 != 0);" (do "do") (compound_statement "{\n      if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }\n      pbVar4 = pbVar4 + 1;\n      bVar5 = *pbVar4;\n    }" ({ "{") (if_statement "if (bVar5 < 0x20) {\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" (if "if") (parenthesized_expression "(bVar5 < 0x20)" (( "(") (binary_expression "bVar5 < 0x20" (identifier "bVar5") (< "<") (number_literal "0x20")) () ")")) (compound_statement "{\n        if (bVar5 != 9) goto LAB_00052f50;\n        *pbVar4 = 0x20;\n      }" ({ "{") (if_statement "if (bVar5 != 9) goto LAB_00052f50;" (if "if") (parenthesized_expression "(bVar5 != 9)" (( "(") (binary_expression "bVar5 != 9" (identifier "bVar5") (!= "!=") (number_literal "9")) () ")")) (goto_statement "goto LAB_00052f50;" (goto "goto") (statement_identifier "LAB_00052f50") (; ";"))) (expression_statement "*pbVar4 = 0x20;" (assignment_expression "*pbVar4 = 0x20" (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4")) (= "=") (number_literal "0x20")) (; ";")) (} "}"))) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" (identifier "pbVar4") (= "=") (binary_expression "pbVar4 + 1" (identifier "pbVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" (identifier "bVar5") (= "=") (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(bVar5 != 0)" (( "(") (binary_expression "bVar5 != 0" (identifier "bVar5") (!= "!=") (number_literal "0")) () ")")) (; ";")) (expression_statement "*pbVar4 = 0;" (assignment_expression "*pbVar4 = 0" (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4")) (= "=") (number_literal "0")) (; ";")) (} "}")))) (if_statement "if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }" (if "if") (parenthesized_expression "((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0))" (( "(") (binary_expression "(param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)" (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "((*(uint *)PTR_DAT_0012a334 & 4) != 0)" (( "(") (binary_expression "(*(uint *)PTR_DAT_0012a334 & 4) != 0" (parenthesized_expression "(*(uint *)PTR_DAT_0012a334 & 4)" (( "(") (binary_expression "*(uint *)PTR_DAT_0012a334 & 4" (pointer_expression "*(uint *)PTR_DAT_0012a334" (* "*") (cast_expression "(uint *)PTR_DAT_0012a334" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_DAT_0012a334"))) (& "&") (number_literal "4")) () ")")) (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);\n  }" ({ "{") (expression_statement "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);" (call_expression "(*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6)" (parenthesized_expression "(*(code *)PTR___fprintf_chk_0012ad0c)" (( "(") (pointer_expression "*(code *)PTR___fprintf_chk_0012ad0c" (* "*") (cast_expression "(code *)PTR___fprintf_chk_0012ad0c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___fprintf_chk_0012ad0c"))) () ")")) (argument_list "(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6)" (( "(") (pointer_expression "*(undefined4 *)PTR_stderr_0012b184" (* "*") (cast_expression "(undefined4 *)PTR_stderr_0012b184" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_stderr_0012b184"))) (, ",") (number_literal "1") (, ",") (identifier "param_2") (, ",") (identifier "pbVar6") () ")"))) (; ";")) (} "}"))) (return_statement "return (uint)bVar1;" (return "return") (cast_expression "(uint)bVar1" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar1")) (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (number_literal) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)))))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))) alternative: (else_clause (compound_statement (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier))) right: (number_literal))) right: (number_literal))))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier))) (number_literal) (identifier) (identifier)))))) (return_statement (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier))))))

uint MASKED(undefined4 param_1,int param_2)

{
  byte bVar1;
  int iVar2;
  uint uVar3;
  byte *pbVar4;
  byte bVar5;
  byte *pbVar6;
  int iVar7;
  
  iVar7 = *(int *)PTR_DAT_0012a304;
  pbVar6 = (byte *)(iVar7 + 0x58);
  iVar2 = (*(code *)PTR_fgets_unlocked_0012ad28)(pbVar6,0x10000,param_1);
  if (iVar2 == 0) {
    uVar3 = (*(code *)PTR_FUN_0012a1ec)(PTR_UINT_0012a18c + 0x4d94);
    return uVar3;
  }
  pbVar4 = (byte *)(*(code *)PTR_strchrnul_0012b160)(pbVar6,10);
  bVar5 = *(byte *)(iVar7 + 0x58);
  bVar1 = *pbVar4;
  pbVar4 = pbVar6;
  if (bVar5 == 0) {
LAB_00052f50:
    *pbVar4 = 0;
  }
  else {
    do {
      if (bVar5 < 0x20) {
        if (bVar5 != 9) goto LAB_00052f50;
        *pbVar4 = 0x20;
      }
      pbVar4 = pbVar4 + 1;
      bVar5 = *pbVar4;
    } while (bVar5 != 0);
    *pbVar4 = 0;
  }
  if ((param_2 != 0) && ((*(uint *)PTR_DAT_0012a334 & 4) != 0)) {
    (*(code *)PTR___fprintf_chk_0012ad0c)(*(undefined4 *)PTR_stderr_0012b184,1,param_2,pbVar6);
  }
  return (uint)bVar1;
}

