
int lgetfileconat(int fd,char *file,security_context_t *con)

{
  uint uVar1;
  long lVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  char *file_00;
  uint *puVar6;
  int *piVar7;
  long in_FS_OFFSET;
  saved_cwd saved_cwd;
  char proc_buf [4032];
  
  lVar2 = *(long *)(in_FS_OFFSET + 0x28);
  if ((fd == -100) || (*file == '/')) {
    iVar3 = rpl_lgetfilecon(file,con);
    goto LAB_001086b8;
  }
  file_00 = openat_proc_name(proc_buf,fd,file);
  if (file_00 == (char *)0x0) goto LAB_00108646;
  iVar3 = rpl_lgetfilecon(file_00,con);
  puVar6 = (uint *)__errno_location();
  uVar1 = *puVar6;
  if (file_00 != proc_buf) {
    free(file_00);
  }
  if (iVar3 != -1) goto LAB_001086b8;
  if (uVar1 < 0x27) {
    if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {
LAB_00108773:
      *puVar6 = uVar1;
      goto LAB_001086b8;
    }
  }
  else if (uVar1 != 0x5f) goto LAB_00108773;
LAB_00108646:
  iVar3 = save_cwd(&saved_cwd);
  if (iVar3 != 0) {
    piVar7 = __errno_location();
                    /* WARNING: Subroutine does not return */
    openat_save_fail(*piVar7);
  }
  if ((fd < 0) || (saved_cwd.desc != fd)) {
    iVar3 = fchdir(fd);
    if (iVar3 == 0) {
      iVar3 = rpl_lgetfilecon(file,con);
      if (iVar3 == -1) {
        piVar7 = __errno_location();
        iVar4 = *piVar7;
        iVar5 = restore_cwd(&saved_cwd);
        if (iVar5 != 0) goto LAB_0010875d;
        free_cwd(&saved_cwd);
        if (iVar4 != 0) {
          *piVar7 = iVar4;
        }
      }
      else {
        iVar4 = restore_cwd(&saved_cwd);
        if (iVar4 != 0) {
LAB_0010875d:
          piVar7 = __errno_location();
                    /* WARNING: Subroutine does not return */
          openat_restore_fail(*piVar7);
        }
        free_cwd(&saved_cwd);
      }
    }
    else {
      piVar7 = __errno_location();
      iVar3 = *piVar7;
      free_cwd(&saved_cwd);
      *piVar7 = iVar3;
      iVar3 = -1;
    }
  }
  else {
    free_cwd(&saved_cwd);
    piVar7 = __errno_location();
    *piVar7 = 9;
    iVar3 = -1;
  }
LAB_001086b8:
  if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}



int FUN_0010859c(int param_1,int *param_2,undefined8 param_3)

{
  int iVar1;
  int iVar2;
  undefined1 *__ptr;
  int *piVar3;
  uint uVar4;
  ulong unaff_R15;
  long in_FS_OFFSET;
  uint *local_1020;
  int local_1018 [4];
  undefined1 local_1008 [4040];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  if ((param_1 == -100) || ((char)*param_2 == '/')) {
    iVar1 = FUN_00108305(param_2,param_3);
    goto LAB_001086b8;
  }
  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);
  if (__ptr == (undefined1 *)0x0) {
LAB_00108646:
    do {
      iVar1 = FUN_00109ec4(local_1018);
      if (iVar1 != 0) {
        piVar3 = __errno_location();
        FUN_00109de9(*piVar3);
LAB_001086f0:
        FUN_00109f36(local_1018);
        piVar3 = __errno_location();
        *piVar3 = 9;
        iVar1 = -1;
        goto LAB_001086b8;
      }
      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;
      iVar1 = fchdir(param_1);
      if (iVar1 != 0) {
        piVar3 = __errno_location();
        iVar1 = *piVar3;
        FUN_00109f36(local_1018);
        *piVar3 = iVar1;
        iVar1 = -1;
        goto LAB_001086b8;
      }
      iVar1 = FUN_00108305(param_2,param_3);
      if (iVar1 == -1) {
        param_2 = __errno_location();
        param_1 = *param_2;
        iVar2 = FUN_00109f15(local_1018);
        if (iVar2 == 0) {
          FUN_00109f36(local_1018);
          if (param_1 != 0) {
            *param_2 = param_1;
          }
          goto LAB_001086b8;
        }
      }
      else {
        iVar2 = FUN_00109f15(local_1018);
        if (iVar2 == 0) {
          FUN_00109f36(local_1018);
          goto LAB_001086b8;
        }
      }
      piVar3 = __errno_location();
      FUN_00109e1f(*piVar3);
LAB_00108769:
      uVar4 = (uint)unaff_R15;
    } while (uVar4 == 0x5f);
  }
  else {
    iVar1 = FUN_00108305(__ptr,param_3);
    local_1020 = (uint *)__errno_location();
    uVar4 = *local_1020;
    unaff_R15 = (ulong)uVar4;
    if (__ptr != local_1008) {
      free(__ptr);
    }
    if (iVar1 != -1) goto LAB_001086b8;
    if (0x26 < uVar4) goto LAB_00108769;
    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;
  }
  *local_1020 = uVar4;
LAB_001086b8:
  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0xff8
