
int rpl_fclose(FILE *fp)

{
  int iVar1;
  int iVar2;
  __off_t _Var3;
  int *piVar4;
  
  iVar1 = fileno((FILE *)fp);
  if (iVar1 < 0) {
    iVar1 = fclose((FILE *)fp);
    return iVar1;
  }
  iVar1 = __freading(fp);
  if (iVar1 != 0) {
    iVar1 = fileno((FILE *)fp);
    _Var3 = lseek(iVar1,0,1);
    if (_Var3 == -1) goto LAB_00115632;
  }
  iVar1 = rpl_fflush(fp);
  if (iVar1 != 0) {
    piVar4 = __errno_location();
    iVar1 = *piVar4;
    iVar2 = fclose((FILE *)fp);
    if (iVar1 == 0) {
      return iVar2;
    }
    *piVar4 = iVar1;
    return -1;
  }
LAB_00115632:
  iVar1 = fclose((FILE *)fp);
  return iVar1;
}



int FUN_001155be(FILE *param_1)

{
  int iVar1;
  int iVar2;
  __off_t _Var3;
  int *piVar4;
  
  iVar1 = fileno(param_1);
  if (iVar1 < 0) {
    iVar1 = fclose(param_1);
    return iVar1;
  }
  iVar1 = __freading(param_1);
  if (iVar1 != 0) {
    iVar1 = fileno(param_1);
    _Var3 = lseek(iVar1,0,1);
    if (_Var3 == -1) goto LAB_00115632;
  }
  iVar1 = FUN_0011563f(param_1);
  if (iVar1 != 0) {
    piVar4 = __errno_location();
    iVar1 = *piVar4;
    iVar2 = fclose(param_1);
    if (iVar1 == 0) {
      return iVar2;
    }
    *piVar4 = iVar1;
    return -1;
  }
LAB_00115632:
  iVar1 = fclose(param_1);
  return iVar1;
}


