
FILE * fopen_safer(char *file,char *mode)

{
  FILE *pFVar1;
  uint fd;
  FILE *pFVar2;
  int iVar3;
  undefined4 *puVar4;
  int e;
  undefined4 uVar5;
  code *pcVar6;
  
  pFVar1 = (FILE *)(*(code *)PTR_fopen64_00075a30)();
  pFVar2 = pFVar1;
  if ((pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)) {
    pFVar2 = (FILE *)dup_safer(fd);
    if ((int)pFVar2 < 0) {
      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
      pcVar6 = (code *)PTR_fclose_00075a44;
    }
    else {
      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);
      if ((iVar3 == 0) &&
         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {
        return pFVar1;
      }
      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
      pFVar1 = pFVar2;
      pcVar6 = (code *)PTR_close_000759e8;
    }
    uVar5 = *puVar4;
    pFVar2 = (FILE *)0x0;
    (*pcVar6)(pFVar1);
    *puVar4 = uVar5;
  }
  return pFVar2;
}



int fopen_safer(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined4 uVar5;
  code *pcVar6;
  
  iVar1 = (*(code *)PTR_fopen64_00075a30)();
  iVar3 = iVar1;
  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {
    iVar3 = dup_safer(uVar2);
    if (iVar3 < 0) {
      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
      pcVar6 = (code *)PTR_fclose_00075a44;
    }
    else {
      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);
      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {
        return iVar1;
      }
      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
      iVar1 = iVar3;
      pcVar6 = (code *)PTR_close_000759e8;
    }
    uVar5 = *puVar4;
    iVar3 = 0;
    (*pcVar6)(iVar1);
    *puVar4 = uVar5;
  }
  return iVar3;
}


