
char * psftp_lcd(char *dir)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  
  iVar1 = chdir(dir);
  pcVar3 = (char *)0x0;
  if (iVar1 < 0) {
    piVar2 = __errno_location();
    pcVar3 = strerror(*piVar2);
    pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);
  }
  return pcVar3;
}



undefined8 FUN_00159419(char *param_1)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  undefined8 uVar4;
  
  iVar1 = chdir(param_1);
  uVar4 = 0;
  if (iVar1 < 0) {
    piVar2 = __errno_location();
    pcVar3 = strerror(*piVar2);
    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);
  }
  return uVar4;
}


PUSH RBX
MOV RBX,RDI
CALL 0x00108270
MOV EDX,0x0
TEST EAX,EAX
JS 0x00159430
MOV RAX,RDX
POP RBX
RET
CALL 0x001080e0
MOV EDI,dword ptr [RAX]
CALL 0x001087f0
MOV RDX,RAX
MOV RSI,RBX
LEA RDI,[0x170a31]
MOV EAX,0x0
CALL 0x0010e862
MOV RDX,RAX
JMP 0x0015942b
(translation_unit "undefined8 FUN_00159419(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}\n\n" (function_definition "undefined8 FUN_00159419(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}" type_identifier (function_declarator "FUN_00159419(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = chdir(param_1);" (assignment_expression "iVar1 = chdir(param_1)" identifier = (call_expression "chdir(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);" (assignment_expression "uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3)" identifier = (call_expression "FUN_0010e862("%s: chdir: %s",param_1,pcVar3)" identifier (argument_list "("%s: chdir: %s",param_1,pcVar3)" ( (string_literal ""%s: chdir: %s"" " string_content ") , identifier , identifier )))) ;) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "char * psftp_lcd(char *dir)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  \n  iVar1 = chdir(dir);\n  pcVar3 = (char *)0x0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);\n  }\n  return pcVar3;\n}\n\n" (function_definition "char * psftp_lcd(char *dir)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  \n  iVar1 = chdir(dir);\n  pcVar3 = (char *)0x0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);\n  }\n  return pcVar3;\n}" primitive_type (pointer_declarator "* psftp_lcd(char *dir)" * (function_declarator "psftp_lcd(char *dir)" identifier (parameter_list "(char *dir)" ( (parameter_declaration "char *dir" primitive_type (pointer_declarator "*dir" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  \n  iVar1 = chdir(dir);\n  pcVar3 = (char *)0x0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);\n  }\n  return pcVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "iVar1 = chdir(dir);" (assignment_expression "iVar1 = chdir(dir)" identifier = (call_expression "chdir(dir)" identifier (argument_list "(dir)" ( identifier )))) ;) (expression_statement "pcVar3 = (char *)0x0;" (assignment_expression "pcVar3 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3);" (assignment_expression "pcVar3 = dupprintf("%s: chdir: %s",dir,pcVar3)" identifier = (call_expression "dupprintf("%s: chdir: %s",dir,pcVar3)" identifier (argument_list "("%s: chdir: %s",dir,pcVar3)" ( (string_literal ""%s: chdir: %s"" " string_content ") , identifier , identifier )))) ;) })) (return_statement "return pcVar3;" return identifier ;) })))
(translation_unit "undefined8 FUN_00159419(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}\n\n" (function_definition "undefined8 FUN_00159419(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}" type_identifier (function_declarator "FUN_00159419(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = chdir(param_1);" (assignment_expression "iVar1 = chdir(param_1)" identifier = (call_expression "chdir(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);" (assignment_expression "uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3)" identifier = (call_expression "FUN_0010e862("%s: chdir: %s",param_1,pcVar3)" identifier (argument_list "("%s: chdir: %s",param_1,pcVar3)" ( (string_literal ""%s: chdir: %s"" " string_content ") , identifier , identifier )))) ;) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < 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 ") , IDENT , IDENT )))) ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined8 FUN_00159419(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}" (type_identifier "undefined8") (function_declarator "FUN_00159419(char *param_1)" (identifier "FUN_00159419") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  \n  iVar1 = chdir(param_1);\n  uVar4 = 0;\n  if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }\n  return uVar4;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "undefined8 uVar4;" (type_identifier "undefined8") (identifier "uVar4") (; ";")) (expression_statement "iVar1 = chdir(param_1);" (assignment_expression "iVar1 = chdir(param_1)" (identifier "iVar1") (= "=") (call_expression "chdir(param_1)" (identifier "chdir") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "uVar4 = 0;" (assignment_expression "uVar4 = 0" (identifier "uVar4") (= "=") (number_literal "0")) (; ";")) (if_statement "if (iVar1 < 0) {\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    piVar2 = __errno_location();\n    pcVar3 = strerror(*piVar2);\n    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);\n  }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" (identifier "pcVar3") (= "=") (call_expression "strerror(*piVar2)" (identifier "strerror") (argument_list "(*piVar2)" (( "(") (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) () ")")))) (; ";")) (expression_statement "uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);" (assignment_expression "uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3)" (identifier "uVar4") (= "=") (call_expression "FUN_0010e862("%s: chdir: %s",param_1,pcVar3)" (identifier "FUN_0010e862") (argument_list "("%s: chdir: %s",param_1,pcVar3)" (( "(") (string_literal ""%s: chdir: %s"" (" """) (string_content "%s: chdir: %s") (" """)) (, ",") (identifier "param_1") (, ",") (identifier "pcVar3") () ")")))) (; ";")) (} "}"))) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}")))

char * function_1(char *dir)

{
  int var_2;
  int *piVar2;
  char *pcVar3;
  
  var_2 = var_1(dir);
  pcVar3 = (char *)0x0;
  if (var_2 < 0) {
    piVar2 = var_3();
    pcVar3 = var_4(*piVar2);
    pcVar3 = var_5("%s: chdir: %s",dir,pcVar3);
  }
  return pcVar3;
}


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

undefined8 MASKED(char *param_1)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  undefined8 uVar4;
  
  iVar1 = chdir(param_1);
  uVar4 = 0;
  if (iVar1 < 0) {
    piVar2 = __errno_location();
    pcVar3 = strerror(*piVar2);
    uVar4 = FUN_0010e862("%s: chdir: %s",param_1,pcVar3);
  }
  return uVar4;
}

