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

int sync_buffered_stream(int bfd)

{
  BUFFERED_STREAM *pBVar1;
  int iVar2;
  
  if ((buffers == (BUFFERED_STREAM **)0x0) ||
     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)) {
    iVar2 = -1;
  }
  else {
    iVar2 = pBVar1->b_used - pBVar1->b_inputp;
    if (iVar2 != 0) {
      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);
    }
    pBVar1->b_inputp = 0;
    iVar2 = 0;
    pBVar1->b_used = 0;
  }
  return iVar2;
}



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

undefined8 __regparm2 sync_buffered_stream(undefined4 param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  __off64_t _Var4;
  
  if (DAT_00151204 != 0) {
    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);
    param_2 = param_3;
    if (piVar1 != (int *)0x0) {
      iVar2 = piVar1[3] - piVar1[5];
      _Var4 = CONCAT44(param_3,iVar2);
      if (iVar2 != 0) {
        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);
      }
      param_2 = (int)((ulonglong)_Var4 >> 0x20);
      piVar1[5] = 0;
      uVar3 = 0;
      piVar1[3] = 0;
      goto LAB_0007d35d;
    }
  }
  uVar3 = 0xffffffff;
LAB_0007d35d:
  return CONCAT44(param_2,uVar3);
}


PUSH ESI
PUSH EBX
CALL 0x00031ed0
ADD EBX,0xcccd9
SUB ESP,0x4
MOV EAX,dword ptr [EBX + 0x7204]
TEST EAX,EAX
JZ 0x0007d381
MOV EDX,dword ptr [ESP + 0x10]
MOV ESI,dword ptr [EAX + EDX*0x4]
TEST ESI,ESI
JZ 0x0007d381
MOV EAX,dword ptr [ESI + 0xc]
SUB EAX,dword ptr [ESI + 0x14]
JNZ 0x0007d368
MOV dword ptr [ESI + 0x14],0x0
XOR EAX,EAX
MOV dword ptr [ESI + 0xc],0x0
ADD ESP,0x4
POP EBX
POP ESI
RET
XOR EDX,EDX
NEG EAX
PUSH 0x1
ADC EDX,0x0
NEG EDX
PUSH EDX
PUSH EAX
PUSH dword ptr [ESI]
CALL 0x0002fb90
ADD ESP,0x10
JMP 0x0007d34d
MOV EAX,0xffffffff
JMP 0x0007d35d
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined8 __regparm2 sync_buffered_stream(undefined4 param_1,int param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}\n\n" comment (function_definition "undefined8 __regparm2 sync_buffered_stream(undefined4 param_1,int param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}" type_identifier (ERROR "__regparm2" identifier) (function_declarator "sync_buffered_stream(undefined4 param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "__off64_t _Var4;" type_identifier identifier ;) (if_statement "if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }" if (parenthesized_expression "(DAT_00151204 != 0)" ( (binary_expression "DAT_00151204 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }" { (expression_statement "piVar1 = *(int **)(DAT_00151204 + param_3 * 4);" (assignment_expression "piVar1 = *(int **)(DAT_00151204 + param_3 * 4)" identifier = (pointer_expression "*(int **)(DAT_00151204 + param_3 * 4)" * (cast_expression "(int **)(DAT_00151204 + param_3 * 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_00151204 + param_3 * 4)" ( (binary_expression "DAT_00151204 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) ))))) ;) (expression_statement "param_2 = param_3;" (assignment_expression "param_2 = param_3" identifier = identifier) ;) (if_statement "if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }" if (parenthesized_expression "(piVar1 != (int *)0x0)" ( (binary_expression "piVar1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }" { (expression_statement "iVar2 = piVar1[3] - piVar1[5];" (assignment_expression "iVar2 = piVar1[3] - piVar1[5]" identifier = (binary_expression "piVar1[3] - piVar1[5]" (subscript_expression "piVar1[3]" identifier [ number_literal ]) - (subscript_expression "piVar1[5]" identifier [ number_literal ]))) ;) (expression_statement "_Var4 = CONCAT44(param_3,iVar2);" (assignment_expression "_Var4 = CONCAT44(param_3,iVar2)" identifier = (call_expression "CONCAT44(param_3,iVar2)" identifier (argument_list "(param_3,iVar2)" ( identifier , identifier )))) ;) (if_statement "if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }" { (expression_statement "_Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);" (assignment_expression "_Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" identifier = (call_expression "lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" identifier (argument_list "(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" ( (pointer_expression "*piVar1" * identifier) , (call_expression "CONCAT44(-(uint)(iVar2 != 0),-iVar2)" identifier (argument_list "(-(uint)(iVar2 != 0),-iVar2)" ( (unary_expression "-(uint)(iVar2 != 0)" - (call_expression "(uint)(iVar2 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )))) , (unary_expression "-iVar2" - identifier) ))) , number_literal )))) ;) })) (expression_statement "param_2 = (int)((ulonglong)_Var4 >> 0x20);" (assignment_expression "param_2 = (int)((ulonglong)_Var4 >> 0x20)" identifier = (cast_expression "(int)((ulonglong)_Var4 >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)_Var4 >> 0x20)" ( (binary_expression "(ulonglong)_Var4 >> 0x20" (cast_expression "(ulonglong)_Var4" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "piVar1[5] = 0;" (assignment_expression "piVar1[5] = 0" (subscript_expression "piVar1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (expression_statement "piVar1[3] = 0;" (assignment_expression "piVar1[3] = 0" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = number_literal) ;) (goto_statement "goto LAB_0007d35d;" goto statement_identifier ;) })) })) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" identifier = number_literal) ;) (labeled_statement "LAB_0007d35d:\n  return CONCAT44(param_2,uVar3);" statement_identifier : (return_statement "return CONCAT44(param_2,uVar3);" return (call_expression "CONCAT44(param_2,uVar3)" identifier (argument_list "(param_2,uVar3)" ( identifier , identifier ))) ;)) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint sync_buffered_stream(int bfd)\n\n{\n  BUFFERED_STREAM *pBVar1;\n  int iVar2;\n  \n  if ((buffers == (BUFFERED_STREAM **)0x0) ||\n     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)) {\n    iVar2 = -1;\n  }\n  else {\n    iVar2 = pBVar1->b_used - pBVar1->b_inputp;\n    if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }\n    pBVar1->b_inputp = 0;\n    iVar2 = 0;\n    pBVar1->b_used = 0;\n  }\n  return iVar2;\n}\n\n" comment comment (function_definition "int sync_buffered_stream(int bfd)\n\n{\n  BUFFERED_STREAM *pBVar1;\n  int iVar2;\n  \n  if ((buffers == (BUFFERED_STREAM **)0x0) ||\n     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)) {\n    iVar2 = -1;\n  }\n  else {\n    iVar2 = pBVar1->b_used - pBVar1->b_inputp;\n    if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }\n    pBVar1->b_inputp = 0;\n    iVar2 = 0;\n    pBVar1->b_used = 0;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "sync_buffered_stream(int bfd)" identifier (parameter_list "(int bfd)" ( (parameter_declaration "int bfd" primitive_type identifier) ))) (compound_statement "{\n  BUFFERED_STREAM *pBVar1;\n  int iVar2;\n  \n  if ((buffers == (BUFFERED_STREAM **)0x0) ||\n     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)) {\n    iVar2 = -1;\n  }\n  else {\n    iVar2 = pBVar1->b_used - pBVar1->b_inputp;\n    if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }\n    pBVar1->b_inputp = 0;\n    iVar2 = 0;\n    pBVar1->b_used = 0;\n  }\n  return iVar2;\n}" { (declaration "BUFFERED_STREAM *pBVar1;" type_identifier (pointer_declarator "*pBVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if ((buffers == (BUFFERED_STREAM **)0x0) ||\n     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)) {\n    iVar2 = -1;\n  }\n  else {\n    iVar2 = pBVar1->b_used - pBVar1->b_inputp;\n    if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }\n    pBVar1->b_inputp = 0;\n    iVar2 = 0;\n    pBVar1->b_used = 0;\n  }" if (parenthesized_expression "((buffers == (BUFFERED_STREAM **)0x0) ||\n     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0))" ( (binary_expression "(buffers == (BUFFERED_STREAM **)0x0) ||\n     (pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)" (parenthesized_expression "(buffers == (BUFFERED_STREAM **)0x0)" ( (binary_expression "buffers == (BUFFERED_STREAM **)0x0" identifier == (cast_expression "(BUFFERED_STREAM **)0x0" ( (type_descriptor "BUFFERED_STREAM **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) number_literal)) )) || (parenthesized_expression "(pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0)" ( (comma_expression "pBVar1 = buffers[bfd], pBVar1 == (BUFFERED_STREAM *)0x0" (assignment_expression "pBVar1 = buffers[bfd]" identifier = (subscript_expression "buffers[bfd]" identifier [ identifier ])) , (binary_expression "pBVar1 == (BUFFERED_STREAM *)0x0" identifier == (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    iVar2 = -1;\n  }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = pBVar1->b_used - pBVar1->b_inputp;\n    if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }\n    pBVar1->b_inputp = 0;\n    iVar2 = 0;\n    pBVar1->b_used = 0;\n  }" else (compound_statement "{\n    iVar2 = pBVar1->b_used - pBVar1->b_inputp;\n    if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }\n    pBVar1->b_inputp = 0;\n    iVar2 = 0;\n    pBVar1->b_used = 0;\n  }" { (expression_statement "iVar2 = pBVar1->b_used - pBVar1->b_inputp;" (assignment_expression "iVar2 = pBVar1->b_used - pBVar1->b_inputp" identifier = (binary_expression "pBVar1->b_used - pBVar1->b_inputp" (field_expression "pBVar1->b_used" identifier -> field_identifier) - (field_expression "pBVar1->b_inputp" identifier -> field_identifier))) ;) (if_statement "if (iVar2 != 0) {\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n    }" { (expression_statement "lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);" (call_expression "lseek64(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" identifier (argument_list "(pBVar1->b_fd,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" ( (field_expression "pBVar1->b_fd" identifier -> field_identifier) , (call_expression "CONCAT44(-(uint)(iVar2 != 0),-iVar2)" identifier (argument_list "(-(uint)(iVar2 != 0),-iVar2)" ( (unary_expression "-(uint)(iVar2 != 0)" - (call_expression "(uint)(iVar2 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )))) , (unary_expression "-iVar2" - identifier) ))) , number_literal ))) ;) })) (expression_statement "pBVar1->b_inputp = 0;" (assignment_expression "pBVar1->b_inputp = 0" (field_expression "pBVar1->b_inputp" identifier -> field_identifier) = number_literal) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "pBVar1->b_used = 0;" (assignment_expression "pBVar1->b_used = 0" (field_expression "pBVar1->b_used" identifier -> field_identifier) = number_literal) ;) }))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "undefined8 __regparm2 sync_buffered_stream(undefined4 param_1,int param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}\n\n" (function_definition "undefined8 __regparm2 sync_buffered_stream(undefined4 param_1,int param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}" type_identifier (ERROR "__regparm2" identifier) (function_declarator "sync_buffered_stream(undefined4 param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "__off64_t _Var4;" type_identifier identifier ;) (if_statement "if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }" if (parenthesized_expression "(DAT_00151204 != 0)" ( (binary_expression "DAT_00151204 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }" { (expression_statement "piVar1 = *(int **)(DAT_00151204 + param_3 * 4);" (assignment_expression "piVar1 = *(int **)(DAT_00151204 + param_3 * 4)" identifier = (pointer_expression "*(int **)(DAT_00151204 + param_3 * 4)" * (cast_expression "(int **)(DAT_00151204 + param_3 * 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_00151204 + param_3 * 4)" ( (binary_expression "DAT_00151204 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) ))))) ;) (expression_statement "param_2 = param_3;" (assignment_expression "param_2 = param_3" identifier = identifier) ;) (if_statement "if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }" if (parenthesized_expression "(piVar1 != (int *)0x0)" ( (binary_expression "piVar1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }" { (expression_statement "iVar2 = piVar1[3] - piVar1[5];" (assignment_expression "iVar2 = piVar1[3] - piVar1[5]" identifier = (binary_expression "piVar1[3] - piVar1[5]" (subscript_expression "piVar1[3]" identifier [ number_literal ]) - (subscript_expression "piVar1[5]" identifier [ number_literal ]))) ;) (expression_statement "_Var4 = CONCAT44(param_3,iVar2);" (assignment_expression "_Var4 = CONCAT44(param_3,iVar2)" identifier = (call_expression "CONCAT44(param_3,iVar2)" identifier (argument_list "(param_3,iVar2)" ( identifier , identifier )))) ;) (if_statement "if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }" { (expression_statement "_Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);" (assignment_expression "_Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" identifier = (call_expression "lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" identifier (argument_list "(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" ( (pointer_expression "*piVar1" * identifier) , (call_expression "CONCAT44(-(uint)(iVar2 != 0),-iVar2)" identifier (argument_list "(-(uint)(iVar2 != 0),-iVar2)" ( (unary_expression "-(uint)(iVar2 != 0)" - (call_expression "(uint)(iVar2 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )))) , (unary_expression "-iVar2" - identifier) ))) , number_literal )))) ;) })) (expression_statement "param_2 = (int)((ulonglong)_Var4 >> 0x20);" (assignment_expression "param_2 = (int)((ulonglong)_Var4 >> 0x20)" identifier = (cast_expression "(int)((ulonglong)_Var4 >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)_Var4 >> 0x20)" ( (binary_expression "(ulonglong)_Var4 >> 0x20" (cast_expression "(ulonglong)_Var4" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "piVar1[5] = 0;" (assignment_expression "piVar1[5] = 0" (subscript_expression "piVar1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (expression_statement "piVar1[3] = 0;" (assignment_expression "piVar1[3] = 0" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = number_literal) ;) (goto_statement "goto LAB_0007d35d;" goto statement_identifier ;) })) })) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" identifier = number_literal) ;) (labeled_statement "LAB_0007d35d:\n  return CONCAT44(param_2,uVar3);" statement_identifier : (return_statement "return CONCAT44(param_2,uVar3);" return (call_expression "CONCAT44(param_2,uVar3)" identifier (argument_list "(param_2,uVar3)" ( identifier , identifier ))) ;)) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (call_expression IDENT (argument_list ( (unary_expression - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT != LIT) )))) , (unary_expression - IDENT) ))) , LIT )))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) >> LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (goto_statement goto statement_identifier ;) })) })) (expression_statement (assignment_expression IDENT = LIT) ;) (labeled_statement statement_identifier : (return_statement return (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;)) })))
(function_definition "undefined8 __regparm2 sync_buffered_stream(undefined4 param_1,int param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}" (type_identifier "undefined8") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "sync_buffered_stream(undefined4 param_1,int param_2,int param_3)" (identifier "sync_buffered_stream") (parameter_list "(undefined4 param_1,int param_2,int param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  __off64_t _Var4;\n  \n  if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }\n  uVar3 = 0xffffffff;\nLAB_0007d35d:\n  return CONCAT44(param_2,uVar3);\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "__off64_t _Var4;" (type_identifier "__off64_t") (identifier "_Var4") (; ";")) (if_statement "if (DAT_00151204 != 0) {\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }" (if "if") (parenthesized_expression "(DAT_00151204 != 0)" (( "(") (binary_expression "DAT_00151204 != 0" (identifier "DAT_00151204") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);\n    param_2 = param_3;\n    if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }\n  }" ({ "{") (expression_statement "piVar1 = *(int **)(DAT_00151204 + param_3 * 4);" (assignment_expression "piVar1 = *(int **)(DAT_00151204 + param_3 * 4)" (identifier "piVar1") (= "=") (pointer_expression "*(int **)(DAT_00151204 + param_3 * 4)" (* "*") (cast_expression "(int **)(DAT_00151204 + param_3 * 4)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(DAT_00151204 + param_3 * 4)" (( "(") (binary_expression "DAT_00151204 + param_3 * 4" (identifier "DAT_00151204") (+ "+") (binary_expression "param_3 * 4" (identifier "param_3") (* "*") (number_literal "4"))) () ")"))))) (; ";")) (expression_statement "param_2 = param_3;" (assignment_expression "param_2 = param_3" (identifier "param_2") (= "=") (identifier "param_3")) (; ";")) (if_statement "if (piVar1 != (int *)0x0) {\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }" (if "if") (parenthesized_expression "(piVar1 != (int *)0x0)" (( "(") (binary_expression "piVar1 != (int *)0x0" (identifier "piVar1") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      iVar2 = piVar1[3] - piVar1[5];\n      _Var4 = CONCAT44(param_3,iVar2);\n      if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }\n      param_2 = (int)((ulonglong)_Var4 >> 0x20);\n      piVar1[5] = 0;\n      uVar3 = 0;\n      piVar1[3] = 0;\n      goto LAB_0007d35d;\n    }" ({ "{") (expression_statement "iVar2 = piVar1[3] - piVar1[5];" (assignment_expression "iVar2 = piVar1[3] - piVar1[5]" (identifier "iVar2") (= "=") (binary_expression "piVar1[3] - piVar1[5]" (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")) (- "-") (subscript_expression "piVar1[5]" (identifier "piVar1") ([ "[") (number_literal "5") (] "]")))) (; ";")) (expression_statement "_Var4 = CONCAT44(param_3,iVar2);" (assignment_expression "_Var4 = CONCAT44(param_3,iVar2)" (identifier "_Var4") (= "=") (call_expression "CONCAT44(param_3,iVar2)" (identifier "CONCAT44") (argument_list "(param_3,iVar2)" (( "(") (identifier "param_3") (, ",") (identifier "iVar2") () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);\n      }" ({ "{") (expression_statement "_Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);" (assignment_expression "_Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" (identifier "_Var4") (= "=") (call_expression "lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" (identifier "lseek64") (argument_list "(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1)" (( "(") (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (, ",") (call_expression "CONCAT44(-(uint)(iVar2 != 0),-iVar2)" (identifier "CONCAT44") (argument_list "(-(uint)(iVar2 != 0),-iVar2)" (( "(") (unary_expression "-(uint)(iVar2 != 0)" (- "-") (call_expression "(uint)(iVar2 != 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")))) (, ",") (unary_expression "-iVar2" (- "-") (identifier "iVar2")) () ")"))) (, ",") (number_literal "1") () ")")))) (; ";")) (} "}"))) (expression_statement "param_2 = (int)((ulonglong)_Var4 >> 0x20);" (assignment_expression "param_2 = (int)((ulonglong)_Var4 >> 0x20)" (identifier "param_2") (= "=") (cast_expression "(int)((ulonglong)_Var4 >> 0x20)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "((ulonglong)_Var4 >> 0x20)" (( "(") (binary_expression "(ulonglong)_Var4 >> 0x20" (cast_expression "(ulonglong)_Var4" (( "(") (type_descriptor "ulonglong" (type_identifier "ulonglong")) () ")") (identifier "_Var4")) (>> ">>") (number_literal "0x20")) () ")")))) (; ";")) (expression_statement "piVar1[5] = 0;" (assignment_expression "piVar1[5] = 0" (subscript_expression "piVar1[5]" (identifier "piVar1") ([ "[") (number_literal "5") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar1[3] = 0;" (assignment_expression "piVar1[3] = 0" (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "0")) (; ";")) (goto_statement "goto LAB_0007d35d;" (goto "goto") (statement_identifier "LAB_0007d35d") (; ";")) (} "}"))) (} "}"))) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" (identifier "uVar3") (= "=") (number_literal "0xffffffff")) (; ";")) (labeled_statement "LAB_0007d35d:\n  return CONCAT44(param_2,uVar3);" (statement_identifier "LAB_0007d35d") (: ":") (return_statement "return CONCAT44(param_2,uVar3);" (return "return") (call_expression "CONCAT44(param_2,uVar3)" (identifier "CONCAT44") (argument_list "(param_2,uVar3)" (( "(") (identifier "param_2") (, ",") (identifier "uVar3") () ")"))) (; ";"))) (} "}")))

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

int function_1(int bfd)

{
  type_1 *var_2;
  int var_3;
  
  if ((var_1 == (type_1 **)0x0) ||
     (var_2 = var_1[bfd], var_2 == (type_1 *)0x0)) {
    var_3 = -1;
  }
  else {
    var_3 = var_2->b_used - var_2->b_inputp;
    if (var_3 != 0) {
      var_4(var_2->b_fd,var_5(-(uint)(var_3 != 0),-var_3),1);
    }
    var_2->b_inputp = 0;
    var_3 = 0;
    var_2->b_used = 0;
  }
  return var_3;
}


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

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

undefined8 __regparm2 MASKED(undefined4 param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  __off64_t _Var4;
  
  if (DAT_00151204 != 0) {
    piVar1 = *(int **)(DAT_00151204 + param_3 * 4);
    param_2 = param_3;
    if (piVar1 != (int *)0x0) {
      iVar2 = piVar1[3] - piVar1[5];
      _Var4 = CONCAT44(param_3,iVar2);
      if (iVar2 != 0) {
        _Var4 = lseek64(*piVar1,CONCAT44(-(uint)(iVar2 != 0),-iVar2),1);
      }
      param_2 = (int)((ulonglong)_Var4 >> 0x20);
      piVar1[5] = 0;
      uVar3 = 0;
      piVar1[3] = 0;
      goto LAB_0007d35d;
    }
  }
  uVar3 = 0xffffffff;
LAB_0007d35d:
  return CONCAT44(param_2,uVar3);
}

