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

int fts_close(FTS *sp)

{
  _ftsent *__ptr;
  Hash_table *table;
  int iVar1;
  int *piVar2;
  _ftsent *p_Var3;
  int iVar4;
  
  __ptr = sp->fts_cur;
  if (__ptr != (_ftsent *)0x0) {
    iVar4 = __ptr->fts_level;
    while (-1 < iVar4) {
      p_Var3 = __ptr->fts_link;
      if (p_Var3 == (_ftsent *)0x0) {
        p_Var3 = __ptr->fts_parent;
      }
      free(__ptr);
      __ptr = p_Var3;
      iVar4 = p_Var3->fts_level;
    }
    free(__ptr);
  }
  if (sp->fts_child != (FTSENT *)0x0) {
    fts_lfree(sp->fts_child);
  }
  free(sp->fts_array);
  free(sp->fts_path);
  if ((sp->fts_options & 0x200U) == 0) {
    if ((sp->fts_options & 4U) == 0) {
      iVar4 = fchdir(sp->fts_rfd);
      if (iVar4 == 0) {
        iVar4 = close(sp->fts_rfd);
        if (iVar4 == 0) goto LAB_0001769a;
        piVar2 = __errno_location();
      }
      else {
        piVar2 = __errno_location();
        iVar4 = *piVar2;
        iVar1 = close(sp->fts_rfd);
        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;
      }
      iVar4 = *piVar2;
      goto LAB_0001769c;
    }
  }
  else if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {
    piVar2 = __errno_location();
    iVar4 = *piVar2;
    goto LAB_0001769c;
  }
LAB_0001769a:
  iVar4 = 0;
LAB_0001769c:
  fd_ring_clear(&sp->fts_fd_ring);
  if (sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0) {
    hash_free(sp->fts_leaf_optimization_works_ht);
  }
  table = (sp->fts_cycle).ht;
  if ((sp->fts_options & 0x102U) == 0) {
    free(table);
  }
  else if (table != (Hash_table *)0x0) {
    hash_free(table);
  }
  free(sp);
  if (iVar4 != 0) {
    piVar2 = __errno_location();
    *piVar2 = iVar4;
    iVar4 = -1;
  }
  return iVar4;
}



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

int fts_close(int *param_1)

{
  void *pvVar1;
  int iVar2;
  int *piVar3;
  void *pvVar4;
  int iVar5;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    iVar5 = *(int *)((int)pvVar1 + 0x30);
    while (-1 < iVar5) {
      pvVar4 = *(void **)((int)pvVar1 + 8);
      if (pvVar4 == (void *)0x0) {
        pvVar4 = *(void **)((int)pvVar1 + 4);
      }
      free(pvVar1);
      pvVar1 = pvVar4;
      iVar5 = *(int *)((int)pvVar4 + 0x30);
    }
    free(pvVar1);
  }
  if (param_1[1] != 0) {
    FUN_00015e90();
  }
  free((void *)param_1[2]);
  free((void *)param_1[5]);
  if ((param_1[0xb] & 0x200U) == 0) {
    if ((param_1[0xb] & 4U) == 0) {
      iVar5 = fchdir(param_1[6]);
      if (iVar5 == 0) {
        iVar5 = close(param_1[6]);
        if (iVar5 == 0) goto LAB_0001769a;
        piVar3 = __errno_location();
      }
      else {
        piVar3 = __errno_location();
        iVar5 = *piVar3;
        iVar2 = close(param_1[6]);
        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;
      }
      iVar5 = *piVar3;
      goto LAB_0001769c;
    }
  }
  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {
    piVar3 = __errno_location();
    iVar5 = *piVar3;
    goto LAB_0001769c;
  }
LAB_0001769a:
  iVar5 = 0;
LAB_0001769c:
  FUN_00015ee0();
  if (param_1[0xc] != 0) {
    FUN_00019be0(param_1[0xc]);
  }
  pvVar1 = (void *)param_1[0xd];
  if ((param_1[0xb] & 0x102U) == 0) {
    free(pvVar1);
  }
  else if (pvVar1 != (void *)0x0) {
    FUN_00019be0(pvVar1);
  }
  free(param_1);
  if (iVar5 != 0) {
    piVar3 = __errno_location();
    *piVar3 = iVar5;
    iVar5 = -1;
  }
  return iVar5;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00012300
