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

void __regparm3 section_add_load_file(section_add *pa)

{
  char *pcVar1;
  FILE *__stream;
  bfd_byte *pbVar2;
  size_t sVar3;
  int iVar4;
  char *pcVar5;
  int *piVar6;
  char *format;
  size_t sVar7;
  size_t sVar8;
  
  __stream = fopen64(pa->filename,"r");
  if (__stream == (FILE *)0x0) {
    piVar6 = __errno_location();
    pcVar5 = strerror(*piVar6);
    pcVar1 = pa->filename;
    format = (char *)dcgettext(0,"cannot open: %s: %s",5);
                    /* WARNING: Subroutine does not return */
    fatal(format,pcVar1,pcVar5);
  }
  sVar7 = 0x1000;
  sVar8 = 0;
  pbVar2 = (bfd_byte *)xmalloc(0x1000);
  pa->contents = pbVar2;
  while( true ) {
    iVar4 = feof(__stream);
    if (iVar4 != 0) {
      pa->size = sVar8;
      fclose(__stream);
      return;
    }
    pbVar2 = pa->contents;
    if (sVar8 == sVar7) {
      sVar7 = sVar8 * 2;
      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);
      pa->contents = pbVar2;
    }
    sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);
    iVar4 = ferror(__stream);
    if (iVar4 != 0) break;
    sVar8 = sVar8 + sVar3;
  }
  pcVar1 = pa->filename;
  pcVar5 = (char *)dcgettext(0,"%s: fread failed",5);
                    /* WARNING: Subroutine does not return */
  fatal(pcVar5,pcVar1);
}



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

void __regparm3 FUN_00016fb0(int param_1)

{
  FILE *__stream;
  undefined4 uVar1;
  size_t sVar2;
  int iVar3;
  undefined4 uVar4;
  int *piVar5;
  char *pcVar6;
  int iVar7;
  int iVar8;
  
  __stream = fopen64(*(char **)(param_1 + 8),"r");
  if (__stream == (FILE *)0x0) {
    piVar5 = __errno_location();
    pcVar6 = strerror(*piVar5);
    uVar1 = *(undefined4 *)(param_1 + 8);
    uVar4 = dcgettext(0,"cannot open: %s: %s",5);
                    /* WARNING: Subroutine does not return */
    FUN_0002b6a0(uVar4,uVar1,pcVar6);
  }
  iVar7 = 0x1000;
  iVar8 = 0;
  uVar1 = xmalloc(0x1000);
  *(undefined4 *)(param_1 + 0x10) = uVar1;
  while( true ) {
    iVar3 = feof(__stream);
    if (iVar3 != 0) {
      *(int *)(param_1 + 0xc) = iVar8;
      fclose(__stream);
      return;
    }
    iVar3 = *(int *)(param_1 + 0x10);
    if (iVar8 == iVar7) {
      iVar7 = iVar8 * 2;
      iVar3 = xrealloc(iVar3,iVar7);
      *(int *)(param_1 + 0x10) = iVar3;
    }
    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);
    iVar3 = ferror(__stream);
    if (iVar3 != 0) break;
    iVar8 = iVar8 + sVar2;
  }
  uVar1 = *(undefined4 *)(param_1 + 8);
  uVar4 = dcgettext(0,"%s: fread failed",5);
                    /* WARNING: Subroutine does not return */
  FUN_0002b6a0(uVar4,uVar1);
}


