
char * internal_read_file(char *filename,size_t *length,char *mode)

{
  int iVar1;
  FILE *stream;
  char *__ptr;
  int *piVar2;
  int iVar3;
  
  stream = fopen(filename,mode);
  if (stream == (FILE *)0x0) {
    __ptr = (char *)0x0;
  }
  else {
    __ptr = fread_file((FILE *)stream,length);
    piVar2 = __errno_location();
    iVar3 = *piVar2;
    iVar1 = rpl_fclose((FILE *)stream);
    if (iVar1 != 0) {
      if (__ptr != (char *)0x0) {
        iVar3 = *piVar2;
        free(__ptr);
      }
      *piVar2 = iVar3;
      __ptr = (char *)0x0;
    }
  }
  return __ptr;
}



void * FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)

{
  int iVar1;
  FILE *pFVar2;
  void *__ptr;
  int *piVar3;
  int iVar4;
  
  pFVar2 = fopen(param_1,param_3);
  if (pFVar2 == (FILE *)0x0) {
    __ptr = (void *)0x0;
  }
  else {
    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);
    piVar3 = __errno_location();
    iVar4 = *piVar3;
    iVar1 = FUN_0010a1a8(pFVar2);
    if (iVar1 != 0) {
      if (__ptr != (void *)0x0) {
        iVar4 = *piVar3;
        free(__ptr);
      }
      *piVar3 = iVar4;
      __ptr = (void *)0x0;
    }
  }
  return __ptr;
}


PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV RBP,RSI
MOV RSI,RDX
CALL 0x001023f0
MOV RBX,RAX
TEST RAX,RAX
JZ 0x00108dae
MOV RSI,RBP
MOV RDI,RAX
CALL 0x00108bb3
MOV RBP,RAX
CALL 0x00102070
MOV R12,RAX
MOV R13D,dword ptr [RAX]
MOV RDI,RBX
CALL 0x0010a1a8
TEST EAX,EAX
JNZ 0x00108d92
MOV RAX,RBP
ADD RSP,0x8
POP RBX
POP RBP
POP R12
POP R13
RET
TEST RBP,RBP
JZ 0x00108da3
MOV R13D,dword ptr [R12]
MOV RDI,RBP
CALL 0x00102040
MOV dword ptr [R12],R13D
MOV EBP,0x0
JMP 0x00108d84
MOV RBP,RAX
JMP 0x00108d84
(translation_unit "void * FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}\n\n" (function_definition "void * FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}" primitive_type (pointer_declarator "* FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)" * (function_declarator "FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)" identifier (parameter_list "(char *param_1,undefined8 param_2,char *param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "pFVar2 = fopen(param_1,param_3);" (assignment_expression "pFVar2 = fopen(param_1,param_3)" identifier = (call_expression "fopen(param_1,param_3)" identifier (argument_list "(param_1,param_3)" ( identifier , identifier )))) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\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 = (void *)0x0;\n  }" { (expression_statement "__ptr = (void *)0x0;" (assignment_expression "__ptr = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }" else (compound_statement "{\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }" { (expression_statement "__ptr = (void *)FUN_00108bb3(pFVar2,param_2);" (assignment_expression "__ptr = (void *)FUN_00108bb3(pFVar2,param_2)" identifier = (cast_expression "(void *)FUN_00108bb3(pFVar2,param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00108bb3(pFVar2,param_2)" identifier (argument_list "(pFVar2,param_2)" ( identifier , identifier ))))) ;) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar1 = FUN_0010a1a8(pFVar2);" (assignment_expression "iVar1 = FUN_0010a1a8(pFVar2)" identifier = (call_expression "FUN_0010a1a8(pFVar2)" identifier (argument_list "(pFVar2)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }" { (if_statement "if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }" if (parenthesized_expression "(__ptr != (void *)0x0)" ( (binary_expression "__ptr != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar4 = *piVar3;\n        free(__ptr);\n      }" { (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (expression_statement "*piVar3 = iVar4;" (assignment_expression "*piVar3 = iVar4" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "__ptr = (void *)0x0;" (assignment_expression "__ptr = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) }))) (return_statement "return __ptr;" return identifier ;) })))
(translation_unit "char * internal_read_file(char *filename,size_t *length,char *mode)\n\n{\n  int iVar1;\n  FILE *stream;\n  char *__ptr;\n  int *piVar2;\n  int iVar3;\n  \n  stream = fopen(filename,mode);\n  if (stream == (FILE *)0x0) {\n    __ptr = (char *)0x0;\n  }\n  else {\n    __ptr = fread_file((FILE *)stream,length);\n    piVar2 = __errno_location();\n    iVar3 = *piVar2;\n    iVar1 = rpl_fclose((FILE *)stream);\n    if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }\n  }\n  return __ptr;\n}\n\n" (function_definition "char * internal_read_file(char *filename,size_t *length,char *mode)\n\n{\n  int iVar1;\n  FILE *stream;\n  char *__ptr;\n  int *piVar2;\n  int iVar3;\n  \n  stream = fopen(filename,mode);\n  if (stream == (FILE *)0x0) {\n    __ptr = (char *)0x0;\n  }\n  else {\n    __ptr = fread_file((FILE *)stream,length);\n    piVar2 = __errno_location();\n    iVar3 = *piVar2;\n    iVar1 = rpl_fclose((FILE *)stream);\n    if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }\n  }\n  return __ptr;\n}" primitive_type (pointer_declarator "* internal_read_file(char *filename,size_t *length,char *mode)" * (function_declarator "internal_read_file(char *filename,size_t *length,char *mode)" identifier (parameter_list "(char *filename,size_t *length,char *mode)" ( (parameter_declaration "char *filename" primitive_type (pointer_declarator "*filename" * identifier)) , (parameter_declaration "size_t *length" primitive_type (pointer_declarator "*length" * identifier)) , (parameter_declaration "char *mode" primitive_type (pointer_declarator "*mode" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  FILE *stream;\n  char *__ptr;\n  int *piVar2;\n  int iVar3;\n  \n  stream = fopen(filename,mode);\n  if (stream == (FILE *)0x0) {\n    __ptr = (char *)0x0;\n  }\n  else {\n    __ptr = fread_file((FILE *)stream,length);\n    piVar2 = __errno_location();\n    iVar3 = *piVar2;\n    iVar1 = rpl_fclose((FILE *)stream);\n    if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }\n  }\n  return __ptr;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *stream;" type_identifier (pointer_declarator "*stream" * identifier) ;) (declaration "char *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "stream = fopen(filename,mode);" (assignment_expression "stream = fopen(filename,mode)" identifier = (call_expression "fopen(filename,mode)" identifier (argument_list "(filename,mode)" ( identifier , identifier )))) ;) (if_statement "if (stream == (FILE *)0x0) {\n    __ptr = (char *)0x0;\n  }\n  else {\n    __ptr = fread_file((FILE *)stream,length);\n    piVar2 = __errno_location();\n    iVar3 = *piVar2;\n    iVar1 = rpl_fclose((FILE *)stream);\n    if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }\n  }" if (parenthesized_expression "(stream == (FILE *)0x0)" ( (binary_expression "stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    __ptr = (char *)0x0;\n  }" { (expression_statement "__ptr = (char *)0x0;" (assignment_expression "__ptr = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    __ptr = fread_file((FILE *)stream,length);\n    piVar2 = __errno_location();\n    iVar3 = *piVar2;\n    iVar1 = rpl_fclose((FILE *)stream);\n    if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }\n  }" else (compound_statement "{\n    __ptr = fread_file((FILE *)stream,length);\n    piVar2 = __errno_location();\n    iVar3 = *piVar2;\n    iVar1 = rpl_fclose((FILE *)stream);\n    if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }\n  }" { (expression_statement "__ptr = fread_file((FILE *)stream,length);" (assignment_expression "__ptr = fread_file((FILE *)stream,length)" identifier = (call_expression "fread_file((FILE *)stream,length)" identifier (argument_list "((FILE *)stream,length)" ( (cast_expression "(FILE *)stream" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier )))) ;) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "iVar1 = rpl_fclose((FILE *)stream);" (assignment_expression "iVar1 = rpl_fclose((FILE *)stream)" identifier = (call_expression "rpl_fclose((FILE *)stream)" identifier (argument_list "((FILE *)stream)" ( (cast_expression "(FILE *)stream" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar1 != 0) {\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }\n      *piVar2 = iVar3;\n      __ptr = (char *)0x0;\n    }" { (if_statement "if (__ptr != (char *)0x0) {\n        iVar3 = *piVar2;\n        free(__ptr);\n      }" if (parenthesized_expression "(__ptr != (char *)0x0)" ( (binary_expression "__ptr != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar3 = *piVar2;\n        free(__ptr);\n      }" { (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "__ptr = (char *)0x0;" (assignment_expression "__ptr = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) }))) (return_statement "return __ptr;" return identifier ;) })))
(translation_unit "void * FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}\n\n" (function_definition "void * FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}" primitive_type (pointer_declarator "* FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)" * (function_declarator "FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)" identifier (parameter_list "(char *param_1,undefined8 param_2,char *param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "pFVar2 = fopen(param_1,param_3);" (assignment_expression "pFVar2 = fopen(param_1,param_3)" identifier = (call_expression "fopen(param_1,param_3)" identifier (argument_list "(param_1,param_3)" ( identifier , identifier )))) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\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 = (void *)0x0;\n  }" { (expression_statement "__ptr = (void *)0x0;" (assignment_expression "__ptr = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }" else (compound_statement "{\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }" { (expression_statement "__ptr = (void *)FUN_00108bb3(pFVar2,param_2);" (assignment_expression "__ptr = (void *)FUN_00108bb3(pFVar2,param_2)" identifier = (cast_expression "(void *)FUN_00108bb3(pFVar2,param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00108bb3(pFVar2,param_2)" identifier (argument_list "(pFVar2,param_2)" ( identifier , identifier ))))) ;) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar1 = FUN_0010a1a8(pFVar2);" (assignment_expression "iVar1 = FUN_0010a1a8(pFVar2)" identifier = (call_expression "FUN_0010a1a8(pFVar2)" identifier (argument_list "(pFVar2)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }" { (if_statement "if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }" if (parenthesized_expression "(__ptr != (void *)0x0)" ( (binary_expression "__ptr != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar4 = *piVar3;\n        free(__ptr);\n      }" { (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (expression_statement "*piVar3 = iVar4;" (assignment_expression "*piVar3 = iVar4" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "__ptr = (void *)0x0;" (assignment_expression "__ptr = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) }))) (return_statement "return __ptr;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) })) }))) (return_statement return IDENT ;) })))
(function_definition "void * FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}" (primitive_type "void") (pointer_declarator "* FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)" (* "*") (function_declarator "FUN_00108d42(char *param_1,undefined8 param_2,char *param_3)" (identifier "FUN_00108d42") (parameter_list "(char *param_1,undefined8 param_2,char *param_3)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "char *param_3" (primitive_type "char") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")")))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  void *__ptr;\n  int *piVar3;\n  int iVar4;\n  \n  pFVar2 = fopen(param_1,param_3);\n  if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }\n  return __ptr;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "FILE *pFVar2;" (type_identifier "FILE") (pointer_declarator "*pFVar2" (* "*") (identifier "pFVar2")) (; ";")) (declaration "void *__ptr;" (primitive_type "void") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (expression_statement "pFVar2 = fopen(param_1,param_3);" (assignment_expression "pFVar2 = fopen(param_1,param_3)" (identifier "pFVar2") (= "=") (call_expression "fopen(param_1,param_3)" (identifier "fopen") (argument_list "(param_1,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    __ptr = (void *)0x0;\n  }\n  else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\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 = (void *)0x0;\n  }" ({ "{") (expression_statement "__ptr = (void *)0x0;" (assignment_expression "__ptr = (void *)0x0" (identifier "__ptr") (= "=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}")) (else_clause "else {\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }" (else "else") (compound_statement "{\n    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);\n    piVar3 = __errno_location();\n    iVar4 = *piVar3;\n    iVar1 = FUN_0010a1a8(pFVar2);\n    if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }\n  }" ({ "{") (expression_statement "__ptr = (void *)FUN_00108bb3(pFVar2,param_2);" (assignment_expression "__ptr = (void *)FUN_00108bb3(pFVar2,param_2)" (identifier "__ptr") (= "=") (cast_expression "(void *)FUN_00108bb3(pFVar2,param_2)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00108bb3(pFVar2,param_2)" (identifier "FUN_00108bb3") (argument_list "(pFVar2,param_2)" (( "(") (identifier "pFVar2") (, ",") (identifier "param_2") () ")"))))) (; ";")) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" (identifier "iVar4") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "iVar1 = FUN_0010a1a8(pFVar2);" (assignment_expression "iVar1 = FUN_0010a1a8(pFVar2)" (identifier "iVar1") (= "=") (call_expression "FUN_0010a1a8(pFVar2)" (identifier "FUN_0010a1a8") (argument_list "(pFVar2)" (( "(") (identifier "pFVar2") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }\n      *piVar3 = iVar4;\n      __ptr = (void *)0x0;\n    }" ({ "{") (if_statement "if (__ptr != (void *)0x0) {\n        iVar4 = *piVar3;\n        free(__ptr);\n      }" (if "if") (parenthesized_expression "(__ptr != (void *)0x0)" (( "(") (binary_expression "__ptr != (void *)0x0" (identifier "__ptr") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        iVar4 = *piVar3;\n        free(__ptr);\n      }" ({ "{") (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" (identifier "iVar4") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (} "}"))) (expression_statement "*piVar3 = iVar4;" (assignment_expression "*piVar3 = iVar4" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar4")) (; ";")) (expression_statement "__ptr = (void *)0x0;" (assignment_expression "__ptr = (void *)0x0" (identifier "__ptr") (= "=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}"))) (} "}")))) (return_statement "return __ptr;" (return "return") (identifier "__ptr") (; ";")) (} "}")))

char * function_1(char *filename,size_t *length,char *mode)

{
  int var_6;
  type_1 *var_2;
  char *var_7;
  int *piVar2;
  int iVar3;
  
  var_2 = var_1(filename,mode);
  if (var_2 == (type_1 *)0x0) {
    var_7 = (char *)0x0;
  }
  else {
    var_7 = var_3((type_1 *)var_2,length);
    piVar2 = var_4();
    iVar3 = *piVar2;
    var_6 = var_5((type_1 *)var_2);
    if (var_6 != 0) {
      if (var_7 != (char *)0x0) {
        iVar3 = *piVar2;
        var_8(var_7);
      }
      *piVar2 = iVar3;
      var_7 = (char *)0x0;
    }
  }
  return var_7;
}


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

void * MASKED(char *param_1,undefined8 param_2,char *param_3)

{
  int iVar1;
  FILE *pFVar2;
  void *__ptr;
  int *piVar3;
  int iVar4;
  
  pFVar2 = fopen(param_1,param_3);
  if (pFVar2 == (FILE *)0x0) {
    __ptr = (void *)0x0;
  }
  else {
    __ptr = (void *)FUN_00108bb3(pFVar2,param_2);
    piVar3 = __errno_location();
    iVar4 = *piVar3;
    iVar1 = FUN_0010a1a8(pFVar2);
    if (iVar1 != 0) {
      if (__ptr != (void *)0x0) {
        iVar4 = *piVar3;
        free(__ptr);
      }
      *piVar3 = iVar4;
      __ptr = (void *)0x0;
    }
  }
  return __ptr;
}

