
Filedata * open_file(char *pathname)

{
  int iVar1;
  bfd_boolean bVar2;
  Filedata *filedata;
  FILE *pFVar3;
  stat statbuf;
  
  iVar1 = __xstat(1,pathname,(stat *)&statbuf);
  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&
     (filedata = (Filedata *)calloc(1,0xa0), filedata != (Filedata *)0x0)) {
    pFVar3 = fopen(pathname,"rb");
    filedata->handle = (FILE *)pFVar3;
    if (pFVar3 != (FILE *)0x0) {
      filedata->file_name = pathname;
      filedata->file_size = statbuf.st_size;
      bVar2 = get_file_header(filedata);
      if (bVar2 != 0) {
        if ((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;
}



undefined8 * FUN_00119900(char *param_1)

{
  int iVar1;
  undefined8 *__ptr;
  FILE *pFVar2;
  stat sStack_a8;
  
  iVar1 = __xstat(1,param_1,&sStack_a8);
  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&
     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {
    pFVar2 = fopen(param_1,"rb");
    __ptr[1] = pFVar2;
    if (pFVar2 != (FILE *)0x0) {
      *__ptr = param_1;
      __ptr[2] = sStack_a8.st_size;
      iVar1 = FUN_001195f0(__ptr);
      if (iVar1 != 0) {
        if (__ptr[7] == 0) {
          return __ptr;
        }
        if (DAT_0019345c == 0) {
          iVar1 = FUN_00115940();
        }
        else {
          iVar1 = FUN_00115650(__ptr,0);
        }
        if (iVar1 != 0) {
          return __ptr;
        }
      }
      if ((FILE *)__ptr[1] != (FILE *)0x0) {
        fclose((FILE *)__ptr[1]);
      }
    }
    free(__ptr);
  }
  return (undefined8 *)0x0;
}


PUSH RBP
MOV RSI,RDI
MOV RBP,RDI
MOV EDI,0x1
PUSH RBX
SUB RSP,0x98
MOV RDX,RSP
CALL 0x001072d0
TEST EAX,EAX
JS 0x001199b0
MOV EAX,dword ptr [RSP + 0x18]
AND EAX,0xf000
CMP EAX,0x8000
JNZ 0x001199b0
MOV ESI,0xa0
MOV EDI,0x1
CALL 0x00107250
MOV RBX,RAX
TEST RAX,RAX
JZ 0x001199b0
LEA RSI,[0x17c91c]
MOV RDI,RBP
CALL 0x00107350
MOV qword ptr [RBX + 0x8],RAX
TEST RAX,RAX
JZ 0x001199a8
MOV RAX,qword ptr [RSP + 0x30]
MOV qword ptr [RBX],RBP
MOV RDI,RBX
MOV qword ptr [RBX + 0x10],RAX
CALL 0x001195f0
TEST EAX,EAX
JZ 0x0011999a
CMP qword ptr [RBX + 0x38],0x0
JZ 0x001199b2
MOV EAX,dword ptr [0x0019345c]
XOR ESI,ESI
MOV RDI,RBX
TEST EAX,EAX
JNZ 0x001199c0
CALL 0x00115940
TEST EAX,EAX
JNZ 0x001199b2
MOV RDI,qword ptr [RBX + 0x8]
TEST RDI,RDI
JZ 0x001199a8
CALL 0x00107100
MOV RDI,RBX
CALL 0x00107030
XOR EBX,EBX
ADD RSP,0x98
MOV RAX,RBX
POP RBX
POP RBP
RET
CALL 0x00115650
JMP 0x00119996
(translation_unit "undefined8 * FUN_00119900(char *param_1)\n\n{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}\n\n" (function_definition "undefined8 * FUN_00119900(char *param_1)\n\n{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}" type_identifier (pointer_declarator "* FUN_00119900(char *param_1)" * (function_declarator "FUN_00119900(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined8 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "stat sStack_a8;" type_identifier identifier ;) (expression_statement "iVar1 = __xstat(1,param_1,&sStack_a8);" (assignment_expression "iVar1 = __xstat(1,param_1,&sStack_a8)" identifier = (call_expression "__xstat(1,param_1,&sStack_a8)" identifier (argument_list "(1,param_1,&sStack_a8)" ( number_literal , identifier , (pointer_expression "&sStack_a8" & identifier) )))) ;) (if_statement "if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0))" ( (binary_expression "((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000))" ( (binary_expression "(-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "((sStack_a8.st_mode & 0xf000) == 0x8000)" ( (binary_expression "(sStack_a8.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(sStack_a8.st_mode & 0xf000)" ( (binary_expression "sStack_a8.st_mode & 0xf000" (field_expression "sStack_a8.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) ))) )) && (parenthesized_expression "(__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)" ( (comma_expression "__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0" (assignment_expression "__ptr = (undefined8 *)calloc(1,0xa0)" identifier = (cast_expression "(undefined8 *)calloc(1,0xa0)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0xa0)" identifier (argument_list "(1,0xa0)" ( number_literal , number_literal ))))) , (binary_expression "__ptr != (undefined8 *)0x0" identifier != (cast_expression "(undefined8 *)0x0" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 = fopen(param_1,"rb");" (assignment_expression "pFVar2 = fopen(param_1,"rb")" identifier = (call_expression "fopen(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] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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] = sStack_a8.st_size;" (assignment_expression "__ptr[2] = sStack_a8.st_size" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = (field_expression "sStack_a8.st_size" identifier . field_identifier)) ;) (expression_statement "iVar1 = FUN_001195f0(__ptr);" (assignment_expression "iVar1 = FUN_001195f0(__ptr)" identifier = (call_expression "FUN_001195f0(__ptr)" identifier (argument_list "(__ptr)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" { (if_statement "if (__ptr[7] == 0) {\n          return __ptr;\n        }" if (parenthesized_expression "(__ptr[7] == 0)" ( (binary_expression "__ptr[7] == 0" (subscript_expression "__ptr[7]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n          return __ptr;\n        }" { (return_statement "return __ptr;" return identifier ;) })) (if_statement "if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }" if (parenthesized_expression "(DAT_0019345c == 0)" ( (binary_expression "DAT_0019345c == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = FUN_00115940();\n        }" { (expression_statement "iVar1 = FUN_00115940();" (assignment_expression "iVar1 = FUN_00115940()" identifier = (call_expression "FUN_00115940()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }" else (compound_statement "{\n          iVar1 = FUN_00115650(__ptr,0);\n        }" { (expression_statement "iVar1 = FUN_00115650(__ptr,0);" (assignment_expression "iVar1 = FUN_00115650(__ptr,0)" identifier = (call_expression "FUN_00115650(__ptr,0)" identifier (argument_list "(__ptr,0)" ( identifier , number_literal )))) ;) }))) (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 (undefined8 *)0x0;" return (cast_expression "(undefined8 *)0x0" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "Filedata * open_file(char *pathname)\n\n{\n  int iVar1;\n  bfd_boolean bVar2;\n  Filedata *filedata;\n  FILE *pFVar3;\n  stat statbuf;\n  \n  iVar1 = __xstat(1,pathname,(stat *)&statbuf);\n  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0xa0), filedata != (Filedata *)0x0)) {\n    pFVar3 = fopen(pathname,"rb");\n    filedata->handle = (FILE *)pFVar3;\n    if (pFVar3 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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" (function_definition "Filedata * open_file(char *pathname)\n\n{\n  int iVar1;\n  bfd_boolean bVar2;\n  Filedata *filedata;\n  FILE *pFVar3;\n  stat statbuf;\n  \n  iVar1 = __xstat(1,pathname,(stat *)&statbuf);\n  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0xa0), filedata != (Filedata *)0x0)) {\n    pFVar3 = fopen(pathname,"rb");\n    filedata->handle = (FILE *)pFVar3;\n    if (pFVar3 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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}" type_identifier (pointer_declarator "* open_file(char *pathname)" * (function_declarator "open_file(char *pathname)" identifier (parameter_list "(char *pathname)" ( (parameter_declaration "char *pathname" primitive_type (pointer_declarator "*pathname" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  bfd_boolean bVar2;\n  Filedata *filedata;\n  FILE *pFVar3;\n  stat statbuf;\n  \n  iVar1 = __xstat(1,pathname,(stat *)&statbuf);\n  if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0xa0), filedata != (Filedata *)0x0)) {\n    pFVar3 = fopen(pathname,"rb");\n    filedata->handle = (FILE *)pFVar3;\n    if (pFVar3 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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 "bfd_boolean bVar2;" type_identifier identifier ;) (declaration "Filedata *filedata;" type_identifier (pointer_declarator "*filedata" * identifier) ;) (declaration "FILE *pFVar3;" type_identifier (pointer_declarator "*pFVar3" * identifier) ;) (declaration "stat statbuf;" type_identifier identifier ;) (expression_statement "iVar1 = __xstat(1,pathname,(stat *)&statbuf);" (assignment_expression "iVar1 = __xstat(1,pathname,(stat *)&statbuf)" identifier = (call_expression "__xstat(1,pathname,(stat *)&statbuf)" identifier (argument_list "(1,pathname,(stat *)&statbuf)" ( number_literal , identifier , (cast_expression "(stat *)&statbuf" ( (type_descriptor "stat *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&statbuf" & identifier)) )))) ;) (if_statement "if (((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0xa0), filedata != (Filedata *)0x0)) {\n    pFVar3 = fopen(pathname,"rb");\n    filedata->handle = (FILE *)pFVar3;\n    if (pFVar3 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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,0xa0), filedata != (Filedata *)0x0))" ( (binary_expression "((-1 < iVar1) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&\n     (filedata = (Filedata *)calloc(1,0xa0), 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,0xa0), filedata != (Filedata *)0x0)" ( (comma_expression "filedata = (Filedata *)calloc(1,0xa0), filedata != (Filedata *)0x0" (assignment_expression "filedata = (Filedata *)calloc(1,0xa0)" identifier = (cast_expression "(Filedata *)calloc(1,0xa0)" ( (type_descriptor "Filedata *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0xa0)" identifier (argument_list "(1,0xa0)" ( 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    pFVar3 = fopen(pathname,"rb");\n    filedata->handle = (FILE *)pFVar3;\n    if (pFVar3 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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 "pFVar3 = fopen(pathname,"rb");" (assignment_expression "pFVar3 = fopen(pathname,"rb")" identifier = (call_expression "fopen(pathname,"rb")" identifier (argument_list "(pathname,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (expression_statement "filedata->handle = (FILE *)pFVar3;" (assignment_expression "filedata->handle = (FILE *)pFVar3" (field_expression "filedata->handle" identifier -> field_identifier) = (cast_expression "(FILE *)pFVar3" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (if_statement "if (pFVar3 != (FILE *)0x0) {\n      filedata->file_name = pathname;\n      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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 "(pFVar3 != (FILE *)0x0)" ( (binary_expression "pFVar3 != (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      filedata->file_size = statbuf.st_size;\n      bVar2 = get_file_header(filedata);\n      if (bVar2 != 0) {\n        if ((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 "filedata->file_size = statbuf.st_size;" (assignment_expression "filedata->file_size = statbuf.st_size" (field_expression "filedata->file_size" identifier -> field_identifier) = (field_expression "statbuf.st_size" identifier . field_identifier)) ;) (expression_statement "bVar2 = get_file_header(filedata);" (assignment_expression "bVar2 = get_file_header(filedata)" identifier = (call_expression "get_file_header(filedata)" identifier (argument_list "(filedata)" ( identifier )))) ;) (if_statement "if (bVar2 != 0) {\n        if ((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 "(bVar2 != 0)" ( (binary_expression "bVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        if ((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 ((filedata->file_header).e_shoff == 0) {\n          return filedata;\n        }" if (parenthesized_expression "((filedata->file_header).e_shoff == 0)" ( (binary_expression "(filedata->file_header).e_shoff == 0" (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 "undefined8 * FUN_00119900(char *param_1)\n\n{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}\n\n" (function_definition "undefined8 * FUN_00119900(char *param_1)\n\n{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}" type_identifier (pointer_declarator "* FUN_00119900(char *param_1)" * (function_declarator "FUN_00119900(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined8 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "stat sStack_a8;" type_identifier identifier ;) (expression_statement "iVar1 = __xstat(1,param_1,&sStack_a8);" (assignment_expression "iVar1 = __xstat(1,param_1,&sStack_a8)" identifier = (call_expression "__xstat(1,param_1,&sStack_a8)" identifier (argument_list "(1,param_1,&sStack_a8)" ( number_literal , identifier , (pointer_expression "&sStack_a8" & identifier) )))) ;) (if_statement "if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0))" ( (binary_expression "((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000))" ( (binary_expression "(-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "((sStack_a8.st_mode & 0xf000) == 0x8000)" ( (binary_expression "(sStack_a8.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(sStack_a8.st_mode & 0xf000)" ( (binary_expression "sStack_a8.st_mode & 0xf000" (field_expression "sStack_a8.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) ))) )) && (parenthesized_expression "(__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)" ( (comma_expression "__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0" (assignment_expression "__ptr = (undefined8 *)calloc(1,0xa0)" identifier = (cast_expression "(undefined8 *)calloc(1,0xa0)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0xa0)" identifier (argument_list "(1,0xa0)" ( number_literal , number_literal ))))) , (binary_expression "__ptr != (undefined8 *)0x0" identifier != (cast_expression "(undefined8 *)0x0" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 = fopen(param_1,"rb");" (assignment_expression "pFVar2 = fopen(param_1,"rb")" identifier = (call_expression "fopen(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] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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] = sStack_a8.st_size;" (assignment_expression "__ptr[2] = sStack_a8.st_size" (subscript_expression "__ptr[2]" identifier [ number_literal ]) = (field_expression "sStack_a8.st_size" identifier . field_identifier)) ;) (expression_statement "iVar1 = FUN_001195f0(__ptr);" (assignment_expression "iVar1 = FUN_001195f0(__ptr)" identifier = (call_expression "FUN_001195f0(__ptr)" identifier (argument_list "(__ptr)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" { (if_statement "if (__ptr[7] == 0) {\n          return __ptr;\n        }" if (parenthesized_expression "(__ptr[7] == 0)" ( (binary_expression "__ptr[7] == 0" (subscript_expression "__ptr[7]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n          return __ptr;\n        }" { (return_statement "return __ptr;" return identifier ;) })) (if_statement "if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }" if (parenthesized_expression "(DAT_0019345c == 0)" ( (binary_expression "DAT_0019345c == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = FUN_00115940();\n        }" { (expression_statement "iVar1 = FUN_00115940();" (assignment_expression "iVar1 = FUN_00115940()" identifier = (call_expression "FUN_00115940()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }" else (compound_statement "{\n          iVar1 = FUN_00115650(__ptr,0);\n        }" { (expression_statement "iVar1 = FUN_00115650(__ptr,0);" (assignment_expression "iVar1 = FUN_00115650(__ptr,0)" identifier = (call_expression "FUN_00115650(__ptr,0)" identifier (argument_list "(__ptr,0)" ( identifier , number_literal )))) ;) }))) (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 (undefined8 *)0x0;" return (cast_expression "(undefined8 *)0x0" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (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 ]) = (field_expression IDENT . field_identifier)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (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 ( IDENT , LIT )))) ;) }))) (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) ;) })))
(function_definition "undefined8 * FUN_00119900(char *param_1)\n\n{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}" (type_identifier "undefined8") (pointer_declarator "* FUN_00119900(char *param_1)" (* "*") (function_declarator "FUN_00119900(char *param_1)" (identifier "FUN_00119900") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")")))) (compound_statement "{\n  int iVar1;\n  undefined8 *__ptr;\n  FILE *pFVar2;\n  stat sStack_a8;\n  \n  iVar1 = __xstat(1,param_1,&sStack_a8);\n  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 (undefined8 *)0x0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined8 *__ptr;" (type_identifier "undefined8") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "FILE *pFVar2;" (type_identifier "FILE") (pointer_declarator "*pFVar2" (* "*") (identifier "pFVar2")) (; ";")) (declaration "stat sStack_a8;" (type_identifier "stat") (identifier "sStack_a8") (; ";")) (expression_statement "iVar1 = __xstat(1,param_1,&sStack_a8);" (assignment_expression "iVar1 = __xstat(1,param_1,&sStack_a8)" (identifier "iVar1") (= "=") (call_expression "__xstat(1,param_1,&sStack_a8)" (identifier "__xstat") (argument_list "(1,param_1,&sStack_a8)" (( "(") (number_literal "1") (, ",") (identifier "param_1") (, ",") (pointer_expression "&sStack_a8" (& "&") (identifier "sStack_a8")) () ")")))) (; ";")) (if_statement "if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0))" (( "(") (binary_expression "((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&\n     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)" (parenthesized_expression "((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000))" (( "(") (binary_expression "(-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)" (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (&& "&&") (parenthesized_expression "((sStack_a8.st_mode & 0xf000) == 0x8000)" (( "(") (binary_expression "(sStack_a8.st_mode & 0xf000) == 0x8000" (parenthesized_expression "(sStack_a8.st_mode & 0xf000)" (( "(") (binary_expression "sStack_a8.st_mode & 0xf000" (field_expression "sStack_a8.st_mode" (identifier "sStack_a8") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xf000")) () ")")) (== "==") (number_literal "0x8000")) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)" (( "(") (comma_expression "__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0" (assignment_expression "__ptr = (undefined8 *)calloc(1,0xa0)" (identifier "__ptr") (= "=") (cast_expression "(undefined8 *)calloc(1,0xa0)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "calloc(1,0xa0)" (identifier "calloc") (argument_list "(1,0xa0)" (( "(") (number_literal "1") (, ",") (number_literal "0xa0") () ")"))))) (, ",") (binary_expression "__ptr != (undefined8 *)0x0" (identifier "__ptr") (!= "!=") (cast_expression "(undefined8 *)0x0" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")"))) () ")")) (compound_statement "{\n    pFVar2 = fopen(param_1,"rb");\n    __ptr[1] = pFVar2;\n    if (pFVar2 != (FILE *)0x0) {\n      *__ptr = param_1;\n      __ptr[2] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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 = fopen(param_1,"rb");" (assignment_expression "pFVar2 = fopen(param_1,"rb")" (identifier "pFVar2") (= "=") (call_expression "fopen(param_1,"rb")" (identifier "fopen") (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] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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] = sStack_a8.st_size;\n      iVar1 = FUN_001195f0(__ptr);\n      if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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] = sStack_a8.st_size;" (assignment_expression "__ptr[2] = sStack_a8.st_size" (subscript_expression "__ptr[2]" (identifier "__ptr") ([ "[") (number_literal "2") (] "]")) (= "=") (field_expression "sStack_a8.st_size" (identifier "sStack_a8") (. ".") (field_identifier "st_size"))) (; ";")) (expression_statement "iVar1 = FUN_001195f0(__ptr);" (assignment_expression "iVar1 = FUN_001195f0(__ptr)" (identifier "iVar1") (= "=") (call_expression "FUN_001195f0(__ptr)" (identifier "FUN_001195f0") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        if (__ptr[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\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[7] == 0) {\n          return __ptr;\n        }\n        if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }\n        if (iVar1 != 0) {\n          return __ptr;\n        }\n      }" ({ "{") (if_statement "if (__ptr[7] == 0) {\n          return __ptr;\n        }" (if "if") (parenthesized_expression "(__ptr[7] == 0)" (( "(") (binary_expression "__ptr[7] == 0" (subscript_expression "__ptr[7]" (identifier "__ptr") ([ "[") (number_literal "7") (] "]")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          return __ptr;\n        }" ({ "{") (return_statement "return __ptr;" (return "return") (identifier "__ptr") (; ";")) (} "}"))) (if_statement "if (DAT_0019345c == 0) {\n          iVar1 = FUN_00115940();\n        }\n        else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }" (if "if") (parenthesized_expression "(DAT_0019345c == 0)" (( "(") (binary_expression "DAT_0019345c == 0" (identifier "DAT_0019345c") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          iVar1 = FUN_00115940();\n        }" ({ "{") (expression_statement "iVar1 = FUN_00115940();" (assignment_expression "iVar1 = FUN_00115940()" (identifier "iVar1") (= "=") (call_expression "FUN_00115940()" (identifier "FUN_00115940") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")) (else_clause "else {\n          iVar1 = FUN_00115650(__ptr,0);\n        }" (else "else") (compound_statement "{\n          iVar1 = FUN_00115650(__ptr,0);\n        }" ({ "{") (expression_statement "iVar1 = FUN_00115650(__ptr,0);" (assignment_expression "iVar1 = FUN_00115650(__ptr,0)" (identifier "iVar1") (= "=") (call_expression "FUN_00115650(__ptr,0)" (identifier "FUN_00115650") (argument_list "(__ptr,0)" (( "(") (identifier "__ptr") (, ",") (number_literal "0") () ")")))) (; ";")) (} "}")))) (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 (undefined8 *)0x0;" (return "return") (cast_expression "(undefined8 *)0x0" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

type_1 * function_1(char *pathname)

{
  int var_2;
  type_2 var_8;
  type_1 *var_4;
  type_3 *var_6;
  type_4 statbuf;
  
  var_2 = var_1(1,pathname,(type_4 *)&statbuf);
  if (((-1 < var_2) && ((statbuf.st_mode & 0xf000) == 0x8000)) &&
     (var_4 = (type_1 *)var_3(1,0xa0), var_4 != (type_1 *)0x0)) {
    var_6 = var_5(pathname,"rb");
    var_4->handle = (type_3 *)var_6;
    if (var_6 != (type_3 *)0x0) {
      var_4->file_name = pathname;
      var_4->file_size = statbuf.st_size;
      var_8 = var_7(var_4);
      if (var_8 != 0) {
        if ((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_3 *)var_4->handle != (type_3 *)0x0) {
        var_12((type_3 *)var_4->handle);
      }
    }
    var_13(var_4);
  }
  return (type_1 *)0x0;
}


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

undefined8 * MASKED(char *param_1)

{
  int iVar1;
  undefined8 *__ptr;
  FILE *pFVar2;
  stat sStack_a8;
  
  iVar1 = __xstat(1,param_1,&sStack_a8);
  if (((-1 < iVar1) && ((sStack_a8.st_mode & 0xf000) == 0x8000)) &&
     (__ptr = (undefined8 *)calloc(1,0xa0), __ptr != (undefined8 *)0x0)) {
    pFVar2 = fopen(param_1,"rb");
    __ptr[1] = pFVar2;
    if (pFVar2 != (FILE *)0x0) {
      *__ptr = param_1;
      __ptr[2] = sStack_a8.st_size;
      iVar1 = FUN_001195f0(__ptr);
      if (iVar1 != 0) {
        if (__ptr[7] == 0) {
          return __ptr;
        }
        if (DAT_0019345c == 0) {
          iVar1 = FUN_00115940();
        }
        else {
          iVar1 = FUN_00115650(__ptr,0);
        }
        if (iVar1 != 0) {
          return __ptr;
        }
      }
      if ((FILE *)__ptr[1] != (FILE *)0x0) {
        fclose((FILE *)__ptr[1]);
      }
    }
    free(__ptr);
  }
  return (undefined8 *)0x0;
}