PUSH EBP
MOV ECX,EAX
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000165d0
ADD EBX,0x28045
SUB ESP,0x24
MOV dword ptr [ESP + 0x14],EAX
LEA EAX,[EBX + 0xffff3e3b]
PUSH EAX
PUSH dword ptr [ECX + 0x8]
CALL 0x000132c0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000170a3
SUB ESP,0xc
MOV EDI,EAX
MOV EBP,0x1000
XOR ESI,ESI
PUSH 0x1000
CALL 0x000132e0
MOV ECX,dword ptr [ESP + 0x1c]
ADD ESP,0x10
MOV dword ptr [ECX + 0x10],EAX
JMP 0x0001702f
MOV EDX,EBP
ADD EAX,ESI
PUSH EDI
SUB EDX,ESI
PUSH EDX
PUSH 0x1
PUSH EAX
CALL 0x00013330
MOV dword ptr [ESP],EDI
MOV dword ptr [ESP + 0x18],EAX
CALL 0x00013170
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00017080
ADD ESI,dword ptr [ESP + 0x8]
SUB ESP,0xc
PUSH EDI
CALL 0x00013480
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00017068
MOV EAX,dword ptr [ESP + 0xc]
MOV EAX,dword ptr [EAX + 0x10]
CMP ESI,EBP
JNZ 0x00017008
SUB ESP,0x8
LEA EBP,[ESI + ESI*0x1]
PUSH EBP
PUSH EAX
CALL 0x00013230
MOV ECX,dword ptr [ESP + 0x1c]
ADD ESP,0x10
MOV dword ptr [ECX + 0x10],EAX
JMP 0x00017008
MOV EAX,dword ptr [ESP + 0xc]
SUB ESP,0xc
MOV dword ptr [EAX + 0xc],ESI
PUSH EDI
CALL 0x00013190
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [ESP + 0xc]
SUB ESP,0x4
MOV ESI,dword ptr [EAX + 0x8]
LEA EAX,[EBX + 0xfffef04f]
PUSH 0x5
PUSH EAX
PUSH 0x0
CALL 0x00013200
POP EDX
POP ECX
PUSH ESI
PUSH EAX
CALL 0x0002b6a0
CALL 0x000135f0
SUB ESP,0xc
PUSH dword ptr [EAX]
CALL 0x00013400
MOV EDI,EAX
MOV EAX,dword ptr [ESP + 0x1c]
ADD ESP,0xc
MOV ESI,dword ptr [EAX + 0x8]
LEA EAX,[EBX + 0xfffef060]
PUSH 0x5
PUSH EAX
PUSH 0x0
CALL 0x00013200
ADD ESP,0xc
PUSH EDI
PUSH ESI
PUSH EAX
CALL 0x0002b6a0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_00016fb0(int param_1)\n\n{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    /* WARNING: Subroutine does not return */\n  FUN_0002b6a0(uVar4,uVar1);\n}\n\n" comment (function_definition "void __regparm3 FUN_00016fb0(int param_1)\n\n{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    /* WARNING: Subroutine does not return */\n  FUN_0002b6a0(uVar4,uVar1);\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00016fb0(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    /* WARNING: Subroutine does not return */\n  FUN_0002b6a0(uVar4,uVar1);\n}" { (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (expression_statement "__stream = fopen64(*(char **)(param_1 + 8),"r");" (assignment_expression "__stream = fopen64(*(char **)(param_1 + 8),"r")" identifier = (call_expression "fopen64(*(char **)(param_1 + 8),"r")" identifier (argument_list "(*(char **)(param_1 + 8),"r")" ( (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (string_literal ""r"" " string_content ") )))) ;) (if_statement "if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }" if (parenthesized_expression "(__stream == (FILE *)0x0)" ( (binary_expression "__stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }" { (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar6 = strerror(*piVar5);" (assignment_expression "pcVar6 = strerror(*piVar5)" identifier = (call_expression "strerror(*piVar5)" identifier (argument_list "(*piVar5)" ( (pointer_expression "*piVar5" * identifier) )))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 8);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 8)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = dcgettext(0,"cannot open: %s: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"cannot open: %s: %s",5)" identifier = (call_expression "dcgettext(0,"cannot open: %s: %s",5)" identifier (argument_list "(0,"cannot open: %s: %s",5)" ( number_literal , (string_literal ""cannot open: %s: %s"" " string_content ") , number_literal )))) ;) comment (expression_statement "FUN_0002b6a0(uVar4,uVar1,pcVar6);" (call_expression "FUN_0002b6a0(uVar4,uVar1,pcVar6)" identifier (argument_list "(uVar4,uVar1,pcVar6)" ( identifier , identifier , identifier ))) ;) })) (expression_statement "iVar7 = 0x1000;" (assignment_expression "iVar7 = 0x1000" identifier = number_literal) ;) (expression_statement "iVar8 = 0;" (assignment_expression "iVar8 = 0" identifier = number_literal) ;) (expression_statement "uVar1 = xmalloc(0x1000);" (assignment_expression "uVar1 = xmalloc(0x1000)" identifier = (call_expression "xmalloc(0x1000)" identifier (argument_list "(0x1000)" ( number_literal )))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x10) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) (while_statement "while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }" { (expression_statement "iVar3 = feof(__stream);" (assignment_expression "iVar3 = feof(__stream)" identifier = (call_expression "feof(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }" { (expression_statement "*(int *)(param_1 + 0xc) = iVar8;" (assignment_expression "*(int *)(param_1 + 0xc) = iVar8" (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "iVar3 = *(int *)(param_1 + 0x10);" (assignment_expression "iVar3 = *(int *)(param_1 + 0x10)" identifier = (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (if_statement "if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }" if (parenthesized_expression "(iVar8 == iVar7)" ( (binary_expression "iVar8 == iVar7" identifier == identifier) )) (compound_statement "{\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }" { (expression_statement "iVar7 = iVar8 * 2;" (assignment_expression "iVar7 = iVar8 * 2" identifier = (binary_expression "iVar8 * 2" identifier * number_literal)) ;) (expression_statement "iVar3 = xrealloc(iVar3,iVar7);" (assignment_expression "iVar3 = xrealloc(iVar3,iVar7)" identifier = (call_expression "xrealloc(iVar3,iVar7)" identifier (argument_list "(iVar3,iVar7)" ( identifier , identifier )))) ;) (expression_statement "*(int *)(param_1 + 0x10) = iVar3;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar3" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) })) (expression_statement "sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);" (assignment_expression "sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" identifier = (call_expression "fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" identifier (argument_list "((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" ( (cast_expression "(void *)(iVar3 + iVar8)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar8)" ( (binary_expression "iVar3 + iVar8" identifier + identifier) ))) , number_literal , (binary_expression "iVar7 - iVar8" identifier - identifier) , identifier )))) ;) (expression_statement "iVar3 = ferror(__stream);" (assignment_expression "iVar3 = ferror(__stream)" identifier = (call_expression "ferror(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) break;" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar8 = iVar8 + sVar2;" (assignment_expression "iVar8 = iVar8 + sVar2" identifier = (binary_expression "iVar8 + sVar2" identifier + identifier)) ;) })) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 8);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 8)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = dcgettext(0,"%s: fread failed",5);" (assignment_expression "uVar4 = dcgettext(0,"%s: fread failed",5)" identifier = (call_expression "dcgettext(0,"%s: fread failed",5)" identifier (argument_list "(0,"%s: fread failed",5)" ( number_literal , (string_literal ""%s: fread failed"" " string_content ") , number_literal )))) ;) comment (expression_statement "FUN_0002b6a0(uVar4,uVar1);" (call_expression "FUN_0002b6a0(uVar4,uVar1)" identifier (argument_list "(uVar4,uVar1)" ( identifier , identifier ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 section_add_load_file(section_add *pa)\n\n{\n  char *pcVar1;\n  FILE *__stream;\n  bfd_byte *pbVar2;\n  size_t sVar3;\n  int iVar4;\n  char *pcVar5;\n  int *piVar6;\n  char *format;\n  size_t sVar7;\n  size_t sVar8;\n  \n  __stream = fopen64(pa->filename,"r");\n  if (__stream == (FILE *)0x0) {\n    piVar6 = __errno_location();\n    pcVar5 = strerror(*piVar6);\n    pcVar1 = pa->filename;\n    format = (char *)dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    fatal(format,pcVar1,pcVar5);\n  }\n  sVar7 = 0x1000;\n  sVar8 = 0;\n  pbVar2 = (bfd_byte *)xmalloc(0x1000);\n  pa->contents = pbVar2;\n  while( true ) {\n    iVar4 = feof(__stream);\n    if (iVar4 != 0) {\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }\n    pbVar2 = pa->contents;\n    if (sVar8 == sVar7) {\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }\n    sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);\n    iVar4 = ferror(__stream);\n    if (iVar4 != 0) break;\n    sVar8 = sVar8 + sVar3;\n  }\n  pcVar1 = pa->filename;\n  pcVar5 = (char *)dcgettext(0,"%s: fread failed",5);\n                    /* WARNING: Subroutine does not return */\n  fatal(pcVar5,pcVar1);\n}\n\n" comment (function_definition "void __regparm3 section_add_load_file(section_add *pa)\n\n{\n  char *pcVar1;\n  FILE *__stream;\n  bfd_byte *pbVar2;\n  size_t sVar3;\n  int iVar4;\n  char *pcVar5;\n  int *piVar6;\n  char *format;\n  size_t sVar7;\n  size_t sVar8;\n  \n  __stream = fopen64(pa->filename,"r");\n  if (__stream == (FILE *)0x0) {\n    piVar6 = __errno_location();\n    pcVar5 = strerror(*piVar6);\n    pcVar1 = pa->filename;\n    format = (char *)dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    fatal(format,pcVar1,pcVar5);\n  }\n  sVar7 = 0x1000;\n  sVar8 = 0;\n  pbVar2 = (bfd_byte *)xmalloc(0x1000);\n  pa->contents = pbVar2;\n  while( true ) {\n    iVar4 = feof(__stream);\n    if (iVar4 != 0) {\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }\n    pbVar2 = pa->contents;\n    if (sVar8 == sVar7) {\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }\n    sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);\n    iVar4 = ferror(__stream);\n    if (iVar4 != 0) break;\n    sVar8 = sVar8 + sVar3;\n  }\n  pcVar1 = pa->filename;\n  pcVar5 = (char *)dcgettext(0,"%s: fread failed",5);\n                    /* WARNING: Subroutine does not return */\n  fatal(pcVar5,pcVar1);\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "section_add_load_file(section_add *pa)" identifier (parameter_list "(section_add *pa)" ( (parameter_declaration "section_add *pa" type_identifier (pointer_declarator "*pa" * identifier)) ))) (compound_statement "{\n  char *pcVar1;\n  FILE *__stream;\n  bfd_byte *pbVar2;\n  size_t sVar3;\n  int iVar4;\n  char *pcVar5;\n  int *piVar6;\n  char *format;\n  size_t sVar7;\n  size_t sVar8;\n  \n  __stream = fopen64(pa->filename,"r");\n  if (__stream == (FILE *)0x0) {\n    piVar6 = __errno_location();\n    pcVar5 = strerror(*piVar6);\n    pcVar1 = pa->filename;\n    format = (char *)dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    fatal(format,pcVar1,pcVar5);\n  }\n  sVar7 = 0x1000;\n  sVar8 = 0;\n  pbVar2 = (bfd_byte *)xmalloc(0x1000);\n  pa->contents = pbVar2;\n  while( true ) {\n    iVar4 = feof(__stream);\n    if (iVar4 != 0) {\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }\n    pbVar2 = pa->contents;\n    if (sVar8 == sVar7) {\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }\n    sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);\n    iVar4 = ferror(__stream);\n    if (iVar4 != 0) break;\n    sVar8 = sVar8 + sVar3;\n  }\n  pcVar1 = pa->filename;\n  pcVar5 = (char *)dcgettext(0,"%s: fread failed",5);\n                    /* WARNING: Subroutine does not return */\n  fatal(pcVar5,pcVar1);\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "bfd_byte *pbVar2;" type_identifier (pointer_declarator "*pbVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "char *format;" primitive_type (pointer_declarator "*format" * identifier) ;) (declaration "size_t sVar7;" primitive_type identifier ;) (declaration "size_t sVar8;" primitive_type identifier ;) (expression_statement "__stream = fopen64(pa->filename,"r");" (assignment_expression "__stream = fopen64(pa->filename,"r")" identifier = (call_expression "fopen64(pa->filename,"r")" identifier (argument_list "(pa->filename,"r")" ( (field_expression "pa->filename" identifier -> field_identifier) , (string_literal ""r"" " string_content ") )))) ;) (if_statement "if (__stream == (FILE *)0x0) {\n    piVar6 = __errno_location();\n    pcVar5 = strerror(*piVar6);\n    pcVar1 = pa->filename;\n    format = (char *)dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    fatal(format,pcVar1,pcVar5);\n  }" if (parenthesized_expression "(__stream == (FILE *)0x0)" ( (binary_expression "__stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    piVar6 = __errno_location();\n    pcVar5 = strerror(*piVar6);\n    pcVar1 = pa->filename;\n    format = (char *)dcgettext(0,"cannot open: %s: %s",5);\n                    /* WARNING: Subroutine does not return */\n    fatal(format,pcVar1,pcVar5);\n  }" { (expression_statement "piVar6 = __errno_location();" (assignment_expression "piVar6 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar6);" (assignment_expression "pcVar5 = strerror(*piVar6)" identifier = (call_expression "strerror(*piVar6)" identifier (argument_list "(*piVar6)" ( (pointer_expression "*piVar6" * identifier) )))) ;) (expression_statement "pcVar1 = pa->filename;" (assignment_expression "pcVar1 = pa->filename" identifier = (field_expression "pa->filename" identifier -> field_identifier)) ;) (expression_statement "format = (char *)dcgettext(0,"cannot open: %s: %s",5);" (assignment_expression "format = (char *)dcgettext(0,"cannot open: %s: %s",5)" identifier = (cast_expression "(char *)dcgettext(0,"cannot open: %s: %s",5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"cannot open: %s: %s",5)" identifier (argument_list "(0,"cannot open: %s: %s",5)" ( number_literal , (string_literal ""cannot open: %s: %s"" " string_content ") , number_literal ))))) ;) comment (expression_statement "fatal(format,pcVar1,pcVar5);" (call_expression "fatal(format,pcVar1,pcVar5)" identifier (argument_list "(format,pcVar1,pcVar5)" ( identifier , identifier , identifier ))) ;) })) (expression_statement "sVar7 = 0x1000;" (assignment_expression "sVar7 = 0x1000" identifier = number_literal) ;) (expression_statement "sVar8 = 0;" (assignment_expression "sVar8 = 0" identifier = number_literal) ;) (expression_statement "pbVar2 = (bfd_byte *)xmalloc(0x1000);" (assignment_expression "pbVar2 = (bfd_byte *)xmalloc(0x1000)" identifier = (cast_expression "(bfd_byte *)xmalloc(0x1000)" ( (type_descriptor "bfd_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x1000)" identifier (argument_list "(0x1000)" ( number_literal ))))) ;) (expression_statement "pa->contents = pbVar2;" (assignment_expression "pa->contents = pbVar2" (field_expression "pa->contents" identifier -> field_identifier) = identifier) ;) (while_statement "while( true ) {\n    iVar4 = feof(__stream);\n    if (iVar4 != 0) {\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }\n    pbVar2 = pa->contents;\n    if (sVar8 == sVar7) {\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }\n    sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);\n    iVar4 = ferror(__stream);\n    if (iVar4 != 0) break;\n    sVar8 = sVar8 + sVar3;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar4 = feof(__stream);\n    if (iVar4 != 0) {\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }\n    pbVar2 = pa->contents;\n    if (sVar8 == sVar7) {\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }\n    sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);\n    iVar4 = ferror(__stream);\n    if (iVar4 != 0) break;\n    sVar8 = sVar8 + sVar3;\n  }" { (expression_statement "iVar4 = feof(__stream);" (assignment_expression "iVar4 = feof(__stream)" identifier = (call_expression "feof(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar4 != 0) {\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      pa->size = sVar8;\n      fclose(__stream);\n      return;\n    }" { (expression_statement "pa->size = sVar8;" (assignment_expression "pa->size = sVar8" (field_expression "pa->size" identifier -> field_identifier) = identifier) ;) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "pbVar2 = pa->contents;" (assignment_expression "pbVar2 = pa->contents" identifier = (field_expression "pa->contents" identifier -> field_identifier)) ;) (if_statement "if (sVar8 == sVar7) {\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }" if (parenthesized_expression "(sVar8 == sVar7)" ( (binary_expression "sVar8 == sVar7" identifier == identifier) )) (compound_statement "{\n      sVar7 = sVar8 * 2;\n      pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);\n      pa->contents = pbVar2;\n    }" { (expression_statement "sVar7 = sVar8 * 2;" (assignment_expression "sVar7 = sVar8 * 2" identifier = (binary_expression "sVar8 * 2" identifier * number_literal)) ;) (expression_statement "pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7);" (assignment_expression "pbVar2 = (bfd_byte *)xrealloc(pbVar2,sVar7)" identifier = (cast_expression "(bfd_byte *)xrealloc(pbVar2,sVar7)" ( (type_descriptor "bfd_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xrealloc(pbVar2,sVar7)" identifier (argument_list "(pbVar2,sVar7)" ( identifier , identifier ))))) ;) (expression_statement "pa->contents = pbVar2;" (assignment_expression "pa->contents = pbVar2" (field_expression "pa->contents" identifier -> field_identifier) = identifier) ;) })) (expression_statement "sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream);" (assignment_expression "sVar3 = fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream)" identifier = (call_expression "fread(pbVar2 + sVar8,1,sVar7 - sVar8,__stream)" identifier (argument_list "(pbVar2 + sVar8,1,sVar7 - sVar8,__stream)" ( (binary_expression "pbVar2 + sVar8" identifier + identifier) , number_literal , (binary_expression "sVar7 - sVar8" identifier - identifier) , identifier )))) ;) (expression_statement "iVar4 = ferror(__stream);" (assignment_expression "iVar4 = ferror(__stream)" identifier = (call_expression "ferror(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar4 != 0) break;" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "sVar8 = sVar8 + sVar3;" (assignment_expression "sVar8 = sVar8 + sVar3" identifier = (binary_expression "sVar8 + sVar3" identifier + identifier)) ;) })) (expression_statement "pcVar1 = pa->filename;" (assignment_expression "pcVar1 = pa->filename" identifier = (field_expression "pa->filename" identifier -> field_identifier)) ;) (expression_statement "pcVar5 = (char *)dcgettext(0,"%s: fread failed",5);" (assignment_expression "pcVar5 = (char *)dcgettext(0,"%s: fread failed",5)" identifier = (cast_expression "(char *)dcgettext(0,"%s: fread failed",5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"%s: fread failed",5)" identifier (argument_list "(0,"%s: fread failed",5)" ( number_literal , (string_literal ""%s: fread failed"" " string_content ") , number_literal ))))) ;) comment (expression_statement "fatal(pcVar5,pcVar1);" (call_expression "fatal(pcVar5,pcVar1)" identifier (argument_list "(pcVar5,pcVar1)" ( identifier , identifier ))) ;) })))
(translation_unit "void __regparm3 FUN_00016fb0(int param_1)\n\n{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    \n  FUN_0002b6a0(uVar4,uVar1);\n}\n\n" (function_definition "void __regparm3 FUN_00016fb0(int param_1)\n\n{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    \n  FUN_0002b6a0(uVar4,uVar1);\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00016fb0(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    \n  FUN_0002b6a0(uVar4,uVar1);\n}" { (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (expression_statement "__stream = fopen64(*(char **)(param_1 + 8),"r");" (assignment_expression "__stream = fopen64(*(char **)(param_1 + 8),"r")" identifier = (call_expression "fopen64(*(char **)(param_1 + 8),"r")" identifier (argument_list "(*(char **)(param_1 + 8),"r")" ( (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (string_literal ""r"" " string_content ") )))) ;) (if_statement "if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }" if (parenthesized_expression "(__stream == (FILE *)0x0)" ( (binary_expression "__stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }" { (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar6 = strerror(*piVar5);" (assignment_expression "pcVar6 = strerror(*piVar5)" identifier = (call_expression "strerror(*piVar5)" identifier (argument_list "(*piVar5)" ( (pointer_expression "*piVar5" * identifier) )))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 8);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 8)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = dcgettext(0,"cannot open: %s: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"cannot open: %s: %s",5)" identifier = (call_expression "dcgettext(0,"cannot open: %s: %s",5)" identifier (argument_list "(0,"cannot open: %s: %s",5)" ( number_literal , (string_literal ""cannot open: %s: %s"" " string_content ") , number_literal )))) ;) (expression_statement "FUN_0002b6a0(uVar4,uVar1,pcVar6);" (call_expression "FUN_0002b6a0(uVar4,uVar1,pcVar6)" identifier (argument_list "(uVar4,uVar1,pcVar6)" ( identifier , identifier , identifier ))) ;) })) (expression_statement "iVar7 = 0x1000;" (assignment_expression "iVar7 = 0x1000" identifier = number_literal) ;) (expression_statement "iVar8 = 0;" (assignment_expression "iVar8 = 0" identifier = number_literal) ;) (expression_statement "uVar1 = xmalloc(0x1000);" (assignment_expression "uVar1 = xmalloc(0x1000)" identifier = (call_expression "xmalloc(0x1000)" identifier (argument_list "(0x1000)" ( number_literal )))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x10) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) (while_statement "while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }" { (expression_statement "iVar3 = feof(__stream);" (assignment_expression "iVar3 = feof(__stream)" identifier = (call_expression "feof(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }" { (expression_statement "*(int *)(param_1 + 0xc) = iVar8;" (assignment_expression "*(int *)(param_1 + 0xc) = iVar8" (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "iVar3 = *(int *)(param_1 + 0x10);" (assignment_expression "iVar3 = *(int *)(param_1 + 0x10)" identifier = (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (if_statement "if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }" if (parenthesized_expression "(iVar8 == iVar7)" ( (binary_expression "iVar8 == iVar7" identifier == identifier) )) (compound_statement "{\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }" { (expression_statement "iVar7 = iVar8 * 2;" (assignment_expression "iVar7 = iVar8 * 2" identifier = (binary_expression "iVar8 * 2" identifier * number_literal)) ;) (expression_statement "iVar3 = xrealloc(iVar3,iVar7);" (assignment_expression "iVar3 = xrealloc(iVar3,iVar7)" identifier = (call_expression "xrealloc(iVar3,iVar7)" identifier (argument_list "(iVar3,iVar7)" ( identifier , identifier )))) ;) (expression_statement "*(int *)(param_1 + 0x10) = iVar3;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar3" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) })) (expression_statement "sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);" (assignment_expression "sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" identifier = (call_expression "fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" identifier (argument_list "((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" ( (cast_expression "(void *)(iVar3 + iVar8)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar8)" ( (binary_expression "iVar3 + iVar8" identifier + identifier) ))) , number_literal , (binary_expression "iVar7 - iVar8" identifier - identifier) , identifier )))) ;) (expression_statement "iVar3 = ferror(__stream);" (assignment_expression "iVar3 = ferror(__stream)" identifier = (call_expression "ferror(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) break;" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar8 = iVar8 + sVar2;" (assignment_expression "iVar8 = iVar8 + sVar2" identifier = (binary_expression "iVar8 + sVar2" identifier + identifier)) ;) })) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 8);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 8)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = dcgettext(0,"%s: fread failed",5);" (assignment_expression "uVar4 = dcgettext(0,"%s: fread failed",5)" identifier = (call_expression "dcgettext(0,"%s: fread failed",5)" identifier (argument_list "(0,"%s: fread failed",5)" ( number_literal , (string_literal ""%s: fread failed"" " string_content ") , number_literal )))) ;) (expression_statement "FUN_0002b6a0(uVar4,uVar1);" (call_expression "FUN_0002b6a0(uVar4,uVar1)" identifier (argument_list "(uVar4,uVar1)" ( identifier , identifier ))) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (string_literal " string_content ") , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (while_statement while (parenthesized_expression ( BOOL )) (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 (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , LIT , (binary_expression IDENT - IDENT) , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (string_literal " string_content ") , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })))
(function_definition "void __regparm3 FUN_00016fb0(int param_1)\n\n{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    \n  FUN_0002b6a0(uVar4,uVar1);\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00016fb0(int param_1)" (identifier "FUN_00016fb0") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  FILE *__stream;\n  undefined4 uVar1;\n  size_t sVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  int iVar7;\n  int iVar8;\n  \n  __stream = fopen64(*(char **)(param_1 + 8),"r");\n  if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }\n  iVar7 = 0x1000;\n  iVar8 = 0;\n  uVar1 = xmalloc(0x1000);\n  *(undefined4 *)(param_1 + 0x10) = uVar1;\n  while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }\n  uVar1 = *(undefined4 *)(param_1 + 8);\n  uVar4 = dcgettext(0,"%s: fread failed",5);\n                    \n  FUN_0002b6a0(uVar4,uVar1);\n}" ({ "{") (declaration "FILE *__stream;" (type_identifier "FILE") (pointer_declarator "*__stream" (* "*") (identifier "__stream")) (; ";")) (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (declaration "int *piVar5;" (primitive_type "int") (pointer_declarator "*piVar5" (* "*") (identifier "piVar5")) (; ";")) (declaration "char *pcVar6;" (primitive_type "char") (pointer_declarator "*pcVar6" (* "*") (identifier "pcVar6")) (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (expression_statement "__stream = fopen64(*(char **)(param_1 + 8),"r");" (assignment_expression "__stream = fopen64(*(char **)(param_1 + 8),"r")" (identifier "__stream") (= "=") (call_expression "fopen64(*(char **)(param_1 + 8),"r")" (identifier "fopen64") (argument_list "(*(char **)(param_1 + 8),"r")" (( "(") (pointer_expression "*(char **)(param_1 + 8)" (* "*") (cast_expression "(char **)(param_1 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (, ",") (string_literal ""r"" (" """) (string_content "r") (" """)) () ")")))) (; ";")) (if_statement "if (__stream == (FILE *)0x0) {\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }" (if "if") (parenthesized_expression "(__stream == (FILE *)0x0)" (( "(") (binary_expression "__stream == (FILE *)0x0" (identifier "__stream") (== "==") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    piVar5 = __errno_location();\n    pcVar6 = strerror(*piVar5);\n    uVar1 = *(undefined4 *)(param_1 + 8);\n    uVar4 = dcgettext(0,"cannot open: %s: %s",5);\n                    \n    FUN_0002b6a0(uVar4,uVar1,pcVar6);\n  }" ({ "{") (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" (identifier "piVar5") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar6 = strerror(*piVar5);" (assignment_expression "pcVar6 = strerror(*piVar5)" (identifier "pcVar6") (= "=") (call_expression "strerror(*piVar5)" (identifier "strerror") (argument_list "(*piVar5)" (( "(") (pointer_expression "*piVar5" (* "*") (identifier "piVar5")) () ")")))) (; ";")) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 8);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 8)" (identifier "uVar1") (= "=") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "uVar4 = dcgettext(0,"cannot open: %s: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"cannot open: %s: %s",5)" (identifier "uVar4") (= "=") (call_expression "dcgettext(0,"cannot open: %s: %s",5)" (identifier "dcgettext") (argument_list "(0,"cannot open: %s: %s",5)" (( "(") (number_literal "0") (, ",") (string_literal ""cannot open: %s: %s"" (" """) (string_content "cannot open: %s: %s") (" """)) (, ",") (number_literal "5") () ")")))) (; ";")) (expression_statement "FUN_0002b6a0(uVar4,uVar1,pcVar6);" (call_expression "FUN_0002b6a0(uVar4,uVar1,pcVar6)" (identifier "FUN_0002b6a0") (argument_list "(uVar4,uVar1,pcVar6)" (( "(") (identifier "uVar4") (, ",") (identifier "uVar1") (, ",") (identifier "pcVar6") () ")"))) (; ";")) (} "}"))) (expression_statement "iVar7 = 0x1000;" (assignment_expression "iVar7 = 0x1000" (identifier "iVar7") (= "=") (number_literal "0x1000")) (; ";")) (expression_statement "iVar8 = 0;" (assignment_expression "iVar8 = 0" (identifier "iVar8") (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar1 = xmalloc(0x1000);" (assignment_expression "uVar1 = xmalloc(0x1000)" (identifier "uVar1") (= "=") (call_expression "xmalloc(0x1000)" (identifier "xmalloc") (argument_list "(0x1000)" (( "(") (number_literal "0x1000") () ")")))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x10) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x10)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "uVar1")) (; ";")) (while_statement "while( true ) {\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    iVar3 = feof(__stream);\n    if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }\n    iVar3 = *(int *)(param_1 + 0x10);\n    if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }\n    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);\n    iVar3 = ferror(__stream);\n    if (iVar3 != 0) break;\n    iVar8 = iVar8 + sVar2;\n  }" ({ "{") (expression_statement "iVar3 = feof(__stream);" (assignment_expression "iVar3 = feof(__stream)" (identifier "iVar3") (= "=") (call_expression "feof(__stream)" (identifier "feof") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      *(int *)(param_1 + 0xc) = iVar8;\n      fclose(__stream);\n      return;\n    }" ({ "{") (expression_statement "*(int *)(param_1 + 0xc) = iVar8;" (assignment_expression "*(int *)(param_1 + 0xc) = iVar8" (pointer_expression "*(int *)(param_1 + 0xc)" (* "*") (cast_expression "(int *)(param_1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "iVar8")) (; ";")) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" (identifier "fclose") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "iVar3 = *(int *)(param_1 + 0x10);" (assignment_expression "iVar3 = *(int *)(param_1 + 0x10)" (identifier "iVar3") (= "=") (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (if_statement "if (iVar8 == iVar7) {\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }" (if "if") (parenthesized_expression "(iVar8 == iVar7)" (( "(") (binary_expression "iVar8 == iVar7" (identifier "iVar8") (== "==") (identifier "iVar7")) () ")")) (compound_statement "{\n      iVar7 = iVar8 * 2;\n      iVar3 = xrealloc(iVar3,iVar7);\n      *(int *)(param_1 + 0x10) = iVar3;\n    }" ({ "{") (expression_statement "iVar7 = iVar8 * 2;" (assignment_expression "iVar7 = iVar8 * 2" (identifier "iVar7") (= "=") (binary_expression "iVar8 * 2" (identifier "iVar8") (* "*") (number_literal "2"))) (; ";")) (expression_statement "iVar3 = xrealloc(iVar3,iVar7);" (assignment_expression "iVar3 = xrealloc(iVar3,iVar7)" (identifier "iVar3") (= "=") (call_expression "xrealloc(iVar3,iVar7)" (identifier "xrealloc") (argument_list "(iVar3,iVar7)" (( "(") (identifier "iVar3") (, ",") (identifier "iVar7") () ")")))) (; ";")) (expression_statement "*(int *)(param_1 + 0x10) = iVar3;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar3" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "iVar3")) (; ";")) (} "}"))) (expression_statement "sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);" (assignment_expression "sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" (identifier "sVar2") (= "=") (call_expression "fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" (identifier "fread") (argument_list "((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream)" (( "(") (cast_expression "(void *)(iVar3 + iVar8)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + iVar8)" (( "(") (binary_expression "iVar3 + iVar8" (identifier "iVar3") (+ "+") (identifier "iVar8")) () ")"))) (, ",") (number_literal "1") (, ",") (binary_expression "iVar7 - iVar8" (identifier "iVar7") (- "-") (identifier "iVar8")) (, ",") (identifier "__stream") () ")")))) (; ";")) (expression_statement "iVar3 = ferror(__stream);" (assignment_expression "iVar3 = ferror(__stream)" (identifier "iVar3") (= "=") (call_expression "ferror(__stream)" (identifier "ferror") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")")))) (; ";")) (if_statement "if (iVar3 != 0) break;" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "iVar8 = iVar8 + sVar2;" (assignment_expression "iVar8 = iVar8 + sVar2" (identifier "iVar8") (= "=") (binary_expression "iVar8 + sVar2" (identifier "iVar8") (+ "+") (identifier "sVar2"))) (; ";")) (} "}"))) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 8);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 8)" (identifier "uVar1") (= "=") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "uVar4 = dcgettext(0,"%s: fread failed",5);" (assignment_expression "uVar4 = dcgettext(0,"%s: fread failed",5)" (identifier "uVar4") (= "=") (call_expression "dcgettext(0,"%s: fread failed",5)" (identifier "dcgettext") (argument_list "(0,"%s: fread failed",5)" (( "(") (number_literal "0") (, ",") (string_literal ""%s: fread failed"" (" """) (string_content "%s: fread failed") (" """)) (, ",") (number_literal "5") () ")")))) (; ";")) (expression_statement "FUN_0002b6a0(uVar4,uVar1);" (call_expression "FUN_0002b6a0(uVar4,uVar1)" (identifier "FUN_0002b6a0") (argument_list "(uVar4,uVar1)" (( "(") (identifier "uVar4") (, ",") (identifier "uVar1") () ")"))) (; ";")) (} "}")))

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

