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

int __regparm3 restore_initial_cwd(FTS *sp)

{
  I_ring *ir;
  _Bool _Var1;
  int iVar2;
  uint uVar3;
  
  ir = &sp->fts_fd_ring;
  if ((sp->fts_options & 4U) != 0) {
    uVar3 = 0;
    goto LAB_00023c50;
  }
  if ((sp->fts_options & 0x200U) != 0) {
    iVar2 = i_ring_push(ir,sp->fts_cwd_fd);
    if (iVar2 < 0) {
      sp->fts_cwd_fd = -100;
    }
    else {
      close(iVar2);
      sp->fts_cwd_fd = -100;
    }
    _Var1 = i_ring_empty(ir);
    uVar3 = 0;
    if (!_Var1) {
      iVar2 = i_ring_pop(ir);
      while( true ) {
        if (-1 < iVar2) {
          close(iVar2);
        }
LAB_00023c50:
        _Var1 = i_ring_empty(ir);
        if (_Var1) break;
        iVar2 = i_ring_pop(ir);
      }
    }
    return uVar3;
  }
  iVar2 = fchdir(sp->fts_rfd);
  uVar3 = (uint)(iVar2 != 0);
  goto LAB_00023c50;
}



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

bool __regparm3 FUN_00023bd0(int param_1)

{
  int iVar1;
  char cVar2;
  int iVar3;
  bool bVar4;
  
  iVar1 = param_1 + 0x38;
  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {
    bVar4 = false;
    goto LAB_00023c50;
  }
  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {
    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));
    if (iVar3 < 0) {
      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;
    }
    else {
      close(iVar3);
      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;
    }
    cVar2 = FUN_0003b600(iVar1);
    bVar4 = false;
    if (cVar2 == '\0') {
      iVar3 = FUN_0003b650(iVar1);
      while( true ) {
        if (-1 < iVar3) {
          close(iVar3);
        }
LAB_00023c50:
        cVar2 = FUN_0003b600(iVar1);
        if (cVar2 != '\0') break;
        iVar3 = FUN_0003b650(iVar1);
      }
    }
    return bVar4;
  }
  iVar3 = fchdir(*(int *)(param_1 + 0x18));
  bVar4 = iVar3 != 0;
  goto LAB_00023c50;
}


