
int restore_cwd(saved_cwd *cwd)

{
  int iVar1;
  
  if (cwd->desc < 0) {
    iVar1 = chdir_long(cwd->name);
  }
  else {
    iVar1 = fchdir(cwd->desc);
  }
  return iVar1;
}



void FUN_00109f15(int *param_1)

{
  if (*param_1 < 0) {
    FUN_0010a008(*(undefined8 *)(param_1 + 2));
  }
  else {
    fchdir(*param_1);
  }
  return;
}


SUB RSP,0x8
MOV EAX,dword ptr [RDI]
TEST EAX,EAX
JS 0x00109f2b
MOV EDI,EAX
CALL 0x00102380
ADD RSP,0x8
RET
MOV RDI,qword ptr [RDI + 0x8]
CALL 0x0010a008
JMP 0x00109f26
(translation_unit "void FUN_00109f15(int *param_1)\n\n{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}\n\n" (function_definition "void FUN_00109f15(int *param_1)\n\n{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00109f15(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}" { (if_statement "if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }" if (parenthesized_expression "(*param_1 < 0)" ( (binary_expression "*param_1 < 0" (pointer_expression "*param_1" * identifier) < number_literal) )) (compound_statement "{\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }" { (expression_statement "FUN_0010a008(*(undefined8 *)(param_1 + 2));" (call_expression "FUN_0010a008(*(undefined8 *)(param_1 + 2))" identifier (argument_list "(*(undefined8 *)(param_1 + 2))" ( (pointer_expression "*(undefined8 *)(param_1 + 2)" * (cast_expression "(undefined8 *)(param_1 + 2)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) ))) ;) }) (else_clause "else {\n    fchdir(*param_1);\n  }" else (compound_statement "{\n    fchdir(*param_1);\n  }" { (expression_statement "fchdir(*param_1);" (call_expression "fchdir(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "int restore_cwd(saved_cwd *cwd)\n\n{\n  int iVar1;\n  \n  if (cwd->desc < 0) {\n    iVar1 = chdir_long(cwd->name);\n  }\n  else {\n    iVar1 = fchdir(cwd->desc);\n  }\n  return iVar1;\n}\n\n" (function_definition "int restore_cwd(saved_cwd *cwd)\n\n{\n  int iVar1;\n  \n  if (cwd->desc < 0) {\n    iVar1 = chdir_long(cwd->name);\n  }\n  else {\n    iVar1 = fchdir(cwd->desc);\n  }\n  return iVar1;\n}" primitive_type (function_declarator "restore_cwd(saved_cwd *cwd)" identifier (parameter_list "(saved_cwd *cwd)" ( (parameter_declaration "saved_cwd *cwd" type_identifier (pointer_declarator "*cwd" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  \n  if (cwd->desc < 0) {\n    iVar1 = chdir_long(cwd->name);\n  }\n  else {\n    iVar1 = fchdir(cwd->desc);\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (cwd->desc < 0) {\n    iVar1 = chdir_long(cwd->name);\n  }\n  else {\n    iVar1 = fchdir(cwd->desc);\n  }" if (parenthesized_expression "(cwd->desc < 0)" ( (binary_expression "cwd->desc < 0" (field_expression "cwd->desc" identifier -> field_identifier) < number_literal) )) (compound_statement "{\n    iVar1 = chdir_long(cwd->name);\n  }" { (expression_statement "iVar1 = chdir_long(cwd->name);" (assignment_expression "iVar1 = chdir_long(cwd->name)" identifier = (call_expression "chdir_long(cwd->name)" identifier (argument_list "(cwd->name)" ( (field_expression "cwd->name" identifier -> field_identifier) )))) ;) }) (else_clause "else {\n    iVar1 = fchdir(cwd->desc);\n  }" else (compound_statement "{\n    iVar1 = fchdir(cwd->desc);\n  }" { (expression_statement "iVar1 = fchdir(cwd->desc);" (assignment_expression "iVar1 = fchdir(cwd->desc)" identifier = (call_expression "fchdir(cwd->desc)" identifier (argument_list "(cwd->desc)" ( (field_expression "cwd->desc" identifier -> field_identifier) )))) ;) }))) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "void FUN_00109f15(int *param_1)\n\n{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}\n\n" (function_definition "void FUN_00109f15(int *param_1)\n\n{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00109f15(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}" { (if_statement "if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }" if (parenthesized_expression "(*param_1 < 0)" ( (binary_expression "*param_1 < 0" (pointer_expression "*param_1" * identifier) < number_literal) )) (compound_statement "{\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }" { (expression_statement "FUN_0010a008(*(undefined8 *)(param_1 + 2));" (call_expression "FUN_0010a008(*(undefined8 *)(param_1 + 2))" identifier (argument_list "(*(undefined8 *)(param_1 + 2))" ( (pointer_expression "*(undefined8 *)(param_1 + 2)" * (cast_expression "(undefined8 *)(param_1 + 2)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) ))) ;) }) (else_clause "else {\n    fchdir(*param_1);\n  }" else (compound_statement "{\n    fchdir(*param_1);\n  }" { (expression_statement "fchdir(*param_1);" (call_expression "fchdir(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * IDENT) ))) ;) }))) (return_statement return ;) })))
(function_definition "void FUN_00109f15(int *param_1)\n\n{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00109f15(int *param_1)" (identifier "FUN_00109f15") (parameter_list "(int *param_1)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }\n  return;\n}" ({ "{") (if_statement "if (*param_1 < 0) {\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }\n  else {\n    fchdir(*param_1);\n  }" (if "if") (parenthesized_expression "(*param_1 < 0)" (( "(") (binary_expression "*param_1 < 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_0010a008(*(undefined8 *)(param_1 + 2));\n  }" ({ "{") (expression_statement "FUN_0010a008(*(undefined8 *)(param_1 + 2));" (call_expression "FUN_0010a008(*(undefined8 *)(param_1 + 2))" (identifier "FUN_0010a008") (argument_list "(*(undefined8 *)(param_1 + 2))" (( "(") (pointer_expression "*(undefined8 *)(param_1 + 2)" (* "*") (cast_expression "(undefined8 *)(param_1 + 2)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) () ")"))) (; ";")) (} "}")) (else_clause "else {\n    fchdir(*param_1);\n  }" (else "else") (compound_statement "{\n    fchdir(*param_1);\n  }" ({ "{") (expression_statement "fchdir(*param_1);" (call_expression "fchdir(*param_1)" (identifier "fchdir") (argument_list "(*param_1)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) () ")"))) (; ";")) (} "}")))) (return_statement "return;" (return "return") (; ";")) (} "}")))

int function_1(type_1 *cwd)

{
  int iVar1;
  
  if (cwd->desc < 0) {
    iVar1 = var_1(cwd->name);
  }
  else {
    iVar1 = var_2(cwd->desc);
  }
  return iVar1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))))) (return_statement))))

void MASKED(int *param_1)

{
  if (*param_1 < 0) {
    FUN_0010a008(*(undefined8 *)(param_1 + 2));
  }
  else {
    fchdir(*param_1);
  }
  return;
}

