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

void * enum_settings_start(void)

{
  char *pcVar1;
  DIR *pDVar2;
  char *ptr;
  
  pcVar1 = getenv("PUTTYSESSIONS");
  if (pcVar1 == (char *)0x0) {
    ptr = make_filename(0,(char *)0x0);
    pcVar1 = dupprintf("%s/sessions",ptr);
    safefree(ptr);
  }
  else {
    pcVar1 = dupstr(pcVar1);
  }
  pDVar2 = opendir(pcVar1);
  safefree(pcVar1);
  return pDVar2;
}



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

DIR * FUN_00059380(void)

{
  char *pcVar1;
  DIR *pDVar2;
  undefined4 uVar3;
  
  pcVar1 = getenv("PUTTYSESSIONS");
  if (pcVar1 == (char *)0x0) {
    uVar3 = FUN_000580e0();
    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);
    FUN_0001c820(uVar3);
  }
  else {
    pcVar1 = (char *)FUN_0001b6c0(pcVar1);
  }
  pDVar2 = opendir(pcVar1);
  FUN_0001c820(pcVar1);
  return pDVar2;
}


PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015340
ADD EBX,0x2b960
SUB ESP,0xc
LEA EAX,[EBX + 0xfffe1862]
PUSH EAX
CALL 0x000144d0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000593d0
SUB ESP,0xc
PUSH EAX
CALL 0x0001b6c0
ADD ESP,0x10
MOV ESI,EAX
SUB ESP,0xc
PUSH ESI
CALL 0x000147a0
MOV dword ptr [ESP],ESI
MOV EDI,EAX
CALL 0x0001c820
ADD ESP,0x10
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
RET
XOR EDX,EDX
XOR EAX,EAX
CALL 0x000580e0
SUB ESP,0x8
PUSH EAX
MOV EDI,EAX
LEA EAX,[EBX + 0xfffe1870]
PUSH EAX
CALL 0x0001b990
MOV dword ptr [ESP],EDI
MOV ESI,EAX
CALL 0x0001c820
ADD ESP,0x10
JMP 0x000593b2
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nDIR * FUN_00059380(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}\n\n" comment (function_definition "DIR * FUN_00059380(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}" type_identifier (pointer_declarator "* FUN_00059380(void)" * (function_declarator "FUN_00059380(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "DIR *pDVar2;" type_identifier (pointer_declarator "*pDVar2" * identifier) ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "pcVar1 = getenv("PUTTYSESSIONS");" (assignment_expression "pcVar1 = getenv("PUTTYSESSIONS")" identifier = (call_expression "getenv("PUTTYSESSIONS")" identifier (argument_list "("PUTTYSESSIONS")" ( (string_literal ""PUTTYSESSIONS"" " string_content ") )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }" { (expression_statement "uVar3 = FUN_000580e0();" (assignment_expression "uVar3 = FUN_000580e0()" identifier = (call_expression "FUN_000580e0()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);" (assignment_expression "pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3)" identifier = (cast_expression "(char *)FUN_0001b990("%s/sessions",uVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("%s/sessions",uVar3)" identifier (argument_list "("%s/sessions",uVar3)" ( (string_literal ""%s/sessions"" " string_content ") , identifier ))))) ;) (expression_statement "FUN_0001c820(uVar3);" (call_expression "FUN_0001c820(uVar3)" identifier (argument_list "(uVar3)" ( identifier ))) ;) }) (else_clause "else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" else (compound_statement "{\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" { (expression_statement "pcVar1 = (char *)FUN_0001b6c0(pcVar1);" (assignment_expression "pcVar1 = (char *)FUN_0001b6c0(pcVar1)" identifier = (cast_expression "(char *)FUN_0001b6c0(pcVar1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b6c0(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))))) ;) }))) (expression_statement "pDVar2 = opendir(pcVar1);" (assignment_expression "pDVar2 = opendir(pcVar1)" identifier = (call_expression "opendir(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier )))) ;) (expression_statement "FUN_0001c820(pcVar1);" (call_expression "FUN_0001c820(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (return_statement "return pDVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid * enum_settings_start(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  char *ptr;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    ptr = make_filename(0,(char *)0x0);\n    pcVar1 = dupprintf("%s/sessions",ptr);\n    safefree(ptr);\n  }\n  else {\n    pcVar1 = dupstr(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  safefree(pcVar1);\n  return pDVar2;\n}\n\n" comment comment (function_definition "void * enum_settings_start(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  char *ptr;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    ptr = make_filename(0,(char *)0x0);\n    pcVar1 = dupprintf("%s/sessions",ptr);\n    safefree(ptr);\n  }\n  else {\n    pcVar1 = dupstr(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  safefree(pcVar1);\n  return pDVar2;\n}" primitive_type (pointer_declarator "* enum_settings_start(void)" * (function_declarator "enum_settings_start(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  char *pcVar1;\n  DIR *pDVar2;\n  char *ptr;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    ptr = make_filename(0,(char *)0x0);\n    pcVar1 = dupprintf("%s/sessions",ptr);\n    safefree(ptr);\n  }\n  else {\n    pcVar1 = dupstr(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  safefree(pcVar1);\n  return pDVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "DIR *pDVar2;" type_identifier (pointer_declarator "*pDVar2" * identifier) ;) (declaration "char *ptr;" primitive_type (pointer_declarator "*ptr" * identifier) ;) (expression_statement "pcVar1 = getenv("PUTTYSESSIONS");" (assignment_expression "pcVar1 = getenv("PUTTYSESSIONS")" identifier = (call_expression "getenv("PUTTYSESSIONS")" identifier (argument_list "("PUTTYSESSIONS")" ( (string_literal ""PUTTYSESSIONS"" " string_content ") )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    ptr = make_filename(0,(char *)0x0);\n    pcVar1 = dupprintf("%s/sessions",ptr);\n    safefree(ptr);\n  }\n  else {\n    pcVar1 = dupstr(pcVar1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    ptr = make_filename(0,(char *)0x0);\n    pcVar1 = dupprintf("%s/sessions",ptr);\n    safefree(ptr);\n  }" { (expression_statement "ptr = make_filename(0,(char *)0x0);" (assignment_expression "ptr = 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 "pcVar1 = dupprintf("%s/sessions",ptr);" (assignment_expression "pcVar1 = dupprintf("%s/sessions",ptr)" identifier = (call_expression "dupprintf("%s/sessions",ptr)" identifier (argument_list "("%s/sessions",ptr)" ( (string_literal ""%s/sessions"" " string_content ") , identifier )))) ;) (expression_statement "safefree(ptr);" (call_expression "safefree(ptr)" identifier (argument_list "(ptr)" ( identifier ))) ;) }) (else_clause "else {\n    pcVar1 = dupstr(pcVar1);\n  }" else (compound_statement "{\n    pcVar1 = dupstr(pcVar1);\n  }" { (expression_statement "pcVar1 = dupstr(pcVar1);" (assignment_expression "pcVar1 = dupstr(pcVar1)" identifier = (call_expression "dupstr(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier )))) ;) }))) (expression_statement "pDVar2 = opendir(pcVar1);" (assignment_expression "pDVar2 = opendir(pcVar1)" identifier = (call_expression "opendir(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier )))) ;) (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (return_statement "return pDVar2;" return identifier ;) })))
(translation_unit "DIR * FUN_00059380(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}\n\n" (function_definition "DIR * FUN_00059380(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}" type_identifier (pointer_declarator "* FUN_00059380(void)" * (function_declarator "FUN_00059380(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "DIR *pDVar2;" type_identifier (pointer_declarator "*pDVar2" * identifier) ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "pcVar1 = getenv("PUTTYSESSIONS");" (assignment_expression "pcVar1 = getenv("PUTTYSESSIONS")" identifier = (call_expression "getenv("PUTTYSESSIONS")" identifier (argument_list "("PUTTYSESSIONS")" ( (string_literal ""PUTTYSESSIONS"" " string_content ") )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }" { (expression_statement "uVar3 = FUN_000580e0();" (assignment_expression "uVar3 = FUN_000580e0()" identifier = (call_expression "FUN_000580e0()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);" (assignment_expression "pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3)" identifier = (cast_expression "(char *)FUN_0001b990("%s/sessions",uVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("%s/sessions",uVar3)" identifier (argument_list "("%s/sessions",uVar3)" ( (string_literal ""%s/sessions"" " string_content ") , identifier ))))) ;) (expression_statement "FUN_0001c820(uVar3);" (call_expression "FUN_0001c820(uVar3)" identifier (argument_list "(uVar3)" ( identifier ))) ;) }) (else_clause "else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" else (compound_statement "{\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" { (expression_statement "pcVar1 = (char *)FUN_0001b6c0(pcVar1);" (assignment_expression "pcVar1 = (char *)FUN_0001b6c0(pcVar1)" identifier = (cast_expression "(char *)FUN_0001b6c0(pcVar1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b6c0(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))))) ;) }))) (expression_statement "pDVar2 = opendir(pcVar1);" (assignment_expression "pDVar2 = opendir(pcVar1)" identifier = (call_expression "opendir(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier )))) ;) (expression_statement "FUN_0001c820(pcVar1);" (call_expression "FUN_0001c820(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (return_statement "return pDVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (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 = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })))
(function_definition "DIR * FUN_00059380(void)\n\n{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}" (type_identifier "DIR") (pointer_declarator "* FUN_00059380(void)" (* "*") (function_declarator "FUN_00059380(void)" (identifier "FUN_00059380") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")")))) (compound_statement "{\n  char *pcVar1;\n  DIR *pDVar2;\n  undefined4 uVar3;\n  \n  pcVar1 = getenv("PUTTYSESSIONS");\n  if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }\n  pDVar2 = opendir(pcVar1);\n  FUN_0001c820(pcVar1);\n  return pDVar2;\n}" ({ "{") (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "DIR *pDVar2;" (type_identifier "DIR") (pointer_declarator "*pDVar2" (* "*") (identifier "pDVar2")) (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (expression_statement "pcVar1 = getenv("PUTTYSESSIONS");" (assignment_expression "pcVar1 = getenv("PUTTYSESSIONS")" (identifier "pcVar1") (= "=") (call_expression "getenv("PUTTYSESSIONS")" (identifier "getenv") (argument_list "("PUTTYSESSIONS")" (( "(") (string_literal ""PUTTYSESSIONS"" (" """) (string_content "PUTTYSESSIONS") (" """)) () ")")))) (; ";")) (if_statement "if (pcVar1 == (char *)0x0) {\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }\n  else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" (if "if") (parenthesized_expression "(pcVar1 == (char *)0x0)" (( "(") (binary_expression "pcVar1 == (char *)0x0" (identifier "pcVar1") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    uVar3 = FUN_000580e0();\n    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);\n    FUN_0001c820(uVar3);\n  }" ({ "{") (expression_statement "uVar3 = FUN_000580e0();" (assignment_expression "uVar3 = FUN_000580e0()" (identifier "uVar3") (= "=") (call_expression "FUN_000580e0()" (identifier "FUN_000580e0") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);" (assignment_expression "pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3)" (identifier "pcVar1") (= "=") (cast_expression "(char *)FUN_0001b990("%s/sessions",uVar3)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001b990("%s/sessions",uVar3)" (identifier "FUN_0001b990") (argument_list "("%s/sessions",uVar3)" (( "(") (string_literal ""%s/sessions"" (" """) (string_content "%s/sessions") (" """)) (, ",") (identifier "uVar3") () ")"))))) (; ";")) (expression_statement "FUN_0001c820(uVar3);" (call_expression "FUN_0001c820(uVar3)" (identifier "FUN_0001c820") (argument_list "(uVar3)" (( "(") (identifier "uVar3") () ")"))) (; ";")) (} "}")) (else_clause "else {\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" (else "else") (compound_statement "{\n    pcVar1 = (char *)FUN_0001b6c0(pcVar1);\n  }" ({ "{") (expression_statement "pcVar1 = (char *)FUN_0001b6c0(pcVar1);" (assignment_expression "pcVar1 = (char *)FUN_0001b6c0(pcVar1)" (identifier "pcVar1") (= "=") (cast_expression "(char *)FUN_0001b6c0(pcVar1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001b6c0(pcVar1)" (identifier "FUN_0001b6c0") (argument_list "(pcVar1)" (( "(") (identifier "pcVar1") () ")"))))) (; ";")) (} "}")))) (expression_statement "pDVar2 = opendir(pcVar1);" (assignment_expression "pDVar2 = opendir(pcVar1)" (identifier "pDVar2") (= "=") (call_expression "opendir(pcVar1)" (identifier "opendir") (argument_list "(pcVar1)" (( "(") (identifier "pcVar1") () ")")))) (; ";")) (expression_statement "FUN_0001c820(pcVar1);" (call_expression "FUN_0001c820(pcVar1)" (identifier "FUN_0001c820") (argument_list "(pcVar1)" (( "(") (identifier "pcVar1") () ")"))) (; ";")) (return_statement "return pDVar2;" (return "return") (identifier "pDVar2") (; ";")) (} "}")))

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

void * function_1(void)

{
  char *var_2;
  type_1 *pDVar2;
  char *ptr;
  
  var_2 = var_1("PUTTYSESSIONS");
  if (var_2 == (char *)0x0) {
    ptr = var_3(0,(char *)0x0);
    var_2 = var_4("%s/sessions",ptr);
    var_5(ptr);
  }
  else {
    var_2 = var_6(var_2);
  }
  pDVar2 = var_7(var_2);
  var_5(var_2);
  return pDVar2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)))))) (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: (call_expression function: (identifier) arguments: (argument_list)))) (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 (string_literal (string_content)) (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) 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))))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))))

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

DIR * MASKED(void)

{
  char *pcVar1;
  DIR *pDVar2;
  undefined4 uVar3;
  
  pcVar1 = getenv("PUTTYSESSIONS");
  if (pcVar1 == (char *)0x0) {
    uVar3 = FUN_000580e0();
    pcVar1 = (char *)FUN_0001b990("%s/sessions",uVar3);
    FUN_0001c820(uVar3);
  }
  else {
    pcVar1 = (char *)FUN_0001b6c0(pcVar1);
  }
  pDVar2 = opendir(pcVar1);
  FUN_0001c820(pcVar1);
  return pDVar2;
}

