
FTSENT * fts_children(FTS *sp,int instr)

{
  undefined4 *puVar1;
  FTSENT *pFVar2;
  int fd;
  undefined4 uVar3;
  _ftsent *p_Var4;
  int iVar5;
  
  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
  if ((instr & 0xffffefffU) != 0) {
    *puVar1 = 0x16;
    return (FTSENT *)0x0;
  }
  p_Var4 = sp->fts_cur;
  *puVar1 = 0;
  if ((sp->fts_options & 0x2000U) == 0) {
    if (p_Var4->fts_info == 9) {
      return p_Var4->fts_link;
    }
    if (p_Var4->fts_info == 1) {
      if (sp->fts_child != (FTSENT *)0x0) {
        fts_lfree(sp->fts_child);
      }
      iVar5 = 2;
      if (instr == 0x1000) {
        sp->fts_options = sp->fts_options | 0x1000;
      }
      else {
        iVar5 = 1;
      }
      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||
         (((uint)sp->fts_options & 4) != 0)) {
        pFVar2 = fts_build(sp,iVar5);
        sp->fts_child = pFVar2;
        return pFVar2;
      }
      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,
                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));
      if (fd < 0) {
        sp->fts_child = (_ftsent *)0x0;
        return (FTSENT *)0x0;
      }
      pFVar2 = fts_build(sp,iVar5);
      sp->fts_child = pFVar2;
      if ((sp->fts_options & 0x200U) == 0) {
        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);
        if (iVar5 == 0) {
          (*(code *)PTR_close_000759e8)(fd);
          return sp->fts_child;
        }
        uVar3 = *puVar1;
        (*(code *)PTR_close_000759e8)(fd);
        *puVar1 = uVar3;
        return (FTSENT *)0x0;
      }
      cwd_advance_fd(sp,fd,true);
      return sp->fts_child;
    }
  }
  return (FTSENT *)0x0;
}



int fts_children(int *param_1,uint param_2)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  
  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
  if ((param_2 & 0xffffefff) != 0) {
    *puVar1 = 0x16;
    return 0;
  }
  iVar3 = *param_1;
  *puVar1 = 0;
  if ((param_1[0xc] & 0x2000U) == 0) {
    if (*(short *)(iVar3 + 0x3c) == 9) {
      return *(int *)(iVar3 + 8);
    }
    if (*(short *)(iVar3 + 0x3c) == 1) {
      if (param_1[1] != 0) {
        FUN_0003eccc();
      }
      uVar4 = 2;
      if (param_2 == 0x1000) {
        param_1[0xc] = param_1[0xc] | 0x1000;
      }
      else {
        uVar4 = 1;
      }
      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||
         ((param_1[0xc] & 4U) != 0)) {
        iVar3 = FUN_0003fa58(param_1,uVar4);
        param_1[1] = iVar3;
        return iVar3;
      }
      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);
      if (iVar3 < 0) {
        param_1[1] = 0;
        return 0;
      }
      iVar2 = FUN_0003fa58(param_1,uVar4);
      param_1[1] = iVar2;
      if ((param_1[0xc] & 0x200U) == 0) {
        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);
        if (iVar2 == 0) {
          (*(code *)PTR_close_000759e8)(iVar3);
          return param_1[1];
        }
        uVar4 = *puVar1;
        (*(code *)PTR_close_000759e8)(iVar3);
        *puVar1 = uVar4;
        return 0;
      }
      FUN_0003f008(param_1,iVar3,1);
      return param_1[1];
    }
  }
  return 0;
}


