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

Filedata * __regparm3 open_file(char *pathname)

{
  int iVar1;
  Filedata *filedata;
  FILE *pFVar2;
  bfd_boolean bVar3;
  stat statbuf;
  
  statbuf.st_ino._4_4_ = 0x268fa;
  iVar1 = __xstat64(3,pathname,(stat64 *)&statbuf);
  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&
     (filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0)) {
    pFVar2 = fopen64(pathname,"rb");
    filedata->handle = (FILE *)pFVar2;
    if (pFVar2 != (FILE *)0x0) {
      filedata->file_name = pathname;
      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;
      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;
      bVar3 = get_file_header(filedata);
      if (bVar3 != 0) {
        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&
            (int)(filedata->file_header).e_shoff == 0) {
          return filedata;
        }
        if (is_32bit_elf == 0) {
          iVar1 = get_64bit_section_headers(filedata,0);
        }
        else {
          iVar1 = get_32bit_section_headers(filedata,0);
        }
        if (iVar1 != 0) {
          return filedata;
        }
      }
      if ((FILE *)filedata->handle != (FILE *)0x0) {
        fclose((FILE *)filedata->handle);
      }
    }
    free(filedata);
  }
  return (Filedata *)0x0;
}



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

undefined4 * __regparm3 FUN_000268f0(char *param_1)

{
  int iVar1;
  undefined4 *__ptr;
  FILE *pFVar2;
  stat64 local_6c;
  
  local_6c.st_ino._4_4_ = 0x268fa;
  iVar1 = __xstat64(3,param_1,&local_6c);
  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&
     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {
    pFVar2 = fopen64(param_1,"rb");
    __ptr[1] = pFVar2;
    if (pFVar2 != (FILE *)0x0) {
      *__ptr = param_1;
      __ptr[2] = (undefined4)local_6c.st_size;
      __ptr[3] = local_6c.st_size._4_4_;
      iVar1 = FUN_00026650();
      if (iVar1 != 0) {
        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {
          return __ptr;
        }
        if (DAT_000b6324 == 0) {
          iVar1 = FUN_0001dde0();
        }
        else {
          iVar1 = FUN_0001dad0();
        }
        if (iVar1 != 0) {
          return __ptr;
        }
      }
      if ((FILE *)__ptr[1] != (FILE *)0x0) {
        fclose((FILE *)__ptr[1]);
      }
    }
    free(__ptr);
  }
  return (undefined4 *)0x0;
}


PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x00013f70
ADD EBX,0x8d706
SUB ESP,0x64
LEA EAX,[ESP + 0x4]
PUSH EAX
PUSH EDI
PUSH 0x3
CALL 0x000133f0
ADD ESP,0x10
TEST EAX,EAX
JS 0x000269b7
MOV EAX,dword ptr [ESP + 0x10]
AND EAX,0xf000
CMP EAX,0x8000
JNZ 0x000269b7
SUB ESP,0x8
PUSH 0x74
PUSH 0x1
CALL 0x00013430
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x000269b7
SUB ESP,0x8
LEA EAX,[EBX + 0xfffda6f4]
PUSH EAX
PUSH EDI
CALL 0x00013140
ADD ESP,0x10
MOV dword ptr [ESI + 0x4],EAX
TEST EAX,EAX
JZ 0x000269ab
MOV EAX,dword ptr [ESP + 0x2c]
MOV EDX,dword ptr [ESP + 0x30]
MOV dword ptr [ESI],EDI
MOV dword ptr [ESI + 0x8],EAX
MOV EAX,ESI
MOV dword ptr [ESI + 0xc],EDX
CALL 0x00026650
TEST EAX,EAX
JZ 0x00026998
MOV EAX,dword ptr [ESI + 0x34]
OR EAX,dword ptr [ESI + 0x30]
JZ 0x000269b9
MOV ECX,dword ptr [EBX + 0x2324]
XOR EDX,EDX
MOV EAX,ESI
TEST ECX,ECX
JNZ 0x000269c8
CALL 0x0001dde0
TEST EAX,EAX
JNZ 0x000269b9
MOV EAX,dword ptr [ESI + 0x4]
TEST EAX,EAX
JZ 0x000269ab
SUB ESP,0xc
PUSH EAX
CALL 0x000130e0
ADD ESP,0x10
SUB ESP,0xc
PUSH ESI
CALL 0x000130a0
ADD ESP,0x10
XOR ESI,ESI
ADD ESP,0x60
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
CALL 0x0001dad0
JMP 0x00026994
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * __regparm3 FUN_000268f0(char *param_1)\n\n{\n  int iVar1;\n  undefined4 *__ptr;\n  FILE *pFVar2;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,param_1,&local_6c);\n  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }\n  return (undefined4 *)0x0;\n}\n\n" comment (ERROR "undefined4 * __regparm3 FUN_000268f0(char *param_1)" (binary_expression "undefined4 * __regparm3 FUN_000268f0(char *param_1)" identifier * (ERROR "__regparm3" identifier) (call_expression "FUN_000268f0(char *param_1)" identifier (argument_list "(char *param_1)" ( (binary_expression "char *param_1" identifier * identifier) ))))) (compound_statement "{\n  int iVar1;\n  undefined4 *__ptr;\n  FILE *pFVar2;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,param_1,&local_6c);\n  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }\n  return (undefined4 *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "stat64 local_6c;" type_identifier identifier ;) (expression_statement "local_6c.st_ino._4_4_ = 0x268fa;" (assignment_expression "local_6c.st_ino._4_4_ = 0x268fa" (field_expression "local_6c.st_ino._4_4_" (field_expression "local_6c.st_ino" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "iVar1 = __xstat64(3,param_1,&local_6c);" (assignment_expression "iVar1 = __xstat64(3,param_1,&local_6c)" identifier = (call_expression "__xstat64(3,param_1,&local_6c)" identifier (argument_list "(3,param_1,&local_6c)" ( number_literal , identifier , (pointer_expression "&local_6c" & identifier) )))) ;) (if_statement "if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }" if (parenthesized_expression "(((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0))" ( (binary_expression "((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000))" ( (binary_expression "(-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "((local_6c.st_mode & 0xf000) == 0x8000)" ( (binary_expression "(local_6c.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(local_6c.st_mode & 0xf000)" ( (binary_expression "local_6c.st_mode & 0xf000" (field_expression "local_6c.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) ))) )) && (parenthesized_expression "(__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)" ( (comma_expression "__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0" (assignment_expression "__ptr = (undefined4 *)calloc(1,0x74)" identifier = (cast_expression "(undefined4 *)calloc(1,0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0x74)" identifier (argument_list "(1,0x74)" ( number_literal , number_literal ))))) , (binary_expression "__ptr != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }" { (expression_statement "pFVar2 = fopen64(param_1,"rb");" (assignment_expression "pFVar2 = fopen64(param_1,"rb")" identifier = (call_expression "fopen64(param_1,"rb")" identifier (argument_list "(param_1,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (expression_statement "__ptr[1] = pFVar2;" (assignment_expression "__ptr[1] = pFVar2" (subscript_expression "__ptr[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }" if (parenthesized_expression "(pFVar2 != (FILE *)0x0)" ( (binary_expression "pFVar2 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }" { (expression_statement "*__ptr = param_1;" (assignment_expression "*__ptr = param_1" (pointer_expression "*__ptr" * identifier) = identifier) ;) (expression_statement "__ptr[2] = (undefined4)local_6c.st_size;" (assignment_expression "__ptr[2] = (undefined4)local_6c.st_size" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = (cast_expression "(undefined4)local_6c.st_size" ( (type_descriptor "undefined4" type_identifier) ) (field_expression "local_6c.st_size" identifier . field_identifier))) ;) (expression_statement "__ptr[3] = local_6c.st_size._4_4_;" (assignment_expression "__ptr[3] = local_6c.st_size._4_4_" (subscript_expression "__ptr[3]" identifier [ number_literal ]) = (field_expression "local_6c.st_size._4_4_" (field_expression "local_6c.st_size" identifier . field_identifier) . field_identifier)) ;) (expression_statement "iVar1 = FUN_00026650();" (assignment_expression "iVar1 = FUN_00026650()" identifier = (call_expression "FUN_00026650()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" { (if_statement "if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }" if (parenthesized_expression "(__ptr[0xd] == 0 && __ptr[0xc] == 0)" ( (binary_expression "__ptr[0xd] == 0 && __ptr[0xc] == 0" (binary_expression "__ptr[0xd] == 0" (subscript_expression "__ptr[0xd]" identifier [ number_literal ]) == number_literal) && (binary_expression "__ptr[0xc] == 0" (subscript_expression "__ptr[0xc]" identifier [ number_literal ]) == number_literal)) )) (compound_statement "{\n          return __ptr;\n        }" { (return_statement "return __ptr;" return identifier ;) })) (if_statement "if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }" if (parenthesized_expression "(DAT_000b6324 == 0)" ( (binary_expression "DAT_000b6324 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = FUN_0001dde0();\n        }" { (expression_statement "iVar1 = FUN_0001dde0();" (assignment_expression "iVar1 = FUN_0001dde0()" identifier = (call_expression "FUN_0001dde0()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n          iVar1 = FUN_0001dad0();\n        }" else (compound_statement "{\n          iVar1 = FUN_0001dad0();\n        }" { (expression_statement "iVar1 = FUN_0001dad0();" (assignment_expression "iVar1 = FUN_0001dad0()" identifier = (call_expression "FUN_0001dad0()" identifier (argument_list "()" ( )))) ;) }))) (if_statement "if (iVar1 != 0) {\n          return __ptr;\n        }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n          return __ptr;\n        }" { (return_statement "return __ptr;" return identifier ;) })) })) (if_statement "if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }" if (parenthesized_expression "((FILE *)__ptr[1] != (FILE *)0x0)" ( (binary_expression "(FILE *)__ptr[1] != (FILE *)0x0" (cast_expression "(FILE *)__ptr[1]" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        fclose((FILE *)__ptr[1]);\n      }" { (expression_statement "fclose((FILE *)__ptr[1]);" (call_expression "fclose((FILE *)__ptr[1])" identifier (argument_list "((FILE *)__ptr[1])" ( (cast_expression "(FILE *)__ptr[1]" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) ))) ;) })) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (return_statement "return (undefined4 *)0x0;" return (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) }))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nFiledata * __regparm3 open_file(char *pathname)\n\n{\n  int iVar1;\n  Filedata *filedata;\n  FILE *pFVar2;\n  bfd_boolean bVar3;\n  stat statbuf;\n  \n  statbuf.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,pathname,(stat64 *)&statbuf);\n  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0)) {\n    pFVar2 = fopen64(pathname,"rb");\n    filedata->handle = (FILE *)pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;\n      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;\n      bVar3 = get_file_header(filedata);\n      if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }\n      if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }\n    }\n    free(filedata);\n  }\n  return (Filedata *)0x0;\n}\n\n" comment (ERROR "Filedata * __regparm3 open_file(char *pathname)" (binary_expression "Filedata * __regparm3 open_file(char *pathname)" identifier * (ERROR "__regparm3" identifier) (call_expression "open_file(char *pathname)" identifier (argument_list "(char *pathname)" ( (binary_expression "char *pathname" identifier * identifier) ))))) (compound_statement "{\n  int iVar1;\n  Filedata *filedata;\n  FILE *pFVar2;\n  bfd_boolean bVar3;\n  stat statbuf;\n  \n  statbuf.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,pathname,(stat64 *)&statbuf);\n  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0)) {\n    pFVar2 = fopen64(pathname,"rb");\n    filedata->handle = (FILE *)pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;\n      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;\n      bVar3 = get_file_header(filedata);\n      if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }\n      if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }\n    }\n    free(filedata);\n  }\n  return (Filedata *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "Filedata *filedata;" type_identifier (pointer_declarator "*filedata" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "bfd_boolean bVar3;" type_identifier identifier ;) (declaration "stat statbuf;" type_identifier identifier ;) (expression_statement "statbuf.st_ino._4_4_ = 0x268fa;" (assignment_expression "statbuf.st_ino._4_4_ = 0x268fa" (field_expression "statbuf.st_ino._4_4_" (field_expression "statbuf.st_ino" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "iVar1 = __xstat64(3,pathname,(stat64 *)&statbuf);" (assignment_expression "iVar1 = __xstat64(3,pathname,(stat64 *)&statbuf)" identifier = (call_expression "__xstat64(3,pathname,(stat64 *)&statbuf)" identifier (argument_list "(3,pathname,(stat64 *)&statbuf)" ( number_literal , identifier , (cast_expression "(stat64 *)&statbuf" ( (type_descriptor "stat64 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&statbuf" & identifier)) )))) ;) (if_statement "if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0)) {\n    pFVar2 = fopen64(pathname,"rb");\n    filedata->handle = (FILE *)pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;\n      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;\n      bVar3 = get_file_header(filedata);\n      if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }\n      if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }\n    }\n    free(filedata);\n  }" if (parenthesized_expression "(((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0))" ( (binary_expression "((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000))" ( (binary_expression "(-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "((statbuf.st_mode & 0xf000) == 0x8000)" ( (binary_expression "(statbuf.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(statbuf.st_mode & 0xf000)" ( (binary_expression "statbuf.st_mode & 0xf000" (field_expression "statbuf.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) ))) )) && (parenthesized_expression "(filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0)" ( (comma_expression "filedata = (Filedata *)calloc(1,0x74), filedata != (Filedata *)0x0" (assignment_expression "filedata = (Filedata *)calloc(1,0x74)" identifier = (cast_expression "(Filedata *)calloc(1,0x74)" ( (type_descriptor "Filedata *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0x74)" identifier (argument_list "(1,0x74)" ( number_literal , number_literal ))))) , (binary_expression "filedata != (Filedata *)0x0" identifier != (cast_expression "(Filedata *)0x0" ( (type_descriptor "Filedata *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    pFVar2 = fopen64(pathname,"rb");\n    filedata->handle = (FILE *)pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;\n      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;\n      bVar3 = get_file_header(filedata);\n      if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }\n      if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }\n    }\n    free(filedata);\n  }" { (expression_statement "pFVar2 = fopen64(pathname,"rb");" (assignment_expression "pFVar2 = fopen64(pathname,"rb")" identifier = (call_expression "fopen64(pathname,"rb")" identifier (argument_list "(pathname,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (expression_statement "filedata->handle = (FILE *)pFVar2;" (assignment_expression "filedata->handle = (FILE *)pFVar2" (field_expression "filedata->handle" identifier -> field_identifier) = (cast_expression "(FILE *)pFVar2" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (if_statement "if (pFVar2 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;\n      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;\n      bVar3 = get_file_header(filedata);\n      if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }\n      if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }\n    }" if (parenthesized_expression "(pFVar2 != (FILE *)0x0)" ( (binary_expression "pFVar2 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      filedata->file_name = pathname;\n      *(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;\n      *(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;\n      bVar3 = get_file_header(filedata);\n      if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }\n      if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }\n    }" { (expression_statement "filedata->file_name = pathname;" (assignment_expression "filedata->file_name = pathname" (field_expression "filedata->file_name" identifier -> field_identifier) = identifier) ;) (expression_statement "*(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size;" (assignment_expression "*(undefined4 *)&filedata->file_size = (undefined4)statbuf.st_size" (pointer_expression "*(undefined4 *)&filedata->file_size" * (cast_expression "(undefined4 *)&filedata->file_size" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&filedata->file_size" & (field_expression "filedata->file_size" identifier -> field_identifier)))) = (cast_expression "(undefined4)statbuf.st_size" ( (type_descriptor "undefined4" type_identifier) ) (field_expression "statbuf.st_size" identifier . field_identifier))) ;) (expression_statement "*(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_;" (assignment_expression "*(undefined4 *)((int)&filedata->file_size + 4) = statbuf.st_size._4_4_" (pointer_expression "*(undefined4 *)((int)&filedata->file_size + 4)" * (cast_expression "(undefined4 *)((int)&filedata->file_size + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&filedata->file_size + 4)" ( (binary_expression "(int)&filedata->file_size + 4" (cast_expression "(int)&filedata->file_size" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&filedata->file_size" & (field_expression "filedata->file_size" identifier -> field_identifier))) + number_literal) )))) = (field_expression "statbuf.st_size._4_4_" (field_expression "statbuf.st_size" identifier . field_identifier) . field_identifier)) ;) (expression_statement "bVar3 = get_file_header(filedata);" (assignment_expression "bVar3 = get_file_header(filedata)" identifier = (call_expression "get_file_header(filedata)" identifier (argument_list "(filedata)" ( identifier )))) ;) (if_statement "if (bVar3 != 0) {\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }" if (parenthesized_expression "(bVar3 != 0)" ( (binary_expression "bVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }\n        if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }\n        if (iVar1 != 0) {\n          return filedata;\n        }\n      }" { (if_statement "if (*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }" if (parenthesized_expression "(*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0)" ( (binary_expression "*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0 &&\n            (int)(filedata->file_header).e_shoff == 0" (binary_expression "*(int *)((int)&(filedata->file_header).e_shoff + 4) == 0" (pointer_expression "*(int *)((int)&(filedata->file_header).e_shoff + 4)" * (cast_expression "(int *)((int)&(filedata->file_header).e_shoff + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&(filedata->file_header).e_shoff + 4)" ( (binary_expression "(int)&(filedata->file_header).e_shoff + 4" (cast_expression "(int)&(filedata->file_header).e_shoff" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&(filedata->file_header).e_shoff" & (field_expression "(filedata->file_header).e_shoff" (parenthesized_expression "(filedata->file_header)" ( (field_expression "filedata->file_header" identifier -> field_identifier) )) . field_identifier))) + number_literal) )))) == number_literal) && (binary_expression "(int)(filedata->file_header).e_shoff == 0" (cast_expression "(int)(filedata->file_header).e_shoff" ( (type_descriptor "int" primitive_type) ) (field_expression "(filedata->file_header).e_shoff" (parenthesized_expression "(filedata->file_header)" ( (field_expression "filedata->file_header" identifier -> field_identifier) )) . field_identifier)) == number_literal)) )) (compound_statement "{\n          return filedata;\n        }" { (return_statement "return filedata;" return identifier ;) })) (if_statement "if (is_32bit_elf == 0) {\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }\n        else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }" if (parenthesized_expression "(is_32bit_elf == 0)" ( (binary_expression "is_32bit_elf == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = get_64bit_section_headers(filedata,0);\n        }" { (expression_statement "iVar1 = get_64bit_section_headers(filedata,0);" (assignment_expression "iVar1 = get_64bit_section_headers(filedata,0)" identifier = (call_expression "get_64bit_section_headers(filedata,0)" identifier (argument_list "(filedata,0)" ( identifier , number_literal )))) ;) }) (else_clause "else {\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }" else (compound_statement "{\n          iVar1 = get_32bit_section_headers(filedata,0);\n        }" { (expression_statement "iVar1 = get_32bit_section_headers(filedata,0);" (assignment_expression "iVar1 = get_32bit_section_headers(filedata,0)" identifier = (call_expression "get_32bit_section_headers(filedata,0)" identifier (argument_list "(filedata,0)" ( identifier , number_literal )))) ;) }))) (if_statement "if (iVar1 != 0) {\n          return filedata;\n        }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n          return filedata;\n        }" { (return_statement "return filedata;" return identifier ;) })) })) (if_statement "if ((FILE *)filedata->handle != (FILE *)0x0) {\n        fclose((FILE *)filedata->handle);\n      }" if (parenthesized_expression "((FILE *)filedata->handle != (FILE *)0x0)" ( (binary_expression "(FILE *)filedata->handle != (FILE *)0x0" (cast_expression "(FILE *)filedata->handle" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "filedata->handle" identifier -> field_identifier)) != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        fclose((FILE *)filedata->handle);\n      }" { (expression_statement "fclose((FILE *)filedata->handle);" (call_expression "fclose((FILE *)filedata->handle)" identifier (argument_list "((FILE *)filedata->handle)" ( (cast_expression "(FILE *)filedata->handle" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "filedata->handle" identifier -> field_identifier)) ))) ;) })) })) (expression_statement "free(filedata);" (call_expression "free(filedata)" identifier (argument_list "(filedata)" ( identifier ))) ;) })) (return_statement "return (Filedata *)0x0;" return (cast_expression "(Filedata *)0x0" ( (type_descriptor "Filedata *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) }))
(translation_unit "undefined4 * __regparm3 FUN_000268f0(char *param_1)\n\n{\n  int iVar1;\n  undefined4 *__ptr;\n  FILE *pFVar2;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,param_1,&local_6c);\n  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }\n  return (undefined4 *)0x0;\n}\n\n" (ERROR "undefined4 * __regparm3 FUN_000268f0(char *param_1)" (binary_expression "undefined4 * __regparm3 FUN_000268f0(char *param_1)" identifier * (ERROR "__regparm3" identifier) (call_expression "FUN_000268f0(char *param_1)" identifier (argument_list "(char *param_1)" ( (binary_expression "char *param_1" identifier * identifier) ))))) (compound_statement "{\n  int iVar1;\n  undefined4 *__ptr;\n  FILE *pFVar2;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,param_1,&local_6c);\n  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }\n  return (undefined4 *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "stat64 local_6c;" type_identifier identifier ;) (expression_statement "local_6c.st_ino._4_4_ = 0x268fa;" (assignment_expression "local_6c.st_ino._4_4_ = 0x268fa" (field_expression "local_6c.st_ino._4_4_" (field_expression "local_6c.st_ino" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "iVar1 = __xstat64(3,param_1,&local_6c);" (assignment_expression "iVar1 = __xstat64(3,param_1,&local_6c)" identifier = (call_expression "__xstat64(3,param_1,&local_6c)" identifier (argument_list "(3,param_1,&local_6c)" ( number_literal , identifier , (pointer_expression "&local_6c" & identifier) )))) ;) (if_statement "if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }" if (parenthesized_expression "(((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0))" ( (binary_expression "((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000))" ( (binary_expression "(-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "((local_6c.st_mode & 0xf000) == 0x8000)" ( (binary_expression "(local_6c.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(local_6c.st_mode & 0xf000)" ( (binary_expression "local_6c.st_mode & 0xf000" (field_expression "local_6c.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) ))) )) && (parenthesized_expression "(__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)" ( (comma_expression "__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0" (assignment_expression "__ptr = (undefined4 *)calloc(1,0x74)" identifier = (cast_expression "(undefined4 *)calloc(1,0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0x74)" identifier (argument_list "(1,0x74)" ( number_literal , number_literal ))))) , (binary_expression "__ptr != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }" { (expression_statement "pFVar2 = fopen64(param_1,"rb");" (assignment_expression "pFVar2 = fopen64(param_1,"rb")" identifier = (call_expression "fopen64(param_1,"rb")" identifier (argument_list "(param_1,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (expression_statement "__ptr[1] = pFVar2;" (assignment_expression "__ptr[1] = pFVar2" (subscript_expression "__ptr[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }" if (parenthesized_expression "(pFVar2 != (FILE *)0x0)" ( (binary_expression "pFVar2 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }" { (expression_statement "*__ptr = param_1;" (assignment_expression "*__ptr = param_1" (pointer_expression "*__ptr" * identifier) = identifier) ;) (expression_statement "__ptr[2] = (undefined4)local_6c.st_size;" (assignment_expression "__ptr[2] = (undefined4)local_6c.st_size" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = (cast_expression "(undefined4)local_6c.st_size" ( (type_descriptor "undefined4" type_identifier) ) (field_expression "local_6c.st_size" identifier . field_identifier))) ;) (expression_statement "__ptr[3] = local_6c.st_size._4_4_;" (assignment_expression "__ptr[3] = local_6c.st_size._4_4_" (subscript_expression "__ptr[3]" identifier [ number_literal ]) = (field_expression "local_6c.st_size._4_4_" (field_expression "local_6c.st_size" identifier . field_identifier) . field_identifier)) ;) (expression_statement "iVar1 = FUN_00026650();" (assignment_expression "iVar1 = FUN_00026650()" identifier = (call_expression "FUN_00026650()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" { (if_statement "if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }" if (parenthesized_expression "(__ptr[0xd] == 0 && __ptr[0xc] == 0)" ( (binary_expression "__ptr[0xd] == 0 && __ptr[0xc] == 0" (binary_expression "__ptr[0xd] == 0" (subscript_expression "__ptr[0xd]" identifier [ number_literal ]) == number_literal) && (binary_expression "__ptr[0xc] == 0" (subscript_expression "__ptr[0xc]" identifier [ number_literal ]) == number_literal)) )) (compound_statement "{\n          return __ptr;\n        }" { (return_statement "return __ptr;" return identifier ;) })) (if_statement "if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }" if (parenthesized_expression "(DAT_000b6324 == 0)" ( (binary_expression "DAT_000b6324 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = FUN_0001dde0();\n        }" { (expression_statement "iVar1 = FUN_0001dde0();" (assignment_expression "iVar1 = FUN_0001dde0()" identifier = (call_expression "FUN_0001dde0()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n          iVar1 = FUN_0001dad0();\n        }" else (compound_statement "{\n          iVar1 = FUN_0001dad0();\n        }" { (expression_statement "iVar1 = FUN_0001dad0();" (assignment_expression "iVar1 = FUN_0001dad0()" identifier = (call_expression "FUN_0001dad0()" identifier (argument_list "()" ( )))) ;) }))) (if_statement "if (iVar1 != 0) {\n          return __ptr;\n        }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n          return __ptr;\n        }" { (return_statement "return __ptr;" return identifier ;) })) })) (if_statement "if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }" if (parenthesized_expression "((FILE *)__ptr[1] != (FILE *)0x0)" ( (binary_expression "(FILE *)__ptr[1] != (FILE *)0x0" (cast_expression "(FILE *)__ptr[1]" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        fclose((FILE *)__ptr[1]);\n      }" { (expression_statement "fclose((FILE *)__ptr[1]);" (call_expression "fclose((FILE *)__ptr[1])" identifier (argument_list "((FILE *)__ptr[1])" ( (cast_expression "(FILE *)__ptr[1]" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) ))) ;) })) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (return_statement "return (undefined4 *)0x0;" return (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) }))
(translation_unit (ERROR (binary_expression IDENT * (ERROR IDENT) (call_expression IDENT (argument_list ( (binary_expression IDENT * IDENT) ))))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression (field_expression (field_expression IDENT . field_identifier) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT . field_identifier) & LIT) )) == LIT) ))) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) , (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) (field_expression IDENT . field_identifier))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (field_expression (field_expression IDENT . field_identifier) . field_identifier)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) == LIT) && (binary_expression (subscript_expression IDENT [ LIT ]) == LIT)) )) (compound_statement { (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) ))) ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) }))
(ERROR "undefined4 * __regparm3 FUN_000268f0(char *param_1)" (binary_expression "undefined4 * __regparm3 FUN_000268f0(char *param_1)" (identifier "undefined4") (* "*") (ERROR "__regparm3" (identifier "__regparm3")) (call_expression "FUN_000268f0(char *param_1)" (identifier "FUN_000268f0") (argument_list "(char *param_1)" (( "(") (binary_expression "char *param_1" (identifier "char") (* "*") (identifier "param_1")) () ")"))))) (compound_statement "{\n  int iVar1;\n  undefined4 *__ptr;\n  FILE *pFVar2;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x268fa;\n  iVar1 = __xstat64(3,param_1,&local_6c);\n  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }\n  return (undefined4 *)0x0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 *__ptr;" (type_identifier "undefined4") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "FILE *pFVar2;" (type_identifier "FILE") (pointer_declarator "*pFVar2" (* "*") (identifier "pFVar2")) (; ";")) (declaration "stat64 local_6c;" (type_identifier "stat64") (identifier "local_6c") (; ";")) (expression_statement "local_6c.st_ino._4_4_ = 0x268fa;" (assignment_expression "local_6c.st_ino._4_4_ = 0x268fa" (field_expression "local_6c.st_ino._4_4_" (field_expression "local_6c.st_ino" (identifier "local_6c") (. ".") (field_identifier "st_ino")) (. ".") (field_identifier "_4_4_")) (= "=") (number_literal "0x268fa")) (; ";")) (expression_statement "iVar1 = __xstat64(3,param_1,&local_6c);" (assignment_expression "iVar1 = __xstat64(3,param_1,&local_6c)" (identifier "iVar1") (= "=") (call_expression "__xstat64(3,param_1,&local_6c)" (identifier "__xstat64") (argument_list "(3,param_1,&local_6c)" (( "(") (number_literal "3") (, ",") (identifier "param_1") (, ",") (pointer_expression "&local_6c" (& "&") (identifier "local_6c")) () ")")))) (; ";")) (if_statement "if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }" (if "if") (parenthesized_expression "(((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0))" (( "(") (binary_expression "((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000))" (( "(") (binary_expression "(-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (&& "&&") (parenthesized_expression "((local_6c.st_mode & 0xf000) == 0x8000)" (( "(") (binary_expression "(local_6c.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(local_6c.st_mode & 0xf000)" (( "(") (binary_expression "local_6c.st_mode & 0xf000" (field_expression "local_6c.st_mode" (identifier "local_6c") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xf000")) () ")")) (== "==") (number_literal "0x8000")) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)" (( "(") (comma_expression "__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0" (assignment_expression "__ptr = (undefined4 *)calloc(1,0x74)" (identifier "__ptr") (= "=") (cast_expression "(undefined4 *)calloc(1,0x74)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "calloc(1,0x74)" (identifier "calloc") (argument_list "(1,0x74)" (( "(") (number_literal "1") (, ",") (number_literal "0x74") () ")"))))) (, ",") (binary_expression "__ptr != (undefined4 *)0x0" (identifier "__ptr") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")"))) () ")")) (compound_statement "{\n    pFVar2 = fopen64(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }\n    free(__ptr);\n  }" ({ "{") (expression_statement "pFVar2 = fopen64(param_1,"rb");" (assignment_expression "pFVar2 = fopen64(param_1,"rb")" (identifier "pFVar2") (= "=") (call_expression "fopen64(param_1,"rb")" (identifier "fopen64") (argument_list "(param_1,"rb")" (( "(") (identifier "param_1") (, ",") (string_literal ""rb"" (" """) (string_content "rb") (" """)) () ")")))) (; ";")) (expression_statement "__ptr[1] = pFVar2;" (assignment_expression "__ptr[1] = pFVar2" (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "pFVar2")) (; ";")) (if_statement "if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }" (if "if") (parenthesized_expression "(pFVar2 != (FILE *)0x0)" (( "(") (binary_expression "pFVar2 != (FILE *)0x0" (identifier "pFVar2") (!= "!=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *__ptr = param_1;\n      __ptr[2] = (undefined4)local_6c.st_size;\n      __ptr[3] = local_6c.st_size._4_4_;\n      iVar1 = FUN_00026650();\n      if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }\n      if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }\n    }" ({ "{") (expression_statement "*__ptr = param_1;" (assignment_expression "*__ptr = param_1" (pointer_expression "*__ptr" (* "*") (identifier "__ptr")) (= "=") (identifier "param_1")) (; ";")) (expression_statement "__ptr[2] = (undefined4)local_6c.st_size;" (assignment_expression "__ptr[2] = (undefined4)local_6c.st_size" (subscript_expression "__ptr[2]" (identifier "__ptr") ([ "[") (number_literal "2") (] "]")) (= "=") (cast_expression "(undefined4)local_6c.st_size" (( "(") (type_descriptor "undefined4" (type_identifier "undefined4")) () ")") (field_expression "local_6c.st_size" (identifier "local_6c") (. ".") (field_identifier "st_size")))) (; ";")) (expression_statement "__ptr[3] = local_6c.st_size._4_4_;" (assignment_expression "__ptr[3] = local_6c.st_size._4_4_" (subscript_expression "__ptr[3]" (identifier "__ptr") ([ "[") (number_literal "3") (] "]")) (= "=") (field_expression "local_6c.st_size._4_4_" (field_expression "local_6c.st_size" (identifier "local_6c") (. ".") (field_identifier "st_size")) (. ".") (field_identifier "_4_4_"))) (; ";")) (expression_statement "iVar1 = FUN_00026650();" (assignment_expression "iVar1 = FUN_00026650()" (identifier "iVar1") (= "=") (call_expression "FUN_00026650()" (identifier "FUN_00026650") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }\n        if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" ({ "{") (if_statement "if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {\n          return __ptr;\n        }" (if "if") (parenthesized_expression "(__ptr[0xd] == 0 && __ptr[0xc] == 0)" (( "(") (binary_expression "__ptr[0xd] == 0 && __ptr[0xc] == 0" (binary_expression "__ptr[0xd] == 0" (subscript_expression "__ptr[0xd]" (identifier "__ptr") ([ "[") (number_literal "0xd") (] "]")) (== "==") (number_literal "0")) (&& "&&") (binary_expression "__ptr[0xc] == 0" (subscript_expression "__ptr[0xc]" (identifier "__ptr") ([ "[") (number_literal "0xc") (] "]")) (== "==") (number_literal "0"))) () ")")) (compound_statement "{\n          return __ptr;\n        }" ({ "{") (return_statement "return __ptr;" (return "return") (identifier "__ptr") (; ";")) (} "}"))) (if_statement "if (DAT_000b6324 == 0) {\n          iVar1 = FUN_0001dde0();\n        }\n        else {\n          iVar1 = FUN_0001dad0();\n        }" (if "if") (parenthesized_expression "(DAT_000b6324 == 0)" (( "(") (binary_expression "DAT_000b6324 == 0" (identifier "DAT_000b6324") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          iVar1 = FUN_0001dde0();\n        }" ({ "{") (expression_statement "iVar1 = FUN_0001dde0();" (assignment_expression "iVar1 = FUN_0001dde0()" (identifier "iVar1") (= "=") (call_expression "FUN_0001dde0()" (identifier "FUN_0001dde0") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")) (else_clause "else {\n          iVar1 = FUN_0001dad0();\n        }" (else "else") (compound_statement "{\n          iVar1 = FUN_0001dad0();\n        }" ({ "{") (expression_statement "iVar1 = FUN_0001dad0();" (assignment_expression "iVar1 = FUN_0001dad0()" (identifier "iVar1") (= "=") (call_expression "FUN_0001dad0()" (identifier "FUN_0001dad0") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")))) (if_statement "if (iVar1 != 0) {\n          return __ptr;\n        }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          return __ptr;\n        }" ({ "{") (return_statement "return __ptr;" (return "return") (identifier "__ptr") (; ";")) (} "}"))) (} "}"))) (if_statement "if ((FILE *)__ptr[1] != (FILE *)0x0) {\n        fclose((FILE *)__ptr[1]);\n      }" (if "if") (parenthesized_expression "((FILE *)__ptr[1] != (FILE *)0x0)" (( "(") (binary_expression "(FILE *)__ptr[1] != (FILE *)0x0" (cast_expression "(FILE *)__ptr[1]" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]"))) (!= "!=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        fclose((FILE *)__ptr[1]);\n      }" ({ "{") (expression_statement "fclose((FILE *)__ptr[1]);" (call_expression "fclose((FILE *)__ptr[1])" (identifier "fclose") (argument_list "((FILE *)__ptr[1])" (( "(") (cast_expression "(FILE *)__ptr[1]" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]"))) () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (} "}"))) (return_statement "return (undefined4 *)0x0;" (return "return") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))

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

type_1 * __regparm3 open_file(char *pathname)

{
  int var_2;
  type_1 *var_4;
  type_2 *var_6;
  type_3 var_8;
  type_4 statbuf;
  
  statbuf.st_ino._4_4_ = 0x268fa;
  var_2 = var_1(3,pathname,(type_5 *)&statbuf);
  if (((-1 < var_2) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&
     (var_4 = (type_1 *)var_3(1,0x74), var_4 != (type_1 *)0x0)) {
    var_6 = var_5(pathname,"rb");
    var_4->handle = (type_2 *)var_6;
    if (var_6 != (type_2 *)0x0) {
      var_4->file_name = pathname;
      *(type_6 *)&var_4->file_size = (type_6)statbuf.st_size;
      *(type_6 *)((int)&var_4->file_size + 4) = statbuf.st_size._4_4_;
      var_8 = var_7(var_4);
      if (var_8 != 0) {
        if (*(int *)((int)&(var_4->file_header).e_shoff + 4) == 0 &&
            (int)(var_4->file_header).e_shoff == 0) {
          return var_4;
        }
        if (var_9 == 0) {
          var_2 = var_10(var_4,0);
        }
        else {
          var_2 = var_11(var_4,0);
        }
        if (var_2 != 0) {
          return var_4;
        }
      }
      if ((type_2 *)var_4->handle != (type_2 *)0x0) {
        var_12((type_2 *)var_4->handle);
      }
    }
    var_13(var_4);
  }
  return (type_1 *)0x0;
}


(translation_unit (ERROR (binary_expression left: (identifier) (ERROR (identifier)) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))) (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (field_expression argument: (field_expression argument: (identifier) field: (field_identifier)) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal))))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal) (number_literal))))) right: (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 (identifier) (string_literal (string_content)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (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: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (field_expression argument: (identifier) field: (field_identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (field_expression argument: (field_expression argument: (identifier) field: (field_identifier)) field: (field_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) consequence: (compound_statement (return_statement (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))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (return_statement (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))))

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

undefined4 * __regparm3 MASKED(char *param_1)

{
  int iVar1;
  undefined4 *__ptr;
  FILE *pFVar2;
  stat64 local_6c;
  
  local_6c.st_ino._4_4_ = 0x268fa;
  iVar1 = __xstat64(3,param_1,&local_6c);
  if (((-1 < iVar1) && ((local_6c.st_mode & 0xf000) == 0x8000)) &&
     (__ptr = (undefined4 *)calloc(1,0x74), __ptr != (undefined4 *)0x0)) {
    pFVar2 = fopen64(param_1,"rb");
    __ptr[1] = pFVar2;
    if (pFVar2 != (FILE *)0x0) {
      *__ptr = param_1;
      __ptr[2] = (undefined4)local_6c.st_size;
      __ptr[3] = local_6c.st_size._4_4_;
      iVar1 = FUN_00026650();
      if (iVar1 != 0) {
        if (__ptr[0xd] == 0 && __ptr[0xc] == 0) {
          return __ptr;
        }
        if (DAT_000b6324 == 0) {
          iVar1 = FUN_0001dde0();
        }
        else {
          iVar1 = FUN_0001dad0();
        }
        if (iVar1 != 0) {
          return __ptr;
        }
      }
      if ((FILE *)__ptr[1] != (FILE *)0x0) {
        fclose((FILE *)__ptr[1]);
      }
    }
    free(__ptr);
  }
  return (undefined4 *)0x0;
}