PUSH R12
PUSH RBP
PUSH RBX
MOV RBX,RDI
CALL 0x00104440
TEST EAX,EAX
JS 0x00115628
MOV RDI,RBX
CALL 0x001044e0
TEST EAX,EAX
JZ 0x001155f9
MOV RDI,RBX
CALL 0x00104440
MOV EDX,0x1
MOV ESI,0x0
MOV EDI,EAX
CALL 0x001042b0
CMP RAX,-0x1
JZ 0x00115632
MOV RDI,RBX
CALL 0x0011563f
TEST EAX,EAX
JZ 0x00115632
CALL 0x00104090
MOV RBP,RAX
MOV R12D,dword ptr [RAX]
MOV RDI,RBX
CALL 0x00104190
TEST R12D,R12D
JZ 0x0011563a
MOV dword ptr [RBP],R12D
MOV EAX,0xffffffff
JMP 0x0011563a
MOV RDI,RBX
CALL 0x00104190
JMP 0x0011563a
MOV RDI,RBX
CALL 0x00104190
POP RBX
POP RBP
POP R12
RET
(translation_unit "int FUN_001155be(FILE *param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}\n\n" (function_definition "int FUN_001155be(FILE *param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" primitive_type (function_declarator "FUN_001155be(FILE *param_1)" identifier (parameter_list "(FILE *param_1)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "__off_t _Var3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (expression_statement "iVar1 = fileno(param_1);" (assignment_expression "iVar1 = fileno(param_1)" identifier = (call_expression "fileno(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }" { (expression_statement "iVar1 = fclose(param_1);" (assignment_expression "iVar1 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = __freading(param_1);" (assignment_expression "iVar1 = __freading(param_1)" identifier = (call_expression "__freading(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" { (expression_statement "iVar1 = fileno(param_1);" (assignment_expression "iVar1 = fileno(param_1)" identifier = (call_expression "fileno(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "_Var3 = lseek(iVar1,0,1);" (assignment_expression "_Var3 = lseek(iVar1,0,1)" identifier = (call_expression "lseek(iVar1,0,1)" identifier (argument_list "(iVar1,0,1)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (_Var3 == -1) goto LAB_00115632;" if (parenthesized_expression "(_Var3 == -1)" ( (binary_expression "_Var3 == -1" identifier == number_literal) )) (goto_statement "goto LAB_00115632;" goto statement_identifier ;)) })) (expression_statement "iVar1 = FUN_0011563f(param_1);" (assignment_expression "iVar1 = FUN_0011563f(param_1)" identifier = (call_expression "FUN_0011563f(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar4;" (assignment_expression "iVar1 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "iVar2 = fclose(param_1);" (assignment_expression "iVar2 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n      return iVar2;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "*piVar4 = iVar1;" (assignment_expression "*piVar4 = iVar1" (pointer_expression "*piVar4" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) (labeled_statement "LAB_00115632:\n  iVar1 = fclose(param_1);" statement_identifier : (expression_statement "iVar1 = fclose(param_1);" (assignment_expression "iVar1 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;)) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "int rpl_fclose(FILE *fp)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno((FILE *)fp);\n  if (iVar1 < 0) {\n    iVar1 = fclose((FILE *)fp);\n    return iVar1;\n  }\n  iVar1 = __freading(fp);\n  if (iVar1 != 0) {\n    iVar1 = fileno((FILE *)fp);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = rpl_fflush(fp);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose((FILE *)fp);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose((FILE *)fp);\n  return iVar1;\n}\n\n" (function_definition "int rpl_fclose(FILE *fp)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno((FILE *)fp);\n  if (iVar1 < 0) {\n    iVar1 = fclose((FILE *)fp);\n    return iVar1;\n  }\n  iVar1 = __freading(fp);\n  if (iVar1 != 0) {\n    iVar1 = fileno((FILE *)fp);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = rpl_fflush(fp);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose((FILE *)fp);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose((FILE *)fp);\n  return iVar1;\n}" primitive_type (function_declarator "rpl_fclose(FILE *fp)" identifier (parameter_list "(FILE *fp)" ( (parameter_declaration "FILE *fp" type_identifier (pointer_declarator "*fp" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno((FILE *)fp);\n  if (iVar1 < 0) {\n    iVar1 = fclose((FILE *)fp);\n    return iVar1;\n  }\n  iVar1 = __freading(fp);\n  if (iVar1 != 0) {\n    iVar1 = fileno((FILE *)fp);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = rpl_fflush(fp);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose((FILE *)fp);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose((FILE *)fp);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "__off_t _Var3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (expression_statement "iVar1 = fileno((FILE *)fp);" (assignment_expression "iVar1 = fileno((FILE *)fp)" identifier = (call_expression "fileno((FILE *)fp)" identifier (argument_list "((FILE *)fp)" ( (cast_expression "(FILE *)fp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar1 = fclose((FILE *)fp);\n    return iVar1;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = fclose((FILE *)fp);\n    return iVar1;\n  }" { (expression_statement "iVar1 = fclose((FILE *)fp);" (assignment_expression "iVar1 = fclose((FILE *)fp)" identifier = (call_expression "fclose((FILE *)fp)" identifier (argument_list "((FILE *)fp)" ( (cast_expression "(FILE *)fp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = __freading(fp);" (assignment_expression "iVar1 = __freading(fp)" identifier = (call_expression "__freading(fp)" identifier (argument_list "(fp)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    iVar1 = fileno((FILE *)fp);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = fileno((FILE *)fp);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" { (expression_statement "iVar1 = fileno((FILE *)fp);" (assignment_expression "iVar1 = fileno((FILE *)fp)" identifier = (call_expression "fileno((FILE *)fp)" identifier (argument_list "((FILE *)fp)" ( (cast_expression "(FILE *)fp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (expression_statement "_Var3 = lseek(iVar1,0,1);" (assignment_expression "_Var3 = lseek(iVar1,0,1)" identifier = (call_expression "lseek(iVar1,0,1)" identifier (argument_list "(iVar1,0,1)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (_Var3 == -1) goto LAB_00115632;" if (parenthesized_expression "(_Var3 == -1)" ( (binary_expression "_Var3 == -1" identifier == number_literal) )) (goto_statement "goto LAB_00115632;" goto statement_identifier ;)) })) (expression_statement "iVar1 = rpl_fflush(fp);" (assignment_expression "iVar1 = rpl_fflush(fp)" identifier = (call_expression "rpl_fflush(fp)" identifier (argument_list "(fp)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose((FILE *)fp);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose((FILE *)fp);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar4;" (assignment_expression "iVar1 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "iVar2 = fclose((FILE *)fp);" (assignment_expression "iVar2 = fclose((FILE *)fp)" identifier = (call_expression "fclose((FILE *)fp)" identifier (argument_list "((FILE *)fp)" ( (cast_expression "(FILE *)fp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n      return iVar2;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "*piVar4 = iVar1;" (assignment_expression "*piVar4 = iVar1" (pointer_expression "*piVar4" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) (labeled_statement "LAB_00115632:\n  iVar1 = fclose((FILE *)fp);" statement_identifier : (expression_statement "iVar1 = fclose((FILE *)fp);" (assignment_expression "iVar1 = fclose((FILE *)fp)" identifier = (call_expression "fclose((FILE *)fp)" identifier (argument_list "((FILE *)fp)" ( (cast_expression "(FILE *)fp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;)) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "int FUN_001155be(FILE *param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}\n\n" (function_definition "int FUN_001155be(FILE *param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" primitive_type (function_declarator "FUN_001155be(FILE *param_1)" identifier (parameter_list "(FILE *param_1)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "__off_t _Var3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (expression_statement "iVar1 = fileno(param_1);" (assignment_expression "iVar1 = fileno(param_1)" identifier = (call_expression "fileno(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }" { (expression_statement "iVar1 = fclose(param_1);" (assignment_expression "iVar1 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = __freading(param_1);" (assignment_expression "iVar1 = __freading(param_1)" identifier = (call_expression "__freading(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" { (expression_statement "iVar1 = fileno(param_1);" (assignment_expression "iVar1 = fileno(param_1)" identifier = (call_expression "fileno(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "_Var3 = lseek(iVar1,0,1);" (assignment_expression "_Var3 = lseek(iVar1,0,1)" identifier = (call_expression "lseek(iVar1,0,1)" identifier (argument_list "(iVar1,0,1)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (_Var3 == -1) goto LAB_00115632;" if (parenthesized_expression "(_Var3 == -1)" ( (binary_expression "_Var3 == -1" identifier == number_literal) )) (goto_statement "goto LAB_00115632;" goto statement_identifier ;)) })) (expression_statement "iVar1 = FUN_0011563f(param_1);" (assignment_expression "iVar1 = FUN_0011563f(param_1)" identifier = (call_expression "FUN_0011563f(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar4;" (assignment_expression "iVar1 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "iVar2 = fclose(param_1);" (assignment_expression "iVar2 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n      return iVar2;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "*piVar4 = iVar1;" (assignment_expression "*piVar4 = iVar1" (pointer_expression "*piVar4" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) (labeled_statement "LAB_00115632:\n  iVar1 = fclose(param_1);" statement_identifier : (expression_statement "iVar1 = fclose(param_1);" (assignment_expression "iVar1 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;)) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (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 = (call_expression IDENT (argument_list ( IDENT )))) ;) (return_statement return IDENT ;) })) (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 = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) })) (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 = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return LIT ;) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;)) (return_statement return IDENT ;) })))
(function_definition "int FUN_001155be(FILE *param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" (primitive_type "int") (function_declarator "FUN_001155be(FILE *param_1)" (identifier "FUN_001155be") (parameter_list "(FILE *param_1)" (( "(") (parameter_declaration "FILE *param_1" (type_identifier "FILE") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  __off_t _Var3;\n  int *piVar4;\n  \n  iVar1 = fileno(param_1);\n  if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }\n  iVar1 = __freading(param_1);\n  if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }\n  iVar1 = FUN_0011563f(param_1);\n  if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }\nLAB_00115632:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "__off_t _Var3;" (type_identifier "__off_t") (identifier "_Var3") (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (expression_statement "iVar1 = fileno(param_1);" (assignment_expression "iVar1 = fileno(param_1)" (identifier "iVar1") (= "=") (call_expression "fileno(param_1)" (identifier "fileno") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = fclose(param_1);\n    return iVar1;\n  }" ({ "{") (expression_statement "iVar1 = fclose(param_1);" (assignment_expression "iVar1 = fclose(param_1)" (identifier "iVar1") (= "=") (call_expression "fclose(param_1)" (identifier "fclose") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "iVar1 = __freading(param_1);" (assignment_expression "iVar1 = __freading(param_1)" (identifier "iVar1") (= "=") (call_expression "__freading(param_1)" (identifier "__freading") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = fileno(param_1);\n    _Var3 = lseek(iVar1,0,1);\n    if (_Var3 == -1) goto LAB_00115632;\n  }" ({ "{") (expression_statement "iVar1 = fileno(param_1);" (assignment_expression "iVar1 = fileno(param_1)" (identifier "iVar1") (= "=") (call_expression "fileno(param_1)" (identifier "fileno") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "_Var3 = lseek(iVar1,0,1);" (assignment_expression "_Var3 = lseek(iVar1,0,1)" (identifier "_Var3") (= "=") (call_expression "lseek(iVar1,0,1)" (identifier "lseek") (argument_list "(iVar1,0,1)" (( "(") (identifier "iVar1") (, ",") (number_literal "0") (, ",") (number_literal "1") () ")")))) (; ";")) (if_statement "if (_Var3 == -1) goto LAB_00115632;" (if "if") (parenthesized_expression "(_Var3 == -1)" (( "(") (binary_expression "_Var3 == -1" (identifier "_Var3") (== "==") (number_literal "-1")) () ")")) (goto_statement "goto LAB_00115632;" (goto "goto") (statement_identifier "LAB_00115632") (; ";"))) (} "}"))) (expression_statement "iVar1 = FUN_0011563f(param_1);" (assignment_expression "iVar1 = FUN_0011563f(param_1)" (identifier "iVar1") (= "=") (call_expression "FUN_0011563f(param_1)" (identifier "FUN_0011563f") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    piVar4 = __errno_location();\n    iVar1 = *piVar4;\n    iVar2 = fclose(param_1);\n    if (iVar1 == 0) {\n      return iVar2;\n    }\n    *piVar4 = iVar1;\n    return -1;\n  }" ({ "{") (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" (identifier "piVar4") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = *piVar4;" (assignment_expression "iVar1 = *piVar4" (identifier "iVar1") (= "=") (pointer_expression "*piVar4" (* "*") (identifier "piVar4"))) (; ";")) (expression_statement "iVar2 = fclose(param_1);" (assignment_expression "iVar2 = fclose(param_1)" (identifier "iVar2") (= "=") (call_expression "fclose(param_1)" (identifier "fclose") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return iVar2;\n    }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "*piVar4 = iVar1;" (assignment_expression "*piVar4 = iVar1" (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) (= "=") (identifier "iVar1")) (; ";")) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (labeled_statement "LAB_00115632:\n  iVar1 = fclose(param_1);" (statement_identifier "LAB_00115632") (: ":") (expression_statement "iVar1 = fclose(param_1);" (assignment_expression "iVar1 = fclose(param_1)" (identifier "iVar1") (= "=") (call_expression "fclose(param_1)" (identifier "fclose") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";"))) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))

int function_1(type_1 *fp)

{
  int var_2;
  int iVar2;
  type_2 var_6;
  int *piVar4;
  
  var_2 = var_1((type_1 *)fp);
  if (var_2 < 0) {
    var_2 = var_3((type_1 *)fp);
    return var_2;
  }
  var_2 = var_4(fp);
  if (var_2 != 0) {
    var_2 = var_1((type_1 *)fp);
    var_6 = var_5(var_2,0,1);
    if (var_6 == -1) goto LAB_00115632;
  }
  var_2 = var_7(fp);
  if (var_2 != 0) {
    piVar4 = var_8();
    var_2 = *piVar4;
    iVar2 = var_3((type_1 *)fp);
    if (var_2 == 0) {
      return iVar2;
    }
    *piVar4 = var_2;
    return -1;
  }
LAB_00115632:
  var_2 = var_3((type_1 *)fp);
  return var_2;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (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: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (return_statement (identifier)))) (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: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))))) (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: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (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 (return_statement (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (return_statement (number_literal)))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (return_statement (identifier)))))

int MASKED(FILE *param_1)

{
  int iVar1;
  int iVar2;
  __off_t _Var3;
  int *piVar4;
  
  iVar1 = fileno(param_1);
  if (iVar1 < 0) {
    iVar1 = fclose(param_1);
    return iVar1;
  }
  iVar1 = __freading(param_1);
  if (iVar1 != 0) {
    iVar1 = fileno(param_1);
    _Var3 = lseek(iVar1,0,1);
    if (_Var3 == -1) goto LAB_00115632;
  }
  iVar1 = FUN_0011563f(param_1);
  if (iVar1 != 0) {
    piVar4 = __errno_location();
    iVar1 = *piVar4;
    iVar2 = fclose(param_1);
    if (iVar1 == 0) {
      return iVar2;
    }
    *piVar4 = iVar1;
    return -1;
  }
LAB_00115632:
  iVar1 = fclose(param_1);
  return iVar1;
}