PUSH EBP
MOV EBP,EAX
PUSH EDI
PUSH ESI
LEA ESI,[EBP + 0x38]
PUSH EBX
CALL 0x00014080
ADD EBX,0x29422
SUB ESP,0xc
MOV EAX,dword ptr [EAX + 0x2c]
MOV EDI,EAX
AND EDI,0x4
JNZ 0x00023c38
TEST AH,0x2
JZ 0x00023c80
SUB ESP,0x8
PUSH dword ptr [EBP + 0x1c]
PUSH ESI
CALL 0x0003b610
ADD ESP,0x10
TEST EAX,EAX
JNS 0x00023ca0
MOV dword ptr [EBP + 0x1c],0xffffff9c
SUB ESP,0xc
PUSH ESI
CALL 0x0003b600
ADD ESP,0x10
TEST AL,AL
JZ 0x00023c40
ADD ESP,0xc
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
XOR EDI,EDI
JMP 0x00023c50
SUB ESP,0xc
PUSH ESI
CALL 0x0003b650
ADD ESP,0x10
TEST EAX,EAX
JNS 0x00023c70
SUB ESP,0xc
PUSH ESI
CALL 0x0003b600
ADD ESP,0x10
TEST AL,AL
JNZ 0x00023c28
SUB ESP,0xc
PUSH ESI
CALL 0x0003b650
ADD ESP,0x10
TEST EAX,EAX
JS 0x00023c50
SUB ESP,0xc
PUSH EAX
CALL 0x00012650
ADD ESP,0x10
JMP 0x00023c50
SUB ESP,0xc
PUSH dword ptr [EBP + 0x18]
CALL 0x00012570
ADD ESP,0x10
TEST EAX,EAX
SETNZ AL
MOVZX EAX,AL
MOV EDI,EAX
JMP 0x00023c50
SUB ESP,0xc
PUSH EAX
CALL 0x00012650
ADD ESP,0x10
MOV dword ptr [EBP + 0x1c],0xffffff9c
JMP 0x00023c18
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nbool __regparm3 FUN_00023bd0(int param_1)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}\n\n" comment (function_definition "bool __regparm3 FUN_00023bd0(int param_1)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00023bd0(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "bool bVar4;" primitive_type identifier ;) (expression_statement "iVar1 = param_1 + 0x38;" (assignment_expression "iVar1 = param_1 + 0x38" identifier = (binary_expression "param_1 + 0x38" identifier + number_literal)) ;) (if_statement "if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x2c) & 4) != 0)" ( (binary_expression "(*(uint *)(param_1 + 0x2c) & 4) != 0" (parenthesized_expression "(*(uint *)(param_1 + 0x2c) & 4)" ( (binary_expression "*(uint *)(param_1 + 0x2c) & 4" (pointer_expression "*(uint *)(param_1 + 0x2c)" * (cast_expression "(uint *)(param_1 + 0x2c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x2c)" ( (binary_expression "param_1 + 0x2c" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    bVar4 = false;\n    goto LAB_00023c50;\n  }" { (expression_statement "bVar4 = false;" (assignment_expression "bVar4 = false" identifier = false) ;) (goto_statement "goto LAB_00023c50;" goto statement_identifier ;) })) (if_statement "if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x2c) & 0x200) != 0)" ( (binary_expression "(*(uint *)(param_1 + 0x2c) & 0x200) != 0" (parenthesized_expression "(*(uint *)(param_1 + 0x2c) & 0x200)" ( (binary_expression "*(uint *)(param_1 + 0x2c) & 0x200" (pointer_expression "*(uint *)(param_1 + 0x2c)" * (cast_expression "(uint *)(param_1 + 0x2c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x2c)" ( (binary_expression "param_1 + 0x2c" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }" { (expression_statement "iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));" (assignment_expression "iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c))" identifier = (call_expression "FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c))" identifier (argument_list "(iVar1,*(undefined4 *)(param_1 + 0x1c))" ( identifier , (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" * (cast_expression "(undefined4 *)(param_1 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) )))) ;) (if_statement "if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" { (expression_statement "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;" (assignment_expression "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c" (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" * (cast_expression "(undefined4 *)(param_1 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = number_literal) ;) }) (else_clause "else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" else (compound_statement "{\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" { (expression_statement "close(iVar3);" (call_expression "close(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;" (assignment_expression "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c" (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" * (cast_expression "(undefined4 *)(param_1 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = number_literal) ;) }))) (expression_statement "cVar2 = FUN_0003b600(iVar1);" (assignment_expression "cVar2 = FUN_0003b600(iVar1)" identifier = (call_expression "FUN_0003b600(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "bVar4 = false;" (assignment_expression "bVar4 = false" identifier = false) ;) (if_statement "if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }" { (expression_statement "iVar3 = FUN_0003b650(iVar1);" (assignment_expression "iVar3 = FUN_0003b650(iVar1)" identifier = (call_expression "FUN_0003b650(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (while_statement "while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }" { (if_statement "if (-1 < iVar3) {\n          close(iVar3);\n        }" if (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) (compound_statement "{\n          close(iVar3);\n        }" { (expression_statement "close(iVar3);" (call_expression "close(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) })) (labeled_statement "LAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);" statement_identifier : (expression_statement "cVar2 = FUN_0003b600(iVar1);" (assignment_expression "cVar2 = FUN_0003b600(iVar1)" identifier = (call_expression "FUN_0003b600(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;)) (if_statement "if (cVar2 != '\0') break;" if (parenthesized_expression "(cVar2 != '\0')" ( (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (break_statement "break;" break ;)) (expression_statement "iVar3 = FUN_0003b650(iVar1);" (assignment_expression "iVar3 = FUN_0003b650(iVar1)" identifier = (call_expression "FUN_0003b650(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) })) })) (return_statement "return bVar4;" return identifier ;) })) (expression_statement "iVar3 = fchdir(*(int *)(param_1 + 0x18));" (assignment_expression "iVar3 = fchdir(*(int *)(param_1 + 0x18))" identifier = (call_expression "fchdir(*(int *)(param_1 + 0x18))" identifier (argument_list "(*(int *)(param_1 + 0x18))" ( (pointer_expression "*(int *)(param_1 + 0x18)" * (cast_expression "(int *)(param_1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) )))) ;) (expression_statement "bVar4 = iVar3 != 0;" (assignment_expression "bVar4 = iVar3 != 0" identifier = (binary_expression "iVar3 != 0" identifier != number_literal)) ;) (goto_statement "goto LAB_00023c50;" goto statement_identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 restore_initial_cwd(FTS *sp)\n\n{\n  I_ring *ir;\n  _Bool _Var1;\n  int iVar2;\n  uint uVar3;\n  \n  ir = &sp->fts_fd_ring;\n  if ((sp->fts_options & 4U) != 0) {\n    uVar3 = 0;\n    goto LAB_00023c50;\n  }\n  if ((sp->fts_options & 0x200U) != 0) {\n    iVar2 = i_ring_push(ir,sp->fts_cwd_fd);\n    if (iVar2 < 0) {\n      sp->fts_cwd_fd = -100;\n    }\n    else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }\n    _Var1 = i_ring_empty(ir);\n    uVar3 = 0;\n    if (!_Var1) {\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }\n    return uVar3;\n  }\n  iVar2 = fchdir(sp->fts_rfd);\n  uVar3 = (uint)(iVar2 != 0);\n  goto LAB_00023c50;\n}\n\n" comment (function_definition "int __regparm3 restore_initial_cwd(FTS *sp)\n\n{\n  I_ring *ir;\n  _Bool _Var1;\n  int iVar2;\n  uint uVar3;\n  \n  ir = &sp->fts_fd_ring;\n  if ((sp->fts_options & 4U) != 0) {\n    uVar3 = 0;\n    goto LAB_00023c50;\n  }\n  if ((sp->fts_options & 0x200U) != 0) {\n    iVar2 = i_ring_push(ir,sp->fts_cwd_fd);\n    if (iVar2 < 0) {\n      sp->fts_cwd_fd = -100;\n    }\n    else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }\n    _Var1 = i_ring_empty(ir);\n    uVar3 = 0;\n    if (!_Var1) {\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }\n    return uVar3;\n  }\n  iVar2 = fchdir(sp->fts_rfd);\n  uVar3 = (uint)(iVar2 != 0);\n  goto LAB_00023c50;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "restore_initial_cwd(FTS *sp)" identifier (parameter_list "(FTS *sp)" ( (parameter_declaration "FTS *sp" type_identifier (pointer_declarator "*sp" * identifier)) ))) (compound_statement "{\n  I_ring *ir;\n  _Bool _Var1;\n  int iVar2;\n  uint uVar3;\n  \n  ir = &sp->fts_fd_ring;\n  if ((sp->fts_options & 4U) != 0) {\n    uVar3 = 0;\n    goto LAB_00023c50;\n  }\n  if ((sp->fts_options & 0x200U) != 0) {\n    iVar2 = i_ring_push(ir,sp->fts_cwd_fd);\n    if (iVar2 < 0) {\n      sp->fts_cwd_fd = -100;\n    }\n    else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }\n    _Var1 = i_ring_empty(ir);\n    uVar3 = 0;\n    if (!_Var1) {\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }\n    return uVar3;\n  }\n  iVar2 = fchdir(sp->fts_rfd);\n  uVar3 = (uint)(iVar2 != 0);\n  goto LAB_00023c50;\n}" { (declaration "I_ring *ir;" type_identifier (pointer_declarator "*ir" * identifier) ;) (declaration "_Bool _Var1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "ir = &sp->fts_fd_ring;" (assignment_expression "ir = &sp->fts_fd_ring" identifier = (pointer_expression "&sp->fts_fd_ring" & (field_expression "sp->fts_fd_ring" identifier -> field_identifier))) ;) (if_statement "if ((sp->fts_options & 4U) != 0) {\n    uVar3 = 0;\n    goto LAB_00023c50;\n  }" if (parenthesized_expression "((sp->fts_options & 4U) != 0)" ( (binary_expression "(sp->fts_options & 4U) != 0" (parenthesized_expression "(sp->fts_options & 4U)" ( (binary_expression "sp->fts_options & 4U" (field_expression "sp->fts_options" identifier -> field_identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n    uVar3 = 0;\n    goto LAB_00023c50;\n  }" { (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (goto_statement "goto LAB_00023c50;" goto statement_identifier ;) })) (if_statement "if ((sp->fts_options & 0x200U) != 0) {\n    iVar2 = i_ring_push(ir,sp->fts_cwd_fd);\n    if (iVar2 < 0) {\n      sp->fts_cwd_fd = -100;\n    }\n    else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }\n    _Var1 = i_ring_empty(ir);\n    uVar3 = 0;\n    if (!_Var1) {\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }\n    return uVar3;\n  }" if (parenthesized_expression "((sp->fts_options & 0x200U) != 0)" ( (binary_expression "(sp->fts_options & 0x200U) != 0" (parenthesized_expression "(sp->fts_options & 0x200U)" ( (binary_expression "sp->fts_options & 0x200U" (field_expression "sp->fts_options" identifier -> field_identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n    iVar2 = i_ring_push(ir,sp->fts_cwd_fd);\n    if (iVar2 < 0) {\n      sp->fts_cwd_fd = -100;\n    }\n    else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }\n    _Var1 = i_ring_empty(ir);\n    uVar3 = 0;\n    if (!_Var1) {\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }\n    return uVar3;\n  }" { (expression_statement "iVar2 = i_ring_push(ir,sp->fts_cwd_fd);" (assignment_expression "iVar2 = i_ring_push(ir,sp->fts_cwd_fd)" identifier = (call_expression "i_ring_push(ir,sp->fts_cwd_fd)" identifier (argument_list "(ir,sp->fts_cwd_fd)" ( identifier , (field_expression "sp->fts_cwd_fd" identifier -> field_identifier) )))) ;) (if_statement "if (iVar2 < 0) {\n      sp->fts_cwd_fd = -100;\n    }\n    else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      sp->fts_cwd_fd = -100;\n    }" { (expression_statement "sp->fts_cwd_fd = -100;" (assignment_expression "sp->fts_cwd_fd = -100" (field_expression "sp->fts_cwd_fd" identifier -> field_identifier) = number_literal) ;) }) (else_clause "else {\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }" else (compound_statement "{\n      close(iVar2);\n      sp->fts_cwd_fd = -100;\n    }" { (expression_statement "close(iVar2);" (call_expression "close(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "sp->fts_cwd_fd = -100;" (assignment_expression "sp->fts_cwd_fd = -100" (field_expression "sp->fts_cwd_fd" identifier -> field_identifier) = number_literal) ;) }))) (expression_statement "_Var1 = i_ring_empty(ir);" (assignment_expression "_Var1 = i_ring_empty(ir)" identifier = (call_expression "i_ring_empty(ir)" identifier (argument_list "(ir)" ( identifier )))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (if_statement "if (!_Var1) {\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }" if (parenthesized_expression "(!_Var1)" ( (unary_expression "!_Var1" ! identifier) )) (compound_statement "{\n      iVar2 = i_ring_pop(ir);\n      while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }\n    }" { (expression_statement "iVar2 = i_ring_pop(ir);" (assignment_expression "iVar2 = i_ring_pop(ir)" identifier = (call_expression "i_ring_pop(ir)" identifier (argument_list "(ir)" ( identifier )))) ;) (while_statement "while( true ) {\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        if (-1 < iVar2) {\n          close(iVar2);\n        }\nLAB_00023c50:\n        _Var1 = i_ring_empty(ir);\n        if (_Var1) break;\n        iVar2 = i_ring_pop(ir);\n      }" { (if_statement "if (-1 < iVar2) {\n          close(iVar2);\n        }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n          close(iVar2);\n        }" { (expression_statement "close(iVar2);" (call_expression "close(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) })) (labeled_statement "LAB_00023c50:\n        _Var1 = i_ring_empty(ir);" statement_identifier : (expression_statement "_Var1 = i_ring_empty(ir);" (assignment_expression "_Var1 = i_ring_empty(ir)" identifier = (call_expression "i_ring_empty(ir)" identifier (argument_list "(ir)" ( identifier )))) ;)) (if_statement "if (_Var1) break;" if (parenthesized_expression "(_Var1)" ( identifier )) (break_statement "break;" break ;)) (expression_statement "iVar2 = i_ring_pop(ir);" (assignment_expression "iVar2 = i_ring_pop(ir)" identifier = (call_expression "i_ring_pop(ir)" identifier (argument_list "(ir)" ( identifier )))) ;) })) })) (return_statement "return uVar3;" return identifier ;) })) (expression_statement "iVar2 = fchdir(sp->fts_rfd);" (assignment_expression "iVar2 = fchdir(sp->fts_rfd)" identifier = (call_expression "fchdir(sp->fts_rfd)" identifier (argument_list "(sp->fts_rfd)" ( (field_expression "sp->fts_rfd" identifier -> field_identifier) )))) ;) (expression_statement "uVar3 = (uint)(iVar2 != 0);" (assignment_expression "uVar3 = (uint)(iVar2 != 0)" identifier = (call_expression "(uint)(iVar2 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )))) ;) (goto_statement "goto LAB_00023c50;" goto statement_identifier ;) })))
(translation_unit "bool __regparm3 FUN_00023bd0(int param_1)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}\n\n" (function_definition "bool __regparm3 FUN_00023bd0(int param_1)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00023bd0(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "bool bVar4;" primitive_type identifier ;) (expression_statement "iVar1 = param_1 + 0x38;" (assignment_expression "iVar1 = param_1 + 0x38" identifier = (binary_expression "param_1 + 0x38" identifier + number_literal)) ;) (if_statement "if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x2c) & 4) != 0)" ( (binary_expression "(*(uint *)(param_1 + 0x2c) & 4) != 0" (parenthesized_expression "(*(uint *)(param_1 + 0x2c) & 4)" ( (binary_expression "*(uint *)(param_1 + 0x2c) & 4" (pointer_expression "*(uint *)(param_1 + 0x2c)" * (cast_expression "(uint *)(param_1 + 0x2c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x2c)" ( (binary_expression "param_1 + 0x2c" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    bVar4 = false;\n    goto LAB_00023c50;\n  }" { (expression_statement "bVar4 = false;" (assignment_expression "bVar4 = false" identifier = false) ;) (goto_statement "goto LAB_00023c50;" goto statement_identifier ;) })) (if_statement "if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x2c) & 0x200) != 0)" ( (binary_expression "(*(uint *)(param_1 + 0x2c) & 0x200) != 0" (parenthesized_expression "(*(uint *)(param_1 + 0x2c) & 0x200)" ( (binary_expression "*(uint *)(param_1 + 0x2c) & 0x200" (pointer_expression "*(uint *)(param_1 + 0x2c)" * (cast_expression "(uint *)(param_1 + 0x2c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x2c)" ( (binary_expression "param_1 + 0x2c" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }" { (expression_statement "iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));" (assignment_expression "iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c))" identifier = (call_expression "FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c))" identifier (argument_list "(iVar1,*(undefined4 *)(param_1 + 0x1c))" ( identifier , (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" * (cast_expression "(undefined4 *)(param_1 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) )))) ;) (if_statement "if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" { (expression_statement "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;" (assignment_expression "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c" (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" * (cast_expression "(undefined4 *)(param_1 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = number_literal) ;) }) (else_clause "else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" else (compound_statement "{\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" { (expression_statement "close(iVar3);" (call_expression "close(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;" (assignment_expression "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c" (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" * (cast_expression "(undefined4 *)(param_1 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = number_literal) ;) }))) (expression_statement "cVar2 = FUN_0003b600(iVar1);" (assignment_expression "cVar2 = FUN_0003b600(iVar1)" identifier = (call_expression "FUN_0003b600(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "bVar4 = false;" (assignment_expression "bVar4 = false" identifier = false) ;) (if_statement "if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }" { (expression_statement "iVar3 = FUN_0003b650(iVar1);" (assignment_expression "iVar3 = FUN_0003b650(iVar1)" identifier = (call_expression "FUN_0003b650(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (while_statement "while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }" { (if_statement "if (-1 < iVar3) {\n          close(iVar3);\n        }" if (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) (compound_statement "{\n          close(iVar3);\n        }" { (expression_statement "close(iVar3);" (call_expression "close(iVar3)" identifier (argument_list "(iVar3)" ( identifier ))) ;) })) (labeled_statement "LAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);" statement_identifier : (expression_statement "cVar2 = FUN_0003b600(iVar1);" (assignment_expression "cVar2 = FUN_0003b600(iVar1)" identifier = (call_expression "FUN_0003b600(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;)) (if_statement "if (cVar2 != '\0') break;" if (parenthesized_expression "(cVar2 != '\0')" ( (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (break_statement "break;" break ;)) (expression_statement "iVar3 = FUN_0003b650(iVar1);" (assignment_expression "iVar3 = FUN_0003b650(iVar1)" identifier = (call_expression "FUN_0003b650(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) })) })) (return_statement "return bVar4;" return identifier ;) })) (expression_statement "iVar3 = fchdir(*(int *)(param_1 + 0x18));" (assignment_expression "iVar3 = fchdir(*(int *)(param_1 + 0x18))" identifier = (call_expression "fchdir(*(int *)(param_1 + 0x18))" identifier (argument_list "(*(int *)(param_1 + 0x18))" ( (pointer_expression "*(int *)(param_1 + 0x18)" * (cast_expression "(int *)(param_1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) )))) ;) (expression_statement "bVar4 = iVar3 != 0;" (assignment_expression "bVar4 = iVar3 != 0" identifier = (binary_expression "iVar3 != 0" identifier != number_literal)) ;) (goto_statement "goto LAB_00023c50;" goto statement_identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = BOOL) ;) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = BOOL) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) })) })) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT != LIT)) ;) (goto_statement goto statement_identifier ;) })))
(function_definition "bool __regparm3 FUN_00023bd0(int param_1)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}" (primitive_type "bool") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00023bd0(int param_1)" (identifier "FUN_00023bd0") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  bool bVar4;\n  \n  iVar1 = param_1 + 0x38;\n  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }\n  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }\n  iVar3 = fchdir(*(int *)(param_1 + 0x18));\n  bVar4 = iVar3 != 0;\n  goto LAB_00023c50;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "char cVar2;" (primitive_type "char") (identifier "cVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "bool bVar4;" (primitive_type "bool") (identifier "bVar4") (; ";")) (expression_statement "iVar1 = param_1 + 0x38;" (assignment_expression "iVar1 = param_1 + 0x38" (identifier "iVar1") (= "=") (binary_expression "param_1 + 0x38" (identifier "param_1") (+ "+") (number_literal "0x38"))) (; ";")) (if_statement "if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {\n    bVar4 = false;\n    goto LAB_00023c50;\n  }" (if "if") (parenthesized_expression "((*(uint *)(param_1 + 0x2c) & 4) != 0)" (( "(") (binary_expression "(*(uint *)(param_1 + 0x2c) & 4) != 0" (parenthesized_expression "(*(uint *)(param_1 + 0x2c) & 4)" (( "(") (binary_expression "*(uint *)(param_1 + 0x2c) & 4" (pointer_expression "*(uint *)(param_1 + 0x2c)" (* "*") (cast_expression "(uint *)(param_1 + 0x2c)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x2c)" (( "(") (binary_expression "param_1 + 0x2c" (identifier "param_1") (+ "+") (number_literal "0x2c")) () ")")))) (& "&") (number_literal "4")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    bVar4 = false;\n    goto LAB_00023c50;\n  }" ({ "{") (expression_statement "bVar4 = false;" (assignment_expression "bVar4 = false" (identifier "bVar4") (= "=") (false "false")) (; ";")) (goto_statement "goto LAB_00023c50;" (goto "goto") (statement_identifier "LAB_00023c50") (; ";")) (} "}"))) (if_statement "if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }" (if "if") (parenthesized_expression "((*(uint *)(param_1 + 0x2c) & 0x200) != 0)" (( "(") (binary_expression "(*(uint *)(param_1 + 0x2c) & 0x200) != 0" (parenthesized_expression "(*(uint *)(param_1 + 0x2c) & 0x200)" (( "(") (binary_expression "*(uint *)(param_1 + 0x2c) & 0x200" (pointer_expression "*(uint *)(param_1 + 0x2c)" (* "*") (cast_expression "(uint *)(param_1 + 0x2c)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x2c)" (( "(") (binary_expression "param_1 + 0x2c" (identifier "param_1") (+ "+") (number_literal "0x2c")) () ")")))) (& "&") (number_literal "0x200")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));\n    if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    cVar2 = FUN_0003b600(iVar1);\n    bVar4 = false;\n    if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }\n    return bVar4;\n  }" ({ "{") (expression_statement "iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));" (assignment_expression "iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c))" (identifier "iVar3") (= "=") (call_expression "FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c))" (identifier "FUN_0003b610") (argument_list "(iVar1,*(undefined4 *)(param_1 + 0x1c))" (( "(") (identifier "iVar1") (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x1c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) () ")")))) (; ";")) (if_statement "if (iVar3 < 0) {\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }\n    else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" (if "if") (parenthesized_expression "(iVar3 < 0)" (( "(") (binary_expression "iVar3 < 0" (identifier "iVar3") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" ({ "{") (expression_statement "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;" (assignment_expression "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c" (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x1c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (= "=") (number_literal "0xffffff9c")) (; ";")) (} "}")) (else_clause "else {\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" (else "else") (compound_statement "{\n      close(iVar3);\n      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;\n    }" ({ "{") (expression_statement "close(iVar3);" (call_expression "close(iVar3)" (identifier "close") (argument_list "(iVar3)" (( "(") (identifier "iVar3") () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;" (assignment_expression "*(undefined4 *)(param_1 + 0x1c) = 0xffffff9c" (pointer_expression "*(undefined4 *)(param_1 + 0x1c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x1c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (= "=") (number_literal "0xffffff9c")) (; ";")) (} "}")))) (expression_statement "cVar2 = FUN_0003b600(iVar1);" (assignment_expression "cVar2 = FUN_0003b600(iVar1)" (identifier "cVar2") (= "=") (call_expression "FUN_0003b600(iVar1)" (identifier "FUN_0003b600") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (expression_statement "bVar4 = false;" (assignment_expression "bVar4 = false" (identifier "bVar4") (= "=") (false "false")) (; ";")) (if_statement "if (cVar2 == '\0') {\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }" (if "if") (parenthesized_expression "(cVar2 == '\0')" (( "(") (binary_expression "cVar2 == '\0'" (identifier "cVar2") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      iVar3 = FUN_0003b650(iVar1);\n      while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }\n    }" ({ "{") (expression_statement "iVar3 = FUN_0003b650(iVar1);" (assignment_expression "iVar3 = FUN_0003b650(iVar1)" (identifier "iVar3") (= "=") (call_expression "FUN_0003b650(iVar1)" (identifier "FUN_0003b650") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (while_statement "while( true ) {\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n        if (-1 < iVar3) {\n          close(iVar3);\n        }\nLAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);\n        if (cVar2 != '\0') break;\n        iVar3 = FUN_0003b650(iVar1);\n      }" ({ "{") (if_statement "if (-1 < iVar3) {\n          close(iVar3);\n        }" (if "if") (parenthesized_expression "(-1 < iVar3)" (( "(") (binary_expression "-1 < iVar3" (number_literal "-1") (< "<") (identifier "iVar3")) () ")")) (compound_statement "{\n          close(iVar3);\n        }" ({ "{") (expression_statement "close(iVar3);" (call_expression "close(iVar3)" (identifier "close") (argument_list "(iVar3)" (( "(") (identifier "iVar3") () ")"))) (; ";")) (} "}"))) (labeled_statement "LAB_00023c50:\n        cVar2 = FUN_0003b600(iVar1);" (statement_identifier "LAB_00023c50") (: ":") (expression_statement "cVar2 = FUN_0003b600(iVar1);" (assignment_expression "cVar2 = FUN_0003b600(iVar1)" (identifier "cVar2") (= "=") (call_expression "FUN_0003b600(iVar1)" (identifier "FUN_0003b600") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";"))) (if_statement "if (cVar2 != '\0') break;" (if "if") (parenthesized_expression "(cVar2 != '\0')" (( "(") (binary_expression "cVar2 != '\0'" (identifier "cVar2") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "iVar3 = FUN_0003b650(iVar1);" (assignment_expression "iVar3 = FUN_0003b650(iVar1)" (identifier "iVar3") (= "=") (call_expression "FUN_0003b650(iVar1)" (identifier "FUN_0003b650") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (} "}"))) (} "}"))) (return_statement "return bVar4;" (return "return") (identifier "bVar4") (; ";")) (} "}"))) (expression_statement "iVar3 = fchdir(*(int *)(param_1 + 0x18));" (assignment_expression "iVar3 = fchdir(*(int *)(param_1 + 0x18))" (identifier "iVar3") (= "=") (call_expression "fchdir(*(int *)(param_1 + 0x18))" (identifier "fchdir") (argument_list "(*(int *)(param_1 + 0x18))" (( "(") (pointer_expression "*(int *)(param_1 + 0x18)" (* "*") (cast_expression "(int *)(param_1 + 0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) () ")")))) (; ";")) (expression_statement "bVar4 = iVar3 != 0;" (assignment_expression "bVar4 = iVar3 != 0" (identifier "bVar4") (= "=") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0"))) (; ";")) (goto_statement "goto LAB_00023c50;" (goto "goto") (statement_identifier "LAB_00023c50") (; ";")) (} "}")))

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

int __regparm3 function_1(type_1 *sp)

{
  type_2 *ir;
  type_3 _Var1;
  int var_2;
  type_4 uVar3;
  
  ir = &sp->fts_fd_ring;
  if ((sp->fts_options & 4U) != 0) {
    uVar3 = 0;
    goto LAB_00023c50;
  }
  if ((sp->fts_options & 0x200U) != 0) {
    var_2 = var_1(ir,sp->fts_cwd_fd);
    if (var_2 < 0) {
      sp->fts_cwd_fd = -100;
    }
    else {
      var_3(var_2);
      sp->fts_cwd_fd = -100;
    }
    _Var1 = var_4(ir);
    uVar3 = 0;
    if (!_Var1) {
      var_2 = var_5(ir);
      while( true ) {
        if (-1 < var_2) {
          var_3(var_2);
        }
LAB_00023c50:
        _Var1 = var_4(ir);
        if (_Var1) break;
        var_2 = var_5(ir);
      }
    }
    return uVar3;
  }
  var_2 = var_6(sp->fts_rfd);
  uVar3 = (type_4)(var_2 != 0);
  goto LAB_00023c50;
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (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))))) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (false))) (goto_statement label: (statement_identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (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))))) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (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))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (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))))) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (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))))) right: (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))))))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (goto_statement label: (statement_identifier)))))

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

bool __regparm3 MASKED(int param_1)

{
  int iVar1;
  char cVar2;
  int iVar3;
  bool bVar4;
  
  iVar1 = param_1 + 0x38;
  if ((*(uint *)(param_1 + 0x2c) & 4) != 0) {
    bVar4 = false;
    goto LAB_00023c50;
  }
  if ((*(uint *)(param_1 + 0x2c) & 0x200) != 0) {
    iVar3 = FUN_0003b610(iVar1,*(undefined4 *)(param_1 + 0x1c));
    if (iVar3 < 0) {
      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;
    }
    else {
      close(iVar3);
      *(undefined4 *)(param_1 + 0x1c) = 0xffffff9c;
    }
    cVar2 = FUN_0003b600(iVar1);
    bVar4 = false;
    if (cVar2 == '\0') {
      iVar3 = FUN_0003b650(iVar1);
      while( true ) {
        if (-1 < iVar3) {
          close(iVar3);
        }
LAB_00023c50:
        cVar2 = FUN_0003b600(iVar1);
        if (cVar2 != '\0') break;
        iVar3 = FUN_0003b650(iVar1);
      }
    }
    return bVar4;
  }
  iVar3 = fchdir(*(int *)(param_1 + 0x18));
  bVar4 = iVar3 != 0;
  goto LAB_00023c50;
}