ADD EBX,0xa9f7
SUB ESP,0xc
MOV EDI,dword ptr [ESP + 0x20]
MOV EAX,dword ptr [EDI]
TEST EAX,EAX
JZ 0x00017664
MOV ECX,dword ptr [EAX + 0x30]
TEST ECX,ECX
JNS 0x0001763d
JMP 0x00017650
SUB ESP,0xc
PUSH EAX
CALL 0x00011430
MOV EDX,dword ptr [ESI + 0x30]
MOV EAX,ESI
ADD ESP,0x10
TEST EDX,EDX
JS 0x00017658
MOV ESI,dword ptr [EAX + 0x8]
TEST ESI,ESI
JNZ 0x00017628
MOV ESI,dword ptr [EAX + 0x4]
JMP 0x00017628
MOV ESI,EAX
LEA ESI,[ESI]
SUB ESP,0xc
PUSH ESI
CALL 0x00011430
ADD ESP,0x10
MOV EAX,dword ptr [EDI + 0x4]
TEST EAX,EAX
JZ 0x00017670
CALL 0x00015e90
SUB ESP,0xc
PUSH dword ptr [EDI + 0x8]
CALL 0x00011430
POP EAX
PUSH dword ptr [EDI + 0x14]
CALL 0x00011430
MOV EAX,dword ptr [EDI + 0x2c]
ADD ESP,0x10
TEST AH,0x2
JZ 0x000176f8
MOV EAX,dword ptr [EDI + 0x1c]
TEST EAX,EAX
JNS 0x00017730
XOR ESI,ESI
LEA EAX,[EDI + 0x38]
CALL 0x00015ee0
MOV EAX,dword ptr [EDI + 0x30]
TEST EAX,EAX
JZ 0x000176b7
SUB ESP,0xc
PUSH EAX
CALL 0x00019be0
ADD ESP,0x10
MOV EAX,dword ptr [EDI + 0x34]
TEST dword ptr [EDI + 0x2c],0x102
JZ 0x00017750
TEST EAX,EAX
JZ 0x000176d7
SUB ESP,0xc
PUSH EAX
CALL 0x00019be0
ADD ESP,0x10
SUB ESP,0xc
PUSH EDI
CALL 0x00011430
ADD ESP,0x10
TEST ESI,ESI
JNZ 0x00017797
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
TEST AL,0x4
JNZ 0x0001769a
SUB ESP,0xc
PUSH dword ptr [EDI + 0x18]
CALL 0x00011320
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00017768
SUB ESP,0xc
PUSH dword ptr [EDI + 0x18]
CALL 0x000113e0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001769a
CALL 0x00011290
MOV EBP,EAX
JMP 0x0001778f
SUB ESP,0xc
PUSH EAX
CALL 0x000113e0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001769a
CALL 0x00011290
MOV ESI,dword ptr [EAX]
JMP 0x0001769c
SUB ESP,0xc
PUSH EAX
CALL 0x00011430
ADD ESP,0x10
JMP 0x000176d7
CALL 0x00011290
SUB ESP,0xc
MOV ESI,dword ptr [EAX]
PUSH dword ptr [EDI + 0x18]
MOV EBP,EAX
CALL 0x000113e0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001769c
TEST ESI,ESI
JNZ 0x0001769c
MOV ESI,dword ptr [EBP]
JMP 0x0001769c
CALL 0x00011290
MOV dword ptr [EAX],ESI
MOV ESI,0xffffffff
JMP 0x000176eb
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint fts_close(int *param_1)\n\n{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}\n\n" comment (function_definition "int fts_close(int *param_1)\n\n{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}" primitive_type (function_declarator "fts_close(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "pvVar1 = (void *)*param_1;" (assignment_expression "pvVar1 = (void *)*param_1" identifier = (cast_expression "(void *)*param_1" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }" { (expression_statement "iVar5 = *(int *)((int)pvVar1 + 0x30);" (assignment_expression "iVar5 = *(int *)((int)pvVar1 + 0x30)" identifier = (pointer_expression "*(int *)((int)pvVar1 + 0x30)" * (cast_expression "(int *)((int)pvVar1 + 0x30)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar1 + 0x30)" ( (binary_expression "(int)pvVar1 + 0x30" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (while_statement "while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }" while (parenthesized_expression "(-1 < iVar5)" ( (binary_expression "-1 < iVar5" number_literal < identifier) )) (compound_statement "{\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }" { (expression_statement "pvVar4 = *(void **)((int)pvVar1 + 8);" (assignment_expression "pvVar4 = *(void **)((int)pvVar1 + 8)" identifier = (pointer_expression "*(void **)((int)pvVar1 + 8)" * (cast_expression "(void **)((int)pvVar1 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)pvVar1 + 8)" ( (binary_expression "(int)pvVar1 + 8" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (if_statement "if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }" if (parenthesized_expression "(pvVar4 == (void *)0x0)" ( (binary_expression "pvVar4 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }" { (expression_statement "pvVar4 = *(void **)((int)pvVar1 + 4);" (assignment_expression "pvVar4 = *(void **)((int)pvVar1 + 4)" identifier = (pointer_expression "*(void **)((int)pvVar1 + 4)" * (cast_expression "(void **)((int)pvVar1 + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)pvVar1 + 4)" ( (binary_expression "(int)pvVar1 + 4" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) })) (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) (expression_statement "pvVar1 = pvVar4;" (assignment_expression "pvVar1 = pvVar4" identifier = identifier) ;) (expression_statement "iVar5 = *(int *)((int)pvVar4 + 0x30);" (assignment_expression "iVar5 = *(int *)((int)pvVar4 + 0x30)" identifier = (pointer_expression "*(int *)((int)pvVar4 + 0x30)" * (cast_expression "(int *)((int)pvVar4 + 0x30)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar4 + 0x30)" ( (binary_expression "(int)pvVar4 + 0x30" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) })) (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) })) (if_statement "if (param_1[1] != 0) {\n    FUN_00015e90();\n  }" if (parenthesized_expression "(param_1[1] != 0)" ( (binary_expression "param_1[1] != 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    FUN_00015e90();\n  }" { (expression_statement "FUN_00015e90();" (call_expression "FUN_00015e90()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "free((void *)param_1[2]);" (call_expression "free((void *)param_1[2])" identifier (argument_list "((void *)param_1[2])" ( (cast_expression "(void *)param_1[2]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) ))) ;) (expression_statement "free((void *)param_1[5]);" (call_expression "free((void *)param_1[5])" identifier (argument_list "((void *)param_1[5])" ( (cast_expression "(void *)param_1[5]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ])) ))) ;) (if_statement "if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" if (parenthesized_expression "((param_1[0xb] & 0x200U) == 0)" ( (binary_expression "(param_1[0xb] & 0x200U) == 0" (parenthesized_expression "(param_1[0xb] & 0x200U)" ( (binary_expression "param_1[0xb] & 0x200U" (subscript_expression "param_1[0xb]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }" { (if_statement "if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }" if (parenthesized_expression "((param_1[0xb] & 4U) == 0)" ( (binary_expression "(param_1[0xb] & 4U) == 0" (parenthesized_expression "(param_1[0xb] & 4U)" ( (binary_expression "param_1[0xb] & 4U" (subscript_expression "param_1[0xb]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }" { (expression_statement "iVar5 = fchdir(param_1[6]);" (assignment_expression "iVar5 = fchdir(param_1[6])" identifier = (call_expression "fchdir(param_1[6])" identifier (argument_list "(param_1[6])" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) )))) ;) (if_statement "if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }" { (expression_statement "iVar5 = close(param_1[6]);" (assignment_expression "iVar5 = close(param_1[6])" identifier = (call_expression "close(param_1[6])" identifier (argument_list "(param_1[6])" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) )))) ;) (if_statement "if (iVar5 == 0) goto LAB_0001769a;" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0001769a;" goto statement_identifier ;)) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" else (compound_statement "{\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = close(param_1[6]);" (assignment_expression "iVar2 = close(param_1[6])" identifier = (call_expression "close(param_1[6])" identifier (argument_list "(param_1[6])" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) )))) ;) (if_statement "if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;" if (parenthesized_expression "((iVar2 == 0) || (iVar5 != 0))" ( (binary_expression "(iVar2 == 0) || (iVar5 != 0)" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) ))) )) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;)) }))) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;) })) }) (else_clause "else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" else (if_statement "if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" if (parenthesized_expression "((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0))" ( (binary_expression "(-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)" (parenthesized_expression "(-1 < param_1[7])" ( (binary_expression "-1 < param_1[7]" number_literal < (subscript_expression "param_1[7]" identifier [ number_literal ])) )) && (parenthesized_expression "(iVar5 = close(param_1[7]), iVar5 != 0)" ( (comma_expression "iVar5 = close(param_1[7]), iVar5 != 0" (assignment_expression "iVar5 = close(param_1[7])" identifier = (call_expression "close(param_1[7])" identifier (argument_list "(param_1[7])" ( (subscript_expression "param_1[7]" identifier [ number_literal ]) )))) , (binary_expression "iVar5 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;) })))) (labeled_statement "LAB_0001769a:\n  iVar5 = 0;" statement_identifier : (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;)) (labeled_statement "LAB_0001769c:\n  FUN_00015ee0();" statement_identifier : (expression_statement "FUN_00015ee0();" (call_expression "FUN_00015ee0()" identifier (argument_list "()" ( ))) ;)) (if_statement "if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }" if (parenthesized_expression "(param_1[0xc] != 0)" ( (binary_expression "param_1[0xc] != 0" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    FUN_00019be0(param_1[0xc]);\n  }" { (expression_statement "FUN_00019be0(param_1[0xc]);" (call_expression "FUN_00019be0(param_1[0xc])" identifier (argument_list "(param_1[0xc])" ( (subscript_expression "param_1[0xc]" identifier [ number_literal ]) ))) ;) })) (expression_statement "pvVar1 = (void *)param_1[0xd];" (assignment_expression "pvVar1 = (void *)param_1[0xd]" identifier = (cast_expression "(void *)param_1[0xd]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[0xd]" identifier [ number_literal ]))) ;) (if_statement "if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" if (parenthesized_expression "((param_1[0xb] & 0x102U) == 0)" ( (binary_expression "(param_1[0xb] & 0x102U) == 0" (parenthesized_expression "(param_1[0xb] & 0x102U)" ( (binary_expression "param_1[0xb] & 0x102U" (subscript_expression "param_1[0xb]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n    free(pvVar1);\n  }" { (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) }) (else_clause "else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" else (if_statement "if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    FUN_00019be0(pvVar1);\n  }" { (expression_statement "FUN_00019be0(pvVar1);" (call_expression "FUN_00019be0(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) })))) (expression_statement "free(param_1);" (call_expression "free(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (if_statement "if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = iVar5;" (assignment_expression "*piVar3 = iVar5" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) })) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint fts_close(FTS *sp)\n\n{\n  _ftsent *__ptr;\n  Hash_table *table;\n  int iVar1;\n  int *piVar2;\n  _ftsent *p_Var3;\n  int iVar4;\n  \n  __ptr = sp->fts_cur;\n  if (__ptr != (_ftsent *)0x0) {\n    iVar4 = __ptr->fts_level;\n    while (-1 < iVar4) {\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }\n    free(__ptr);\n  }\n  if (sp->fts_child != (FTSENT *)0x0) {\n    fts_lfree(sp->fts_child);\n  }\n  free(sp->fts_array);\n  free(sp->fts_path);\n  if ((sp->fts_options & 0x200U) == 0) {\n    if ((sp->fts_options & 4U) == 0) {\n      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar4 = 0;\nLAB_0001769c:\n  fd_ring_clear(&sp->fts_fd_ring);\n  if (sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0) {\n    hash_free(sp->fts_leaf_optimization_works_ht);\n  }\n  table = (sp->fts_cycle).ht;\n  if ((sp->fts_options & 0x102U) == 0) {\n    free(table);\n  }\n  else if (table != (Hash_table *)0x0) {\n    hash_free(table);\n  }\n  free(sp);\n  if (iVar4 != 0) {\n    piVar2 = __errno_location();\n    *piVar2 = iVar4;\n    iVar4 = -1;\n  }\n  return iVar4;\n}\n\n" comment comment (function_definition "int fts_close(FTS *sp)\n\n{\n  _ftsent *__ptr;\n  Hash_table *table;\n  int iVar1;\n  int *piVar2;\n  _ftsent *p_Var3;\n  int iVar4;\n  \n  __ptr = sp->fts_cur;\n  if (__ptr != (_ftsent *)0x0) {\n    iVar4 = __ptr->fts_level;\n    while (-1 < iVar4) {\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }\n    free(__ptr);\n  }\n  if (sp->fts_child != (FTSENT *)0x0) {\n    fts_lfree(sp->fts_child);\n  }\n  free(sp->fts_array);\n  free(sp->fts_path);\n  if ((sp->fts_options & 0x200U) == 0) {\n    if ((sp->fts_options & 4U) == 0) {\n      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar4 = 0;\nLAB_0001769c:\n  fd_ring_clear(&sp->fts_fd_ring);\n  if (sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0) {\n    hash_free(sp->fts_leaf_optimization_works_ht);\n  }\n  table = (sp->fts_cycle).ht;\n  if ((sp->fts_options & 0x102U) == 0) {\n    free(table);\n  }\n  else if (table != (Hash_table *)0x0) {\n    hash_free(table);\n  }\n  free(sp);\n  if (iVar4 != 0) {\n    piVar2 = __errno_location();\n    *piVar2 = iVar4;\n    iVar4 = -1;\n  }\n  return iVar4;\n}" primitive_type (function_declarator "fts_close(FTS *sp)" identifier (parameter_list "(FTS *sp)" ( (parameter_declaration "FTS *sp" type_identifier (pointer_declarator "*sp" * identifier)) ))) (compound_statement "{\n  _ftsent *__ptr;\n  Hash_table *table;\n  int iVar1;\n  int *piVar2;\n  _ftsent *p_Var3;\n  int iVar4;\n  \n  __ptr = sp->fts_cur;\n  if (__ptr != (_ftsent *)0x0) {\n    iVar4 = __ptr->fts_level;\n    while (-1 < iVar4) {\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }\n    free(__ptr);\n  }\n  if (sp->fts_child != (FTSENT *)0x0) {\n    fts_lfree(sp->fts_child);\n  }\n  free(sp->fts_array);\n  free(sp->fts_path);\n  if ((sp->fts_options & 0x200U) == 0) {\n    if ((sp->fts_options & 4U) == 0) {\n      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar4 = 0;\nLAB_0001769c:\n  fd_ring_clear(&sp->fts_fd_ring);\n  if (sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0) {\n    hash_free(sp->fts_leaf_optimization_works_ht);\n  }\n  table = (sp->fts_cycle).ht;\n  if ((sp->fts_options & 0x102U) == 0) {\n    free(table);\n  }\n  else if (table != (Hash_table *)0x0) {\n    hash_free(table);\n  }\n  free(sp);\n  if (iVar4 != 0) {\n    piVar2 = __errno_location();\n    *piVar2 = iVar4;\n    iVar4 = -1;\n  }\n  return iVar4;\n}" { (declaration "_ftsent *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "Hash_table *table;" type_identifier (pointer_declarator "*table" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "_ftsent *p_Var3;" type_identifier (pointer_declarator "*p_Var3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "__ptr = sp->fts_cur;" (assignment_expression "__ptr = sp->fts_cur" identifier = (field_expression "sp->fts_cur" identifier -> field_identifier)) ;) (if_statement "if (__ptr != (_ftsent *)0x0) {\n    iVar4 = __ptr->fts_level;\n    while (-1 < iVar4) {\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }\n    free(__ptr);\n  }" if (parenthesized_expression "(__ptr != (_ftsent *)0x0)" ( (binary_expression "__ptr != (_ftsent *)0x0" identifier != (cast_expression "(_ftsent *)0x0" ( (type_descriptor "_ftsent *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar4 = __ptr->fts_level;\n    while (-1 < iVar4) {\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }\n    free(__ptr);\n  }" { (expression_statement "iVar4 = __ptr->fts_level;" (assignment_expression "iVar4 = __ptr->fts_level" identifier = (field_expression "__ptr->fts_level" identifier -> field_identifier)) ;) (while_statement "while (-1 < iVar4) {\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }" while (parenthesized_expression "(-1 < iVar4)" ( (binary_expression "-1 < iVar4" number_literal < identifier) )) (compound_statement "{\n      p_Var3 = __ptr->fts_link;\n      if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }\n      free(__ptr);\n      __ptr = p_Var3;\n      iVar4 = p_Var3->fts_level;\n    }" { (expression_statement "p_Var3 = __ptr->fts_link;" (assignment_expression "p_Var3 = __ptr->fts_link" identifier = (field_expression "__ptr->fts_link" identifier -> field_identifier)) ;) (if_statement "if (p_Var3 == (_ftsent *)0x0) {\n        p_Var3 = __ptr->fts_parent;\n      }" if (parenthesized_expression "(p_Var3 == (_ftsent *)0x0)" ( (binary_expression "p_Var3 == (_ftsent *)0x0" identifier == (cast_expression "(_ftsent *)0x0" ( (type_descriptor "_ftsent *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        p_Var3 = __ptr->fts_parent;\n      }" { (expression_statement "p_Var3 = __ptr->fts_parent;" (assignment_expression "p_Var3 = __ptr->fts_parent" identifier = (field_expression "__ptr->fts_parent" identifier -> field_identifier)) ;) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "__ptr = p_Var3;" (assignment_expression "__ptr = p_Var3" identifier = identifier) ;) (expression_statement "iVar4 = p_Var3->fts_level;" (assignment_expression "iVar4 = p_Var3->fts_level" identifier = (field_expression "p_Var3->fts_level" identifier -> field_identifier)) ;) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (if_statement "if (sp->fts_child != (FTSENT *)0x0) {\n    fts_lfree(sp->fts_child);\n  }" if (parenthesized_expression "(sp->fts_child != (FTSENT *)0x0)" ( (binary_expression "sp->fts_child != (FTSENT *)0x0" (field_expression "sp->fts_child" identifier -> field_identifier) != (cast_expression "(FTSENT *)0x0" ( (type_descriptor "FTSENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    fts_lfree(sp->fts_child);\n  }" { (expression_statement "fts_lfree(sp->fts_child);" (call_expression "fts_lfree(sp->fts_child)" identifier (argument_list "(sp->fts_child)" ( (field_expression "sp->fts_child" identifier -> field_identifier) ))) ;) })) (expression_statement "free(sp->fts_array);" (call_expression "free(sp->fts_array)" identifier (argument_list "(sp->fts_array)" ( (field_expression "sp->fts_array" identifier -> field_identifier) ))) ;) (expression_statement "free(sp->fts_path);" (call_expression "free(sp->fts_path)" identifier (argument_list "(sp->fts_path)" ( (field_expression "sp->fts_path" identifier -> field_identifier) ))) ;) (if_statement "if ((sp->fts_options & 0x200U) == 0) {\n    if ((sp->fts_options & 4U) == 0) {\n      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\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    if ((sp->fts_options & 4U) == 0) {\n      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\n    }\n  }" { (if_statement "if ((sp->fts_options & 4U) == 0) {\n      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\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      iVar4 = fchdir(sp->fts_rfd);\n      if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }\n      iVar4 = *piVar2;\n      goto LAB_0001769c;\n    }" { (expression_statement "iVar4 = fchdir(sp->fts_rfd);" (assignment_expression "iVar4 = 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) )))) ;) (if_statement "if (iVar4 == 0) {\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }\n      else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar4 = close(sp->fts_rfd);\n        if (iVar4 == 0) goto LAB_0001769a;\n        piVar2 = __errno_location();\n      }" { (expression_statement "iVar4 = close(sp->fts_rfd);" (assignment_expression "iVar4 = close(sp->fts_rfd)" identifier = (call_expression "close(sp->fts_rfd)" identifier (argument_list "(sp->fts_rfd)" ( (field_expression "sp->fts_rfd" identifier -> field_identifier) )))) ;) (if_statement "if (iVar4 == 0) goto LAB_0001769a;" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0001769a;" goto statement_identifier ;)) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }" else (compound_statement "{\n        piVar2 = __errno_location();\n        iVar4 = *piVar2;\n        iVar1 = close(sp->fts_rfd);\n        if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "iVar1 = close(sp->fts_rfd);" (assignment_expression "iVar1 = close(sp->fts_rfd)" identifier = (call_expression "close(sp->fts_rfd)" identifier (argument_list "(sp->fts_rfd)" ( (field_expression "sp->fts_rfd" identifier -> field_identifier) )))) ;) (if_statement "if ((iVar1 == 0) || (iVar4 != 0)) goto LAB_0001769c;" if (parenthesized_expression "((iVar1 == 0) || (iVar4 != 0))" ( (binary_expression "(iVar1 == 0) || (iVar4 != 0)" (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) ))) )) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;)) }))) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;) })) }) (else_clause "else if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\n  }" else (if_statement "if ((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)) {\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\n  }" if (parenthesized_expression "((-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0))" ( (binary_expression "(-1 < sp->fts_cwd_fd) && (iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)" (parenthesized_expression "(-1 < sp->fts_cwd_fd)" ( (binary_expression "-1 < sp->fts_cwd_fd" number_literal < (field_expression "sp->fts_cwd_fd" identifier -> field_identifier)) )) && (parenthesized_expression "(iVar4 = close(sp->fts_cwd_fd), iVar4 != 0)" ( (comma_expression "iVar4 = close(sp->fts_cwd_fd), iVar4 != 0" (assignment_expression "iVar4 = close(sp->fts_cwd_fd)" identifier = (call_expression "close(sp->fts_cwd_fd)" identifier (argument_list "(sp->fts_cwd_fd)" ( (field_expression "sp->fts_cwd_fd" identifier -> field_identifier) )))) , (binary_expression "iVar4 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    piVar2 = __errno_location();\n    iVar4 = *piVar2;\n    goto LAB_0001769c;\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;) })))) (labeled_statement "LAB_0001769a:\n  iVar4 = 0;" statement_identifier : (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;)) (labeled_statement "LAB_0001769c:\n  fd_ring_clear(&sp->fts_fd_ring);" statement_identifier : (expression_statement "fd_ring_clear(&sp->fts_fd_ring);" (call_expression "fd_ring_clear(&sp->fts_fd_ring)" identifier (argument_list "(&sp->fts_fd_ring)" ( (pointer_expression "&sp->fts_fd_ring" & (field_expression "sp->fts_fd_ring" identifier -> field_identifier)) ))) ;)) (if_statement "if (sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0) {\n    hash_free(sp->fts_leaf_optimization_works_ht);\n  }" if (parenthesized_expression "(sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0)" ( (binary_expression "sp->fts_leaf_optimization_works_ht != (Hash_table *)0x0" (field_expression "sp->fts_leaf_optimization_works_ht" identifier -> field_identifier) != (cast_expression "(Hash_table *)0x0" ( (type_descriptor "Hash_table *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    hash_free(sp->fts_leaf_optimization_works_ht);\n  }" { (expression_statement "hash_free(sp->fts_leaf_optimization_works_ht);" (call_expression "hash_free(sp->fts_leaf_optimization_works_ht)" identifier (argument_list "(sp->fts_leaf_optimization_works_ht)" ( (field_expression "sp->fts_leaf_optimization_works_ht" identifier -> field_identifier) ))) ;) })) (expression_statement "table = (sp->fts_cycle).ht;" (assignment_expression "table = (sp->fts_cycle).ht" identifier = (field_expression "(sp->fts_cycle).ht" (parenthesized_expression "(sp->fts_cycle)" ( (field_expression "sp->fts_cycle" identifier -> field_identifier) )) . field_identifier)) ;) (if_statement "if ((sp->fts_options & 0x102U) == 0) {\n    free(table);\n  }\n  else if (table != (Hash_table *)0x0) {\n    hash_free(table);\n  }" if (parenthesized_expression "((sp->fts_options & 0x102U) == 0)" ( (binary_expression "(sp->fts_options & 0x102U) == 0" (parenthesized_expression "(sp->fts_options & 0x102U)" ( (binary_expression "sp->fts_options & 0x102U" (field_expression "sp->fts_options" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\n    free(table);\n  }" { (expression_statement "free(table);" (call_expression "free(table)" identifier (argument_list "(table)" ( identifier ))) ;) }) (else_clause "else if (table != (Hash_table *)0x0) {\n    hash_free(table);\n  }" else (if_statement "if (table != (Hash_table *)0x0) {\n    hash_free(table);\n  }" if (parenthesized_expression "(table != (Hash_table *)0x0)" ( (binary_expression "table != (Hash_table *)0x0" identifier != (cast_expression "(Hash_table *)0x0" ( (type_descriptor "Hash_table *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    hash_free(table);\n  }" { (expression_statement "hash_free(table);" (call_expression "hash_free(table)" identifier (argument_list "(table)" ( identifier ))) ;) })))) (expression_statement "free(sp);" (call_expression "free(sp)" identifier (argument_list "(sp)" ( identifier ))) ;) (if_statement "if (iVar4 != 0) {\n    piVar2 = __errno_location();\n    *piVar2 = iVar4;\n    iVar4 = -1;\n  }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar2 = __errno_location();\n    *piVar2 = iVar4;\n    iVar4 = -1;\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = iVar4;" (assignment_expression "*piVar2 = iVar4" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) })) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit "int fts_close(int *param_1)\n\n{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}\n\n" (function_definition "int fts_close(int *param_1)\n\n{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}" primitive_type (function_declarator "fts_close(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "pvVar1 = (void *)*param_1;" (assignment_expression "pvVar1 = (void *)*param_1" identifier = (cast_expression "(void *)*param_1" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }" { (expression_statement "iVar5 = *(int *)((int)pvVar1 + 0x30);" (assignment_expression "iVar5 = *(int *)((int)pvVar1 + 0x30)" identifier = (pointer_expression "*(int *)((int)pvVar1 + 0x30)" * (cast_expression "(int *)((int)pvVar1 + 0x30)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar1 + 0x30)" ( (binary_expression "(int)pvVar1 + 0x30" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (while_statement "while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }" while (parenthesized_expression "(-1 < iVar5)" ( (binary_expression "-1 < iVar5" number_literal < identifier) )) (compound_statement "{\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }" { (expression_statement "pvVar4 = *(void **)((int)pvVar1 + 8);" (assignment_expression "pvVar4 = *(void **)((int)pvVar1 + 8)" identifier = (pointer_expression "*(void **)((int)pvVar1 + 8)" * (cast_expression "(void **)((int)pvVar1 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)pvVar1 + 8)" ( (binary_expression "(int)pvVar1 + 8" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (if_statement "if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }" if (parenthesized_expression "(pvVar4 == (void *)0x0)" ( (binary_expression "pvVar4 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }" { (expression_statement "pvVar4 = *(void **)((int)pvVar1 + 4);" (assignment_expression "pvVar4 = *(void **)((int)pvVar1 + 4)" identifier = (pointer_expression "*(void **)((int)pvVar1 + 4)" * (cast_expression "(void **)((int)pvVar1 + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)pvVar1 + 4)" ( (binary_expression "(int)pvVar1 + 4" (cast_expression "(int)pvVar1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) })) (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) (expression_statement "pvVar1 = pvVar4;" (assignment_expression "pvVar1 = pvVar4" identifier = identifier) ;) (expression_statement "iVar5 = *(int *)((int)pvVar4 + 0x30);" (assignment_expression "iVar5 = *(int *)((int)pvVar4 + 0x30)" identifier = (pointer_expression "*(int *)((int)pvVar4 + 0x30)" * (cast_expression "(int *)((int)pvVar4 + 0x30)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar4 + 0x30)" ( (binary_expression "(int)pvVar4 + 0x30" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) })) (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) })) (if_statement "if (param_1[1] != 0) {\n    FUN_00015e90();\n  }" if (parenthesized_expression "(param_1[1] != 0)" ( (binary_expression "param_1[1] != 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    FUN_00015e90();\n  }" { (expression_statement "FUN_00015e90();" (call_expression "FUN_00015e90()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "free((void *)param_1[2]);" (call_expression "free((void *)param_1[2])" identifier (argument_list "((void *)param_1[2])" ( (cast_expression "(void *)param_1[2]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) ))) ;) (expression_statement "free((void *)param_1[5]);" (call_expression "free((void *)param_1[5])" identifier (argument_list "((void *)param_1[5])" ( (cast_expression "(void *)param_1[5]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ])) ))) ;) (if_statement "if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" if (parenthesized_expression "((param_1[0xb] & 0x200U) == 0)" ( (binary_expression "(param_1[0xb] & 0x200U) == 0" (parenthesized_expression "(param_1[0xb] & 0x200U)" ( (binary_expression "param_1[0xb] & 0x200U" (subscript_expression "param_1[0xb]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }" { (if_statement "if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }" if (parenthesized_expression "((param_1[0xb] & 4U) == 0)" ( (binary_expression "(param_1[0xb] & 4U) == 0" (parenthesized_expression "(param_1[0xb] & 4U)" ( (binary_expression "param_1[0xb] & 4U" (subscript_expression "param_1[0xb]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }" { (expression_statement "iVar5 = fchdir(param_1[6]);" (assignment_expression "iVar5 = fchdir(param_1[6])" identifier = (call_expression "fchdir(param_1[6])" identifier (argument_list "(param_1[6])" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) )))) ;) (if_statement "if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }" { (expression_statement "iVar5 = close(param_1[6]);" (assignment_expression "iVar5 = close(param_1[6])" identifier = (call_expression "close(param_1[6])" identifier (argument_list "(param_1[6])" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) )))) ;) (if_statement "if (iVar5 == 0) goto LAB_0001769a;" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0001769a;" goto statement_identifier ;)) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" else (compound_statement "{\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iVar2 = close(param_1[6]);" (assignment_expression "iVar2 = close(param_1[6])" identifier = (call_expression "close(param_1[6])" identifier (argument_list "(param_1[6])" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) )))) ;) (if_statement "if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;" if (parenthesized_expression "((iVar2 == 0) || (iVar5 != 0))" ( (binary_expression "(iVar2 == 0) || (iVar5 != 0)" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) ))) )) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;)) }))) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;) })) }) (else_clause "else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" else (if_statement "if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" if (parenthesized_expression "((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0))" ( (binary_expression "(-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)" (parenthesized_expression "(-1 < param_1[7])" ( (binary_expression "-1 < param_1[7]" number_literal < (subscript_expression "param_1[7]" identifier [ number_literal ])) )) && (parenthesized_expression "(iVar5 = close(param_1[7]), iVar5 != 0)" ( (comma_expression "iVar5 = close(param_1[7]), iVar5 != 0" (assignment_expression "iVar5 = close(param_1[7])" identifier = (call_expression "close(param_1[7])" identifier (argument_list "(param_1[7])" ( (subscript_expression "param_1[7]" identifier [ number_literal ]) )))) , (binary_expression "iVar5 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (goto_statement "goto LAB_0001769c;" goto statement_identifier ;) })))) (labeled_statement "LAB_0001769a:\n  iVar5 = 0;" statement_identifier : (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;)) (labeled_statement "LAB_0001769c:\n  FUN_00015ee0();" statement_identifier : (expression_statement "FUN_00015ee0();" (call_expression "FUN_00015ee0()" identifier (argument_list "()" ( ))) ;)) (if_statement "if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }" if (parenthesized_expression "(param_1[0xc] != 0)" ( (binary_expression "param_1[0xc] != 0" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    FUN_00019be0(param_1[0xc]);\n  }" { (expression_statement "FUN_00019be0(param_1[0xc]);" (call_expression "FUN_00019be0(param_1[0xc])" identifier (argument_list "(param_1[0xc])" ( (subscript_expression "param_1[0xc]" identifier [ number_literal ]) ))) ;) })) (expression_statement "pvVar1 = (void *)param_1[0xd];" (assignment_expression "pvVar1 = (void *)param_1[0xd]" identifier = (cast_expression "(void *)param_1[0xd]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[0xd]" identifier [ number_literal ]))) ;) (if_statement "if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" if (parenthesized_expression "((param_1[0xb] & 0x102U) == 0)" ( (binary_expression "(param_1[0xb] & 0x102U) == 0" (parenthesized_expression "(param_1[0xb] & 0x102U)" ( (binary_expression "param_1[0xb] & 0x102U" (subscript_expression "param_1[0xb]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n    free(pvVar1);\n  }" { (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) }) (else_clause "else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" else (if_statement "if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" if (parenthesized_expression "(pvVar1 != (void *)0x0)" ( (binary_expression "pvVar1 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    FUN_00019be0(pvVar1);\n  }" { (expression_statement "FUN_00019be0(pvVar1);" (call_expression "FUN_00019be0(pvVar1)" identifier (argument_list "(pvVar1)" ( identifier ))) ;) })))) (expression_statement "free(param_1);" (call_expression "free(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (if_statement "if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = iVar5;" (assignment_expression "*piVar3 = iVar5" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) })) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) ))))) ;) (while_statement while (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) ))))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) ))))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) ))) ;) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) & LIT) )) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (goto_statement goto statement_identifier ;)) }))) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (goto_statement goto statement_identifier ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < (subscript_expression IDENT [ LIT ])) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) )))) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (goto_statement goto statement_identifier ;) })))) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = LIT) ;)) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( ))) ;)) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) ))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) & LIT) )) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })))) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (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 (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) (return_statement return IDENT ;) })))
(function_definition "int fts_close(int *param_1)\n\n{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}" (primitive_type "int") (function_declarator "fts_close(int *param_1)" (identifier "fts_close") (parameter_list "(int *param_1)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  void *pvVar1;\n  int iVar2;\n  int *piVar3;\n  void *pvVar4;\n  int iVar5;\n  \n  pvVar1 = (void *)*param_1;\n  if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }\n  if (param_1[1] != 0) {\n    FUN_00015e90();\n  }\n  free((void *)param_1[2]);\n  free((void *)param_1[5]);\n  if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }\nLAB_0001769a:\n  iVar5 = 0;\nLAB_0001769c:\n  FUN_00015ee0();\n  if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }\n  pvVar1 = (void *)param_1[0xd];\n  if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }\n  free(param_1);\n  if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }\n  return iVar5;\n}" ({ "{") (declaration "void *pvVar1;" (primitive_type "void") (pointer_declarator "*pvVar1" (* "*") (identifier "pvVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "void *pvVar4;" (primitive_type "void") (pointer_declarator "*pvVar4" (* "*") (identifier "pvVar4")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (expression_statement "pvVar1 = (void *)*param_1;" (assignment_expression "pvVar1 = (void *)*param_1" (identifier "pvVar1") (= "=") (cast_expression "(void *)*param_1" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if (pvVar1 != (void *)0x0) {\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }" (if "if") (parenthesized_expression "(pvVar1 != (void *)0x0)" (( "(") (binary_expression "pvVar1 != (void *)0x0" (identifier "pvVar1") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar5 = *(int *)((int)pvVar1 + 0x30);\n    while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }\n    free(pvVar1);\n  }" ({ "{") (expression_statement "iVar5 = *(int *)((int)pvVar1 + 0x30);" (assignment_expression "iVar5 = *(int *)((int)pvVar1 + 0x30)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)((int)pvVar1 + 0x30)" (* "*") (cast_expression "(int *)((int)pvVar1 + 0x30)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)pvVar1 + 0x30)" (( "(") (binary_expression "(int)pvVar1 + 0x30" (cast_expression "(int)pvVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar1")) (+ "+") (number_literal "0x30")) () ")"))))) (; ";")) (while_statement "while (-1 < iVar5) {\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }" (while "while") (parenthesized_expression "(-1 < iVar5)" (( "(") (binary_expression "-1 < iVar5" (number_literal "-1") (< "<") (identifier "iVar5")) () ")")) (compound_statement "{\n      pvVar4 = *(void **)((int)pvVar1 + 8);\n      if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }\n      free(pvVar1);\n      pvVar1 = pvVar4;\n      iVar5 = *(int *)((int)pvVar4 + 0x30);\n    }" ({ "{") (expression_statement "pvVar4 = *(void **)((int)pvVar1 + 8);" (assignment_expression "pvVar4 = *(void **)((int)pvVar1 + 8)" (identifier "pvVar4") (= "=") (pointer_expression "*(void **)((int)pvVar1 + 8)" (* "*") (cast_expression "(void **)((int)pvVar1 + 8)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)pvVar1 + 8)" (( "(") (binary_expression "(int)pvVar1 + 8" (cast_expression "(int)pvVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar1")) (+ "+") (number_literal "8")) () ")"))))) (; ";")) (if_statement "if (pvVar4 == (void *)0x0) {\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }" (if "if") (parenthesized_expression "(pvVar4 == (void *)0x0)" (( "(") (binary_expression "pvVar4 == (void *)0x0" (identifier "pvVar4") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        pvVar4 = *(void **)((int)pvVar1 + 4);\n      }" ({ "{") (expression_statement "pvVar4 = *(void **)((int)pvVar1 + 4);" (assignment_expression "pvVar4 = *(void **)((int)pvVar1 + 4)" (identifier "pvVar4") (= "=") (pointer_expression "*(void **)((int)pvVar1 + 4)" (* "*") (cast_expression "(void **)((int)pvVar1 + 4)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)pvVar1 + 4)" (( "(") (binary_expression "(int)pvVar1 + 4" (cast_expression "(int)pvVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar1")) (+ "+") (number_literal "4")) () ")"))))) (; ";")) (} "}"))) (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" (identifier "free") (argument_list "(pvVar1)" (( "(") (identifier "pvVar1") () ")"))) (; ";")) (expression_statement "pvVar1 = pvVar4;" (assignment_expression "pvVar1 = pvVar4" (identifier "pvVar1") (= "=") (identifier "pvVar4")) (; ";")) (expression_statement "iVar5 = *(int *)((int)pvVar4 + 0x30);" (assignment_expression "iVar5 = *(int *)((int)pvVar4 + 0x30)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)((int)pvVar4 + 0x30)" (* "*") (cast_expression "(int *)((int)pvVar4 + 0x30)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)pvVar4 + 0x30)" (( "(") (binary_expression "(int)pvVar4 + 0x30" (cast_expression "(int)pvVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar4")) (+ "+") (number_literal "0x30")) () ")"))))) (; ";")) (} "}"))) (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" (identifier "free") (argument_list "(pvVar1)" (( "(") (identifier "pvVar1") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_1[1] != 0) {\n    FUN_00015e90();\n  }" (if "if") (parenthesized_expression "(param_1[1] != 0)" (( "(") (binary_expression "param_1[1] != 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_00015e90();\n  }" ({ "{") (expression_statement "FUN_00015e90();" (call_expression "FUN_00015e90()" (identifier "FUN_00015e90") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "free((void *)param_1[2]);" (call_expression "free((void *)param_1[2])" (identifier "free") (argument_list "((void *)param_1[2])" (( "(") (cast_expression "(void *)param_1[2]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) () ")"))) (; ";")) (expression_statement "free((void *)param_1[5]);" (call_expression "free((void *)param_1[5])" (identifier "free") (argument_list "((void *)param_1[5])" (( "(") (cast_expression "(void *)param_1[5]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]"))) () ")"))) (; ";")) (if_statement "if ((param_1[0xb] & 0x200U) == 0) {\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }\n  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" (if "if") (parenthesized_expression "((param_1[0xb] & 0x200U) == 0)" (( "(") (binary_expression "(param_1[0xb] & 0x200U) == 0" (parenthesized_expression "(param_1[0xb] & 0x200U)" (( "(") (binary_expression "param_1[0xb] & 0x200U" (subscript_expression "param_1[0xb]" (identifier "param_1") ([ "[") (number_literal "0xb") (] "]")) (& "&") (number_literal "0x200U")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }\n  }" ({ "{") (if_statement "if ((param_1[0xb] & 4U) == 0) {\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }" (if "if") (parenthesized_expression "((param_1[0xb] & 4U) == 0)" (( "(") (binary_expression "(param_1[0xb] & 4U) == 0" (parenthesized_expression "(param_1[0xb] & 4U)" (( "(") (binary_expression "param_1[0xb] & 4U" (subscript_expression "param_1[0xb]" (identifier "param_1") ([ "[") (number_literal "0xb") (] "]")) (& "&") (number_literal "4U")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar5 = fchdir(param_1[6]);\n      if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }\n      iVar5 = *piVar3;\n      goto LAB_0001769c;\n    }" ({ "{") (expression_statement "iVar5 = fchdir(param_1[6]);" (assignment_expression "iVar5 = fchdir(param_1[6])" (identifier "iVar5") (= "=") (call_expression "fchdir(param_1[6])" (identifier "fchdir") (argument_list "(param_1[6])" (( "(") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) () ")")))) (; ";")) (if_statement "if (iVar5 == 0) {\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }\n      else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" (if "if") (parenthesized_expression "(iVar5 == 0)" (( "(") (binary_expression "iVar5 == 0" (identifier "iVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar5 = close(param_1[6]);\n        if (iVar5 == 0) goto LAB_0001769a;\n        piVar3 = __errno_location();\n      }" ({ "{") (expression_statement "iVar5 = close(param_1[6]);" (assignment_expression "iVar5 = close(param_1[6])" (identifier "iVar5") (= "=") (call_expression "close(param_1[6])" (identifier "close") (argument_list "(param_1[6])" (( "(") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) () ")")))) (; ";")) (if_statement "if (iVar5 == 0) goto LAB_0001769a;" (if "if") (parenthesized_expression "(iVar5 == 0)" (( "(") (binary_expression "iVar5 == 0" (identifier "iVar5") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0001769a;" (goto "goto") (statement_identifier "LAB_0001769a") (; ";"))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")) (else_clause "else {\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" (else "else") (compound_statement "{\n        piVar3 = __errno_location();\n        iVar5 = *piVar3;\n        iVar2 = close(param_1[6]);\n        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;\n      }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" (identifier "iVar5") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "iVar2 = close(param_1[6]);" (assignment_expression "iVar2 = close(param_1[6])" (identifier "iVar2") (= "=") (call_expression "close(param_1[6])" (identifier "close") (argument_list "(param_1[6])" (( "(") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) () ")")))) (; ";")) (if_statement "if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;" (if "if") (parenthesized_expression "((iVar2 == 0) || (iVar5 != 0))" (( "(") (binary_expression "(iVar2 == 0) || (iVar5 != 0)" (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar5 != 0)" (( "(") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0")) () ")"))) () ")")) (goto_statement "goto LAB_0001769c;" (goto "goto") (statement_identifier "LAB_0001769c") (; ";"))) (} "}")))) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" (identifier "iVar5") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (goto_statement "goto LAB_0001769c;" (goto "goto") (statement_identifier "LAB_0001769c") (; ";")) (} "}"))) (} "}")) (else_clause "else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" (else "else") (if_statement "if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" (if "if") (parenthesized_expression "((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0))" (( "(") (binary_expression "(-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)" (parenthesized_expression "(-1 < param_1[7])" (( "(") (binary_expression "-1 < param_1[7]" (number_literal "-1") (< "<") (subscript_expression "param_1[7]" (identifier "param_1") ([ "[") (number_literal "7") (] "]"))) () ")")) (&& "&&") (parenthesized_expression "(iVar5 = close(param_1[7]), iVar5 != 0)" (( "(") (comma_expression "iVar5 = close(param_1[7]), iVar5 != 0" (assignment_expression "iVar5 = close(param_1[7])" (identifier "iVar5") (= "=") (call_expression "close(param_1[7])" (identifier "close") (argument_list "(param_1[7])" (( "(") (subscript_expression "param_1[7]" (identifier "param_1") ([ "[") (number_literal "7") (] "]")) () ")")))) (, ",") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    piVar3 = __errno_location();\n    iVar5 = *piVar3;\n    goto LAB_0001769c;\n  }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar5 = *piVar3;" (assignment_expression "iVar5 = *piVar3" (identifier "iVar5") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (goto_statement "goto LAB_0001769c;" (goto "goto") (statement_identifier "LAB_0001769c") (; ";")) (} "}"))))) (labeled_statement "LAB_0001769a:\n  iVar5 = 0;" (statement_identifier "LAB_0001769a") (: ":") (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" (identifier "iVar5") (= "=") (number_literal "0")) (; ";"))) (labeled_statement "LAB_0001769c:\n  FUN_00015ee0();" (statement_identifier "LAB_0001769c") (: ":") (expression_statement "FUN_00015ee0();" (call_expression "FUN_00015ee0()" (identifier "FUN_00015ee0") (argument_list "()" (( "(") () ")"))) (; ";"))) (if_statement "if (param_1[0xc] != 0) {\n    FUN_00019be0(param_1[0xc]);\n  }" (if "if") (parenthesized_expression "(param_1[0xc] != 0)" (( "(") (binary_expression "param_1[0xc] != 0" (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_00019be0(param_1[0xc]);\n  }" ({ "{") (expression_statement "FUN_00019be0(param_1[0xc]);" (call_expression "FUN_00019be0(param_1[0xc])" (identifier "FUN_00019be0") (argument_list "(param_1[0xc])" (( "(") (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) () ")"))) (; ";")) (} "}"))) (expression_statement "pvVar1 = (void *)param_1[0xd];" (assignment_expression "pvVar1 = (void *)param_1[0xd]" (identifier "pvVar1") (= "=") (cast_expression "(void *)param_1[0xd]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[0xd]" (identifier "param_1") ([ "[") (number_literal "0xd") (] "]")))) (; ";")) (if_statement "if ((param_1[0xb] & 0x102U) == 0) {\n    free(pvVar1);\n  }\n  else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" (if "if") (parenthesized_expression "((param_1[0xb] & 0x102U) == 0)" (( "(") (binary_expression "(param_1[0xb] & 0x102U) == 0" (parenthesized_expression "(param_1[0xb] & 0x102U)" (( "(") (binary_expression "param_1[0xb] & 0x102U" (subscript_expression "param_1[0xb]" (identifier "param_1") ([ "[") (number_literal "0xb") (] "]")) (& "&") (number_literal "0x102U")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    free(pvVar1);\n  }" ({ "{") (expression_statement "free(pvVar1);" (call_expression "free(pvVar1)" (identifier "free") (argument_list "(pvVar1)" (( "(") (identifier "pvVar1") () ")"))) (; ";")) (} "}")) (else_clause "else if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" (else "else") (if_statement "if (pvVar1 != (void *)0x0) {\n    FUN_00019be0(pvVar1);\n  }" (if "if") (parenthesized_expression "(pvVar1 != (void *)0x0)" (( "(") (binary_expression "pvVar1 != (void *)0x0" (identifier "pvVar1") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    FUN_00019be0(pvVar1);\n  }" ({ "{") (expression_statement "FUN_00019be0(pvVar1);" (call_expression "FUN_00019be0(pvVar1)" (identifier "FUN_00019be0") (argument_list "(pvVar1)" (( "(") (identifier "pvVar1") () ")"))) (; ";")) (} "}"))))) (expression_statement "free(param_1);" (call_expression "free(param_1)" (identifier "free") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (if_statement "if (iVar5 != 0) {\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }" (if "if") (parenthesized_expression "(iVar5 != 0)" (( "(") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    piVar3 = __errno_location();\n    *piVar3 = iVar5;\n    iVar5 = -1;\n  }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*piVar3 = iVar5;" (assignment_expression "*piVar3 = iVar5" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar5")) (; ";")) (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" (identifier "iVar5") (= "=") (number_literal "-1")) (; ";")) (} "}"))) (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}")))

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

int function_1(type_1 *sp)

{
  type_2 *var_1;
  type_3 *var_12;
  int var_9;
  int *piVar2;
  type_2 *var_3;
  int var_2;
  
  var_1 = sp->fts_cur;
  if (var_1 != (type_2 *)0x0) {
    var_2 = var_1->fts_level;
    while (-1 < var_2) {
      var_3 = var_1->fts_link;
      if (var_3 == (type_2 *)0x0) {
        var_3 = var_1->fts_parent;
      }
      var_4(var_1);
      var_1 = var_3;
      var_2 = var_3->fts_level;
    }
    var_4(var_1);
  }
  if (sp->fts_child != (type_4 *)0x0) {
    var_5(sp->fts_child);
  }
  var_4(sp->fts_array);
  var_4(sp->fts_path);
  if ((sp->fts_options & 0x200U) == 0) {
    if ((sp->fts_options & 4U) == 0) {
      var_2 = var_6(sp->fts_rfd);
      if (var_2 == 0) {
        var_2 = var_7(sp->fts_rfd);
        if (var_2 == 0) goto LAB_0001769a;
        piVar2 = var_8();
      }
      else {
        piVar2 = var_8();
        var_2 = *piVar2;
        var_9 = var_7(sp->fts_rfd);
        if ((var_9 == 0) || (var_2 != 0)) goto LAB_0001769c;
      }
      var_2 = *piVar2;
      goto LAB_0001769c;
    }
  }
  else if ((-1 < sp->fts_cwd_fd) && (var_2 = var_7(sp->fts_cwd_fd), var_2 != 0)) {
    piVar2 = var_8();
    var_2 = *piVar2;
    goto LAB_0001769c;
  }
LAB_0001769a:
  var_2 = 0;
LAB_0001769c:
  var_10(&sp->fts_fd_ring);
  if (sp->fts_leaf_optimization_works_ht != (type_3 *)0x0) {
    var_11(sp->fts_leaf_optimization_works_ht);
  }
  var_12 = (sp->fts_cycle).ht;
  if ((sp->fts_options & 0x102U) == 0) {
    var_4(var_12);
  }
  else if (var_12 != (type_3 *)0x0) {
    var_11(var_12);
  }
  var_4(sp);
  if (var_2 != 0) {
    piVar2 = var_8();
    *piVar2 = var_2;
    var_2 = -1;
  }
  return var_2;
}


(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 (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (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: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (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: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))))) (while_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))))) (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: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (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 (subscript_expression argument: (identifier) index: (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 (subscript_expression argument: (identifier) index: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (goto_statement label: (statement_identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (goto_statement label: (statement_identifier))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (subscript_expression argument: (identifier) index: (number_literal)))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal))))) right: (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: (pointer_expression argument: (identifier)))) (goto_statement label: (statement_identifier)))))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) alternative: (else_clause (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 (call_expression function: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (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: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))))) (return_statement (identifier)))))

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