MOV RBP,RSI
MOV R14,RDX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0xfe8],RAX
XOR EAX,EAX
CMP EDI,-0x64
JZ 0x001086aa
MOV EBX,EDI
CMP byte ptr [RSI],0x2f
JZ 0x001086aa
LEA RDI,[RSP + 0x20]
MOV RDX,RSI
MOV ESI,EBX
CALL 0x0010a5ae
MOV R13,RAX
TEST RAX,RAX
JZ 0x00108646
MOV RSI,R14
MOV RDI,RAX
CALL 0x00108305
MOV R12D,EAX
CALL 0x00102040
MOV qword ptr [RSP + 0x8],RAX
MOV R15D,dword ptr [RAX]
LEA RAX,[RSP + 0x20]
CMP R13,RAX
JZ 0x0010861e
MOV RDI,R13
CALL 0x00102500
CMP R12D,-0x1
JNZ 0x001086b8
CMP R15D,0x26
JA 0x00108769
MOV RAX,0x4000102006
BT RAX,R15
JNC 0x00108773
LEA RDI,[RSP + 0x10]
CALL 0x00109ec4
TEST EAX,EAX
JNZ 0x001086e4
TEST EBX,EBX
JS 0x00108666
CMP dword ptr [RSP + 0x10],EBX
JZ 0x001086f0
MOV EDI,EBX
CALL 0x00102380
TEST EAX,EAX
JNZ 0x0010870d
MOV RSI,R14
MOV RDI,RBP
CALL 0x00108305
MOV R12D,EAX
CMP EAX,-0x1
JZ 0x0010872b
LEA RDI,[RSP + 0x10]
CALL 0x00109f15
TEST EAX,EAX
JNZ 0x0010875d
LEA RDI,[RSP + 0x10]
CALL 0x00109f36
JMP 0x001086b8
MOV RSI,R14
MOV RDI,RBP
CALL 0x00108305
MOV R12D,EAX
MOV EAX,R12D
MOV RCX,qword ptr [RSP + 0xfe8]
XOR RCX,qword ptr FS:[0x28]
JNZ 0x00108780
ADD RSP,0xff8
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
CALL 0x00102040
MOV EDI,dword ptr [RAX]
CALL 0x00109de9
LEA RDI,[RSP + 0x10]
CALL 0x00109f36
CALL 0x00102040
MOV dword ptr [RAX],0x9
MOV R12D,0xffffffff
JMP 0x001086b8
CALL 0x00102040
MOV RBX,RAX
MOV EBP,dword ptr [RAX]
LEA RDI,[RSP + 0x10]
CALL 0x00109f36
MOV dword ptr [RBX],EBP
MOV R12D,0xffffffff
JMP 0x001086b8
CALL 0x00102040
MOV RBP,RAX
MOV EBX,dword ptr [RAX]
LEA RDI,[RSP + 0x10]
CALL 0x00109f15
TEST EAX,EAX
JNZ 0x0010875d
LEA RDI,[RSP + 0x10]
CALL 0x00109f36
TEST EBX,EBX
JZ 0x001086b8
MOV dword ptr [RBP],EBX
JMP 0x001086b8
CALL 0x00102040
MOV EDI,dword ptr [RAX]
CALL 0x00109e1f
CMP R15D,0x5f
JZ 0x00108646
MOV RAX,qword ptr [RSP + 0x8]
MOV dword ptr [RAX],R15D
JMP 0x001086b8
CALL 0x00102160
(translation_unit "int FUN_0010859c(int param_1,int *param_2,undefined8 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "int FUN_0010859c(int param_1,int *param_2,undefined8 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (function_declarator "FUN_0010859c(int param_1,int *param_2,undefined8 param_3)" identifier (parameter_list "(int param_1,int *param_2,undefined8 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined8 param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "ulong unaff_R15;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "uint *local_1020;" type_identifier (pointer_declarator "*local_1020" * identifier) ;) (declaration "int local_1018 [4];" primitive_type (array_declarator "local_1018 [4]" identifier [ number_literal ]) ;) (declaration "undefined1 local_1008 [4040];" type_identifier (array_declarator "local_1008 [4040]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }" if (parenthesized_expression "((param_1 == -100) || ((char)*param_2 == '/'))" ( (binary_expression "(param_1 == -100) || ((char)*param_2 == '/')" (parenthesized_expression "(param_1 == -100)" ( (binary_expression "param_1 == -100" identifier == number_literal) )) || (parenthesized_expression "((char)*param_2 == '/')" ( (binary_expression "(char)*param_2 == '/'" (cast_expression "(char)*param_2" ( (type_descriptor "char" primitive_type) ) (pointer_expression "*param_2" * identifier)) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }" { (expression_statement "iVar1 = FUN_00108305(param_2,param_3);" (assignment_expression "iVar1 = FUN_00108305(param_2,param_3)" identifier = (call_expression "FUN_00108305(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (expression_statement "__ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);" (assignment_expression "__ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2)" identifier = (cast_expression "(undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0010a5ae(local_1008,param_1,param_2)" identifier (argument_list "(local_1008,param_1,param_2)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" if (parenthesized_expression "(__ptr == (undefined1 *)0x0)" ( (binary_expression "__ptr == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }" { (labeled_statement "LAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);" statement_identifier : (do_statement "do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);" do (compound_statement "{\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    }" { (expression_statement "iVar1 = FUN_00109ec4(local_1018);" (assignment_expression "iVar1 = FUN_00109ec4(local_1018)" identifier = (call_expression "FUN_00109ec4(local_1018)" identifier (argument_list "(local_1018)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "FUN_00109de9(*piVar3);" (call_expression "FUN_00109de9(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) ))) ;) (labeled_statement "LAB_001086f0:\n        FUN_00109f36(local_1018);" statement_identifier : (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;)) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = 9;" (assignment_expression "*piVar3 = 9" (pointer_expression "*piVar3" * identifier) = number_literal) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (if_statement "if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;" if (parenthesized_expression "((-1 < param_1) && (local_1018[0] == param_1))" ( (binary_expression "(-1 < param_1) && (local_1018[0] == param_1)" (parenthesized_expression "(-1 < param_1)" ( (binary_expression "-1 < param_1" number_literal < identifier) )) && (parenthesized_expression "(local_1018[0] == param_1)" ( (binary_expression "local_1018[0] == param_1" (subscript_expression "local_1018[0]" identifier [ number_literal ]) == identifier) ))) )) (goto_statement "goto LAB_001086f0;" goto statement_identifier ;)) (expression_statement "iVar1 = fchdir(param_1);" (assignment_expression "iVar1 = fchdir(param_1)" identifier = (call_expression "fchdir(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (expression_statement "iVar1 = FUN_00108305(param_2,param_3);" (assignment_expression "iVar1 = FUN_00108305(param_2,param_3)" identifier = (call_expression "FUN_00108305(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }" { (expression_statement "param_2 = __errno_location();" (assignment_expression "param_2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "param_1 = *param_2;" (assignment_expression "param_1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "iVar2 = FUN_00109f15(local_1018);" (assignment_expression "iVar2 = FUN_00109f15(local_1018)" identifier = (call_expression "FUN_00109f15(local_1018)" identifier (argument_list "(local_1018)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }" { (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;) (if_statement "if (param_1 != 0) {\n            *param_2 = param_1;\n          }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n            *param_2 = param_1;\n          }" { (expression_statement "*param_2 = param_1;" (assignment_expression "*param_2 = param_1" (pointer_expression "*param_2" * identifier) = identifier) ;) })) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) }) (else_clause "else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" else (compound_statement "{\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" { (expression_statement "iVar2 = FUN_00109f15(local_1018);" (assignment_expression "iVar2 = FUN_00109f15(local_1018)" identifier = (call_expression "FUN_00109f15(local_1018)" identifier (argument_list "(local_1018)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }" { (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) }))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "FUN_00109e1f(*piVar3);" (call_expression "FUN_00109e1f(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) ))) ;) (labeled_statement "LAB_00108769:\n      uVar4 = (uint)unaff_R15;" statement_identifier : (expression_statement "uVar4 = (uint)unaff_R15;" (assignment_expression "uVar4 = (uint)unaff_R15" identifier = (cast_expression "(uint)unaff_R15" ( (type_descriptor "uint" type_identifier) ) identifier)) ;)) }) while (parenthesized_expression "(uVar4 == 0x5f)" ( (binary_expression "uVar4 == 0x5f" identifier == number_literal) )) ;)) }) (else_clause "else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" else (compound_statement "{\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" { (expression_statement "iVar1 = FUN_00108305(__ptr,param_3);" (assignment_expression "iVar1 = FUN_00108305(__ptr,param_3)" identifier = (call_expression "FUN_00108305(__ptr,param_3)" identifier (argument_list "(__ptr,param_3)" ( identifier , identifier )))) ;) (expression_statement "local_1020 = (uint *)__errno_location();" (assignment_expression "local_1020 = (uint *)__errno_location()" identifier = (cast_expression "(uint *)__errno_location()" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "__errno_location()" identifier (argument_list "()" ( ))))) ;) (expression_statement "uVar4 = *local_1020;" (assignment_expression "uVar4 = *local_1020" identifier = (pointer_expression "*local_1020" * identifier)) ;) (expression_statement "unaff_R15 = (ulong)uVar4;" (assignment_expression "unaff_R15 = (ulong)uVar4" identifier = (cast_expression "(ulong)uVar4" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) (if_statement "if (__ptr != local_1008) {\n      free(__ptr);\n    }" if (parenthesized_expression "(__ptr != local_1008)" ( (binary_expression "__ptr != local_1008" identifier != identifier) )) (compound_statement "{\n      free(__ptr);\n    }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (if_statement "if (iVar1 != -1) goto LAB_001086b8;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;)) (if_statement "if (0x26 < uVar4) goto LAB_00108769;" if (parenthesized_expression "(0x26 < uVar4)" ( (binary_expression "0x26 < uVar4" number_literal < identifier) )) (goto_statement "goto LAB_00108769;" goto statement_identifier ;)) (if_statement "if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;" if (parenthesized_expression "((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0)" ( (binary_expression "(0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0" (parenthesized_expression "(0x4000102006U >> (unaff_R15 & 0x3f) & 1)" ( (binary_expression "0x4000102006U >> (unaff_R15 & 0x3f) & 1" (binary_expression "0x4000102006U >> (unaff_R15 & 0x3f)" number_literal >> (parenthesized_expression "(unaff_R15 & 0x3f)" ( (binary_expression "unaff_R15 & 0x3f" identifier & number_literal) ))) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00108646;" goto statement_identifier ;)) }))) (expression_statement "*local_1020 = uVar4;" (assignment_expression "*local_1020 = uVar4" (pointer_expression "*local_1020" * identifier) = identifier) ;) (labeled_statement "LAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int lgetfileconat(int fd,char *file,security_context_t *con)\n\n{\n  uint uVar1;\n  long lVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  char *file_00;\n  uint *puVar6;\n  int *piVar7;\n  long in_FS_OFFSET;\n  saved_cwd saved_cwd;\n  char proc_buf [4032];\n  \n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((fd == -100) || (*file == '/')) {\n    iVar3 = rpl_lgetfilecon(file,con);\n    goto LAB_001086b8;\n  }\n  file_00 = openat_proc_name(proc_buf,fd,file);\n  if (file_00 == (char *)0x0) goto LAB_00108646;\n  iVar3 = rpl_lgetfilecon(file_00,con);\n  puVar6 = (uint *)__errno_location();\n  uVar1 = *puVar6;\n  if (file_00 != proc_buf) {\n    free(file_00);\n  }\n  if (iVar3 != -1) goto LAB_001086b8;\n  if (uVar1 < 0x27) {\n    if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }\n  }\n  else if (uVar1 != 0x5f) goto LAB_00108773;\nLAB_00108646:\n  iVar3 = save_cwd(&saved_cwd);\n  if (iVar3 != 0) {\n    piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n    openat_save_fail(*piVar7);\n  }\n  if ((fd < 0) || (saved_cwd.desc != fd)) {\n    iVar3 = fchdir(fd);\n    if (iVar3 == 0) {\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }\n    else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }\n  }\n  else {\n    free_cwd(&saved_cwd);\n    piVar7 = __errno_location();\n    *piVar7 = 9;\n    iVar3 = -1;\n  }\nLAB_001086b8:\n  if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "int lgetfileconat(int fd,char *file,security_context_t *con)\n\n{\n  uint uVar1;\n  long lVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  char *file_00;\n  uint *puVar6;\n  int *piVar7;\n  long in_FS_OFFSET;\n  saved_cwd saved_cwd;\n  char proc_buf [4032];\n  \n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((fd == -100) || (*file == '/')) {\n    iVar3 = rpl_lgetfilecon(file,con);\n    goto LAB_001086b8;\n  }\n  file_00 = openat_proc_name(proc_buf,fd,file);\n  if (file_00 == (char *)0x0) goto LAB_00108646;\n  iVar3 = rpl_lgetfilecon(file_00,con);\n  puVar6 = (uint *)__errno_location();\n  uVar1 = *puVar6;\n  if (file_00 != proc_buf) {\n    free(file_00);\n  }\n  if (iVar3 != -1) goto LAB_001086b8;\n  if (uVar1 < 0x27) {\n    if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }\n  }\n  else if (uVar1 != 0x5f) goto LAB_00108773;\nLAB_00108646:\n  iVar3 = save_cwd(&saved_cwd);\n  if (iVar3 != 0) {\n    piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n    openat_save_fail(*piVar7);\n  }\n  if ((fd < 0) || (saved_cwd.desc != fd)) {\n    iVar3 = fchdir(fd);\n    if (iVar3 == 0) {\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }\n    else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }\n  }\n  else {\n    free_cwd(&saved_cwd);\n    piVar7 = __errno_location();\n    *piVar7 = 9;\n    iVar3 = -1;\n  }\nLAB_001086b8:\n  if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (function_declarator "lgetfileconat(int fd,char *file,security_context_t *con)" identifier (parameter_list "(int fd,char *file,security_context_t *con)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) , (parameter_declaration "security_context_t *con" type_identifier (pointer_declarator "*con" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  long lVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  char *file_00;\n  uint *puVar6;\n  int *piVar7;\n  long in_FS_OFFSET;\n  saved_cwd saved_cwd;\n  char proc_buf [4032];\n  \n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((fd == -100) || (*file == '/')) {\n    iVar3 = rpl_lgetfilecon(file,con);\n    goto LAB_001086b8;\n  }\n  file_00 = openat_proc_name(proc_buf,fd,file);\n  if (file_00 == (char *)0x0) goto LAB_00108646;\n  iVar3 = rpl_lgetfilecon(file_00,con);\n  puVar6 = (uint *)__errno_location();\n  uVar1 = *puVar6;\n  if (file_00 != proc_buf) {\n    free(file_00);\n  }\n  if (iVar3 != -1) goto LAB_001086b8;\n  if (uVar1 < 0x27) {\n    if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }\n  }\n  else if (uVar1 != 0x5f) goto LAB_00108773;\nLAB_00108646:\n  iVar3 = save_cwd(&saved_cwd);\n  if (iVar3 != 0) {\n    piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n    openat_save_fail(*piVar7);\n  }\n  if ((fd < 0) || (saved_cwd.desc != fd)) {\n    iVar3 = fchdir(fd);\n    if (iVar3 == 0) {\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }\n    else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }\n  }\n  else {\n    free_cwd(&saved_cwd);\n    piVar7 = __errno_location();\n    *piVar7 = 9;\n    iVar3 = -1;\n  }\nLAB_001086b8:\n  if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "char *file_00;" primitive_type (pointer_declarator "*file_00" * identifier) ;) (declaration "uint *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "int *piVar7;" primitive_type (pointer_declarator "*piVar7" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "saved_cwd saved_cwd;" type_identifier identifier ;) (declaration "char proc_buf [4032];" primitive_type (array_declarator "proc_buf [4032]" identifier [ number_literal ]) ;) (expression_statement "lVar2 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar2 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if ((fd == -100) || (*file == '/')) {\n    iVar3 = rpl_lgetfilecon(file,con);\n    goto LAB_001086b8;\n  }" if (parenthesized_expression "((fd == -100) || (*file == '/'))" ( (binary_expression "(fd == -100) || (*file == '/')" (parenthesized_expression "(fd == -100)" ( (binary_expression "fd == -100" identifier == number_literal) )) || (parenthesized_expression "(*file == '/')" ( (binary_expression "*file == '/'" (pointer_expression "*file" * identifier) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n    iVar3 = rpl_lgetfilecon(file,con);\n    goto LAB_001086b8;\n  }" { (expression_statement "iVar3 = rpl_lgetfilecon(file,con);" (assignment_expression "iVar3 = rpl_lgetfilecon(file,con)" identifier = (call_expression "rpl_lgetfilecon(file,con)" identifier (argument_list "(file,con)" ( identifier , identifier )))) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (expression_statement "file_00 = openat_proc_name(proc_buf,fd,file);" (assignment_expression "file_00 = openat_proc_name(proc_buf,fd,file)" identifier = (call_expression "openat_proc_name(proc_buf,fd,file)" identifier (argument_list "(proc_buf,fd,file)" ( identifier , identifier , identifier )))) ;) (if_statement "if (file_00 == (char *)0x0) goto LAB_00108646;" if (parenthesized_expression "(file_00 == (char *)0x0)" ( (binary_expression "file_00 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00108646;" goto statement_identifier ;)) (expression_statement "iVar3 = rpl_lgetfilecon(file_00,con);" (assignment_expression "iVar3 = rpl_lgetfilecon(file_00,con)" identifier = (call_expression "rpl_lgetfilecon(file_00,con)" identifier (argument_list "(file_00,con)" ( identifier , identifier )))) ;) (expression_statement "puVar6 = (uint *)__errno_location();" (assignment_expression "puVar6 = (uint *)__errno_location()" identifier = (cast_expression "(uint *)__errno_location()" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "__errno_location()" identifier (argument_list "()" ( ))))) ;) (expression_statement "uVar1 = *puVar6;" (assignment_expression "uVar1 = *puVar6" identifier = (pointer_expression "*puVar6" * identifier)) ;) (if_statement "if (file_00 != proc_buf) {\n    free(file_00);\n  }" if (parenthesized_expression "(file_00 != proc_buf)" ( (binary_expression "file_00 != proc_buf" identifier != identifier) )) (compound_statement "{\n    free(file_00);\n  }" { (expression_statement "free(file_00);" (call_expression "free(file_00)" identifier (argument_list "(file_00)" ( identifier ))) ;) })) (if_statement "if (iVar3 != -1) goto LAB_001086b8;" if (parenthesized_expression "(iVar3 != -1)" ( (binary_expression "iVar3 != -1" identifier != number_literal) )) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;)) (if_statement "if (uVar1 < 0x27) {\n    if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }\n  }\n  else if (uVar1 != 0x5f) goto LAB_00108773;" if (parenthesized_expression "(uVar1 < 0x27)" ( (binary_expression "uVar1 < 0x27" identifier < number_literal) )) (compound_statement "{\n    if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }\n  }" { (if_statement "if ((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0) {\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }" if (parenthesized_expression "((0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0)" ( (binary_expression "(0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1) == 0" (parenthesized_expression "(0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1)" ( (binary_expression "0x4000102006U >> ((ulong)uVar1 & 0x3f) & 1" (binary_expression "0x4000102006U >> ((ulong)uVar1 & 0x3f)" number_literal >> (parenthesized_expression "((ulong)uVar1 & 0x3f)" ( (binary_expression "(ulong)uVar1 & 0x3f" (cast_expression "(ulong)uVar1" ( (type_descriptor "ulong" type_identifier) ) identifier) & number_literal) ))) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00108773:\n      *puVar6 = uVar1;\n      goto LAB_001086b8;\n    }" { (labeled_statement "LAB_00108773:\n      *puVar6 = uVar1;" statement_identifier : (expression_statement "*puVar6 = uVar1;" (assignment_expression "*puVar6 = uVar1" (pointer_expression "*puVar6" * identifier) = identifier) ;)) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) }) (else_clause "else if (uVar1 != 0x5f) goto LAB_00108773;" else (if_statement "if (uVar1 != 0x5f) goto LAB_00108773;" if (parenthesized_expression "(uVar1 != 0x5f)" ( (binary_expression "uVar1 != 0x5f" identifier != number_literal) )) (goto_statement "goto LAB_00108773;" goto statement_identifier ;)))) (labeled_statement "LAB_00108646:\n  iVar3 = save_cwd(&saved_cwd);" statement_identifier : (expression_statement "iVar3 = save_cwd(&saved_cwd);" (assignment_expression "iVar3 = save_cwd(&saved_cwd)" identifier = (call_expression "save_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) )))) ;)) (if_statement "if (iVar3 != 0) {\n    piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n    openat_save_fail(*piVar7);\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n    openat_save_fail(*piVar7);\n  }" { (expression_statement "piVar7 = __errno_location();" (assignment_expression "piVar7 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) comment (expression_statement "openat_save_fail(*piVar7);" (call_expression "openat_save_fail(*piVar7)" identifier (argument_list "(*piVar7)" ( (pointer_expression "*piVar7" * identifier) ))) ;) })) (if_statement "if ((fd < 0) || (saved_cwd.desc != fd)) {\n    iVar3 = fchdir(fd);\n    if (iVar3 == 0) {\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }\n    else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }\n  }\n  else {\n    free_cwd(&saved_cwd);\n    piVar7 = __errno_location();\n    *piVar7 = 9;\n    iVar3 = -1;\n  }" if (parenthesized_expression "((fd < 0) || (saved_cwd.desc != fd))" ( (binary_expression "(fd < 0) || (saved_cwd.desc != fd)" (parenthesized_expression "(fd < 0)" ( (binary_expression "fd < 0" identifier < number_literal) )) || (parenthesized_expression "(saved_cwd.desc != fd)" ( (binary_expression "saved_cwd.desc != fd" (field_expression "saved_cwd.desc" identifier . field_identifier) != identifier) ))) )) (compound_statement "{\n    iVar3 = fchdir(fd);\n    if (iVar3 == 0) {\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }\n    else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }\n  }" { (expression_statement "iVar3 = fchdir(fd);" (assignment_expression "iVar3 = fchdir(fd)" identifier = (call_expression "fchdir(fd)" identifier (argument_list "(fd)" ( identifier )))) ;) (if_statement "if (iVar3 == 0) {\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }\n    else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar3 = rpl_lgetfilecon(file,con);\n      if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }\n    }" { (expression_statement "iVar3 = rpl_lgetfilecon(file,con);" (assignment_expression "iVar3 = rpl_lgetfilecon(file,con)" identifier = (call_expression "rpl_lgetfilecon(file,con)" identifier (argument_list "(file,con)" ( identifier , identifier )))) ;) (if_statement "if (iVar3 == -1) {\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }\n      else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (compound_statement "{\n        piVar7 = __errno_location();\n        iVar4 = *piVar7;\n        iVar5 = restore_cwd(&saved_cwd);\n        if (iVar5 != 0) goto LAB_0010875d;\n        free_cwd(&saved_cwd);\n        if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }\n      }" { (expression_statement "piVar7 = __errno_location();" (assignment_expression "piVar7 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar4 = *piVar7;" (assignment_expression "iVar4 = *piVar7" identifier = (pointer_expression "*piVar7" * identifier)) ;) (expression_statement "iVar5 = restore_cwd(&saved_cwd);" (assignment_expression "iVar5 = restore_cwd(&saved_cwd)" identifier = (call_expression "restore_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) )))) ;) (if_statement "if (iVar5 != 0) goto LAB_0010875d;" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0010875d;" goto statement_identifier ;)) (expression_statement "free_cwd(&saved_cwd);" (call_expression "free_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) ))) ;) (if_statement "if (iVar4 != 0) {\n          *piVar7 = iVar4;\n        }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          *piVar7 = iVar4;\n        }" { (expression_statement "*piVar7 = iVar4;" (assignment_expression "*piVar7 = iVar4" (pointer_expression "*piVar7" * identifier) = identifier) ;) })) }) (else_clause "else {\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }" else (compound_statement "{\n        iVar4 = restore_cwd(&saved_cwd);\n        if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }\n        free_cwd(&saved_cwd);\n      }" { (expression_statement "iVar4 = restore_cwd(&saved_cwd);" (assignment_expression "iVar4 = restore_cwd(&saved_cwd)" identifier = (call_expression "restore_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) )))) ;) (if_statement "if (iVar4 != 0) {\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_0010875d:\n          piVar7 = __errno_location();\n                    /* WARNING: Subroutine does not return */\n          openat_restore_fail(*piVar7);\n        }" { (labeled_statement "LAB_0010875d:\n          piVar7 = __errno_location();" statement_identifier : (expression_statement "piVar7 = __errno_location();" (assignment_expression "piVar7 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;)) comment (expression_statement "openat_restore_fail(*piVar7);" (call_expression "openat_restore_fail(*piVar7)" identifier (argument_list "(*piVar7)" ( (pointer_expression "*piVar7" * identifier) ))) ;) })) (expression_statement "free_cwd(&saved_cwd);" (call_expression "free_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) ))) ;) }))) }) (else_clause "else {\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }" else (compound_statement "{\n      piVar7 = __errno_location();\n      iVar3 = *piVar7;\n      free_cwd(&saved_cwd);\n      *piVar7 = iVar3;\n      iVar3 = -1;\n    }" { (expression_statement "piVar7 = __errno_location();" (assignment_expression "piVar7 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar3 = *piVar7;" (assignment_expression "iVar3 = *piVar7" identifier = (pointer_expression "*piVar7" * identifier)) ;) (expression_statement "free_cwd(&saved_cwd);" (call_expression "free_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) ))) ;) (expression_statement "*piVar7 = iVar3;" (assignment_expression "*piVar7 = iVar3" (pointer_expression "*piVar7" * identifier) = identifier) ;) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) }))) }) (else_clause "else {\n    free_cwd(&saved_cwd);\n    piVar7 = __errno_location();\n    *piVar7 = 9;\n    iVar3 = -1;\n  }" else (compound_statement "{\n    free_cwd(&saved_cwd);\n    piVar7 = __errno_location();\n    *piVar7 = 9;\n    iVar3 = -1;\n  }" { (expression_statement "free_cwd(&saved_cwd);" (call_expression "free_cwd(&saved_cwd)" identifier (argument_list "(&saved_cwd)" ( (pointer_expression "&saved_cwd" & identifier) ))) ;) (expression_statement "piVar7 = __errno_location();" (assignment_expression "piVar7 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar7 = 9;" (assignment_expression "*piVar7 = 9" (pointer_expression "*piVar7" * identifier) = number_literal) ;) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) }))) (labeled_statement "LAB_001086b8:\n  if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar3;\n  }" statement_identifier : (if_statement "if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar3;\n  }" if (parenthesized_expression "(lVar2 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar2 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int FUN_0010859c(int param_1,int *param_2,undefined8 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}\n\n" (function_definition "int FUN_0010859c(int param_1,int *param_2,undefined8 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" primitive_type (function_declarator "FUN_0010859c(int param_1,int *param_2,undefined8 param_3)" identifier (parameter_list "(int param_1,int *param_2,undefined8 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined8 param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *__ptr;" type_identifier (pointer_declarator "*__ptr" * identifier) ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "ulong unaff_R15;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "uint *local_1020;" type_identifier (pointer_declarator "*local_1020" * identifier) ;) (declaration "int local_1018 [4];" primitive_type (array_declarator "local_1018 [4]" identifier [ number_literal ]) ;) (declaration "undefined1 local_1008 [4040];" type_identifier (array_declarator "local_1008 [4040]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }" if (parenthesized_expression "((param_1 == -100) || ((char)*param_2 == '/'))" ( (binary_expression "(param_1 == -100) || ((char)*param_2 == '/')" (parenthesized_expression "(param_1 == -100)" ( (binary_expression "param_1 == -100" identifier == number_literal) )) || (parenthesized_expression "((char)*param_2 == '/')" ( (binary_expression "(char)*param_2 == '/'" (cast_expression "(char)*param_2" ( (type_descriptor "char" primitive_type) ) (pointer_expression "*param_2" * identifier)) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }" { (expression_statement "iVar1 = FUN_00108305(param_2,param_3);" (assignment_expression "iVar1 = FUN_00108305(param_2,param_3)" identifier = (call_expression "FUN_00108305(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (expression_statement "__ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);" (assignment_expression "__ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2)" identifier = (cast_expression "(undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0010a5ae(local_1008,param_1,param_2)" identifier (argument_list "(local_1008,param_1,param_2)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" if (parenthesized_expression "(__ptr == (undefined1 *)0x0)" ( (binary_expression "__ptr == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }" { (labeled_statement "LAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);" statement_identifier : (do_statement "do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);" do (compound_statement "{\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    }" { (expression_statement "iVar1 = FUN_00109ec4(local_1018);" (assignment_expression "iVar1 = FUN_00109ec4(local_1018)" identifier = (call_expression "FUN_00109ec4(local_1018)" identifier (argument_list "(local_1018)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "FUN_00109de9(*piVar3);" (call_expression "FUN_00109de9(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) ))) ;) (labeled_statement "LAB_001086f0:\n        FUN_00109f36(local_1018);" statement_identifier : (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;)) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = 9;" (assignment_expression "*piVar3 = 9" (pointer_expression "*piVar3" * identifier) = number_literal) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (if_statement "if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;" if (parenthesized_expression "((-1 < param_1) && (local_1018[0] == param_1))" ( (binary_expression "(-1 < param_1) && (local_1018[0] == param_1)" (parenthesized_expression "(-1 < param_1)" ( (binary_expression "-1 < param_1" number_literal < identifier) )) && (parenthesized_expression "(local_1018[0] == param_1)" ( (binary_expression "local_1018[0] == param_1" (subscript_expression "local_1018[0]" identifier [ number_literal ]) == identifier) ))) )) (goto_statement "goto LAB_001086f0;" goto statement_identifier ;)) (expression_statement "iVar1 = fchdir(param_1);" (assignment_expression "iVar1 = fchdir(param_1)" identifier = (call_expression "fchdir(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) (expression_statement "iVar1 = FUN_00108305(param_2,param_3);" (assignment_expression "iVar1 = FUN_00108305(param_2,param_3)" identifier = (call_expression "FUN_00108305(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }" { (expression_statement "param_2 = __errno_location();" (assignment_expression "param_2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "param_1 = *param_2;" (assignment_expression "param_1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "iVar2 = FUN_00109f15(local_1018);" (assignment_expression "iVar2 = FUN_00109f15(local_1018)" identifier = (call_expression "FUN_00109f15(local_1018)" identifier (argument_list "(local_1018)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }" { (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;) (if_statement "if (param_1 != 0) {\n            *param_2 = param_1;\n          }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n            *param_2 = param_1;\n          }" { (expression_statement "*param_2 = param_1;" (assignment_expression "*param_2 = param_1" (pointer_expression "*param_2" * identifier) = identifier) ;) })) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) }) (else_clause "else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" else (compound_statement "{\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" { (expression_statement "iVar2 = FUN_00109f15(local_1018);" (assignment_expression "iVar2 = FUN_00109f15(local_1018)" identifier = (call_expression "FUN_00109f15(local_1018)" identifier (argument_list "(local_1018)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }" { (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" identifier (argument_list "(local_1018)" ( identifier ))) ;) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;) })) }))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "FUN_00109e1f(*piVar3);" (call_expression "FUN_00109e1f(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) ))) ;) (labeled_statement "LAB_00108769:\n      uVar4 = (uint)unaff_R15;" statement_identifier : (expression_statement "uVar4 = (uint)unaff_R15;" (assignment_expression "uVar4 = (uint)unaff_R15" identifier = (cast_expression "(uint)unaff_R15" ( (type_descriptor "uint" type_identifier) ) identifier)) ;)) }) while (parenthesized_expression "(uVar4 == 0x5f)" ( (binary_expression "uVar4 == 0x5f" identifier == number_literal) )) ;)) }) (else_clause "else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" else (compound_statement "{\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" { (expression_statement "iVar1 = FUN_00108305(__ptr,param_3);" (assignment_expression "iVar1 = FUN_00108305(__ptr,param_3)" identifier = (call_expression "FUN_00108305(__ptr,param_3)" identifier (argument_list "(__ptr,param_3)" ( identifier , identifier )))) ;) (expression_statement "local_1020 = (uint *)__errno_location();" (assignment_expression "local_1020 = (uint *)__errno_location()" identifier = (cast_expression "(uint *)__errno_location()" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "__errno_location()" identifier (argument_list "()" ( ))))) ;) (expression_statement "uVar4 = *local_1020;" (assignment_expression "uVar4 = *local_1020" identifier = (pointer_expression "*local_1020" * identifier)) ;) (expression_statement "unaff_R15 = (ulong)uVar4;" (assignment_expression "unaff_R15 = (ulong)uVar4" identifier = (cast_expression "(ulong)uVar4" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) (if_statement "if (__ptr != local_1008) {\n      free(__ptr);\n    }" if (parenthesized_expression "(__ptr != local_1008)" ( (binary_expression "__ptr != local_1008" identifier != identifier) )) (compound_statement "{\n      free(__ptr);\n    }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (if_statement "if (iVar1 != -1) goto LAB_001086b8;" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (goto_statement "goto LAB_001086b8;" goto statement_identifier ;)) (if_statement "if (0x26 < uVar4) goto LAB_00108769;" if (parenthesized_expression "(0x26 < uVar4)" ( (binary_expression "0x26 < uVar4" number_literal < identifier) )) (goto_statement "goto LAB_00108769;" goto statement_identifier ;)) (if_statement "if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;" if (parenthesized_expression "((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0)" ( (binary_expression "(0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0" (parenthesized_expression "(0x4000102006U >> (unaff_R15 & 0x3f) & 1)" ( (binary_expression "0x4000102006U >> (unaff_R15 & 0x3f) & 1" (binary_expression "0x4000102006U >> (unaff_R15 & 0x3f)" number_literal >> (parenthesized_expression "(unaff_R15 & 0x3f)" ( (binary_expression "unaff_R15 & 0x3f" identifier & number_literal) ))) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00108646;" goto statement_identifier ;)) }))) (expression_statement "*local_1020 = uVar4;" (assignment_expression "*local_1020 = uVar4" (pointer_expression "*local_1020" * identifier) = identifier) ;) (labeled_statement "LAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) }))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (pointer_expression * IDENT)) == (char_literal ' character ')) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (labeled_statement statement_identifier : (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * IDENT) ))) ;) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == IDENT) ))) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (goto_statement goto statement_identifier ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (goto_statement goto statement_identifier ;) })) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * IDENT) ))) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;)) }) while (parenthesized_expression ( (binary_expression IDENT == LIT) )) ;)) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression LIT >> (parenthesized_expression ( (binary_expression IDENT & LIT) ))) & LIT) )) != LIT) )) (goto_statement goto statement_identifier ;)) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int FUN_0010859c(int param_1,int *param_2,undefined8 param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" (primitive_type "int") (function_declarator "FUN_0010859c(int param_1,int *param_2,undefined8 param_3)" (identifier "FUN_0010859c") (parameter_list "(int param_1,int *param_2,undefined8 param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined8 param_3" (type_identifier "undefined8") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined1 *__ptr;\n  int *piVar3;\n  uint uVar4;\n  ulong unaff_R15;\n  long in_FS_OFFSET;\n  uint *local_1020;\n  int local_1018 [4];\n  undefined1 local_1008 [4040];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }\n  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);\n  if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }\n  *local_1020 = uVar4;\nLAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined1 *__ptr;" (type_identifier "undefined1") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "ulong unaff_R15;" (type_identifier "ulong") (identifier "unaff_R15") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "uint *local_1020;" (type_identifier "uint") (pointer_declarator "*local_1020" (* "*") (identifier "local_1020")) (; ";")) (declaration "int local_1018 [4];" (primitive_type "int") (array_declarator "local_1018 [4]" (identifier "local_1018") ([ "[") (number_literal "4") (] "]")) (; ";")) (declaration "undefined1 local_1008 [4040];" (type_identifier "undefined1") (array_declarator "local_1008 [4040]" (identifier "local_1008") ([ "[") (number_literal "4040") (] "]")) (; ";")) (declaration "long local_40;" (sized_type_specifier "long" (long "long")) (identifier "local_40") (; ";")) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if ((param_1 == -100) || ((char)*param_2 == '/')) {\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }" (if "if") (parenthesized_expression "((param_1 == -100) || ((char)*param_2 == '/'))" (( "(") (binary_expression "(param_1 == -100) || ((char)*param_2 == '/')" (parenthesized_expression "(param_1 == -100)" (( "(") (binary_expression "param_1 == -100" (identifier "param_1") (== "==") (number_literal "-100")) () ")")) (|| "||") (parenthesized_expression "((char)*param_2 == '/')" (( "(") (binary_expression "(char)*param_2 == '/'" (cast_expression "(char)*param_2" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")"))) () ")")) (compound_statement "{\n    iVar1 = FUN_00108305(param_2,param_3);\n    goto LAB_001086b8;\n  }" ({ "{") (expression_statement "iVar1 = FUN_00108305(param_2,param_3);" (assignment_expression "iVar1 = FUN_00108305(param_2,param_3)" (identifier "iVar1") (= "=") (call_expression "FUN_00108305(param_2,param_3)" (identifier "FUN_00108305") (argument_list "(param_2,param_3)" (( "(") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (goto_statement "goto LAB_001086b8;" (goto "goto") (statement_identifier "LAB_001086b8") (; ";")) (} "}"))) (expression_statement "__ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);" (assignment_expression "__ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2)" (identifier "__ptr") (= "=") (cast_expression "(undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0010a5ae(local_1008,param_1,param_2)" (identifier "FUN_0010a5ae") (argument_list "(local_1008,param_1,param_2)" (( "(") (identifier "local_1008") (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")"))))) (; ";")) (if_statement "if (__ptr == (undefined1 *)0x0) {\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }\n  else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" (if "if") (parenthesized_expression "(__ptr == (undefined1 *)0x0)" (( "(") (binary_expression "__ptr == (undefined1 *)0x0" (identifier "__ptr") (== "==") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\nLAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);\n  }" ({ "{") (labeled_statement "LAB_00108646:\n    do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);" (statement_identifier "LAB_00108646") (: ":") (do_statement "do {\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    } while (uVar4 == 0x5f);" (do "do") (compound_statement "{\n      iVar1 = FUN_00109ec4(local_1018);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;\n      iVar1 = fchdir(param_1);\n      if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }\n      iVar1 = FUN_00108305(param_2,param_3);\n      if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }\n      piVar3 = __errno_location();\n      FUN_00109e1f(*piVar3);\nLAB_00108769:\n      uVar4 = (uint)unaff_R15;\n    }" ({ "{") (expression_statement "iVar1 = FUN_00109ec4(local_1018);" (assignment_expression "iVar1 = FUN_00109ec4(local_1018)" (identifier "iVar1") (= "=") (call_expression "FUN_00109ec4(local_1018)" (identifier "FUN_00109ec4") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        piVar3 = __errno_location();\n        FUN_00109de9(*piVar3);\nLAB_001086f0:\n        FUN_00109f36(local_1018);\n        piVar3 = __errno_location();\n        *piVar3 = 9;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "FUN_00109de9(*piVar3);" (call_expression "FUN_00109de9(*piVar3)" (identifier "FUN_00109de9") (argument_list "(*piVar3)" (( "(") (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) () ")"))) (; ";")) (labeled_statement "LAB_001086f0:\n        FUN_00109f36(local_1018);" (statement_identifier "LAB_001086f0") (: ":") (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" (identifier "FUN_00109f36") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")"))) (; ";"))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*piVar3 = 9;" (assignment_expression "*piVar3 = 9" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (number_literal "9")) (; ";")) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (goto_statement "goto LAB_001086b8;" (goto "goto") (statement_identifier "LAB_001086b8") (; ";")) (} "}"))) (if_statement "if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;" (if "if") (parenthesized_expression "((-1 < param_1) && (local_1018[0] == param_1))" (( "(") (binary_expression "(-1 < param_1) && (local_1018[0] == param_1)" (parenthesized_expression "(-1 < param_1)" (( "(") (binary_expression "-1 < param_1" (number_literal "-1") (< "<") (identifier "param_1")) () ")")) (&& "&&") (parenthesized_expression "(local_1018[0] == param_1)" (( "(") (binary_expression "local_1018[0] == param_1" (subscript_expression "local_1018[0]" (identifier "local_1018") ([ "[") (number_literal "0") (] "]")) (== "==") (identifier "param_1")) () ")"))) () ")")) (goto_statement "goto LAB_001086f0;" (goto "goto") (statement_identifier "LAB_001086f0") (; ";"))) (expression_statement "iVar1 = fchdir(param_1);" (assignment_expression "iVar1 = fchdir(param_1)" (identifier "iVar1") (= "=") (call_expression "fchdir(param_1)" (identifier "fchdir") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        piVar3 = __errno_location();\n        iVar1 = *piVar3;\n        FUN_00109f36(local_1018);\n        *piVar3 = iVar1;\n        iVar1 = -1;\n        goto LAB_001086b8;\n      }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" (identifier "iVar1") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" (identifier "FUN_00109f36") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")"))) (; ";")) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (goto_statement "goto LAB_001086b8;" (goto "goto") (statement_identifier "LAB_001086b8") (; ";")) (} "}"))) (expression_statement "iVar1 = FUN_00108305(param_2,param_3);" (assignment_expression "iVar1 = FUN_00108305(param_2,param_3)" (identifier "iVar1") (= "=") (call_expression "FUN_00108305(param_2,param_3)" (identifier "FUN_00108305") (argument_list "(param_2,param_3)" (( "(") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (iVar1 == -1) {\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }\n      else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" (if "if") (parenthesized_expression "(iVar1 == -1)" (( "(") (binary_expression "iVar1 == -1" (identifier "iVar1") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n        param_2 = __errno_location();\n        param_1 = *param_2;\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }\n      }" ({ "{") (expression_statement "param_2 = __errno_location();" (assignment_expression "param_2 = __errno_location()" (identifier "param_2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "param_1 = *param_2;" (assignment_expression "param_1 = *param_2" (identifier "param_1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (expression_statement "iVar2 = FUN_00109f15(local_1018);" (assignment_expression "iVar2 = FUN_00109f15(local_1018)" (identifier "iVar2") (= "=") (call_expression "FUN_00109f15(local_1018)" (identifier "FUN_00109f15") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          FUN_00109f36(local_1018);\n          if (param_1 != 0) {\n            *param_2 = param_1;\n          }\n          goto LAB_001086b8;\n        }" ({ "{") (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" (identifier "FUN_00109f36") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")"))) (; ";")) (if_statement "if (param_1 != 0) {\n            *param_2 = param_1;\n          }" (if "if") (parenthesized_expression "(param_1 != 0)" (( "(") (binary_expression "param_1 != 0" (identifier "param_1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            *param_2 = param_1;\n          }" ({ "{") (expression_statement "*param_2 = param_1;" (assignment_expression "*param_2 = param_1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "param_1")) (; ";")) (} "}"))) (goto_statement "goto LAB_001086b8;" (goto "goto") (statement_identifier "LAB_001086b8") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" (else "else") (compound_statement "{\n        iVar2 = FUN_00109f15(local_1018);\n        if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }\n      }" ({ "{") (expression_statement "iVar2 = FUN_00109f15(local_1018);" (assignment_expression "iVar2 = FUN_00109f15(local_1018)" (identifier "iVar2") (= "=") (call_expression "FUN_00109f15(local_1018)" (identifier "FUN_00109f15") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          FUN_00109f36(local_1018);\n          goto LAB_001086b8;\n        }" ({ "{") (expression_statement "FUN_00109f36(local_1018);" (call_expression "FUN_00109f36(local_1018)" (identifier "FUN_00109f36") (argument_list "(local_1018)" (( "(") (identifier "local_1018") () ")"))) (; ";")) (goto_statement "goto LAB_001086b8;" (goto "goto") (statement_identifier "LAB_001086b8") (; ";")) (} "}"))) (} "}")))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "FUN_00109e1f(*piVar3);" (call_expression "FUN_00109e1f(*piVar3)" (identifier "FUN_00109e1f") (argument_list "(*piVar3)" (( "(") (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) () ")"))) (; ";")) (labeled_statement "LAB_00108769:\n      uVar4 = (uint)unaff_R15;" (statement_identifier "LAB_00108769") (: ":") (expression_statement "uVar4 = (uint)unaff_R15;" (assignment_expression "uVar4 = (uint)unaff_R15" (identifier "uVar4") (= "=") (cast_expression "(uint)unaff_R15" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "unaff_R15"))) (; ";"))) (} "}")) (while "while") (parenthesized_expression "(uVar4 == 0x5f)" (( "(") (binary_expression "uVar4 == 0x5f" (identifier "uVar4") (== "==") (number_literal "0x5f")) () ")")) (; ";"))) (} "}")) (else_clause "else {\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" (else "else") (compound_statement "{\n    iVar1 = FUN_00108305(__ptr,param_3);\n    local_1020 = (uint *)__errno_location();\n    uVar4 = *local_1020;\n    unaff_R15 = (ulong)uVar4;\n    if (__ptr != local_1008) {\n      free(__ptr);\n    }\n    if (iVar1 != -1) goto LAB_001086b8;\n    if (0x26 < uVar4) goto LAB_00108769;\n    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;\n  }" ({ "{") (expression_statement "iVar1 = FUN_00108305(__ptr,param_3);" (assignment_expression "iVar1 = FUN_00108305(__ptr,param_3)" (identifier "iVar1") (= "=") (call_expression "FUN_00108305(__ptr,param_3)" (identifier "FUN_00108305") (argument_list "(__ptr,param_3)" (( "(") (identifier "__ptr") (, ",") (identifier "param_3") () ")")))) (; ";")) (expression_statement "local_1020 = (uint *)__errno_location();" (assignment_expression "local_1020 = (uint *)__errno_location()" (identifier "local_1020") (= "=") (cast_expression "(uint *)__errno_location()" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "uVar4 = *local_1020;" (assignment_expression "uVar4 = *local_1020" (identifier "uVar4") (= "=") (pointer_expression "*local_1020" (* "*") (identifier "local_1020"))) (; ";")) (expression_statement "unaff_R15 = (ulong)uVar4;" (assignment_expression "unaff_R15 = (ulong)uVar4" (identifier "unaff_R15") (= "=") (cast_expression "(ulong)uVar4" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "uVar4"))) (; ";")) (if_statement "if (__ptr != local_1008) {\n      free(__ptr);\n    }" (if "if") (parenthesized_expression "(__ptr != local_1008)" (( "(") (binary_expression "__ptr != local_1008" (identifier "__ptr") (!= "!=") (identifier "local_1008")) () ")")) (compound_statement "{\n      free(__ptr);\n    }" ({ "{") (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (} "}"))) (if_statement "if (iVar1 != -1) goto LAB_001086b8;" (if "if") (parenthesized_expression "(iVar1 != -1)" (( "(") (binary_expression "iVar1 != -1" (identifier "iVar1") (!= "!=") (number_literal "-1")) () ")")) (goto_statement "goto LAB_001086b8;" (goto "goto") (statement_identifier "LAB_001086b8") (; ";"))) (if_statement "if (0x26 < uVar4) goto LAB_00108769;" (if "if") (parenthesized_expression "(0x26 < uVar4)" (( "(") (binary_expression "0x26 < uVar4" (number_literal "0x26") (< "<") (identifier "uVar4")) () ")")) (goto_statement "goto LAB_00108769;" (goto "goto") (statement_identifier "LAB_00108769") (; ";"))) (if_statement "if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;" (if "if") (parenthesized_expression "((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0)" (( "(") (binary_expression "(0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0" (parenthesized_expression "(0x4000102006U >> (unaff_R15 & 0x3f) & 1)" (( "(") (binary_expression "0x4000102006U >> (unaff_R15 & 0x3f) & 1" (binary_expression "0x4000102006U >> (unaff_R15 & 0x3f)" (number_literal "0x4000102006U") (>> ">>") (parenthesized_expression "(unaff_R15 & 0x3f)" (( "(") (binary_expression "unaff_R15 & 0x3f" (identifier "unaff_R15") (& "&") (number_literal "0x3f")) () ")"))) (& "&") (number_literal "1")) () ")")) (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_00108646;" (goto "goto") (statement_identifier "LAB_00108646") (; ";"))) (} "}")))) (expression_statement "*local_1020 = uVar4;" (assignment_expression "*local_1020 = uVar4" (pointer_expression "*local_1020" (* "*") (identifier "local_1020")) (= "=") (identifier "uVar4")) (; ";")) (labeled_statement "LAB_001086b8:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" (statement_identifier "LAB_001086b8") (: ":") (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

int function_1(int var_2,char *file,type_1 *con)

{
  type_2 var_10;
  long var_19;
  int var_9;
  int var_17;
  int var_15;
  char *var_5;
  type_2 *puVar6;
  int *piVar7;
  long var_1;
  type_3 type_3;
  char var_7 [4032];
  
  var_19 = *(long *)(var_1 + 0x28);
  if ((var_2 == -100) || (*file == '/')) {
    var_9 = var_3(file,con);
    goto LAB_001086b8;
  }
  var_5 = var_4(var_7,var_2,file);
  if (var_5 == (char *)0x0) goto LAB_00108646;
  var_9 = var_3(var_5,con);
  puVar6 = (type_2 *)var_6();
  var_10 = *puVar6;
  if (var_5 != var_7) {
    var_8(var_5);
  }
  if (var_9 != -1) goto LAB_001086b8;
  if (var_10 < 0x27) {
    if ((0x4000102006U >> ((type_4)var_10 & 0x3f) & 1) == 0) {
LAB_00108773:
      *puVar6 = var_10;
      goto LAB_001086b8;
    }
  }
  else if (var_10 != 0x5f) goto LAB_00108773;
LAB_00108646:
  var_9 = var_11(&type_3);
  if (var_9 != 0) {
    piVar7 = var_6();
                    /* WARNING: Subroutine does not return */
    var_12(*piVar7);
  }
  if ((var_2 < 0) || (type_3.desc != var_2)) {
    var_9 = var_13(var_2);
    if (var_9 == 0) {
      var_9 = var_3(file,con);
      if (var_9 == -1) {
        piVar7 = var_6();
        var_17 = *piVar7;
        var_15 = var_14(&type_3);
        if (var_15 != 0) goto LAB_0010875d;
        var_16(&type_3);
        if (var_17 != 0) {
          *piVar7 = var_17;
        }
      }
      else {
        var_17 = var_14(&type_3);
        if (var_17 != 0) {
LAB_0010875d:
          piVar7 = var_6();
                    /* WARNING: Subroutine does not return */
          var_18(*piVar7);
        }
        var_16(&type_3);
      }
    }
    else {
      piVar7 = var_6();
      var_9 = *piVar7;
      var_16(&type_3);
      *piVar7 = var_9;
      var_9 = -1;
    }
  }
  else {
    var_16(&type_3);
    piVar7 = var_6();
    *piVar7 = 9;
    var_9 = -1;
  }
LAB_001086b8:
  if (var_19 == *(long *)(var_1 + 0x28)) {
    return var_9;
  }
                    /* WARNING: Subroutine does not return */
  var_20();
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (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))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (pointer_expression argument: (identifier))) right: (char_literal (character)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))) (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (goto_statement label: (statement_identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))))) (goto_statement label: (statement_identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (goto_statement label: (statement_identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (goto_statement label: (statement_identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (number_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal))) right: (number_literal))) consequence: (goto_statement label: (statement_identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (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))))))) consequence: (compound_statement (return_statement (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

int MASKED(int param_1,int *param_2,undefined8 param_3)

{
  int iVar1;
  int iVar2;
  undefined1 *__ptr;
  int *piVar3;
  uint uVar4;
  ulong unaff_R15;
  long in_FS_OFFSET;
  uint *local_1020;
  int local_1018 [4];
  undefined1 local_1008 [4040];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  if ((param_1 == -100) || ((char)*param_2 == '/')) {
    iVar1 = FUN_00108305(param_2,param_3);
    goto LAB_001086b8;
  }
  __ptr = (undefined1 *)FUN_0010a5ae(local_1008,param_1,param_2);
  if (__ptr == (undefined1 *)0x0) {
LAB_00108646:
    do {
      iVar1 = FUN_00109ec4(local_1018);
      if (iVar1 != 0) {
        piVar3 = __errno_location();
        FUN_00109de9(*piVar3);
LAB_001086f0:
        FUN_00109f36(local_1018);
        piVar3 = __errno_location();
        *piVar3 = 9;
        iVar1 = -1;
        goto LAB_001086b8;
      }
      if ((-1 < param_1) && (local_1018[0] == param_1)) goto LAB_001086f0;
      iVar1 = fchdir(param_1);
      if (iVar1 != 0) {
        piVar3 = __errno_location();
        iVar1 = *piVar3;
        FUN_00109f36(local_1018);
        *piVar3 = iVar1;
        iVar1 = -1;
        goto LAB_001086b8;
      }
      iVar1 = FUN_00108305(param_2,param_3);
      if (iVar1 == -1) {
        param_2 = __errno_location();
        param_1 = *param_2;
        iVar2 = FUN_00109f15(local_1018);
        if (iVar2 == 0) {
          FUN_00109f36(local_1018);
          if (param_1 != 0) {
            *param_2 = param_1;
          }
          goto LAB_001086b8;
        }
      }
      else {
        iVar2 = FUN_00109f15(local_1018);
        if (iVar2 == 0) {
          FUN_00109f36(local_1018);
          goto LAB_001086b8;
        }
      }
      piVar3 = __errno_location();
      FUN_00109e1f(*piVar3);
LAB_00108769:
      uVar4 = (uint)unaff_R15;
    } while (uVar4 == 0x5f);
  }
  else {
    iVar1 = FUN_00108305(__ptr,param_3);
    local_1020 = (uint *)__errno_location();
    uVar4 = *local_1020;
    unaff_R15 = (ulong)uVar4;
    if (__ptr != local_1008) {
      free(__ptr);
    }
    if (iVar1 != -1) goto LAB_001086b8;
    if (0x26 < uVar4) goto LAB_00108769;
    if ((0x4000102006U >> (unaff_R15 & 0x3f) & 1) != 0) goto LAB_00108646;
  }
  *local_1020 = uVar4;
LAB_001086b8:
  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