lui gp,0x4
addiu gp,gp,-0x410c
addu gp,gp,t9
addiu sp,sp,-0x30
lw t9,-0x7abc(gp)
sw gp,0x10(sp)
sw s3,0x28(sp)
sw s2,0x24(sp)
or s2,a1,zero
sw s0,0x1c(sp)
or s0,a0,zero
sw ra,0x2c(sp)
jalr t9
_sw s1,0x20(sp)
or s3,v0,zero
li v0,-0x1001
and v0,s2,v0
beq v0,zero,0x00041700
_lw gp,0x10(sp)
li v1,0x16
or v0,zero,zero
sw v1,0x0(s3)
lw ra,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
lw s1,0x0(s0)
sw zero,0x0(s3)
lw v0,0x30(s0)
andi v0,v0,0x2000
bne v0,zero,0x000417b8
_li v1,0x9
lhu v0,0x3c(s1)
beq v0,v1,0x00041848
_li v1,0x1
bne v0,v1,0x000417bc
_lw ra,0x2c(sp)
lw a0,0x4(s0)
beq a0,zero,0x00041748
_lw t9,-0x7c60(gp)
addiu t9,t9,-0x1334
bal 0x0003eccc
_nop
lw gp,0x10(sp)
li v0,0x1000
beq s2,v0,0x00041868
_li s2,0x2
li s2,0x1
lw v0,0x30(s1)
bne v0,zero,0x00041784
_li v0,0x2f
lw v1,0x18(s1)
lb v1,0x0(v1)
beq v1,v0,0x00041788
_lw t9,-0x7c60(gp)
lw a1,0x30(s0)
andi v0,a1,0x4
beq v0,zero,0x000417d8
_lw a2,-0x7fc8(gp)
lw t9,-0x7c60(gp)
or a1,s2,zero
addiu t9,t9,-0x5a8
bal 0x0003fa58
_or a0,s0,zero
lw ra,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
sw v0,0x4(s0)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
lw ra,0x2c(sp)
or v0,zero,zero
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
lw t9,-0x7c60(gp)
lw a0,0x20(s0)
addiu t9,t9,-0xae0
bal 0x0003f520
_addiu a2,a2,-0x1268
lw gp,0x10(sp)
bltz v0,0x00041898
_or s1,v0,zero
lw t9,-0x7c60(gp)
or a1,s2,zero
addiu t9,t9,-0x5a8
bal 0x0003fa58
_or a0,s0,zero
lw v1,0x30(s0)
lw gp,0x10(sp)
andi v1,v1,0x200
bne v1,zero,0x00041878
_sw v0,0x4(s0)
lw t9,-0x7b44(gp)
jalr t9
_or a0,s1,zero
bne v0,zero,0x000418a4
_lw gp,0x10(sp)
lw t9,-0x7b98(gp)
jalr t9
_or a0,s1,zero
b 0x000416e4
_lw v0,0x4(s0)
lw ra,0x2c(sp)
lw v0,0x8(s1)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
lw v0,0x30(s0)
ori v0,v0,0x1000
b 0x00041758
_sw v0,0x30(s0)
lw t9,-0x7c60(gp)
li a2,0x1
or a1,s1,zero
addiu t9,t9,-0xff8
bal 0x0003f008
_or a0,s0,zero
b 0x000416e4
_lw v0,0x4(s0)
sw zero,0x4(s0)
b 0x000416e4
_or v0,zero,zero
lw s0,0x0(s3)
lw t9,-0x7b98(gp)
jalr t9
_or a0,s1,zero
or v0,zero,zero
b 0x000416e4
_sw s0,0x0(s3)
(translation_unit "int fts_children(int *param_1,uint param_2)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}\n\n" (function_definition "int fts_children(int *param_1,uint param_2)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}" primitive_type (function_declarator "fts_children(int *param_1,uint param_2)" identifier (parameter_list "(int *param_1,uint param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }" if (parenthesized_expression "((param_2 & 0xffffefff) != 0)" ( (binary_expression "(param_2 & 0xffffefff) != 0" (parenthesized_expression "(param_2 & 0xffffefff)" ( (binary_expression "param_2 & 0xffffefff" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n    *puVar1 = 0x16;\n    return 0;\n  }" { (expression_statement "*puVar1 = 0x16;" (assignment_expression "*puVar1 = 0x16" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (if_statement "if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }" if (parenthesized_expression "((param_1[0xc] & 0x2000U) == 0)" ( (binary_expression "(param_1[0xc] & 0x2000U) == 0" (parenthesized_expression "(param_1[0xc] & 0x2000U)" ( (binary_expression "param_1[0xc] & 0x2000U" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }" { (if_statement "if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }" if (parenthesized_expression "(*(short *)(iVar3 + 0x3c) == 9)" ( (binary_expression "*(short *)(iVar3 + 0x3c) == 9" (pointer_expression "*(short *)(iVar3 + 0x3c)" * (cast_expression "(short *)(iVar3 + 0x3c)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x3c)" ( (binary_expression "iVar3 + 0x3c" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n      return *(int *)(iVar3 + 8);\n    }" { (return_statement "return *(int *)(iVar3 + 8);" return (pointer_expression "*(int *)(iVar3 + 8)" * (cast_expression "(int *)(iVar3 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 8)" ( (binary_expression "iVar3 + 8" identifier + number_literal) )))) ;) })) (if_statement "if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }" if (parenthesized_expression "(*(short *)(iVar3 + 0x3c) == 1)" ( (binary_expression "*(short *)(iVar3 + 0x3c) == 1" (pointer_expression "*(short *)(iVar3 + 0x3c)" * (cast_expression "(short *)(iVar3 + 0x3c)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x3c)" ( (binary_expression "iVar3 + 0x3c" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }" { (if_statement "if (param_1[1] != 0) {\n        FUN_0003eccc();\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_0003eccc();\n      }" { (expression_statement "FUN_0003eccc();" (call_expression "FUN_0003eccc()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar4 = 2;" (assignment_expression "uVar4 = 2" identifier = number_literal) ;) (if_statement "if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }" if (parenthesized_expression "(param_2 == 0x1000)" ( (binary_expression "param_2 == 0x1000" identifier == number_literal) )) (compound_statement "{\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }" { (expression_statement "param_1[0xc] = param_1[0xc] | 0x1000;" (assignment_expression "param_1[0xc] = param_1[0xc] | 0x1000" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) = (binary_expression "param_1[0xc] | 0x1000" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) | number_literal)) ;) }) (else_clause "else {\n        uVar4 = 1;\n      }" else (compound_statement "{\n        uVar4 = 1;\n      }" { (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 1" identifier = number_literal) ;) }))) (if_statement "if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }" if (parenthesized_expression "(((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0))" ( (binary_expression "((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)" (parenthesized_expression "((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/'))" ( (binary_expression "(*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')" (parenthesized_expression "(*(int *)(iVar3 + 0x30) != 0)" ( (binary_expression "*(int *)(iVar3 + 0x30) != 0" (pointer_expression "*(int *)(iVar3 + 0x30)" * (cast_expression "(int *)(iVar3 + 0x30)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x30)" ( (binary_expression "iVar3 + 0x30" identifier + number_literal) )))) != number_literal) )) || (parenthesized_expression "(**(char **)(iVar3 + 0x18) == '/')" ( (binary_expression "**(char **)(iVar3 + 0x18) == '/'" (pointer_expression "**(char **)(iVar3 + 0x18)" * (pointer_expression "*(char **)(iVar3 + 0x18)" * (cast_expression "(char **)(iVar3 + 0x18)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar3 + 0x18)" ( (binary_expression "iVar3 + 0x18" identifier + number_literal) ))))) == (char_literal "'/'" ' character ')) ))) )) || (parenthesized_expression "((param_1[0xc] & 4U) != 0)" ( (binary_expression "(param_1[0xc] & 4U) != 0" (parenthesized_expression "(param_1[0xc] & 4U)" ( (binary_expression "param_1[0xc] & 4U" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }" { (expression_statement "iVar3 = FUN_0003fa58(param_1,uVar4);" (assignment_expression "iVar3 = FUN_0003fa58(param_1,uVar4)" identifier = (call_expression "FUN_0003fa58(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier )))) ;) (expression_statement "param_1[1] = iVar3;" (assignment_expression "param_1[1] = iVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return iVar3;" return identifier ;) })) (expression_statement "iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);" (assignment_expression "iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" identifier = (call_expression "FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" identifier (argument_list "(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" ( (subscript_expression "param_1[8]" identifier [ number_literal ]) , (subscript_expression "param_1[0xc]" identifier [ number_literal ]) , (binary_expression "PTR_s_directory_000755b8 + -0x1268" identifier + number_literal) )))) ;) (if_statement "if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n        param_1[1] = 0;\n        return 0;\n      }" { (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar2 = FUN_0003fa58(param_1,uVar4);" (assignment_expression "iVar2 = FUN_0003fa58(param_1,uVar4)" identifier = (call_expression "FUN_0003fa58(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier )))) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }" if (parenthesized_expression "((param_1[0xc] & 0x200U) == 0)" ( (binary_expression "(param_1[0xc] & 0x200U) == 0" (parenthesized_expression "(param_1[0xc] & 0x200U)" ( (binary_expression "param_1[0xc] & 0x200U" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }" { (expression_statement "iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);" (assignment_expression "iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3)" identifier = (call_expression "(*(code *)PTR_fchdir_00075a3c)(iVar3)" (parenthesized_expression "(*(code *)PTR_fchdir_00075a3c)" ( (pointer_expression "*(code *)PTR_fchdir_00075a3c" * (cast_expression "(code *)PTR_fchdir_00075a3c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }" { (expression_statement "(*(code *)PTR_close_000759e8)(iVar3);" (call_expression "(*(code *)PTR_close_000759e8)(iVar3)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" ( (pointer_expression "*(code *)PTR_close_000759e8" * (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3)" ( identifier ))) ;) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })) (expression_statement "uVar4 = *puVar1;" (assignment_expression "uVar4 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "(*(code *)PTR_close_000759e8)(iVar3);" (call_expression "(*(code *)PTR_close_000759e8)(iVar3)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" ( (pointer_expression "*(code *)PTR_close_000759e8" * (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3)" ( identifier ))) ;) (expression_statement "*puVar1 = uVar4;" (assignment_expression "*puVar1 = uVar4" (pointer_expression "*puVar1" * identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "FUN_0003f008(param_1,iVar3,1);" (call_expression "FUN_0003f008(param_1,iVar3,1)" identifier (argument_list "(param_1,iVar3,1)" ( identifier , identifier , number_literal ))) ;) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "FTSENT * fts_children(FTS *sp,int instr)\n\n{\n  undefined4 *puVar1;\n  FTSENT *pFVar2;\n  int fd;\n  undefined4 uVar3;\n  _ftsent *p_Var4;\n  int iVar5;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((instr & 0xffffefffU) != 0) {\n    *puVar1 = 0x16;\n    return (FTSENT *)0x0;\n  }\n  p_Var4 = sp->fts_cur;\n  *puVar1 = 0;\n  if ((sp->fts_options & 0x2000U) == 0) {\n    if (p_Var4->fts_info == 9) {\n      return p_Var4->fts_link;\n    }\n    if (p_Var4->fts_info == 1) {\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }\n  }\n  return (FTSENT *)0x0;\n}\n\n" (function_definition "FTSENT * fts_children(FTS *sp,int instr)\n\n{\n  undefined4 *puVar1;\n  FTSENT *pFVar2;\n  int fd;\n  undefined4 uVar3;\n  _ftsent *p_Var4;\n  int iVar5;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((instr & 0xffffefffU) != 0) {\n    *puVar1 = 0x16;\n    return (FTSENT *)0x0;\n  }\n  p_Var4 = sp->fts_cur;\n  *puVar1 = 0;\n  if ((sp->fts_options & 0x2000U) == 0) {\n    if (p_Var4->fts_info == 9) {\n      return p_Var4->fts_link;\n    }\n    if (p_Var4->fts_info == 1) {\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }\n  }\n  return (FTSENT *)0x0;\n}" type_identifier (pointer_declarator "* fts_children(FTS *sp,int instr)" * (function_declarator "fts_children(FTS *sp,int instr)" identifier (parameter_list "(FTS *sp,int instr)" ( (parameter_declaration "FTS *sp" type_identifier (pointer_declarator "*sp" * identifier)) , (parameter_declaration "int instr" primitive_type identifier) )))) (compound_statement "{\n  undefined4 *puVar1;\n  FTSENT *pFVar2;\n  int fd;\n  undefined4 uVar3;\n  _ftsent *p_Var4;\n  int iVar5;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((instr & 0xffffefffU) != 0) {\n    *puVar1 = 0x16;\n    return (FTSENT *)0x0;\n  }\n  p_Var4 = sp->fts_cur;\n  *puVar1 = 0;\n  if ((sp->fts_options & 0x2000U) == 0) {\n    if (p_Var4->fts_info == 9) {\n      return p_Var4->fts_link;\n    }\n    if (p_Var4->fts_info == 1) {\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }\n  }\n  return (FTSENT *)0x0;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "FTSENT *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "int fd;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "_ftsent *p_Var4;" type_identifier (pointer_declarator "*p_Var4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if ((instr & 0xffffefffU) != 0) {\n    *puVar1 = 0x16;\n    return (FTSENT *)0x0;\n  }" if (parenthesized_expression "((instr & 0xffffefffU) != 0)" ( (binary_expression "(instr & 0xffffefffU) != 0" (parenthesized_expression "(instr & 0xffffefffU)" ( (binary_expression "instr & 0xffffefffU" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n    *puVar1 = 0x16;\n    return (FTSENT *)0x0;\n  }" { (expression_statement "*puVar1 = 0x16;" (assignment_expression "*puVar1 = 0x16" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (return_statement "return (FTSENT *)0x0;" return (cast_expression "(FTSENT *)0x0" ( (type_descriptor "FTSENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "p_Var4 = sp->fts_cur;" (assignment_expression "p_Var4 = sp->fts_cur" identifier = (field_expression "sp->fts_cur" identifier -> field_identifier)) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (if_statement "if ((sp->fts_options & 0x2000U) == 0) {\n    if (p_Var4->fts_info == 9) {\n      return p_Var4->fts_link;\n    }\n    if (p_Var4->fts_info == 1) {\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }\n  }" if (parenthesized_expression "((sp->fts_options & 0x2000U) == 0)" ( (binary_expression "(sp->fts_options & 0x2000U) == 0" (parenthesized_expression "(sp->fts_options & 0x2000U)" ( (binary_expression "sp->fts_options & 0x2000U" (field_expression "sp->fts_options" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\n    if (p_Var4->fts_info == 9) {\n      return p_Var4->fts_link;\n    }\n    if (p_Var4->fts_info == 1) {\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }\n  }" { (if_statement "if (p_Var4->fts_info == 9) {\n      return p_Var4->fts_link;\n    }" if (parenthesized_expression "(p_Var4->fts_info == 9)" ( (binary_expression "p_Var4->fts_info == 9" (field_expression "p_Var4->fts_info" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n      return p_Var4->fts_link;\n    }" { (return_statement "return p_Var4->fts_link;" return (field_expression "p_Var4->fts_link" identifier -> field_identifier) ;) })) (if_statement "if (p_Var4->fts_info == 1) {\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }" if (parenthesized_expression "(p_Var4->fts_info == 1)" ( (binary_expression "p_Var4->fts_info == 1" (field_expression "p_Var4->fts_info" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n      if (sp->fts_child != (FTSENT *)0x0) {\n        fts_lfree(sp->fts_child);\n      }\n      iVar5 = 2;\n      if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }\n      if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }\n      fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));\n      if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }\n      pFVar2 = fts_build(sp,iVar5);\n      sp->fts_child = pFVar2;\n      if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }\n      cwd_advance_fd(sp,fd,true);\n      return sp->fts_child;\n    }" { (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 "iVar5 = 2;" (assignment_expression "iVar5 = 2" identifier = number_literal) ;) (if_statement "if (instr == 0x1000) {\n        sp->fts_options = sp->fts_options | 0x1000;\n      }\n      else {\n        iVar5 = 1;\n      }" if (parenthesized_expression "(instr == 0x1000)" ( (binary_expression "instr == 0x1000" identifier == number_literal) )) (compound_statement "{\n        sp->fts_options = sp->fts_options | 0x1000;\n      }" { (expression_statement "sp->fts_options = sp->fts_options | 0x1000;" (assignment_expression "sp->fts_options = sp->fts_options | 0x1000" (field_expression "sp->fts_options" identifier -> field_identifier) = (binary_expression "sp->fts_options | 0x1000" (field_expression "sp->fts_options" identifier -> field_identifier) | number_literal)) ;) }) (else_clause "else {\n        iVar5 = 1;\n      }" else (compound_statement "{\n        iVar5 = 1;\n      }" { (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" identifier = number_literal) ;) }))) (if_statement "if (((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)) {\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }" if (parenthesized_expression "(((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0))" ( (binary_expression "((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')) ||\n         (((uint)sp->fts_options & 4) != 0)" (parenthesized_expression "((p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/'))" ( (binary_expression "(p_Var4->fts_level != 0) || (*p_Var4->fts_accpath == '/')" (parenthesized_expression "(p_Var4->fts_level != 0)" ( (binary_expression "p_Var4->fts_level != 0" (field_expression "p_Var4->fts_level" identifier -> field_identifier) != number_literal) )) || (parenthesized_expression "(*p_Var4->fts_accpath == '/')" ( (binary_expression "*p_Var4->fts_accpath == '/'" (pointer_expression "*p_Var4->fts_accpath" * (field_expression "p_Var4->fts_accpath" identifier -> field_identifier)) == (char_literal "'/'" ' character ')) ))) )) || (parenthesized_expression "(((uint)sp->fts_options & 4) != 0)" ( (binary_expression "((uint)sp->fts_options & 4) != 0" (parenthesized_expression "((uint)sp->fts_options & 4)" ( (binary_expression "(uint)sp->fts_options & 4" (cast_expression "(uint)sp->fts_options" ( (type_descriptor "uint" type_identifier) ) (field_expression "sp->fts_options" identifier -> field_identifier)) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n        pFVar2 = fts_build(sp,iVar5);\n        sp->fts_child = pFVar2;\n        return pFVar2;\n      }" { (expression_statement "pFVar2 = fts_build(sp,iVar5);" (assignment_expression "pFVar2 = fts_build(sp,iVar5)" identifier = (call_expression "fts_build(sp,iVar5)" identifier (argument_list "(sp,iVar5)" ( identifier , identifier )))) ;) (expression_statement "sp->fts_child = pFVar2;" (assignment_expression "sp->fts_child = pFVar2" (field_expression "sp->fts_child" identifier -> field_identifier) = identifier) ;) (return_statement "return pFVar2;" return identifier ;) })) (expression_statement "fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268));" (assignment_expression "fd = diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268))" identifier = (call_expression "diropen((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268))" identifier (argument_list "((FTS *)sp->fts_cwd_fd,(char *)sp->fts_options,\n                   (FTS *)(PTR_s_directory_000755b8 + -0x1268))" ( (cast_expression "(FTS *)sp->fts_cwd_fd" ( (type_descriptor "FTS *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "sp->fts_cwd_fd" identifier -> field_identifier)) , (cast_expression "(char *)sp->fts_options" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (field_expression "sp->fts_options" identifier -> field_identifier)) , (cast_expression "(FTS *)(PTR_s_directory_000755b8 + -0x1268)" ( (type_descriptor "FTS *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_s_directory_000755b8 + -0x1268)" ( (binary_expression "PTR_s_directory_000755b8 + -0x1268" identifier + number_literal) ))) )))) ;) (if_statement "if (fd < 0) {\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }" if (parenthesized_expression "(fd < 0)" ( (binary_expression "fd < 0" identifier < number_literal) )) (compound_statement "{\n        sp->fts_child = (_ftsent *)0x0;\n        return (FTSENT *)0x0;\n      }" { (expression_statement "sp->fts_child = (_ftsent *)0x0;" (assignment_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)) ;) (return_statement "return (FTSENT *)0x0;" return (cast_expression "(FTSENT *)0x0" ( (type_descriptor "FTSENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pFVar2 = fts_build(sp,iVar5);" (assignment_expression "pFVar2 = fts_build(sp,iVar5)" identifier = (call_expression "fts_build(sp,iVar5)" identifier (argument_list "(sp,iVar5)" ( identifier , identifier )))) ;) (expression_statement "sp->fts_child = pFVar2;" (assignment_expression "sp->fts_child = pFVar2" (field_expression "sp->fts_child" identifier -> field_identifier) = identifier) ;) (if_statement "if ((sp->fts_options & 0x200U) == 0) {\n        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\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        iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);\n        if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }\n        uVar3 = *puVar1;\n        (*(code *)PTR_close_000759e8)(fd);\n        *puVar1 = uVar3;\n        return (FTSENT *)0x0;\n      }" { (expression_statement "iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd);" (assignment_expression "iVar5 = (*(code *)PTR_fchdir_00075a3c)(fd)" identifier = (call_expression "(*(code *)PTR_fchdir_00075a3c)(fd)" (parenthesized_expression "(*(code *)PTR_fchdir_00075a3c)" ( (pointer_expression "*(code *)PTR_fchdir_00075a3c" * (cast_expression "(code *)PTR_fchdir_00075a3c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier )))) ;) (if_statement "if (iVar5 == 0) {\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n          (*(code *)PTR_close_000759e8)(fd);\n          return sp->fts_child;\n        }" { (expression_statement "(*(code *)PTR_close_000759e8)(fd);" (call_expression "(*(code *)PTR_close_000759e8)(fd)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" ( (pointer_expression "*(code *)PTR_close_000759e8" * (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier ))) ;) (return_statement "return sp->fts_child;" return (field_expression "sp->fts_child" identifier -> field_identifier) ;) })) (expression_statement "uVar3 = *puVar1;" (assignment_expression "uVar3 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "(*(code *)PTR_close_000759e8)(fd);" (call_expression "(*(code *)PTR_close_000759e8)(fd)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" ( (pointer_expression "*(code *)PTR_close_000759e8" * (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier ))) ;) (expression_statement "*puVar1 = uVar3;" (assignment_expression "*puVar1 = uVar3" (pointer_expression "*puVar1" * identifier) = identifier) ;) (return_statement "return (FTSENT *)0x0;" return (cast_expression "(FTSENT *)0x0" ( (type_descriptor "FTSENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "cwd_advance_fd(sp,fd,true);" (call_expression "cwd_advance_fd(sp,fd,true)" identifier (argument_list "(sp,fd,true)" ( identifier , identifier , true ))) ;) (return_statement "return sp->fts_child;" return (field_expression "sp->fts_child" identifier -> field_identifier) ;) })) })) (return_statement "return (FTSENT *)0x0;" return (cast_expression "(FTSENT *)0x0" ( (type_descriptor "FTSENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int fts_children(int *param_1,uint param_2)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}\n\n" (function_definition "int fts_children(int *param_1,uint param_2)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}" primitive_type (function_declarator "fts_children(int *param_1,uint param_2)" identifier (parameter_list "(int *param_1,uint param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" ( (pointer_expression "*(code *)PTR___errno_location_00075ac4" * (cast_expression "(code *)PTR___errno_location_00075ac4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (if_statement "if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }" if (parenthesized_expression "((param_2 & 0xffffefff) != 0)" ( (binary_expression "(param_2 & 0xffffefff) != 0" (parenthesized_expression "(param_2 & 0xffffefff)" ( (binary_expression "param_2 & 0xffffefff" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n    *puVar1 = 0x16;\n    return 0;\n  }" { (expression_statement "*puVar1 = 0x16;" (assignment_expression "*puVar1 = 0x16" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (if_statement "if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }" if (parenthesized_expression "((param_1[0xc] & 0x2000U) == 0)" ( (binary_expression "(param_1[0xc] & 0x2000U) == 0" (parenthesized_expression "(param_1[0xc] & 0x2000U)" ( (binary_expression "param_1[0xc] & 0x2000U" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }" { (if_statement "if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }" if (parenthesized_expression "(*(short *)(iVar3 + 0x3c) == 9)" ( (binary_expression "*(short *)(iVar3 + 0x3c) == 9" (pointer_expression "*(short *)(iVar3 + 0x3c)" * (cast_expression "(short *)(iVar3 + 0x3c)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x3c)" ( (binary_expression "iVar3 + 0x3c" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n      return *(int *)(iVar3 + 8);\n    }" { (return_statement "return *(int *)(iVar3 + 8);" return (pointer_expression "*(int *)(iVar3 + 8)" * (cast_expression "(int *)(iVar3 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 8)" ( (binary_expression "iVar3 + 8" identifier + number_literal) )))) ;) })) (if_statement "if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }" if (parenthesized_expression "(*(short *)(iVar3 + 0x3c) == 1)" ( (binary_expression "*(short *)(iVar3 + 0x3c) == 1" (pointer_expression "*(short *)(iVar3 + 0x3c)" * (cast_expression "(short *)(iVar3 + 0x3c)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x3c)" ( (binary_expression "iVar3 + 0x3c" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }" { (if_statement "if (param_1[1] != 0) {\n        FUN_0003eccc();\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_0003eccc();\n      }" { (expression_statement "FUN_0003eccc();" (call_expression "FUN_0003eccc()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar4 = 2;" (assignment_expression "uVar4 = 2" identifier = number_literal) ;) (if_statement "if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }" if (parenthesized_expression "(param_2 == 0x1000)" ( (binary_expression "param_2 == 0x1000" identifier == number_literal) )) (compound_statement "{\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }" { (expression_statement "param_1[0xc] = param_1[0xc] | 0x1000;" (assignment_expression "param_1[0xc] = param_1[0xc] | 0x1000" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) = (binary_expression "param_1[0xc] | 0x1000" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) | number_literal)) ;) }) (else_clause "else {\n        uVar4 = 1;\n      }" else (compound_statement "{\n        uVar4 = 1;\n      }" { (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 1" identifier = number_literal) ;) }))) (if_statement "if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }" if (parenthesized_expression "(((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0))" ( (binary_expression "((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)" (parenthesized_expression "((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/'))" ( (binary_expression "(*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')" (parenthesized_expression "(*(int *)(iVar3 + 0x30) != 0)" ( (binary_expression "*(int *)(iVar3 + 0x30) != 0" (pointer_expression "*(int *)(iVar3 + 0x30)" * (cast_expression "(int *)(iVar3 + 0x30)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x30)" ( (binary_expression "iVar3 + 0x30" identifier + number_literal) )))) != number_literal) )) || (parenthesized_expression "(**(char **)(iVar3 + 0x18) == '/')" ( (binary_expression "**(char **)(iVar3 + 0x18) == '/'" (pointer_expression "**(char **)(iVar3 + 0x18)" * (pointer_expression "*(char **)(iVar3 + 0x18)" * (cast_expression "(char **)(iVar3 + 0x18)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar3 + 0x18)" ( (binary_expression "iVar3 + 0x18" identifier + number_literal) ))))) == (char_literal "'/'" ' character ')) ))) )) || (parenthesized_expression "((param_1[0xc] & 4U) != 0)" ( (binary_expression "(param_1[0xc] & 4U) != 0" (parenthesized_expression "(param_1[0xc] & 4U)" ( (binary_expression "param_1[0xc] & 4U" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }" { (expression_statement "iVar3 = FUN_0003fa58(param_1,uVar4);" (assignment_expression "iVar3 = FUN_0003fa58(param_1,uVar4)" identifier = (call_expression "FUN_0003fa58(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier )))) ;) (expression_statement "param_1[1] = iVar3;" (assignment_expression "param_1[1] = iVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return iVar3;" return identifier ;) })) (expression_statement "iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);" (assignment_expression "iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" identifier = (call_expression "FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" identifier (argument_list "(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" ( (subscript_expression "param_1[8]" identifier [ number_literal ]) , (subscript_expression "param_1[0xc]" identifier [ number_literal ]) , (binary_expression "PTR_s_directory_000755b8 + -0x1268" identifier + number_literal) )))) ;) (if_statement "if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n        param_1[1] = 0;\n        return 0;\n      }" { (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar2 = FUN_0003fa58(param_1,uVar4);" (assignment_expression "iVar2 = FUN_0003fa58(param_1,uVar4)" identifier = (call_expression "FUN_0003fa58(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier )))) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }" if (parenthesized_expression "((param_1[0xc] & 0x200U) == 0)" ( (binary_expression "(param_1[0xc] & 0x200U) == 0" (parenthesized_expression "(param_1[0xc] & 0x200U)" ( (binary_expression "param_1[0xc] & 0x200U" (subscript_expression "param_1[0xc]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }" { (expression_statement "iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);" (assignment_expression "iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3)" identifier = (call_expression "(*(code *)PTR_fchdir_00075a3c)(iVar3)" (parenthesized_expression "(*(code *)PTR_fchdir_00075a3c)" ( (pointer_expression "*(code *)PTR_fchdir_00075a3c" * (cast_expression "(code *)PTR_fchdir_00075a3c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }" { (expression_statement "(*(code *)PTR_close_000759e8)(iVar3);" (call_expression "(*(code *)PTR_close_000759e8)(iVar3)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" ( (pointer_expression "*(code *)PTR_close_000759e8" * (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3)" ( identifier ))) ;) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })) (expression_statement "uVar4 = *puVar1;" (assignment_expression "uVar4 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "(*(code *)PTR_close_000759e8)(iVar3);" (call_expression "(*(code *)PTR_close_000759e8)(iVar3)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" ( (pointer_expression "*(code *)PTR_close_000759e8" * (cast_expression "(code *)PTR_close_000759e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3)" ( identifier ))) ;) (expression_statement "*puVar1 = uVar4;" (assignment_expression "*puVar1 = uVar4" (pointer_expression "*puVar1" * identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "FUN_0003f008(param_1,iVar3,1);" (call_expression "FUN_0003f008(param_1,iVar3,1)" identifier (argument_list "(param_1,iVar3,1)" ( identifier , identifier , number_literal ))) ;) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_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 (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (return_statement return (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) | LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) || (parenthesized_expression ( (binary_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) == (char_literal ' character ')) ))) )) || (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 ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , (subscript_expression IDENT [ LIT ]) , (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (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 (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (return_statement return (subscript_expression IDENT [ LIT ]) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) (return_statement return (subscript_expression IDENT [ LIT ]) ;) })) })) (return_statement return LIT ;) })))
(function_definition "int fts_children(int *param_1,uint param_2)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}" (primitive_type "int") (function_declarator "fts_children(int *param_1,uint param_2)" (identifier "fts_children") (parameter_list "(int *param_1,uint param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();\n  if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }\n  iVar3 = *param_1;\n  *puVar1 = 0;\n  if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }\n  return 0;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_00075ac4)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00075ac4)()" (parenthesized_expression "(*(code *)PTR___errno_location_00075ac4)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00075ac4" (* "*") (cast_expression "(code *)PTR___errno_location_00075ac4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00075ac4"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if ((param_2 & 0xffffefff) != 0) {\n    *puVar1 = 0x16;\n    return 0;\n  }" (if "if") (parenthesized_expression "((param_2 & 0xffffefff) != 0)" (( "(") (binary_expression "(param_2 & 0xffffefff) != 0" (parenthesized_expression "(param_2 & 0xffffefff)" (( "(") (binary_expression "param_2 & 0xffffefff" (identifier "param_2") (& "&") (number_literal "0xffffefff")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    *puVar1 = 0x16;\n    return 0;\n  }" ({ "{") (expression_statement "*puVar1 = 0x16;" (assignment_expression "*puVar1 = 0x16" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0x16")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" (identifier "iVar3") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0")) (; ";")) (if_statement "if ((param_1[0xc] & 0x2000U) == 0) {\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }" (if "if") (parenthesized_expression "((param_1[0xc] & 0x2000U) == 0)" (( "(") (binary_expression "(param_1[0xc] & 0x2000U) == 0" (parenthesized_expression "(param_1[0xc] & 0x2000U)" (( "(") (binary_expression "param_1[0xc] & 0x2000U" (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (& "&") (number_literal "0x2000U")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }\n    if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }\n  }" ({ "{") (if_statement "if (*(short *)(iVar3 + 0x3c) == 9) {\n      return *(int *)(iVar3 + 8);\n    }" (if "if") (parenthesized_expression "(*(short *)(iVar3 + 0x3c) == 9)" (( "(") (binary_expression "*(short *)(iVar3 + 0x3c) == 9" (pointer_expression "*(short *)(iVar3 + 0x3c)" (* "*") (cast_expression "(short *)(iVar3 + 0x3c)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x3c)" (( "(") (binary_expression "iVar3 + 0x3c" (identifier "iVar3") (+ "+") (number_literal "0x3c")) () ")")))) (== "==") (number_literal "9")) () ")")) (compound_statement "{\n      return *(int *)(iVar3 + 8);\n    }" ({ "{") (return_statement "return *(int *)(iVar3 + 8);" (return "return") (pointer_expression "*(int *)(iVar3 + 8)" (* "*") (cast_expression "(int *)(iVar3 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 8)" (( "(") (binary_expression "iVar3 + 8" (identifier "iVar3") (+ "+") (number_literal "8")) () ")")))) (; ";")) (} "}"))) (if_statement "if (*(short *)(iVar3 + 0x3c) == 1) {\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }" (if "if") (parenthesized_expression "(*(short *)(iVar3 + 0x3c) == 1)" (( "(") (binary_expression "*(short *)(iVar3 + 0x3c) == 1" (pointer_expression "*(short *)(iVar3 + 0x3c)" (* "*") (cast_expression "(short *)(iVar3 + 0x3c)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x3c)" (( "(") (binary_expression "iVar3 + 0x3c" (identifier "iVar3") (+ "+") (number_literal "0x3c")) () ")")))) (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      if (param_1[1] != 0) {\n        FUN_0003eccc();\n      }\n      uVar4 = 2;\n      if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }\n      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }\n      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);\n      if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }\n      iVar2 = FUN_0003fa58(param_1,uVar4);\n      param_1[1] = iVar2;\n      if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }\n      FUN_0003f008(param_1,iVar3,1);\n      return param_1[1];\n    }" ({ "{") (if_statement "if (param_1[1] != 0) {\n        FUN_0003eccc();\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_0003eccc();\n      }" ({ "{") (expression_statement "FUN_0003eccc();" (call_expression "FUN_0003eccc()" (identifier "FUN_0003eccc") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar4 = 2;" (assignment_expression "uVar4 = 2" (identifier "uVar4") (= "=") (number_literal "2")) (; ";")) (if_statement "if (param_2 == 0x1000) {\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }\n      else {\n        uVar4 = 1;\n      }" (if "if") (parenthesized_expression "(param_2 == 0x1000)" (( "(") (binary_expression "param_2 == 0x1000" (identifier "param_2") (== "==") (number_literal "0x1000")) () ")")) (compound_statement "{\n        param_1[0xc] = param_1[0xc] | 0x1000;\n      }" ({ "{") (expression_statement "param_1[0xc] = param_1[0xc] | 0x1000;" (assignment_expression "param_1[0xc] = param_1[0xc] | 0x1000" (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (= "=") (binary_expression "param_1[0xc] | 0x1000" (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (| "|") (number_literal "0x1000"))) (; ";")) (} "}")) (else_clause "else {\n        uVar4 = 1;\n      }" (else "else") (compound_statement "{\n        uVar4 = 1;\n      }" ({ "{") (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 1" (identifier "uVar4") (= "=") (number_literal "1")) (; ";")) (} "}")))) (if_statement "if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)) {\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }" (if "if") (parenthesized_expression "(((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0))" (( "(") (binary_expression "((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||\n         ((param_1[0xc] & 4U) != 0)" (parenthesized_expression "((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/'))" (( "(") (binary_expression "(*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')" (parenthesized_expression "(*(int *)(iVar3 + 0x30) != 0)" (( "(") (binary_expression "*(int *)(iVar3 + 0x30) != 0" (pointer_expression "*(int *)(iVar3 + 0x30)" (* "*") (cast_expression "(int *)(iVar3 + 0x30)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x30)" (( "(") (binary_expression "iVar3 + 0x30" (identifier "iVar3") (+ "+") (number_literal "0x30")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(**(char **)(iVar3 + 0x18) == '/')" (( "(") (binary_expression "**(char **)(iVar3 + 0x18) == '/'" (pointer_expression "**(char **)(iVar3 + 0x18)" (* "*") (pointer_expression "*(char **)(iVar3 + 0x18)" (* "*") (cast_expression "(char **)(iVar3 + 0x18)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar3 + 0x18)" (( "(") (binary_expression "iVar3 + 0x18" (identifier "iVar3") (+ "+") (number_literal "0x18")) () ")"))))) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")"))) () ")")) (|| "||") (parenthesized_expression "((param_1[0xc] & 4U) != 0)" (( "(") (binary_expression "(param_1[0xc] & 4U) != 0" (parenthesized_expression "(param_1[0xc] & 4U)" (( "(") (binary_expression "param_1[0xc] & 4U" (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (& "&") (number_literal "4U")) () ")")) (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n        iVar3 = FUN_0003fa58(param_1,uVar4);\n        param_1[1] = iVar3;\n        return iVar3;\n      }" ({ "{") (expression_statement "iVar3 = FUN_0003fa58(param_1,uVar4);" (assignment_expression "iVar3 = FUN_0003fa58(param_1,uVar4)" (identifier "iVar3") (= "=") (call_expression "FUN_0003fa58(param_1,uVar4)" (identifier "FUN_0003fa58") (argument_list "(param_1,uVar4)" (( "(") (identifier "param_1") (, ",") (identifier "uVar4") () ")")))) (; ";")) (expression_statement "param_1[1] = iVar3;" (assignment_expression "param_1[1] = iVar3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar3")) (; ";")) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (expression_statement "iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);" (assignment_expression "iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" (identifier "iVar3") (= "=") (call_expression "FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" (identifier "FUN_0003f520") (argument_list "(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268)" (( "(") (subscript_expression "param_1[8]" (identifier "param_1") ([ "[") (number_literal "8") (] "]")) (, ",") (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (, ",") (binary_expression "PTR_s_directory_000755b8 + -0x1268" (identifier "PTR_s_directory_000755b8") (+ "+") (number_literal "-0x1268")) () ")")))) (; ";")) (if_statement "if (iVar3 < 0) {\n        param_1[1] = 0;\n        return 0;\n      }" (if "if") (parenthesized_expression "(iVar3 < 0)" (( "(") (binary_expression "iVar3 < 0" (identifier "iVar3") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n        param_1[1] = 0;\n        return 0;\n      }" ({ "{") (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar2 = FUN_0003fa58(param_1,uVar4);" (assignment_expression "iVar2 = FUN_0003fa58(param_1,uVar4)" (identifier "iVar2") (= "=") (call_expression "FUN_0003fa58(param_1,uVar4)" (identifier "FUN_0003fa58") (argument_list "(param_1,uVar4)" (( "(") (identifier "param_1") (, ",") (identifier "uVar4") () ")")))) (; ";")) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (if_statement "if ((param_1[0xc] & 0x200U) == 0) {\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }" (if "if") (parenthesized_expression "((param_1[0xc] & 0x200U) == 0)" (( "(") (binary_expression "(param_1[0xc] & 0x200U) == 0" (parenthesized_expression "(param_1[0xc] & 0x200U)" (( "(") (binary_expression "param_1[0xc] & 0x200U" (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]")) (& "&") (number_literal "0x200U")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);\n        if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }\n        uVar4 = *puVar1;\n        (*(code *)PTR_close_000759e8)(iVar3);\n        *puVar1 = uVar4;\n        return 0;\n      }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);" (assignment_expression "iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_fchdir_00075a3c)(iVar3)" (parenthesized_expression "(*(code *)PTR_fchdir_00075a3c)" (( "(") (pointer_expression "*(code *)PTR_fchdir_00075a3c" (* "*") (cast_expression "(code *)PTR_fchdir_00075a3c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fchdir_00075a3c"))) () ")")) (argument_list "(iVar3)" (( "(") (identifier "iVar3") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          (*(code *)PTR_close_000759e8)(iVar3);\n          return param_1[1];\n        }" ({ "{") (expression_statement "(*(code *)PTR_close_000759e8)(iVar3);" (call_expression "(*(code *)PTR_close_000759e8)(iVar3)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" (( "(") (pointer_expression "*(code *)PTR_close_000759e8" (* "*") (cast_expression "(code *)PTR_close_000759e8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_000759e8"))) () ")")) (argument_list "(iVar3)" (( "(") (identifier "iVar3") () ")"))) (; ";")) (return_statement "return param_1[1];" (return "return") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (; ";")) (} "}"))) (expression_statement "uVar4 = *puVar1;" (assignment_expression "uVar4 = *puVar1" (identifier "uVar4") (= "=") (pointer_expression "*puVar1" (* "*") (identifier "puVar1"))) (; ";")) (expression_statement "(*(code *)PTR_close_000759e8)(iVar3);" (call_expression "(*(code *)PTR_close_000759e8)(iVar3)" (parenthesized_expression "(*(code *)PTR_close_000759e8)" (( "(") (pointer_expression "*(code *)PTR_close_000759e8" (* "*") (cast_expression "(code *)PTR_close_000759e8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_000759e8"))) () ")")) (argument_list "(iVar3)" (( "(") (identifier "iVar3") () ")"))) (; ";")) (expression_statement "*puVar1 = uVar4;" (assignment_expression "*puVar1 = uVar4" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (identifier "uVar4")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "FUN_0003f008(param_1,iVar3,1);" (call_expression "FUN_0003f008(param_1,iVar3,1)" (identifier "FUN_0003f008") (argument_list "(param_1,iVar3,1)" (( "(") (identifier "param_1") (, ",") (identifier "iVar3") (, ",") (number_literal "1") () ")"))) (; ";")) (return_statement "return param_1[1];" (return "return") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (; ";")) (} "}"))) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))
(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))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (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: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) consequence: (compound_statement (return_statement (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) consequence: (compound_statement (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 (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (pointer_expression argument: (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: (identifier) right: (number_literal)))))) right: (char_literal (character)))))) right: (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 (identifier) (identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal)) (subscript_expression argument: (identifier) index: (number_literal)) (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (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: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))) (return_statement (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (return_statement (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal)))) (return_statement (subscript_expression argument: (identifier) index: (number_literal))))))) (return_statement (number_literal)))))

int MASKED(int *param_1,uint param_2)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  
  puVar1 = (undefined4 *)(*(code *)PTR___errno_location_00075ac4)();
  if ((param_2 & 0xffffefff) != 0) {
    *puVar1 = 0x16;
    return 0;
  }
  iVar3 = *param_1;
  *puVar1 = 0;
  if ((param_1[0xc] & 0x2000U) == 0) {
    if (*(short *)(iVar3 + 0x3c) == 9) {
      return *(int *)(iVar3 + 8);
    }
    if (*(short *)(iVar3 + 0x3c) == 1) {
      if (param_1[1] != 0) {
        FUN_0003eccc();
      }
      uVar4 = 2;
      if (param_2 == 0x1000) {
        param_1[0xc] = param_1[0xc] | 0x1000;
      }
      else {
        uVar4 = 1;
      }
      if (((*(int *)(iVar3 + 0x30) != 0) || (**(char **)(iVar3 + 0x18) == '/')) ||
         ((param_1[0xc] & 4U) != 0)) {
        iVar3 = FUN_0003fa58(param_1,uVar4);
        param_1[1] = iVar3;
        return iVar3;
      }
      iVar3 = FUN_0003f520(param_1[8],param_1[0xc],PTR_s_directory_000755b8 + -0x1268);
      if (iVar3 < 0) {
        param_1[1] = 0;
        return 0;
      }
      iVar2 = FUN_0003fa58(param_1,uVar4);
      param_1[1] = iVar2;
      if ((param_1[0xc] & 0x200U) == 0) {
        iVar2 = (*(code *)PTR_fchdir_00075a3c)(iVar3);
        if (iVar2 == 0) {
          (*(code *)PTR_close_000759e8)(iVar3);
          return param_1[1];
        }
        uVar4 = *puVar1;
        (*(code *)PTR_close_000759e8)(iVar3);
        *puVar1 = uVar4;
        return 0;
      }
      FUN_0003f008(param_1,iVar3,1);
      return param_1[1];
    }
  }
  return 0;
}