void __regparm3 function_1(type_1 *pa)

{
  char *pcVar1;
  type_2 *var_2;
  type_3 *var_15;
  size_t var_17;
  int var_9;
  char *pcVar5;
  int *piVar6;
  char *format;
  size_t var_12;
  size_t var_11;
  
  var_2 = var_1(pa->filename,"r");
  if (var_2 == (type_2 *)0x0) {
    piVar6 = var_3();
    pcVar5 = var_4(*piVar6);
    pcVar1 = pa->filename;
    format = (char *)var_5(0,"cannot open: %s: %s",5);
                    /* WARNING: Subroutine does not return */
    var_6(format,pcVar1,pcVar5);
  }
  var_12 = 0x1000;
  var_11 = 0;
  var_15 = (type_3 *)var_7(0x1000);
  pa->contents = var_15;
  while( true ) {
    var_9 = var_8(var_2);
    if (var_9 != 0) {
      pa->size = var_11;
      var_10(var_2);
      return;
    }
    var_15 = pa->contents;
    if (var_11 == var_12) {
      var_12 = var_11 * 2;
      var_15 = (type_3 *)var_13(var_15,var_12);
      pa->contents = var_15;
    }
    var_17 = var_14(var_15 + var_11,1,var_12 - var_11,var_2);
    var_9 = var_16(var_2);
    if (var_9 != 0) break;
    var_11 = var_11 + var_17;
  }
  pcVar1 = pa->filename;
  pcVar5 = (char *)var_5(0,"%s: fread failed",5);
                    /* WARNING: Subroutine does not return */
  var_6(pcVar5,pcVar1);
}


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

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

