
void * open_settings_w(char *sessionname,char **errmsg)

{
  char *pcVar1;
  char *pcVar2;
  FILE *pFVar3;
  char *pcVar4;
  int *piVar5;
  
  *errmsg = (char *)0x0;
  pcVar1 = make_filename(0,(char *)0x0);
  pcVar2 = make_dir_path(pcVar1,0x1c0);
  if (pcVar2 == (char *)0x0) {
    safefree(pcVar1);
    pcVar1 = make_filename(4,(char *)0x0);
    pcVar2 = make_dir_path(pcVar1,0x1c0);
    if (pcVar2 == (char *)0x0) {
      safefree(pcVar1);
      pcVar1 = make_filename(5,sessionname);
      pFVar3 = fopen64(pcVar1,"w");
      if (pFVar3 == (FILE *)0x0) {
        piVar5 = __errno_location();
        pcVar2 = strerror(*piVar5);
        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);
        *errmsg = pcVar2;
        safefree(pcVar1);
      }
      else {
        safefree(pcVar1);
      }
    }
    else {
      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);
      *errmsg = pcVar4;
      safefree(pcVar2);
      safefree(pcVar1);
      pFVar3 = (FILE *)0x0;
    }
  }
  else {
    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);
    *errmsg = pcVar4;
    safefree(pcVar2);
    safefree(pcVar1);
    pFVar3 = (FILE *)0x0;
  }
  return pFVar3;
}



FILE * FUN_0014bebd(undefined8 param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  long lVar2;
  char *__filename;
  FILE *pFVar3;
  undefined8 uVar4;
  int *piVar5;
  char *pcVar6;
  
  *param_2 = 0;
  uVar1 = FUN_0014b929(0,0);
  lVar2 = FUN_0014a0a9(uVar1,0x1c0);
  if (lVar2 == 0) {
    FUN_001217b3(uVar1);
    uVar1 = FUN_0014b929(4,0);
    lVar2 = FUN_0014a0a9(uVar1,0x1c0);
    if (lVar2 == 0) {
      FUN_001217b3(uVar1);
      __filename = (char *)FUN_0014b929(5,param_1);
      pFVar3 = fopen64(__filename,"w");
      if (pFVar3 == (FILE *)0x0) {
        piVar5 = __errno_location();
        pcVar6 = strerror(*piVar5);
        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,
                             pcVar6);
        *param_2 = uVar1;
        FUN_001217b3(__filename);
      }
      else {
        FUN_001217b3(__filename);
      }
    }
    else {
      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);
      *param_2 = uVar4;
      FUN_001217b3(lVar2);
      FUN_001217b3(uVar1);
      pFVar3 = (FILE *)0x0;
    }
  }
  else {
    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);
    *param_2 = uVar4;
    FUN_001217b3(lVar2);
    FUN_001217b3(uVar1);
    pFVar3 = (FILE *)0x0;
  }
  return pFVar3;
}


PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
MOV R14,RDI
MOV R12,RSI
MOV qword ptr [RSI],0x0
MOV ESI,0x0
MOV EDI,0x0
CALL 0x0014b929
MOV RBP,RAX
MOV ESI,0x1c0
MOV RDI,RAX
CALL 0x0014a0a9
MOV RBX,RAX
TEST RAX,RAX
JNZ 0x0014bf6b
MOV RDI,RBP
CALL 0x001217b3
MOV ESI,0x0
MOV EDI,0x4
CALL 0x0014b929
MOV RBP,RAX
MOV ESI,0x1c0
MOV RDI,RAX
CALL 0x0014a0a9
MOV R13,RAX
TEST RAX,RAX
JNZ 0x0014bf9a
MOV RDI,RBP
CALL 0x001217b3
MOV RSI,R14
MOV EDI,0x5
CALL 0x0014b929
MOV RBP,RAX
LEA RSI,[0x1786cf]
MOV RDI,RAX
CALL 0x001101a0
MOV RBX,RAX
TEST RAX,RAX
JZ 0x0014bfc4
MOV RDI,RBP
CALL 0x001217b3
MOV RAX,RBX
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
MOV RSI,RAX
LEA RDI,[0x1794f1]
MOV EAX,0x0
CALL 0x00121586
MOV qword ptr [R12],RAX
MOV RDI,RBX
CALL 0x001217b3
MOV RDI,RBP
CALL 0x001217b3
MOV EBX,0x0
JMP 0x0014bf5f
MOV RSI,RAX
LEA RDI,[0x1794f1]
MOV EAX,0x0
CALL 0x00121586
MOV qword ptr [R12],RAX
MOV RDI,R13
CALL 0x001217b3
MOV RDI,RBP
CALL 0x001217b3
JMP 0x0014bf5f
CALL 0x0010f080
MOV EDI,dword ptr [RAX]
CALL 0x0010f4c0
MOV RDX,RAX
MOV RSI,RBP
LEA RDI,[0x179560]
MOV EAX,0x0
CALL 0x00121586
MOV qword ptr [R12],RAX
MOV RDI,RBP
CALL 0x001217b3
JMP 0x0014bf5f
(translation_unit "FILE * FUN_0014bebd(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}\n\n" (function_definition "FILE * FUN_0014bebd(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" type_identifier (pointer_declarator "* FUN_0014bebd(undefined8 param_1,undefined8 *param_2)" * (function_declarator "FUN_0014bebd(undefined8 param_1,undefined8 *param_2)" identifier (parameter_list "(undefined8 param_1,undefined8 *param_2)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" { (declaration "undefined8 uVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "FILE *pFVar3;" type_identifier (pointer_declarator "*pFVar3" * identifier) ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (expression_statement "uVar1 = FUN_0014b929(0,0);" (assignment_expression "uVar1 = FUN_0014b929(0,0)" identifier = (call_expression "FUN_0014b929(0,0)" identifier (argument_list "(0,0)" ( number_literal , number_literal )))) ;) (expression_statement "lVar2 = FUN_0014a0a9(uVar1,0x1c0);" (assignment_expression "lVar2 = FUN_0014a0a9(uVar1,0x1c0)" identifier = (call_expression "FUN_0014a0a9(uVar1,0x1c0)" identifier (argument_list "(uVar1,0x1c0)" ( identifier , number_literal )))) ;) (if_statement "if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" if (parenthesized_expression "(lVar2 == 0)" ( (binary_expression "lVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }" { (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "uVar1 = FUN_0014b929(4,0);" (assignment_expression "uVar1 = FUN_0014b929(4,0)" identifier = (call_expression "FUN_0014b929(4,0)" identifier (argument_list "(4,0)" ( number_literal , number_literal )))) ;) (expression_statement "lVar2 = FUN_0014a0a9(uVar1,0x1c0);" (assignment_expression "lVar2 = FUN_0014a0a9(uVar1,0x1c0)" identifier = (call_expression "FUN_0014a0a9(uVar1,0x1c0)" identifier (argument_list "(uVar1,0x1c0)" ( identifier , number_literal )))) ;) (if_statement "if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" if (parenthesized_expression "(lVar2 == 0)" ( (binary_expression "lVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }" { (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "__filename = (char *)FUN_0014b929(5,param_1);" (assignment_expression "__filename = (char *)FUN_0014b929(5,param_1)" identifier = (cast_expression "(char *)FUN_0014b929(5,param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0014b929(5,param_1)" identifier (argument_list "(5,param_1)" ( number_literal , identifier ))))) ;) (expression_statement "pFVar3 = fopen64(__filename,"w");" (assignment_expression "pFVar3 = fopen64(__filename,"w")" identifier = (call_expression "fopen64(__filename,"w")" identifier (argument_list "(__filename,"w")" ( identifier , (string_literal ""w"" " string_content ") )))) ;) (if_statement "if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\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        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }" { (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar6 = strerror(*piVar5);" (assignment_expression "pcVar6 = strerror(*piVar5)" identifier = (call_expression "strerror(*piVar5)" identifier (argument_list "(*piVar5)" ( (pointer_expression "*piVar5" * identifier) )))) ;) (expression_statement "uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);" (assignment_expression "uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" identifier = (call_expression "FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" identifier (argument_list "("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" ( (string_literal ""Unable to save session: open(\"%s\") returned \'%s\'"" " string_content escape_sequence string_content escape_sequence string_content escape_sequence string_content escape_sequence ") , identifier , identifier )))) ;) (expression_statement "*param_2 = uVar1;" (assignment_expression "*param_2 = uVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "FUN_001217b3(__filename);" (call_expression "FUN_001217b3(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) }) (else_clause "else {\n        FUN_001217b3(__filename);\n      }" else (compound_statement "{\n        FUN_001217b3(__filename);\n      }" { (expression_statement "FUN_001217b3(__filename);" (call_expression "FUN_001217b3(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) }))) }) (else_clause "else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" else (compound_statement "{\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" { (expression_statement "uVar4 = FUN_00121586("Unable to save session: %s",lVar2);" (assignment_expression "uVar4 = FUN_00121586("Unable to save session: %s",lVar2)" identifier = (call_expression "FUN_00121586("Unable to save session: %s",lVar2)" identifier (argument_list "("Unable to save session: %s",lVar2)" ( (string_literal ""Unable to save session: %s"" " string_content ") , identifier )))) ;) (expression_statement "*param_2 = uVar4;" (assignment_expression "*param_2 = uVar4" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "FUN_001217b3(lVar2);" (call_expression "FUN_001217b3(lVar2)" identifier (argument_list "(lVar2)" ( identifier ))) ;) (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) }) (else_clause "else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" else (compound_statement "{\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" { (expression_statement "uVar4 = FUN_00121586("Unable to save session: %s",lVar2);" (assignment_expression "uVar4 = FUN_00121586("Unable to save session: %s",lVar2)" identifier = (call_expression "FUN_00121586("Unable to save session: %s",lVar2)" identifier (argument_list "("Unable to save session: %s",lVar2)" ( (string_literal ""Unable to save session: %s"" " string_content ") , identifier )))) ;) (expression_statement "*param_2 = uVar4;" (assignment_expression "*param_2 = uVar4" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "FUN_001217b3(lVar2);" (call_expression "FUN_001217b3(lVar2)" identifier (argument_list "(lVar2)" ( identifier ))) ;) (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) (return_statement "return pFVar3;" return identifier ;) })))
(translation_unit "void * open_settings_w(char *sessionname,char **errmsg)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  FILE *pFVar3;\n  char *pcVar4;\n  int *piVar5;\n  \n  *errmsg = (char *)0x0;\n  pcVar1 = make_filename(0,(char *)0x0);\n  pcVar2 = make_dir_path(pcVar1,0x1c0);\n  if (pcVar2 == (char *)0x0) {\n    safefree(pcVar1);\n    pcVar1 = make_filename(4,(char *)0x0);\n    pcVar2 = make_dir_path(pcVar1,0x1c0);\n    if (pcVar2 == (char *)0x0) {\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }\n    else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n    *errmsg = pcVar4;\n    safefree(pcVar2);\n    safefree(pcVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}\n\n" (function_definition "void * open_settings_w(char *sessionname,char **errmsg)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  FILE *pFVar3;\n  char *pcVar4;\n  int *piVar5;\n  \n  *errmsg = (char *)0x0;\n  pcVar1 = make_filename(0,(char *)0x0);\n  pcVar2 = make_dir_path(pcVar1,0x1c0);\n  if (pcVar2 == (char *)0x0) {\n    safefree(pcVar1);\n    pcVar1 = make_filename(4,(char *)0x0);\n    pcVar2 = make_dir_path(pcVar1,0x1c0);\n    if (pcVar2 == (char *)0x0) {\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }\n    else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n    *errmsg = pcVar4;\n    safefree(pcVar2);\n    safefree(pcVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" primitive_type (pointer_declarator "* open_settings_w(char *sessionname,char **errmsg)" * (function_declarator "open_settings_w(char *sessionname,char **errmsg)" identifier (parameter_list "(char *sessionname,char **errmsg)" ( (parameter_declaration "char *sessionname" primitive_type (pointer_declarator "*sessionname" * identifier)) , (parameter_declaration "char **errmsg" primitive_type (pointer_declarator "**errmsg" * (pointer_declarator "*errmsg" * identifier))) )))) (compound_statement "{\n  char *pcVar1;\n  char *pcVar2;\n  FILE *pFVar3;\n  char *pcVar4;\n  int *piVar5;\n  \n  *errmsg = (char *)0x0;\n  pcVar1 = make_filename(0,(char *)0x0);\n  pcVar2 = make_dir_path(pcVar1,0x1c0);\n  if (pcVar2 == (char *)0x0) {\n    safefree(pcVar1);\n    pcVar1 = make_filename(4,(char *)0x0);\n    pcVar2 = make_dir_path(pcVar1,0x1c0);\n    if (pcVar2 == (char *)0x0) {\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }\n    else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n    *errmsg = pcVar4;\n    safefree(pcVar2);\n    safefree(pcVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "FILE *pFVar3;" type_identifier (pointer_declarator "*pFVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (expression_statement "*errmsg = (char *)0x0;" (assignment_expression "*errmsg = (char *)0x0" (pointer_expression "*errmsg" * identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pcVar1 = make_filename(0,(char *)0x0);" (assignment_expression "pcVar1 = make_filename(0,(char *)0x0)" identifier = (call_expression "make_filename(0,(char *)0x0)" identifier (argument_list "(0,(char *)0x0)" ( number_literal , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "pcVar2 = make_dir_path(pcVar1,0x1c0);" (assignment_expression "pcVar2 = make_dir_path(pcVar1,0x1c0)" identifier = (call_expression "make_dir_path(pcVar1,0x1c0)" identifier (argument_list "(pcVar1,0x1c0)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar2 == (char *)0x0) {\n    safefree(pcVar1);\n    pcVar1 = make_filename(4,(char *)0x0);\n    pcVar2 = make_dir_path(pcVar1,0x1c0);\n    if (pcVar2 == (char *)0x0) {\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }\n    else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n    *errmsg = pcVar4;\n    safefree(pcVar2);\n    safefree(pcVar1);\n    pFVar3 = (FILE *)0x0;\n  }" if (parenthesized_expression "(pcVar2 == (char *)0x0)" ( (binary_expression "pcVar2 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    safefree(pcVar1);\n    pcVar1 = make_filename(4,(char *)0x0);\n    pcVar2 = make_dir_path(pcVar1,0x1c0);\n    if (pcVar2 == (char *)0x0) {\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }\n    else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }" { (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pcVar1 = make_filename(4,(char *)0x0);" (assignment_expression "pcVar1 = make_filename(4,(char *)0x0)" identifier = (call_expression "make_filename(4,(char *)0x0)" identifier (argument_list "(4,(char *)0x0)" ( number_literal , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "pcVar2 = make_dir_path(pcVar1,0x1c0);" (assignment_expression "pcVar2 = make_dir_path(pcVar1,0x1c0)" identifier = (call_expression "make_dir_path(pcVar1,0x1c0)" identifier (argument_list "(pcVar1,0x1c0)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar2 == (char *)0x0) {\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }\n    else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }" if (parenthesized_expression "(pcVar2 == (char *)0x0)" ( (binary_expression "pcVar2 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      safefree(pcVar1);\n      pcVar1 = make_filename(5,sessionname);\n      pFVar3 = fopen64(pcVar1,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\n      }\n    }" { (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pcVar1 = make_filename(5,sessionname);" (assignment_expression "pcVar1 = make_filename(5,sessionname)" identifier = (call_expression "make_filename(5,sessionname)" identifier (argument_list "(5,sessionname)" ( number_literal , identifier )))) ;) (expression_statement "pFVar3 = fopen64(pcVar1,"w");" (assignment_expression "pFVar3 = fopen64(pcVar1,"w")" identifier = (call_expression "fopen64(pcVar1,"w")" identifier (argument_list "(pcVar1,"w")" ( identifier , (string_literal ""w"" " string_content ") )))) ;) (if_statement "if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }\n      else {\n        safefree(pcVar1);\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        piVar5 = __errno_location();\n        pcVar2 = strerror(*piVar5);\n        pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);\n        *errmsg = pcVar2;\n        safefree(pcVar1);\n      }" { (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar2 = strerror(*piVar5);" (assignment_expression "pcVar2 = strerror(*piVar5)" identifier = (call_expression "strerror(*piVar5)" identifier (argument_list "(*piVar5)" ( (pointer_expression "*piVar5" * identifier) )))) ;) (expression_statement "pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2);" (assignment_expression "pcVar2 = dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2)" identifier = (call_expression "dupprintf("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2)" identifier (argument_list "("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,pcVar2)" ( (string_literal ""Unable to save session: open(\"%s\") returned \'%s\'"" " string_content escape_sequence string_content escape_sequence string_content escape_sequence string_content escape_sequence ") , identifier , identifier )))) ;) (expression_statement "*errmsg = pcVar2;" (assignment_expression "*errmsg = pcVar2" (pointer_expression "*errmsg" * identifier) = identifier) ;) (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) }) (else_clause "else {\n        safefree(pcVar1);\n      }" else (compound_statement "{\n        safefree(pcVar1);\n      }" { (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) }))) }) (else_clause "else {\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }" else (compound_statement "{\n      pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n      *errmsg = pcVar4;\n      safefree(pcVar2);\n      safefree(pcVar1);\n      pFVar3 = (FILE *)0x0;\n    }" { (expression_statement "pcVar4 = dupprintf("Unable to save session: %s",pcVar2);" (assignment_expression "pcVar4 = dupprintf("Unable to save session: %s",pcVar2)" identifier = (call_expression "dupprintf("Unable to save session: %s",pcVar2)" identifier (argument_list "("Unable to save session: %s",pcVar2)" ( (string_literal ""Unable to save session: %s"" " string_content ") , identifier )))) ;) (expression_statement "*errmsg = pcVar4;" (assignment_expression "*errmsg = pcVar4" (pointer_expression "*errmsg" * identifier) = identifier) ;) (expression_statement "safefree(pcVar2);" (call_expression "safefree(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier ))) ;) (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) }) (else_clause "else {\n    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n    *errmsg = pcVar4;\n    safefree(pcVar2);\n    safefree(pcVar1);\n    pFVar3 = (FILE *)0x0;\n  }" else (compound_statement "{\n    pcVar4 = dupprintf("Unable to save session: %s",pcVar2);\n    *errmsg = pcVar4;\n    safefree(pcVar2);\n    safefree(pcVar1);\n    pFVar3 = (FILE *)0x0;\n  }" { (expression_statement "pcVar4 = dupprintf("Unable to save session: %s",pcVar2);" (assignment_expression "pcVar4 = dupprintf("Unable to save session: %s",pcVar2)" identifier = (call_expression "dupprintf("Unable to save session: %s",pcVar2)" identifier (argument_list "("Unable to save session: %s",pcVar2)" ( (string_literal ""Unable to save session: %s"" " string_content ") , identifier )))) ;) (expression_statement "*errmsg = pcVar4;" (assignment_expression "*errmsg = pcVar4" (pointer_expression "*errmsg" * identifier) = identifier) ;) (expression_statement "safefree(pcVar2);" (call_expression "safefree(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier ))) ;) (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) (return_statement "return pFVar3;" return identifier ;) })))
(translation_unit "FILE * FUN_0014bebd(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}\n\n" (function_definition "FILE * FUN_0014bebd(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" type_identifier (pointer_declarator "* FUN_0014bebd(undefined8 param_1,undefined8 *param_2)" * (function_declarator "FUN_0014bebd(undefined8 param_1,undefined8 *param_2)" identifier (parameter_list "(undefined8 param_1,undefined8 *param_2)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" { (declaration "undefined8 uVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "FILE *pFVar3;" type_identifier (pointer_declarator "*pFVar3" * identifier) ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (expression_statement "uVar1 = FUN_0014b929(0,0);" (assignment_expression "uVar1 = FUN_0014b929(0,0)" identifier = (call_expression "FUN_0014b929(0,0)" identifier (argument_list "(0,0)" ( number_literal , number_literal )))) ;) (expression_statement "lVar2 = FUN_0014a0a9(uVar1,0x1c0);" (assignment_expression "lVar2 = FUN_0014a0a9(uVar1,0x1c0)" identifier = (call_expression "FUN_0014a0a9(uVar1,0x1c0)" identifier (argument_list "(uVar1,0x1c0)" ( identifier , number_literal )))) ;) (if_statement "if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" if (parenthesized_expression "(lVar2 == 0)" ( (binary_expression "lVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }" { (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "uVar1 = FUN_0014b929(4,0);" (assignment_expression "uVar1 = FUN_0014b929(4,0)" identifier = (call_expression "FUN_0014b929(4,0)" identifier (argument_list "(4,0)" ( number_literal , number_literal )))) ;) (expression_statement "lVar2 = FUN_0014a0a9(uVar1,0x1c0);" (assignment_expression "lVar2 = FUN_0014a0a9(uVar1,0x1c0)" identifier = (call_expression "FUN_0014a0a9(uVar1,0x1c0)" identifier (argument_list "(uVar1,0x1c0)" ( identifier , number_literal )))) ;) (if_statement "if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" if (parenthesized_expression "(lVar2 == 0)" ( (binary_expression "lVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }" { (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "__filename = (char *)FUN_0014b929(5,param_1);" (assignment_expression "__filename = (char *)FUN_0014b929(5,param_1)" identifier = (cast_expression "(char *)FUN_0014b929(5,param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0014b929(5,param_1)" identifier (argument_list "(5,param_1)" ( number_literal , identifier ))))) ;) (expression_statement "pFVar3 = fopen64(__filename,"w");" (assignment_expression "pFVar3 = fopen64(__filename,"w")" identifier = (call_expression "fopen64(__filename,"w")" identifier (argument_list "(__filename,"w")" ( identifier , (string_literal ""w"" " string_content ") )))) ;) (if_statement "if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\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        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }" { (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar6 = strerror(*piVar5);" (assignment_expression "pcVar6 = strerror(*piVar5)" identifier = (call_expression "strerror(*piVar5)" identifier (argument_list "(*piVar5)" ( (pointer_expression "*piVar5" * identifier) )))) ;) (expression_statement "uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);" (assignment_expression "uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" identifier = (call_expression "FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" identifier (argument_list "("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" ( (string_literal ""Unable to save session: open(\"%s\") returned \'%s\'"" " string_content escape_sequence string_content escape_sequence string_content escape_sequence string_content escape_sequence ") , identifier , identifier )))) ;) (expression_statement "*param_2 = uVar1;" (assignment_expression "*param_2 = uVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "FUN_001217b3(__filename);" (call_expression "FUN_001217b3(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) }) (else_clause "else {\n        FUN_001217b3(__filename);\n      }" else (compound_statement "{\n        FUN_001217b3(__filename);\n      }" { (expression_statement "FUN_001217b3(__filename);" (call_expression "FUN_001217b3(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) }))) }) (else_clause "else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" else (compound_statement "{\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" { (expression_statement "uVar4 = FUN_00121586("Unable to save session: %s",lVar2);" (assignment_expression "uVar4 = FUN_00121586("Unable to save session: %s",lVar2)" identifier = (call_expression "FUN_00121586("Unable to save session: %s",lVar2)" identifier (argument_list "("Unable to save session: %s",lVar2)" ( (string_literal ""Unable to save session: %s"" " string_content ") , identifier )))) ;) (expression_statement "*param_2 = uVar4;" (assignment_expression "*param_2 = uVar4" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "FUN_001217b3(lVar2);" (call_expression "FUN_001217b3(lVar2)" identifier (argument_list "(lVar2)" ( identifier ))) ;) (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) }) (else_clause "else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" else (compound_statement "{\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" { (expression_statement "uVar4 = FUN_00121586("Unable to save session: %s",lVar2);" (assignment_expression "uVar4 = FUN_00121586("Unable to save session: %s",lVar2)" identifier = (call_expression "FUN_00121586("Unable to save session: %s",lVar2)" identifier (argument_list "("Unable to save session: %s",lVar2)" ( (string_literal ""Unable to save session: %s"" " string_content ") , identifier )))) ;) (expression_statement "*param_2 = uVar4;" (assignment_expression "*param_2 = uVar4" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "FUN_001217b3(lVar2);" (call_expression "FUN_001217b3(lVar2)" identifier (argument_list "(lVar2)" ( identifier ))) ;) (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) (return_statement "return pFVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content escape_sequence string_content escape_sequence string_content escape_sequence string_content escape_sequence ") , IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) }))) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) }))) (return_statement return IDENT ;) })))
(function_definition "FILE * FUN_0014bebd(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" (type_identifier "FILE") (pointer_declarator "* FUN_0014bebd(undefined8 param_1,undefined8 *param_2)" (* "*") (function_declarator "FUN_0014bebd(undefined8 param_1,undefined8 *param_2)" (identifier "FUN_0014bebd") (parameter_list "(undefined8 param_1,undefined8 *param_2)" (( "(") (parameter_declaration "undefined8 param_1" (type_identifier "undefined8") (identifier "param_1")) (, ",") (parameter_declaration "undefined8 *param_2" (type_identifier "undefined8") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")")))) (compound_statement "{\n  undefined8 uVar1;\n  long lVar2;\n  char *__filename;\n  FILE *pFVar3;\n  undefined8 uVar4;\n  int *piVar5;\n  char *pcVar6;\n  \n  *param_2 = 0;\n  uVar1 = FUN_0014b929(0,0);\n  lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n  if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }\n  return pFVar3;\n}" ({ "{") (declaration "undefined8 uVar1;" (type_identifier "undefined8") (identifier "uVar1") (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "char *__filename;" (primitive_type "char") (pointer_declarator "*__filename" (* "*") (identifier "__filename")) (; ";")) (declaration "FILE *pFVar3;" (type_identifier "FILE") (pointer_declarator "*pFVar3" (* "*") (identifier "pFVar3")) (; ";")) (declaration "undefined8 uVar4;" (type_identifier "undefined8") (identifier "uVar4") (; ";")) (declaration "int *piVar5;" (primitive_type "int") (pointer_declarator "*piVar5" (* "*") (identifier "piVar5")) (; ";")) (declaration "char *pcVar6;" (primitive_type "char") (pointer_declarator "*pcVar6" (* "*") (identifier "pcVar6")) (; ";")) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar1 = FUN_0014b929(0,0);" (assignment_expression "uVar1 = FUN_0014b929(0,0)" (identifier "uVar1") (= "=") (call_expression "FUN_0014b929(0,0)" (identifier "FUN_0014b929") (argument_list "(0,0)" (( "(") (number_literal "0") (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "lVar2 = FUN_0014a0a9(uVar1,0x1c0);" (assignment_expression "lVar2 = FUN_0014a0a9(uVar1,0x1c0)" (identifier "lVar2") (= "=") (call_expression "FUN_0014a0a9(uVar1,0x1c0)" (identifier "FUN_0014a0a9") (argument_list "(uVar1,0x1c0)" (( "(") (identifier "uVar1") (, ",") (number_literal "0x1c0") () ")")))) (; ";")) (if_statement "if (lVar2 == 0) {\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }\n  else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" (if "if") (parenthesized_expression "(lVar2 == 0)" (( "(") (binary_expression "lVar2 == 0" (identifier "lVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_001217b3(uVar1);\n    uVar1 = FUN_0014b929(4,0);\n    lVar2 = FUN_0014a0a9(uVar1,0x1c0);\n    if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }\n  }" ({ "{") (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" (identifier "FUN_001217b3") (argument_list "(uVar1)" (( "(") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "uVar1 = FUN_0014b929(4,0);" (assignment_expression "uVar1 = FUN_0014b929(4,0)" (identifier "uVar1") (= "=") (call_expression "FUN_0014b929(4,0)" (identifier "FUN_0014b929") (argument_list "(4,0)" (( "(") (number_literal "4") (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "lVar2 = FUN_0014a0a9(uVar1,0x1c0);" (assignment_expression "lVar2 = FUN_0014a0a9(uVar1,0x1c0)" (identifier "lVar2") (= "=") (call_expression "FUN_0014a0a9(uVar1,0x1c0)" (identifier "FUN_0014a0a9") (argument_list "(uVar1,0x1c0)" (( "(") (identifier "uVar1") (, ",") (number_literal "0x1c0") () ")")))) (; ";")) (if_statement "if (lVar2 == 0) {\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }\n    else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" (if "if") (parenthesized_expression "(lVar2 == 0)" (( "(") (binary_expression "lVar2 == 0" (identifier "lVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_001217b3(uVar1);\n      __filename = (char *)FUN_0014b929(5,param_1);\n      pFVar3 = fopen64(__filename,"w");\n      if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }\n    }" ({ "{") (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" (identifier "FUN_001217b3") (argument_list "(uVar1)" (( "(") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "__filename = (char *)FUN_0014b929(5,param_1);" (assignment_expression "__filename = (char *)FUN_0014b929(5,param_1)" (identifier "__filename") (= "=") (cast_expression "(char *)FUN_0014b929(5,param_1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0014b929(5,param_1)" (identifier "FUN_0014b929") (argument_list "(5,param_1)" (( "(") (number_literal "5") (, ",") (identifier "param_1") () ")"))))) (; ";")) (expression_statement "pFVar3 = fopen64(__filename,"w");" (assignment_expression "pFVar3 = fopen64(__filename,"w")" (identifier "pFVar3") (= "=") (call_expression "fopen64(__filename,"w")" (identifier "fopen64") (argument_list "(__filename,"w")" (( "(") (identifier "__filename") (, ",") (string_literal ""w"" (" """) (string_content "w") (" """)) () ")")))) (; ";")) (if_statement "if (pFVar3 == (FILE *)0x0) {\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }\n      else {\n        FUN_001217b3(__filename);\n      }" (if "if") (parenthesized_expression "(pFVar3 == (FILE *)0x0)" (( "(") (binary_expression "pFVar3 == (FILE *)0x0" (identifier "pFVar3") (== "==") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        piVar5 = __errno_location();\n        pcVar6 = strerror(*piVar5);\n        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);\n        *param_2 = uVar1;\n        FUN_001217b3(__filename);\n      }" ({ "{") (expression_statement "piVar5 = __errno_location();" (assignment_expression "piVar5 = __errno_location()" (identifier "piVar5") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar6 = strerror(*piVar5);" (assignment_expression "pcVar6 = strerror(*piVar5)" (identifier "pcVar6") (= "=") (call_expression "strerror(*piVar5)" (identifier "strerror") (argument_list "(*piVar5)" (( "(") (pointer_expression "*piVar5" (* "*") (identifier "piVar5")) () ")")))) (; ";")) (expression_statement "uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6);" (assignment_expression "uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" (identifier "uVar1") (= "=") (call_expression "FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" (identifier "FUN_00121586") (argument_list "("Unable to save session: open(\"%s\") returned \'%s\'",__filename,\n                             pcVar6)" (( "(") (string_literal ""Unable to save session: open(\"%s\") returned \'%s\'"" (" """) (string_content "Unable to save session: open(") (escape_sequence "\"") (string_content "%s") (escape_sequence "\"") (string_content ") returned ") (escape_sequence "\'") (string_content "%s") (escape_sequence "\'") (" """)) (, ",") (identifier "__filename") (, ",") (identifier "pcVar6") () ")")))) (; ";")) (expression_statement "*param_2 = uVar1;" (assignment_expression "*param_2 = uVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "FUN_001217b3(__filename);" (call_expression "FUN_001217b3(__filename)" (identifier "FUN_001217b3") (argument_list "(__filename)" (( "(") (identifier "__filename") () ")"))) (; ";")) (} "}")) (else_clause "else {\n        FUN_001217b3(__filename);\n      }" (else "else") (compound_statement "{\n        FUN_001217b3(__filename);\n      }" ({ "{") (expression_statement "FUN_001217b3(__filename);" (call_expression "FUN_001217b3(__filename)" (identifier "FUN_001217b3") (argument_list "(__filename)" (( "(") (identifier "__filename") () ")"))) (; ";")) (} "}")))) (} "}")) (else_clause "else {\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" (else "else") (compound_statement "{\n      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n      *param_2 = uVar4;\n      FUN_001217b3(lVar2);\n      FUN_001217b3(uVar1);\n      pFVar3 = (FILE *)0x0;\n    }" ({ "{") (expression_statement "uVar4 = FUN_00121586("Unable to save session: %s",lVar2);" (assignment_expression "uVar4 = FUN_00121586("Unable to save session: %s",lVar2)" (identifier "uVar4") (= "=") (call_expression "FUN_00121586("Unable to save session: %s",lVar2)" (identifier "FUN_00121586") (argument_list "("Unable to save session: %s",lVar2)" (( "(") (string_literal ""Unable to save session: %s"" (" """) (string_content "Unable to save session: %s") (" """)) (, ",") (identifier "lVar2") () ")")))) (; ";")) (expression_statement "*param_2 = uVar4;" (assignment_expression "*param_2 = uVar4" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "FUN_001217b3(lVar2);" (call_expression "FUN_001217b3(lVar2)" (identifier "FUN_001217b3") (argument_list "(lVar2)" (( "(") (identifier "lVar2") () ")"))) (; ";")) (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" (identifier "FUN_001217b3") (argument_list "(uVar1)" (( "(") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" (identifier "pFVar3") (= "=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}")))) (} "}")) (else_clause "else {\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" (else "else") (compound_statement "{\n    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);\n    *param_2 = uVar4;\n    FUN_001217b3(lVar2);\n    FUN_001217b3(uVar1);\n    pFVar3 = (FILE *)0x0;\n  }" ({ "{") (expression_statement "uVar4 = FUN_00121586("Unable to save session: %s",lVar2);" (assignment_expression "uVar4 = FUN_00121586("Unable to save session: %s",lVar2)" (identifier "uVar4") (= "=") (call_expression "FUN_00121586("Unable to save session: %s",lVar2)" (identifier "FUN_00121586") (argument_list "("Unable to save session: %s",lVar2)" (( "(") (string_literal ""Unable to save session: %s"" (" """) (string_content "Unable to save session: %s") (" """)) (, ",") (identifier "lVar2") () ")")))) (; ";")) (expression_statement "*param_2 = uVar4;" (assignment_expression "*param_2 = uVar4" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "FUN_001217b3(lVar2);" (call_expression "FUN_001217b3(lVar2)" (identifier "FUN_001217b3") (argument_list "(lVar2)" (( "(") (identifier "lVar2") () ")"))) (; ";")) (expression_statement "FUN_001217b3(uVar1);" (call_expression "FUN_001217b3(uVar1)" (identifier "FUN_001217b3") (argument_list "(uVar1)" (( "(") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" (identifier "pFVar3") (= "=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}")))) (return_statement "return pFVar3;" (return "return") (identifier "pFVar3") (; ";")) (} "}")))

void * function_1(char *sessionname,char **errmsg)

{
  char *pcVar1;
  char *var_3;
  type_1 *var_6;
  char *pcVar4;
  int *piVar5;
  
  *errmsg = (char *)0x0;
  pcVar1 = var_1(0,(char *)0x0);
  var_3 = var_2(pcVar1,0x1c0);
  if (var_3 == (char *)0x0) {
    var_4(pcVar1);
    pcVar1 = var_1(4,(char *)0x0);
    var_3 = var_2(pcVar1,0x1c0);
    if (var_3 == (char *)0x0) {
      var_4(pcVar1);
      pcVar1 = var_1(5,sessionname);
      var_6 = var_5(pcVar1,"w");
      if (var_6 == (type_1 *)0x0) {
        piVar5 = var_7();
        var_3 = var_8(*piVar5);
        var_3 = var_9("Unable to save session: open(\"%s\") returned \'%s\'",pcVar1,var_3);
        *errmsg = var_3;
        var_4(pcVar1);
      }
      else {
        var_4(pcVar1);
      }
    }
    else {
      pcVar4 = var_9("Unable to save session: %s",var_3);
      *errmsg = pcVar4;
      var_4(var_3);
      var_4(pcVar1);
      var_6 = (type_1 *)0x0;
    }
  }
  else {
    pcVar4 = var_9("Unable to save session: %s",var_3);
    *errmsg = pcVar4;
    var_4(var_3);
    var_4(pcVar1);
    var_6 = (type_1 *)0x0;
  }
  return var_6;
}


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

FILE * MASKED(undefined8 param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  long lVar2;
  char *__filename;
  FILE *pFVar3;
  undefined8 uVar4;
  int *piVar5;
  char *pcVar6;
  
  *param_2 = 0;
  uVar1 = FUN_0014b929(0,0);
  lVar2 = FUN_0014a0a9(uVar1,0x1c0);
  if (lVar2 == 0) {
    FUN_001217b3(uVar1);
    uVar1 = FUN_0014b929(4,0);
    lVar2 = FUN_0014a0a9(uVar1,0x1c0);
    if (lVar2 == 0) {
      FUN_001217b3(uVar1);
      __filename = (char *)FUN_0014b929(5,param_1);
      pFVar3 = fopen64(__filename,"w");
      if (pFVar3 == (FILE *)0x0) {
        piVar5 = __errno_location();
        pcVar6 = strerror(*piVar5);
        uVar1 = FUN_00121586("Unable to save session: open(\"%s\") returned \'%s\'",__filename,
                             pcVar6);
        *param_2 = uVar1;
        FUN_001217b3(__filename);
      }
      else {
        FUN_001217b3(__filename);
      }
    }
    else {
      uVar4 = FUN_00121586("Unable to save session: %s",lVar2);
      *param_2 = uVar4;
      FUN_001217b3(lVar2);
      FUN_001217b3(uVar1);
      pFVar3 = (FILE *)0x0;
    }
  }
  else {
    uVar4 = FUN_00121586("Unable to save session: %s",lVar2);
    *param_2 = uVar4;
    FUN_001217b3(lVar2);
    FUN_001217b3(uVar1);
    pFVar3 = (FILE *)0x0;
  }
  return pFVar3;
}