int MASKED(int *param_1)

{
  void *pvVar1;
  int iVar2;
  int *piVar3;
  void *pvVar4;
  int iVar5;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    iVar5 = *(int *)((int)pvVar1 + 0x30);
    while (-1 < iVar5) {
      pvVar4 = *(void **)((int)pvVar1 + 8);
      if (pvVar4 == (void *)0x0) {
        pvVar4 = *(void **)((int)pvVar1 + 4);
      }
      free(pvVar1);
      pvVar1 = pvVar4;
      iVar5 = *(int *)((int)pvVar4 + 0x30);
    }
    free(pvVar1);
  }
  if (param_1[1] != 0) {
    FUN_00015e90();
  }
  free((void *)param_1[2]);
  free((void *)param_1[5]);
  if ((param_1[0xb] & 0x200U) == 0) {
    if ((param_1[0xb] & 4U) == 0) {
      iVar5 = fchdir(param_1[6]);
      if (iVar5 == 0) {
        iVar5 = close(param_1[6]);
        if (iVar5 == 0) goto LAB_0001769a;
        piVar3 = __errno_location();
      }
      else {
        piVar3 = __errno_location();
        iVar5 = *piVar3;
        iVar2 = close(param_1[6]);
        if ((iVar2 == 0) || (iVar5 != 0)) goto LAB_0001769c;
      }
      iVar5 = *piVar3;
      goto LAB_0001769c;
    }
  }
  else if ((-1 < param_1[7]) && (iVar5 = close(param_1[7]), iVar5 != 0)) {
    piVar3 = __errno_location();
    iVar5 = *piVar3;
    goto LAB_0001769c;
  }
LAB_0001769a:
  iVar5 = 0;
LAB_0001769c:
  FUN_00015ee0();
  if (param_1[0xc] != 0) {
    FUN_00019be0(param_1[0xc]);
  }
  pvVar1 = (void *)param_1[0xd];
  if ((param_1[0xb] & 0x102U) == 0) {
    free(pvVar1);
  }
  else if (pvVar1 != (void *)0x0) {
    FUN_00019be0(pvVar1);
  }
  free(param_1);
  if (iVar5 != 0) {
    piVar3 = __errno_location();
    *piVar3 = iVar5;
    iVar5 = -1;
  }
  return iVar5;
}