void __regparm3 MASKED(int param_1)

{
  FILE *__stream;
  undefined4 uVar1;
  size_t sVar2;
  int iVar3;
  undefined4 uVar4;
  int *piVar5;
  char *pcVar6;
  int iVar7;
  int iVar8;
  
  __stream = fopen64(*(char **)(param_1 + 8),"r");
  if (__stream == (FILE *)0x0) {
    piVar5 = __errno_location();
    pcVar6 = strerror(*piVar5);
    uVar1 = *(undefined4 *)(param_1 + 8);
    uVar4 = dcgettext(0,"cannot open: %s: %s",5);
                    /* WARNING: Subroutine does not return */
    FUN_0002b6a0(uVar4,uVar1,pcVar6);
  }
  iVar7 = 0x1000;
  iVar8 = 0;
  uVar1 = xmalloc(0x1000);
  *(undefined4 *)(param_1 + 0x10) = uVar1;
  while( true ) {
    iVar3 = feof(__stream);
    if (iVar3 != 0) {
      *(int *)(param_1 + 0xc) = iVar8;
      fclose(__stream);
      return;
    }
    iVar3 = *(int *)(param_1 + 0x10);
    if (iVar8 == iVar7) {
      iVar7 = iVar8 * 2;
      iVar3 = xrealloc(iVar3,iVar7);
      *(int *)(param_1 + 0x10) = iVar3;
    }
    sVar2 = fread((void *)(iVar3 + iVar8),1,iVar7 - iVar8,__stream);
    iVar3 = ferror(__stream);
    if (iVar3 != 0) break;
    iVar8 = iVar8 + sVar2;
  }
  uVar1 = *(undefined4 *)(param_1 + 8);
  uVar4 = dcgettext(0,"%s: fread failed",5);
                    /* WARNING: Subroutine does not return */
  FUN_0002b6a0(uVar4,uVar1);
}

