
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

int rpl_fclose(FILE *fp)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  __off64_t _Var4;
  
  iVar1 = fileno((FILE *)fp);
  if (-1 < iVar1) {
    iVar1 = __freading(fp);
    if (iVar1 == 0) {
      iVar1 = rpl_fflush(fp);
    }
    else {
      iVar1 = fileno((FILE *)fp);
      _Var4 = lseek64(iVar1,0,1);
      if (_Var4 == -1) goto LAB_00015e43;
      iVar1 = rpl_fflush(fp);
    }
    if (iVar1 != 0) {
      piVar2 = __errno_location();
      iVar1 = *piVar2;
      iVar3 = fclose((FILE *)fp);
      if (iVar1 == 0) {
        return iVar3;
      }
      *piVar2 = iVar1;
      return -1;
    }
  }
LAB_00015e43:
  iVar1 = fclose((FILE *)fp);
  return iVar1;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int FUN_00015e00(FILE *param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  __off64_t _Var4;
  
  iVar1 = fileno(param_1);
  if (-1 < iVar1) {
    iVar1 = __freading(param_1);
    if (iVar1 == 0) {
      iVar1 = FUN_00015ec0(param_1);
    }
    else {
      iVar1 = fileno(param_1);
      _Var4 = lseek64(iVar1,0,1);
      if (_Var4 == -1) goto LAB_00015e43;
      iVar1 = FUN_00015ec0(param_1);
    }
    if (iVar1 != 0) {
      piVar2 = __errno_location();
      iVar1 = *piVar2;
      iVar3 = fclose(param_1);
      if (iVar1 == 0) {
        return iVar3;
      }
      *piVar2 = iVar1;
      return -1;
    }
  }
LAB_00015e43:
  iVar1 = fclose(param_1);
  return iVar1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000117d0
ADD EBX,0x61f7
SUB ESP,0x18
MOV ESI,dword ptr [ESP + 0x2c]
PUSH ESI
CALL 0x00011250
ADD ESP,0x10
TEST EAX,EAX
JS 0x00015e43
SUB ESP,0xc
PUSH ESI
CALL 0x000111c0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00015e60
SUB ESP,0xc
PUSH ESI
CALL 0x00015ec0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00015e8f
SUB ESP,0xc
PUSH ESI
CALL 0x00011090
ADD ESP,0x10
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH ESI
CALL 0x00011250
PUSH 0x1
PUSH 0x0
PUSH 0x0
PUSH EAX
CALL 0x000112c0
ADD ESP,0x20
AND EDX,EAX
CMP EDX,-0x1
JZ 0x00015e43
SUB ESP,0xc
PUSH ESI
CALL 0x00015ec0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00015e43
CALL 0x00011240
SUB ESP,0xc
MOV EBP,dword ptr [EAX]
PUSH ESI
MOV EDI,EAX
CALL 0x00011090
ADD ESP,0x10
TEST EBP,EBP
JZ 0x00015e4f
MOV dword ptr [EDI],EBP
MOV EAX,0xffffffff
JMP 0x00015e4f
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_00015e00(FILE *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}\n\n" comment (function_definition "int FUN_00015e00(FILE *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" primitive_type (function_declarator "FUN_00015e00(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 *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "__off64_t _Var4;" type_identifier 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 (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" { (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 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = FUN_00015ec0(param_1);\n    }" { (expression_statement "iVar1 = FUN_00015ec0(param_1);" (assignment_expression "iVar1 = FUN_00015ec0(param_1)" identifier = (call_expression "FUN_00015ec0(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) }) (else_clause "else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }" else (compound_statement "{\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\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 "_Var4 = lseek64(iVar1,0,1);" (assignment_expression "_Var4 = lseek64(iVar1,0,1)" identifier = (call_expression "lseek64(iVar1,0,1)" identifier (argument_list "(iVar1,0,1)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (_Var4 == -1) goto LAB_00015e43;" if (parenthesized_expression "(_Var4 == -1)" ( (binary_expression "_Var4 == -1" identifier == number_literal) )) (goto_statement "goto LAB_00015e43;" goto statement_identifier ;)) (expression_statement "iVar1 = FUN_00015ec0(param_1);" (assignment_expression "iVar1 = FUN_00015ec0(param_1)" identifier = (call_expression "FUN_00015ec0(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) }))) (if_statement "if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "iVar3 = fclose(param_1);" (assignment_expression "iVar3 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        return iVar3;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) })) (labeled_statement "LAB_00015e43:\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 "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint rpl_fclose(FILE *fp)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno((FILE *)fp);\n  if (-1 < iVar1) {\n    iVar1 = __freading(fp);\n    if (iVar1 == 0) {\n      iVar1 = rpl_fflush(fp);\n    }\n    else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose((FILE *)fp);\n  return iVar1;\n}\n\n" comment comment (function_definition "int rpl_fclose(FILE *fp)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno((FILE *)fp);\n  if (-1 < iVar1) {\n    iVar1 = __freading(fp);\n    if (iVar1 == 0) {\n      iVar1 = rpl_fflush(fp);\n    }\n    else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\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 *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno((FILE *)fp);\n  if (-1 < iVar1) {\n    iVar1 = __freading(fp);\n    if (iVar1 == 0) {\n      iVar1 = rpl_fflush(fp);\n    }\n    else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose((FILE *)fp);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "__off64_t _Var4;" type_identifier 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 (-1 < iVar1) {\n    iVar1 = __freading(fp);\n    if (iVar1 == 0) {\n      iVar1 = rpl_fflush(fp);\n    }\n    else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar1 = __freading(fp);\n    if (iVar1 == 0) {\n      iVar1 = rpl_fflush(fp);\n    }\n    else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" { (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 = rpl_fflush(fp);\n    }\n    else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = rpl_fflush(fp);\n    }" { (expression_statement "iVar1 = rpl_fflush(fp);" (assignment_expression "iVar1 = rpl_fflush(fp)" identifier = (call_expression "rpl_fflush(fp)" identifier (argument_list "(fp)" ( identifier )))) ;) }) (else_clause "else {\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\n    }" else (compound_statement "{\n      iVar1 = fileno((FILE *)fp);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = rpl_fflush(fp);\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 "_Var4 = lseek64(iVar1,0,1);" (assignment_expression "_Var4 = lseek64(iVar1,0,1)" identifier = (call_expression "lseek64(iVar1,0,1)" identifier (argument_list "(iVar1,0,1)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (_Var4 == -1) goto LAB_00015e43;" if (parenthesized_expression "(_Var4 == -1)" ( (binary_expression "_Var4 == -1" identifier == number_literal) )) (goto_statement "goto LAB_00015e43;" 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      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose((FILE *)fp);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "iVar3 = fclose((FILE *)fp);" (assignment_expression "iVar3 = 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 iVar3;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) })) (labeled_statement "LAB_00015e43:\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_00015e00(FILE *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}\n\n" (function_definition "int FUN_00015e00(FILE *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" primitive_type (function_declarator "FUN_00015e00(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 *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "__off64_t _Var4;" type_identifier 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 (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" { (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 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = FUN_00015ec0(param_1);\n    }" { (expression_statement "iVar1 = FUN_00015ec0(param_1);" (assignment_expression "iVar1 = FUN_00015ec0(param_1)" identifier = (call_expression "FUN_00015ec0(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) }) (else_clause "else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }" else (compound_statement "{\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\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 "_Var4 = lseek64(iVar1,0,1);" (assignment_expression "_Var4 = lseek64(iVar1,0,1)" identifier = (call_expression "lseek64(iVar1,0,1)" identifier (argument_list "(iVar1,0,1)" ( identifier , number_literal , number_literal )))) ;) (if_statement "if (_Var4 == -1) goto LAB_00015e43;" if (parenthesized_expression "(_Var4 == -1)" ( (binary_expression "_Var4 == -1" identifier == number_literal) )) (goto_statement "goto LAB_00015e43;" goto statement_identifier ;)) (expression_statement "iVar1 = FUN_00015ec0(param_1);" (assignment_expression "iVar1 = FUN_00015ec0(param_1)" identifier = (call_expression "FUN_00015ec0(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) }))) (if_statement "if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "iVar3 = fclose(param_1);" (assignment_expression "iVar3 = fclose(param_1)" identifier = (call_expression "fclose(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        return iVar3;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (return_statement "return -1;" return number_literal ;) })) })) (labeled_statement "LAB_00015e43:\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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (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 = (call_expression IDENT (argument_list ( IDENT )))) ;) }) (else_clause else (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_00015e00(FILE *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" (primitive_type "int") (function_declarator "FUN_00015e00(FILE *param_1)" (identifier "FUN_00015e00") (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 *piVar2;\n  int iVar3;\n  __off64_t _Var4;\n  \n  iVar1 = fileno(param_1);\n  if (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }\nLAB_00015e43:\n  iVar1 = fclose(param_1);\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "__off64_t _Var4;" (type_identifier "__off64_t") (identifier "_Var4") (; ";")) (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 (-1 < iVar1) {\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n    iVar1 = __freading(param_1);\n    if (iVar1 == 0) {\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }\n    if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }\n  }" ({ "{") (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 = FUN_00015ec0(param_1);\n    }\n    else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = FUN_00015ec0(param_1);\n    }" ({ "{") (expression_statement "iVar1 = FUN_00015ec0(param_1);" (assignment_expression "iVar1 = FUN_00015ec0(param_1)" (identifier "iVar1") (= "=") (call_expression "FUN_00015ec0(param_1)" (identifier "FUN_00015ec0") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (} "}")) (else_clause "else {\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\n    }" (else "else") (compound_statement "{\n      iVar1 = fileno(param_1);\n      _Var4 = lseek64(iVar1,0,1);\n      if (_Var4 == -1) goto LAB_00015e43;\n      iVar1 = FUN_00015ec0(param_1);\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 "_Var4 = lseek64(iVar1,0,1);" (assignment_expression "_Var4 = lseek64(iVar1,0,1)" (identifier "_Var4") (= "=") (call_expression "lseek64(iVar1,0,1)" (identifier "lseek64") (argument_list "(iVar1,0,1)" (( "(") (identifier "iVar1") (, ",") (number_literal "0") (, ",") (number_literal "1") () ")")))) (; ";")) (if_statement "if (_Var4 == -1) goto LAB_00015e43;" (if "if") (parenthesized_expression "(_Var4 == -1)" (( "(") (binary_expression "_Var4 == -1" (identifier "_Var4") (== "==") (number_literal "-1")) () ")")) (goto_statement "goto LAB_00015e43;" (goto "goto") (statement_identifier "LAB_00015e43") (; ";"))) (expression_statement "iVar1 = FUN_00015ec0(param_1);" (assignment_expression "iVar1 = FUN_00015ec0(param_1)" (identifier "iVar1") (= "=") (call_expression "FUN_00015ec0(param_1)" (identifier "FUN_00015ec0") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (} "}")))) (if_statement "if (iVar1 != 0) {\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      piVar2 = __errno_location();\n      iVar1 = *piVar2;\n      iVar3 = fclose(param_1);\n      if (iVar1 == 0) {\n        return iVar3;\n      }\n      *piVar2 = iVar1;\n      return -1;\n    }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" (identifier "iVar1") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (expression_statement "iVar3 = fclose(param_1);" (assignment_expression "iVar3 = fclose(param_1)" (identifier "iVar3") (= "=") (call_expression "fclose(param_1)" (identifier "fclose") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n        return iVar3;\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return iVar3;\n      }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar1")) (; ";")) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (} "}"))) (labeled_statement "LAB_00015e43:\n  iVar1 = fclose(param_1);" (statement_identifier "LAB_00015e43") (: ":") (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") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

int function_1(type_1 *fp)

{
  int var_2;
  int *piVar2;
  int iVar3;
  type_2 var_6;
  
  var_2 = var_1((type_1 *)fp);
  if (-1 < var_2) {
    var_2 = var_3(fp);
    if (var_2 == 0) {
      var_2 = var_4(fp);
    }
    else {
      var_2 = var_1((type_1 *)fp);
      var_6 = var_5(var_2,0,1);
      if (var_6 == -1) goto LAB_00015e43;
      var_2 = var_4(fp);
    }
    if (var_2 != 0) {
      piVar2 = var_7();
      var_2 = *piVar2;
      iVar3 = var_8((type_1 *)fp);
      if (var_2 == 0) {
        return iVar3;
      }
      *piVar2 = var_2;
      return -1;
    }
  }
LAB_00015e43:
  var_2 = var_8((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: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) 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: (number_literal) right: (identifier))) 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: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) alternative: (else_clause (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)))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int MASKED(FILE *param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  __off64_t _Var4;
  
  iVar1 = fileno(param_1);
  if (-1 < iVar1) {
    iVar1 = __freading(param_1);
    if (iVar1 == 0) {
      iVar1 = FUN_00015ec0(param_1);
    }
    else {
      iVar1 = fileno(param_1);
      _Var4 = lseek64(iVar1,0,1);
      if (_Var4 == -1) goto LAB_00015e43;
      iVar1 = FUN_00015ec0(param_1);
    }
    if (iVar1 != 0) {
      piVar2 = __errno_location();
      iVar1 = *piVar2;
      iVar3 = fclose(param_1);
      if (iVar1 == 0) {
        return iVar3;
      }
      *piVar2 = iVar1;
      return -1;
    }
  }
LAB_00015e43:
  iVar1 = fclose(param_1);
  return iVar1;
}