lui gp,0x5
addiu gp,gp,0x2e30
addu gp,gp,t9
addiu sp,sp,-0x28
lw t9,-0x7b50(gp)
sw gp,0x10(sp)
sw s1,0x1c(sp)
or s1,a1,zero
sw s0,0x18(sp)
sw ra,0x24(sp)
jalr t9
_sw s2,0x20(sp)
lw gp,0x10(sp)
beq v0,zero,0x0002a7a4
_or s0,v0,zero
lw t9,-0x7ac8(gp)
jalr t9
_or a0,v0,zero
sltiu v1,v0,0x3
bne v1,zero,0x0002a7c0
_lw gp,0x10(sp)
lw ra,0x24(sp)
or v0,s0,zero
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
lw t9,-0x7cc0(gp)
bal 0x000396d0
_or a0,v0,zero
lw gp,0x10(sp)
bltz v0,0x0002a838
_or s2,v0,zero
lw t9,-0x7b3c(gp)
jalr t9
_or a0,s0,zero
bne v0,zero,0x0002a808
_lw gp,0x10(sp)
lw t9,-0x7938(gp)
or a1,s1,zero
jalr t9
_or a0,s2,zero
lw gp,0x10(sp)
bne v0,zero,0x0002a7a4
_or s0,v0,zero
lw t9,-0x7abc(gp)
jalr t9
_nop
or a0,s2,zero
lw gp,0x10(sp)
or s1,v0,zero
lw t9,-0x7b98(gp)
lw s2,0x0(s1)
jalr t9
_or s0,zero,zero
b 0x0002a7a4
_sw s2,0x0(s1)
lw t9,-0x7abc(gp)
jalr t9
_nop
or a0,s0,zero
lw gp,0x10(sp)
or s1,v0,zero
b 0x0002a824
_lw t9,-0x7b3c(gp)
(translation_unit "int fopen_safer(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}\n\n" (function_definition "int fopen_safer(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}" primitive_type (function_declarator "fopen_safer(undefined4 param_1,undefined4 param_2)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "code *pcVar6;" type_identifier (pointer_declarator "*pcVar6" * identifier) ;) (expression_statement "iVar1 = (*(code *)PTR_fopen64_00075a30)();" (assignment_expression "iVar1 = (*(code *)PTR_fopen64_00075a30)()" identifier = (call_expression "(*(code *)PTR_fopen64_00075a30)()" (parenthesized_expression "(*(code *)PTR_fopen64_00075a30)" ( (pointer_expression "*(code *)PTR_fopen64_00075a30" * (cast_expression "(code *)PTR_fopen64_00075a30" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" identifier = identifier) ;) (if_statement "if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }" if (parenthesized_expression "((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3))" ( (binary_expression "(iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "(uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)" ( (comma_expression "uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3" (assignment_expression "uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1)" identifier = (call_expression "(*(code *)PTR_fileno_00075ab8)(iVar1)" (parenthesized_expression "(*(code *)PTR_fileno_00075ab8)" ( (pointer_expression "*(code *)PTR_fileno_00075ab8" * (cast_expression "(code *)PTR_fileno_00075ab8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) , (binary_expression "uVar2 < 3" identifier < number_literal)) ))) )) (compound_statement "{\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }" { (expression_statement "iVar3 = dup_safer(uVar2);" (assignment_expression "iVar3 = dup_safer(uVar2)" identifier = (call_expression "dup_safer(uVar2)" identifier (argument_list "(uVar2)" ( identifier )))) ;) (if_statement "if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }" { (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "pcVar6 = (code *)PTR_fclose_00075a44;" (assignment_expression "pcVar6 = (code *)PTR_fclose_00075a44" identifier = (cast_expression "(code *)PTR_fclose_00075a44" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }) (else_clause "else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" else (compound_statement "{\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" { (expression_statement "iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);" (assignment_expression "iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1)" identifier = (call_expression "(*(code *)PTR_fclose_00075a44)(iVar1)" (parenthesized_expression "(*(code *)PTR_fclose_00075a44)" ( (pointer_expression "*(code *)PTR_fclose_00075a44" * (cast_expression "(code *)PTR_fclose_00075a44" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }" if (parenthesized_expression "((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0))" ( (binary_expression "(iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)" (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)" ( (comma_expression "iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0" (assignment_expression "iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2)" identifier = (call_expression "(*(code *)PTR_fdopen_00075c48)(iVar3,param_2)" (parenthesized_expression "(*(code *)PTR_fdopen_00075c48)" ( (pointer_expression "*(code *)PTR_fdopen_00075c48" * (cast_expression "(code *)PTR_fdopen_00075c48" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3,param_2)" ( identifier , identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n        return iVar1;\n      }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = iVar3;" (assignment_expression "iVar1 = iVar3" identifier = identifier) ;) (expression_statement "pcVar6 = (code *)PTR_close_000759e8;" (assignment_expression "pcVar6 = (code *)PTR_close_000759e8" identifier = (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }))) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "(*pcVar6)(iVar1);" (call_expression "(*pcVar6)(iVar1)" (parenthesized_expression "(*pcVar6)" ( (pointer_expression "*pcVar6" * identifier) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "*puVar4 = uVar5;" (assignment_expression "*puVar4 = uVar5" (pointer_expression "*puVar4" * identifier) = identifier) ;) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "FILE * fopen_safer(char *file,char *mode)\n\n{\n  FILE *pFVar1;\n  uint fd;\n  FILE *pFVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  int e;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  pFVar1 = (FILE *)(*(code *)PTR_fopen64_00075a30)();\n  pFVar2 = pFVar1;\n  if ((pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)) {\n    pFVar2 = (FILE *)dup_safer(fd);\n    if ((int)pFVar2 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    pFVar2 = (FILE *)0x0;\n    (*pcVar6)(pFVar1);\n    *puVar4 = uVar5;\n  }\n  return pFVar2;\n}\n\n" (function_definition "FILE * fopen_safer(char *file,char *mode)\n\n{\n  FILE *pFVar1;\n  uint fd;\n  FILE *pFVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  int e;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  pFVar1 = (FILE *)(*(code *)PTR_fopen64_00075a30)();\n  pFVar2 = pFVar1;\n  if ((pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)) {\n    pFVar2 = (FILE *)dup_safer(fd);\n    if ((int)pFVar2 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    pFVar2 = (FILE *)0x0;\n    (*pcVar6)(pFVar1);\n    *puVar4 = uVar5;\n  }\n  return pFVar2;\n}" type_identifier (pointer_declarator "* fopen_safer(char *file,char *mode)" * (function_declarator "fopen_safer(char *file,char *mode)" identifier (parameter_list "(char *file,char *mode)" ( (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) , (parameter_declaration "char *mode" primitive_type (pointer_declarator "*mode" * identifier)) )))) (compound_statement "{\n  FILE *pFVar1;\n  uint fd;\n  FILE *pFVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  int e;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  pFVar1 = (FILE *)(*(code *)PTR_fopen64_00075a30)();\n  pFVar2 = pFVar1;\n  if ((pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)) {\n    pFVar2 = (FILE *)dup_safer(fd);\n    if ((int)pFVar2 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    pFVar2 = (FILE *)0x0;\n    (*pcVar6)(pFVar1);\n    *puVar4 = uVar5;\n  }\n  return pFVar2;\n}" { (declaration "FILE *pFVar1;" type_identifier (pointer_declarator "*pFVar1" * identifier) ;) (declaration "uint fd;" type_identifier identifier ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "int e;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "code *pcVar6;" type_identifier (pointer_declarator "*pcVar6" * identifier) ;) (expression_statement "pFVar1 = (FILE *)(*(code *)PTR_fopen64_00075a30)();" (assignment_expression "pFVar1 = (FILE *)(*(code *)PTR_fopen64_00075a30)()" identifier = (cast_expression "(FILE *)(*(code *)PTR_fopen64_00075a30)()" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_fopen64_00075a30)()" (parenthesized_expression "(*(code *)PTR_fopen64_00075a30)" ( (pointer_expression "*(code *)PTR_fopen64_00075a30" * (cast_expression "(code *)PTR_fopen64_00075a30" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "pFVar2 = pFVar1;" (assignment_expression "pFVar2 = pFVar1" identifier = identifier) ;) (if_statement "if ((pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)) {\n    pFVar2 = (FILE *)dup_safer(fd);\n    if ((int)pFVar2 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    pFVar2 = (FILE *)0x0;\n    (*pcVar6)(pFVar1);\n    *puVar4 = uVar5;\n  }" if (parenthesized_expression "((pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3))" ( (binary_expression "(pFVar1 != (FILE *)0x0) && (fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)" (parenthesized_expression "(pFVar1 != (FILE *)0x0)" ( (binary_expression "pFVar1 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3)" ( (comma_expression "fd = (*(code *)PTR_fileno_00075ab8)(pFVar1), fd < 3" (assignment_expression "fd = (*(code *)PTR_fileno_00075ab8)(pFVar1)" identifier = (call_expression "(*(code *)PTR_fileno_00075ab8)(pFVar1)" (parenthesized_expression "(*(code *)PTR_fileno_00075ab8)" ( (pointer_expression "*(code *)PTR_fileno_00075ab8" * (cast_expression "(code *)PTR_fileno_00075ab8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pFVar1)" ( identifier )))) , (binary_expression "fd < 3" identifier < number_literal)) ))) )) (compound_statement "{\n    pFVar2 = (FILE *)dup_safer(fd);\n    if ((int)pFVar2 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    pFVar2 = (FILE *)0x0;\n    (*pcVar6)(pFVar1);\n    *puVar4 = uVar5;\n  }" { (expression_statement "pFVar2 = (FILE *)dup_safer(fd);" (assignment_expression "pFVar2 = (FILE *)dup_safer(fd)" identifier = (cast_expression "(FILE *)dup_safer(fd)" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "dup_safer(fd)" identifier (argument_list "(fd)" ( identifier ))))) ;) (if_statement "if ((int)pFVar2 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" if (parenthesized_expression "((int)pFVar2 < 0)" ( (binary_expression "(int)pFVar2 < 0" (cast_expression "(int)pFVar2" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }" { (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "pcVar6 = (code *)PTR_fclose_00075a44;" (assignment_expression "pcVar6 = (code *)PTR_fclose_00075a44" identifier = (cast_expression "(code *)PTR_fclose_00075a44" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }) (else_clause "else {\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" else (compound_statement "{\n      iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);\n      if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pFVar1 = pFVar2;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" { (expression_statement "iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1);" (assignment_expression "iVar3 = (*(code *)PTR_fclose_00075a44)(pFVar1)" identifier = (call_expression "(*(code *)PTR_fclose_00075a44)(pFVar1)" (parenthesized_expression "(*(code *)PTR_fclose_00075a44)" ( (pointer_expression "*(code *)PTR_fclose_00075a44" * (cast_expression "(code *)PTR_fclose_00075a44" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pFVar1)" ( identifier )))) ;) (if_statement "if ((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)) {\n        return pFVar1;\n      }" if (parenthesized_expression "((iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0))" ( (binary_expression "(iVar3 == 0) &&\n         (pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)" (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) && (parenthesized_expression "(pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0)" ( (comma_expression "pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode), pFVar1 != (FILE *)0x0" (assignment_expression "pFVar1 = (FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode)" identifier = (cast_expression "(FILE *)(*(code *)PTR_fdopen_00075c48)(pFVar2,mode)" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_fdopen_00075c48)(pFVar2,mode)" (parenthesized_expression "(*(code *)PTR_fdopen_00075c48)" ( (pointer_expression "*(code *)PTR_fdopen_00075c48" * (cast_expression "(code *)PTR_fdopen_00075c48" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pFVar2,mode)" ( identifier , identifier ))))) , (binary_expression "pFVar1 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n        return pFVar1;\n      }" { (return_statement "return pFVar1;" return identifier ;) })) (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "pFVar1 = pFVar2;" (assignment_expression "pFVar1 = pFVar2" identifier = identifier) ;) (expression_statement "pcVar6 = (code *)PTR_close_000759e8;" (assignment_expression "pcVar6 = (code *)PTR_close_000759e8" identifier = (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }))) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "pFVar2 = (FILE *)0x0;" (assignment_expression "pFVar2 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "(*pcVar6)(pFVar1);" (call_expression "(*pcVar6)(pFVar1)" (parenthesized_expression "(*pcVar6)" ( (pointer_expression "*pcVar6" * identifier) )) (argument_list "(pFVar1)" ( identifier ))) ;) (expression_statement "*puVar4 = uVar5;" (assignment_expression "*puVar4 = uVar5" (pointer_expression "*puVar4" * identifier) = identifier) ;) })) (return_statement "return pFVar2;" return identifier ;) })))
(translation_unit "int fopen_safer(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}\n\n" (function_definition "int fopen_safer(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}" primitive_type (function_declarator "fopen_safer(undefined4 param_1,undefined4 param_2)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "code *pcVar6;" type_identifier (pointer_declarator "*pcVar6" * identifier) ;) (expression_statement "iVar1 = (*(code *)PTR_fopen64_00075a30)();" (assignment_expression "iVar1 = (*(code *)PTR_fopen64_00075a30)()" identifier = (call_expression "(*(code *)PTR_fopen64_00075a30)()" (parenthesized_expression "(*(code *)PTR_fopen64_00075a30)" ( (pointer_expression "*(code *)PTR_fopen64_00075a30" * (cast_expression "(code *)PTR_fopen64_00075a30" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" identifier = identifier) ;) (if_statement "if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }" if (parenthesized_expression "((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3))" ( (binary_expression "(iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "(uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)" ( (comma_expression "uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3" (assignment_expression "uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1)" identifier = (call_expression "(*(code *)PTR_fileno_00075ab8)(iVar1)" (parenthesized_expression "(*(code *)PTR_fileno_00075ab8)" ( (pointer_expression "*(code *)PTR_fileno_00075ab8" * (cast_expression "(code *)PTR_fileno_00075ab8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) , (binary_expression "uVar2 < 3" identifier < number_literal)) ))) )) (compound_statement "{\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }" { (expression_statement "iVar3 = dup_safer(uVar2);" (assignment_expression "iVar3 = dup_safer(uVar2)" identifier = (call_expression "dup_safer(uVar2)" identifier (argument_list "(uVar2)" ( identifier )))) ;) (if_statement "if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }" { (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "pcVar6 = (code *)PTR_fclose_00075a44;" (assignment_expression "pcVar6 = (code *)PTR_fclose_00075a44" identifier = (cast_expression "(code *)PTR_fclose_00075a44" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }) (else_clause "else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" else (compound_statement "{\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" { (expression_statement "iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);" (assignment_expression "iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1)" identifier = (call_expression "(*(code *)PTR_fclose_00075a44)(iVar1)" (parenthesized_expression "(*(code *)PTR_fclose_00075a44)" ( (pointer_expression "*(code *)PTR_fclose_00075a44" * (cast_expression "(code *)PTR_fclose_00075a44" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }" if (parenthesized_expression "((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0))" ( (binary_expression "(iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)" (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)" ( (comma_expression "iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0" (assignment_expression "iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2)" identifier = (call_expression "(*(code *)PTR_fdopen_00075c48)(iVar3,param_2)" (parenthesized_expression "(*(code *)PTR_fdopen_00075c48)" ( (pointer_expression "*(code *)PTR_fdopen_00075c48" * (cast_expression "(code *)PTR_fdopen_00075c48" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3,param_2)" ( identifier , identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n        return iVar1;\n      }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = iVar3;" (assignment_expression "iVar1 = iVar3" identifier = identifier) ;) (expression_statement "pcVar6 = (code *)PTR_close_000759e8;" (assignment_expression "pcVar6 = (code *)PTR_close_000759e8" identifier = (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }))) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "(*pcVar6)(iVar1);" (call_expression "(*pcVar6)(iVar1)" (parenthesized_expression "(*pcVar6)" ( (pointer_expression "*pcVar6" * identifier) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "*puVar4 = uVar5;" (assignment_expression "*puVar4 = uVar5" (pointer_expression "*puVar4" * identifier) = identifier) ;) })) (return_statement "return iVar3;" return 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) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) , (binary_expression IDENT < LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (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 ( ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT )))) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (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 ( ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) ;) }))) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (return_statement return IDENT ;) })))
(function_definition "int fopen_safer(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}" (primitive_type "int") (function_declarator "fopen_safer(undefined4 param_1,undefined4 param_2)" (identifier "fopen_safer") (parameter_list "(undefined4 param_1,undefined4 param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  undefined4 uVar5;\n  code *pcVar6;\n  \n  iVar1 = (*(code *)PTR_fopen64_00075a30)();\n  iVar3 = iVar1;\n  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }\n  return iVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined4 *puVar4;" (type_identifier "undefined4") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "code *pcVar6;" (type_identifier "code") (pointer_declarator "*pcVar6" (* "*") (identifier "pcVar6")) (; ";")) (expression_statement "iVar1 = (*(code *)PTR_fopen64_00075a30)();" (assignment_expression "iVar1 = (*(code *)PTR_fopen64_00075a30)()" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_fopen64_00075a30)()" (parenthesized_expression "(*(code *)PTR_fopen64_00075a30)" (( "(") (pointer_expression "*(code *)PTR_fopen64_00075a30" (* "*") (cast_expression "(code *)PTR_fopen64_00075a30" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fopen64_00075a30"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" (identifier "iVar3") (= "=") (identifier "iVar1")) (; ";")) (if_statement "if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }" (if "if") (parenthesized_expression "((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3))" (( "(") (binary_expression "(iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)" (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)" (( "(") (comma_expression "uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3" (assignment_expression "uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1)" (identifier "uVar2") (= "=") (call_expression "(*(code *)PTR_fileno_00075ab8)(iVar1)" (parenthesized_expression "(*(code *)PTR_fileno_00075ab8)" (( "(") (pointer_expression "*(code *)PTR_fileno_00075ab8" (* "*") (cast_expression "(code *)PTR_fileno_00075ab8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fileno_00075ab8"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (, ",") (binary_expression "uVar2 < 3" (identifier "uVar2") (< "<") (number_literal "3"))) () ")"))) () ")")) (compound_statement "{\n    iVar3 = dup_safer(uVar2);\n    if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }\n    uVar5 = *puVar4;\n    iVar3 = 0;\n    (*pcVar6)(iVar1);\n    *puVar4 = uVar5;\n  }" ({ "{") (expression_statement "iVar3 = dup_safer(uVar2);" (assignment_expression "iVar3 = dup_safer(uVar2)" (identifier "iVar3") (= "=") (call_expression "dup_safer(uVar2)" (identifier "dup_safer") (argument_list "(uVar2)" (( "(") (identifier "uVar2") () ")")))) (; ";")) (if_statement "if (iVar3 < 0) {\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }\n    else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" (if "if") (parenthesized_expression "(iVar3 < 0)" (( "(") (binary_expression "iVar3 < 0" (identifier "iVar3") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      pcVar6 = (code *)PTR_fclose_00075a44;\n    }" ({ "{") (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" (identifier "puVar4") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00075ac4" (* "*") (cast_expression "(code *)PTR___errno_location_00075ac4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00075ac4"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "pcVar6 = (code *)PTR_fclose_00075a44;" (assignment_expression "pcVar6 = (code *)PTR_fclose_00075a44" (identifier "pcVar6") (= "=") (cast_expression "(code *)PTR_fclose_00075a44" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fclose_00075a44"))) (; ";")) (} "}")) (else_clause "else {\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" (else "else") (compound_statement "{\n      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);\n      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }\n      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n      iVar1 = iVar3;\n      pcVar6 = (code *)PTR_close_000759e8;\n    }" ({ "{") (expression_statement "iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);" (assignment_expression "iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_fclose_00075a44)(iVar1)" (parenthesized_expression "(*(code *)PTR_fclose_00075a44)" (( "(") (pointer_expression "*(code *)PTR_fclose_00075a44" (* "*") (cast_expression "(code *)PTR_fclose_00075a44" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fclose_00075a44"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (if_statement "if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {\n        return iVar1;\n      }" (if "if") (parenthesized_expression "((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0))" (( "(") (binary_expression "(iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)" (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)" (( "(") (comma_expression "iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0" (assignment_expression "iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_fdopen_00075c48)(iVar3,param_2)" (parenthesized_expression "(*(code *)PTR_fdopen_00075c48)" (( "(") (pointer_expression "*(code *)PTR_fdopen_00075c48" (* "*") (cast_expression "(code *)PTR_fdopen_00075c48" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fdopen_00075c48"))) () ")")) (argument_list "(iVar3,param_2)" (( "(") (identifier "iVar3") (, ",") (identifier "param_2") () ")")))) (, ",") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n        return iVar1;\n      }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" (identifier "puVar4") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00075ac4" (* "*") (cast_expression "(code *)PTR___errno_location_00075ac4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00075ac4"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "iVar1 = iVar3;" (assignment_expression "iVar1 = iVar3" (identifier "iVar1") (= "=") (identifier "iVar3")) (; ";")) (expression_statement "pcVar6 = (code *)PTR_close_000759e8;" (assignment_expression "pcVar6 = (code *)PTR_close_000759e8" (identifier "pcVar6") (= "=") (cast_expression "(code *)PTR_close_000759e8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_000759e8"))) (; ";")) (} "}")))) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" (identifier "uVar5") (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "(*pcVar6)(iVar1);" (call_expression "(*pcVar6)(iVar1)" (parenthesized_expression "(*pcVar6)" (( "(") (pointer_expression "*pcVar6" (* "*") (identifier "pcVar6")) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "*puVar4 = uVar5;" (assignment_expression "*puVar4 = uVar5" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (identifier "uVar5")) (; ";")) (} "}"))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))
(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) 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))) (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)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (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)))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (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))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier))))) alternative: (else_clause (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 (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (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) (identifier)))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (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))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (identifier))) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))))) (return_statement (identifier)))))

int MASKED(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined4 uVar5;
  code *pcVar6;
  
  iVar1 = (*(code *)PTR_fopen64_00075a30)();
  iVar3 = iVar1;
  if ((iVar1 != 0) && (uVar2 = (*(code *)PTR_fileno_00075ab8)(iVar1), uVar2 < 3)) {
    iVar3 = dup_safer(uVar2);
    if (iVar3 < 0) {
      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
      pcVar6 = (code *)PTR_fclose_00075a44;
    }
    else {
      iVar1 = (*(code *)PTR_fclose_00075a44)(iVar1);
      if ((iVar1 == 0) && (iVar1 = (*(code *)PTR_fdopen_00075c48)(iVar3,param_2), iVar1 != 0)) {
        return iVar1;
      }
      puVar4 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
      iVar1 = iVar3;
      pcVar6 = (code *)PTR_close_000759e8;
    }
    uVar5 = *puVar4;
    iVar3 = 0;
    (*pcVar6)(iVar1);
    *puVar4 = uVar5;
  }
  return iVar3;
}

