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

int chdir_long(char *dir)

{
  char *pcVar1;
  int iVar2;
  int *piVar3;
  size_t sVar4;
  cd_buf *pcVar5;
  int iVar6;
  undefined1 *puVar7;
  size_t sVar8;
  int iVar9;
  int iVar10;
  char *pcVar11;
  int iVar12;
  cd_buf *in_stack_ffffffd4;
  
  iVar2 = chdir(dir);
  if (iVar2 == 0) {
    return 0;
  }
  piVar3 = __errno_location();
  if (*piVar3 != 0x24) {
    return iVar2;
  }
  sVar4 = strlen(dir);
  if (sVar4 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");
  }
  if (sVar4 < 0x1000) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");
  }
  pcVar5 = (cd_buf *)strspn(dir,"/");
  if (pcVar5 == (cd_buf *)0x2) {
    puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);
    if (puVar7 == (undefined1 *)0x0) {
      return -1;
    }
    *puVar7 = 0;
    iVar2 = openat64(-100,dir,0x10900);
    *puVar7 = 0x2f;
    if (iVar2 < 0) {
LAB_0001d6ef:
      iVar12 = *piVar3;
      goto LAB_0001d546;
    }
    in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);
    sVar8 = strspn((char *)in_stack_ffffffd4,"/");
    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);
  }
  else {
    iVar2 = -100;
    pcVar11 = dir;
    if (pcVar5 != (cd_buf *)0x0) {
      iVar2 = openat64(-100,"/",0x10900);
      if (iVar2 < 0) goto LAB_0001d6ef;
      pcVar11 = dir + (int)pcVar5;
      in_stack_ffffffd4 = pcVar5;
    }
  }
  if (*pcVar11 == '/') {
                    /* WARNING: Subroutine does not return */
    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");
  }
  pcVar1 = dir + sVar4;
  if (pcVar1 < pcVar11) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");
  }
  for (; iVar10 = iVar2, 0xfff < (int)pcVar1 - (int)pcVar11; pcVar11 = pcVar11 + sVar4) {
    in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);
    if (in_stack_ffffffd4 == (cd_buf *)0x0) {
      *piVar3 = 0x24;
      return -1;
    }
    *(char *)&in_stack_ffffffd4->fd = '\0';
    if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");
    }
    iVar6 = openat64(iVar2,pcVar11,0x10900);
    if (iVar6 < 0) {
      *(char *)&in_stack_ffffffd4->fd = '/';
      goto LAB_0001d538;
    }
    if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;
    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);
    *(char *)&in_stack_ffffffd4->fd = '/';
    sVar4 = strspn(pcVar11,"/");
    iVar2 = iVar6;
  }
  iVar6 = iVar2;
  if (pcVar11 < pcVar1) {
    iVar9 = openat64(iVar2,pcVar11,0x10900);
    if (iVar9 < 0) goto LAB_0001d538;
    if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {
      iVar10 = fchdir(iVar9);
      if (iVar10 != 0) {
        iVar12 = *piVar3;
        goto LAB_0001d697;
      }
      goto LAB_0001d654;
    }
  }
  else {
    iVar9 = fchdir(iVar2);
    if (iVar9 != 0) goto LAB_0001d538;
    iVar9 = iVar2;
    if (iVar2 < 0) {
      return 0;
    }
LAB_0001d654:
    iVar10 = close(iVar9);
    if (iVar10 == 0) {
      return 0;
    }
  }
LAB_0001d52d:
  do {
    cdb_free(in_stack_ffffffd4);
    iVar6 = iVar2;
    iVar10 = iVar2;
LAB_0001d538:
    iVar12 = *piVar3;
    iVar2 = iVar6;
    iVar9 = iVar10;
    if (iVar10 < 0) break;
LAB_0001d697:
    iVar10 = close(iVar9);
  } while (iVar10 != 0);
LAB_0001d546:
  *piVar3 = iVar12;
  return -1;
}



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

int FUN_0001d3e0(char *param_1)

{
  int iVar1;
  int *piVar2;
  size_t sVar3;
  size_t sVar4;
  undefined1 *puVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  char *__file;
  int iVar9;
  
  iVar1 = chdir(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  piVar2 = __errno_location();
  if (*piVar2 != 0x24) {
    return iVar1;
  }
  sVar3 = strlen(param_1);
  if (sVar3 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");
  }
  if (sVar3 < 0x1000) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");
  }
  sVar4 = strspn(param_1,"/");
  if (sVar4 == 2) {
    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);
    if (puVar5 == (undefined1 *)0x0) {
      return -1;
    }
    *puVar5 = 0;
    iVar1 = openat64(-100,param_1,0x10900);
    *puVar5 = 0x2f;
    if (iVar1 < 0) {
LAB_0001d6ef:
      iVar9 = *piVar2;
      goto LAB_0001d546;
    }
    sVar4 = strspn(puVar5 + 1,"/");
    __file = puVar5 + 1 + sVar4;
  }
  else {
    iVar1 = -100;
    __file = param_1;
    if (sVar4 != 0) {
      iVar1 = openat64(-100,"/",0x10900);
      if (iVar1 < 0) goto LAB_0001d6ef;
      __file = param_1 + sVar4;
    }
  }
  if (*__file == '/') {
                    /* WARNING: Subroutine does not return */
    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");
  }
  param_1 = param_1 + sVar3;
  if (param_1 < __file) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");
  }
  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {
    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);
    if (puVar5 == (undefined1 *)0x0) {
      *piVar2 = 0x24;
      return -1;
    }
    *puVar5 = 0;
    if (0xfff < (int)puVar5 - (int)__file) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");
    }
    iVar6 = openat64(iVar1,__file,0x10900);
    if (iVar6 < 0) {
      *puVar5 = 0x2f;
      goto LAB_0001d538;
    }
    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;
    *puVar5 = 0x2f;
    sVar3 = strspn(puVar5 + 1,"/");
    iVar1 = iVar6;
    __file = puVar5 + 1 + sVar3;
  }
  iVar6 = iVar1;
  if (__file < param_1) {
    iVar7 = openat64(iVar1,__file,0x10900);
    if (iVar7 < 0) goto LAB_0001d538;
    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {
      iVar8 = fchdir(iVar7);
      if (iVar8 != 0) {
        iVar9 = *piVar2;
        goto LAB_0001d697;
      }
      goto LAB_0001d654;
    }
  }
  else {
    iVar7 = fchdir(iVar1);
    if (iVar7 != 0) goto LAB_0001d538;
    iVar7 = iVar1;
    if (iVar1 < 0) {
      return 0;
    }
LAB_0001d654:
    iVar8 = close(iVar7);
    if (iVar8 == 0) {
      return 0;
    }
  }
LAB_0001d52d:
  do {
    FUN_0001d3b0();
    iVar6 = iVar1;
    iVar8 = iVar1;
LAB_0001d538:
    iVar9 = *piVar2;
    iVar1 = iVar6;
    iVar7 = iVar8;
    if (iVar8 < 0) break;
LAB_0001d697:
    iVar8 = close(iVar7);
  } while (iVar8 != 0);
LAB_0001d546:
  *piVar2 = iVar9;
  return -1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00012c10
ADD EBX,0x9c17
SUB ESP,0x28
MOV EBP,dword ptr [ESP + 0x3c]
PUSH EBP
CALL 0x00012130
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x0001d551
CALL 0x00012320
CMP dword ptr [EAX],0x24
MOV dword ptr [ESP + 0xc],EAX
JNZ 0x0001d551
SUB ESP,0xc
PUSH EBP
CALL 0x000122c0
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x0001d719
CMP EAX,0xfff
JBE 0x0001d735
SUB ESP,0x8
LEA EAX,[EBX + 0xffff9f71]
MOV dword ptr [ESP + 0x10],EAX
PUSH EAX
PUSH EBP
CALL 0x000124c0
ADD ESP,0x10
CMP EAX,0x2
JZ 0x0001d590
MOV EDX,EBP
MOV EDI,0xffffff9c
TEST EAX,EAX
JNZ 0x0001d560
CMP byte ptr [EDX],0x2f
JZ 0x0001d751
LEA EAX,[EBP + ESI*0x1]
MOV dword ptr [ESP + 0x4],EAX
CMP EDX,EAX
JA 0x0001d770
SUB EAX,EDX
MOV ESI,EDX
CMP EAX,0xfff
JG 0x0001d4c3
JMP 0x0001d6e8
SUB ESP,0x8
LEA ESI,[EDX + 0x1]
MOV byte ptr [EDX],0x2f
MOV EDI,EBP
PUSH dword ptr [ESP + 0x10]
PUSH ESI
CALL 0x000124c0
ADD ESP,0x10
ADD ESI,EAX
MOV EAX,dword ptr [ESP + 0x4]
SUB EAX,ESI
CMP EAX,0xfff
JLE 0x0001d618
SUB ESP,0x4
PUSH 0x1000
PUSH 0x2f
PUSH ESI
CALL 0x000122b0
ADD ESP,0x10
MOV EDX,EAX
TEST EAX,EAX
JZ 0x0001d600
MOV byte ptr [EAX],0x0
SUB EAX,ESI
CMP EAX,0xfff
JG 0x0001d6fa
MOV dword ptr [ESP],EDX
SUB ESP,0x4
PUSH 0x10900
PUSH ESI
PUSH EDI
CALL 0x000122d0
ADD ESP,0x10
MOV EDX,dword ptr [ESP]
TEST EAX,EAX
MOV EBP,EAX
JS 0x0001d6b0
TEST EDI,EDI
JS 0x0001d498
SUB ESP,0xc
PUSH EDI
CALL 0x000124a0
ADD ESP,0x10
MOV EDX,dword ptr [ESP]
TEST EAX,EAX
JZ 0x0001d498
CALL 0x0001d3b0
MOV EDI,EBP
LEA ESI,[ESI]
MOV EAX,dword ptr [ESP + 0xc]
MOV ESI,dword ptr [EAX]
TEST EDI,EDI
JNS 0x0001d697
MOV EAX,dword ptr [ESP + 0xc]
MOV dword ptr [EAX],ESI
MOV ESI,0xffffffff
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV dword ptr [ESP],EAX
SUB ESP,0x4
PUSH 0x10900
PUSH dword ptr [ESP + 0x10]
PUSH -0x64
CALL 0x000122d0
ADD ESP,0x10
MOV EDI,EAX
TEST EAX,EAX
JS 0x0001d6ef
MOV ECX,dword ptr [ESP]
LEA EDX,[EBP + ECX*0x1]
JMP 0x0001d46b
SUB ESP,0x4
LEA EAX,[ESI + -0x3]
PUSH EAX
LEA EAX,[EBP + 0x3]
PUSH 0x2f
PUSH EAX
CALL 0x0001e090
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001d6c0
MOV dword ptr [ESP],EAX
SUB ESP,0x4
MOV byte ptr [EAX],0x0
PUSH 0x10900
PUSH EBP
PUSH -0x64
CALL 0x000122d0
ADD ESP,0x10
MOV EDX,dword ptr [ESP]
TEST EAX,EAX
MOV EDI,EAX
MOV byte ptr [EDX],0x2f
JS 0x0001d6ef
SUB ESP,0x8
ADD EDX,0x1
PUSH dword ptr [ESP + 0x10]
PUSH EDX
MOV dword ptr [ESP + 0x10],EDX
CALL 0x000124c0
ADD ESP,0x10
MOV EDX,dword ptr [ESP]
ADD EDX,EAX
JMP 0x0001d46b
MOV EAX,dword ptr [ESP + 0xc]
MOV ESI,0xffffffff
MOV dword ptr [EAX],0x24
JMP 0x0001d551
MOV EDX,ESI
CMP dword ptr [ESP + 0x4],EDX
JBE 0x0001d670
SUB ESP,0x4
PUSH 0x10900
PUSH EDX
PUSH EBP
CALL 0x000122d0
ADD ESP,0x10
MOV EDI,EAX
TEST EAX,EAX
JS 0x0001d532
TEST EBP,EBP
JNS 0x0001d6ca
SUB ESP,0xc
PUSH EDI
CALL 0x000123e0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0001d691
SUB ESP,0xc
PUSH EDI
CALL 0x000124a0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0001d52d
XOR ESI,ESI
JMP 0x0001d551
SUB ESP,0xc
MOV EDI,EBP
PUSH EBP
CALL 0x000123e0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0001d538
TEST EBP,EBP
JNS 0x0001d654
XOR ESI,ESI
JMP 0x0001d551
MOV EAX,dword ptr [ESP + 0xc]
MOV ESI,dword ptr [EAX]
SUB ESP,0xc
PUSH EDI
CALL 0x000124a0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001d546
JMP 0x0001d52d
MOV byte ptr [EDX],0x2f
JMP 0x0001d538
MOV ESI,0xffffffff
JMP 0x0001d551
SUB ESP,0xc
PUSH EBP
CALL 0x000124a0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001d644
JMP 0x0001d52d
MOV EBP,EDI
JMP 0x0001d61a
MOV EAX,dword ptr [ESP + 0xc]
MOV ESI,dword ptr [EAX]
JMP 0x0001d546
LEA EAX,[EBX + 0xffffa120]
PUSH EAX
LEA EAX,[EBX + 0xffffa0b4]
PUSH 0xb3
PUSH EAX
LEA EAX,[EBX + 0xffffa101]
PUSH EAX
CALL 0x000124e0
LEA EAX,[EBX + 0xffffa120]
PUSH EAX
LEA EAX,[EBX + 0xffffa0b4]
PUSH 0x7e
PUSH EAX
LEA EAX,[EBX + 0xffffa0d2]
PUSH EAX
CALL 0x000124e0
LEA EAX,[EBX + 0xffffa120]
PUSH EAX
LEA EAX,[EBX + 0xffffa0b4]
PUSH 0x7f
PUSH EAX
LEA EAX,[EBX + 0xffffa0da]
PUSH EAX
CALL 0x000124e0
LEA EAX,[EBX + 0xffffa120]
PUSH EAX
LEA EAX,[EBX + 0xffffa0b4]
PUSH 0xa2
PUSH EAX
LEA EAX,[EBX + 0xffffa0e6]
PUSH EAX
CALL 0x000124e0
LEA EAX,[EBX + 0xffffa120]
PUSH EAX
LEA EAX,[EBX + 0xffffa0b4]
PUSH 0xa3
PUSH EAX
LEA EAX,[EBX + 0xffffa0f2]
PUSH EAX
CALL 0x000124e0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_0001d3e0(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}\n\n" comment (function_definition "int FUN_0001d3e0(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}" primitive_type (function_declarator "FUN_0001d3e0(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "char *__file;" primitive_type (pointer_declarator "*__file" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (expression_statement "iVar1 = chdir(param_1);" (assignment_expression "iVar1 = chdir(param_1)" identifier = (call_expression "chdir(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n    return 0;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 0x24) {\n    return iVar1;\n  }" if (parenthesized_expression "(*piVar2 != 0x24)" ( (binary_expression "*piVar2 != 0x24" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "sVar3 = strlen(param_1);" (assignment_expression "sVar3 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (sVar3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" if (parenthesized_expression "(sVar3 == 0)" ( (binary_expression "sVar3 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");" (call_expression "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" identifier (argument_list "("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" ( (string_literal ""0 < len"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (if_statement "if (sVar3 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" if (parenthesized_expression "(sVar3 < 0x1000)" ( (binary_expression "sVar3 < 0x1000" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");" (call_expression "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" identifier (argument_list "("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" ( (string_literal ""4096 <= len"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "sVar4 = strspn(param_1,"/");" (assignment_expression "sVar4 = strspn(param_1,"/")" identifier = (call_expression "strspn(param_1,"/")" identifier (argument_list "(param_1,"/")" ( identifier , (string_literal ""/"" " string_content ") )))) ;) (if_statement "if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" if (parenthesized_expression "(sVar4 == 2)" ( (binary_expression "sVar4 == 2" identifier == number_literal) )) (compound_statement "{\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }" { (expression_statement "puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);" (assignment_expression "puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" identifier = (cast_expression "(undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" identifier (argument_list "(param_1 + 3,0x2f,sVar3 - 3)" ( (binary_expression "param_1 + 3" identifier + number_literal) , number_literal , (binary_expression "sVar3 - 3" identifier - number_literal) ))))) ;) (if_statement "if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }" if (parenthesized_expression "(puVar5 == (undefined1 *)0x0)" ( (binary_expression "puVar5 == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (expression_statement "iVar1 = openat64(-100,param_1,0x10900);" (assignment_expression "iVar1 = openat64(-100,param_1,0x10900)" identifier = (call_expression "openat64(-100,param_1,0x10900)" identifier (argument_list "(-100,param_1,0x10900)" ( number_literal , identifier , number_literal )))) ;) (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (if_statement "if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }" { (labeled_statement "LAB_0001d6ef:\n      iVar9 = *piVar2;" statement_identifier : (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;)) (goto_statement "goto LAB_0001d546;" goto statement_identifier ;) })) (expression_statement "sVar4 = strspn(puVar5 + 1,"/");" (assignment_expression "sVar4 = strspn(puVar5 + 1,"/")" identifier = (call_expression "strspn(puVar5 + 1,"/")" identifier (argument_list "(puVar5 + 1,"/")" ( (binary_expression "puVar5 + 1" identifier + number_literal) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "__file = puVar5 + 1 + sVar4;" (assignment_expression "__file = puVar5 + 1 + sVar4" identifier = (binary_expression "puVar5 + 1 + sVar4" (binary_expression "puVar5 + 1" identifier + number_literal) + identifier)) ;) }) (else_clause "else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" else (compound_statement "{\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" { (expression_statement "iVar1 = -100;" (assignment_expression "iVar1 = -100" identifier = number_literal) ;) (expression_statement "__file = param_1;" (assignment_expression "__file = param_1" identifier = identifier) ;) (if_statement "if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }" { (expression_statement "iVar1 = openat64(-100,"/",0x10900);" (assignment_expression "iVar1 = openat64(-100,"/",0x10900)" identifier = (call_expression "openat64(-100,"/",0x10900)" identifier (argument_list "(-100,"/",0x10900)" ( number_literal , (string_literal ""/"" " string_content ") , number_literal )))) ;) (if_statement "if (iVar1 < 0) goto LAB_0001d6ef;" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0001d6ef;" goto statement_identifier ;)) (expression_statement "__file = param_1 + sVar4;" (assignment_expression "__file = param_1 + sVar4" identifier = (binary_expression "param_1 + sVar4" identifier + identifier)) ;) })) }))) (if_statement "if (*__file == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" if (parenthesized_expression "(*__file == '/')" ( (binary_expression "*__file == '/'" (pointer_expression "*__file" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");" (call_expression "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" identifier (argument_list "("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" ( (string_literal ""*dir != \'/\'"" " string_content escape_sequence string_content escape_sequence ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "param_1 = param_1 + sVar3;" (assignment_expression "param_1 = param_1 + sVar3" identifier = (binary_expression "param_1 + sVar3" identifier + identifier)) ;) (if_statement "if (param_1 < __file) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" if (parenthesized_expression "(param_1 < __file)" ( (binary_expression "param_1 < __file" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");" (call_expression "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" identifier (argument_list "("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" ( (string_literal ""dir <= dir_end"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (while_statement "while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }" while (parenthesized_expression "(iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file)" ( (comma_expression "iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file" (assignment_expression "iVar8 = iVar1" identifier = identifier) , (binary_expression "0xfff < (int)param_1 - (int)__file" number_literal < (binary_expression "(int)param_1 - (int)__file" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)__file" ( (type_descriptor "int" primitive_type) ) identifier)))) )) (compound_statement "{\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }" { (expression_statement "puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);" (assignment_expression "puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000)" identifier = (cast_expression "(undefined1 *)memrchr(__file,0x2f,0x1000)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memrchr(__file,0x2f,0x1000)" identifier (argument_list "(__file,0x2f,0x1000)" ( identifier , number_literal , number_literal ))))) ;) (if_statement "if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }" if (parenthesized_expression "(puVar5 == (undefined1 *)0x0)" ( (binary_expression "puVar5 == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *piVar2 = 0x24;\n      return -1;\n    }" { (expression_statement "*piVar2 = 0x24;" (assignment_expression "*piVar2 = 0x24" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (if_statement "if (0xfff < (int)puVar5 - (int)__file) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" if (parenthesized_expression "(0xfff < (int)puVar5 - (int)__file)" ( (binary_expression "0xfff < (int)puVar5 - (int)__file" number_literal < (binary_expression "(int)puVar5 - (int)__file" (cast_expression "(int)puVar5" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)__file" ( (type_descriptor "int" primitive_type) ) identifier))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" { comment (expression_statement "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");" (call_expression "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" identifier (argument_list "("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" ( (string_literal ""slash - dir < 4096"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "iVar6 = openat64(iVar1,__file,0x10900);" (assignment_expression "iVar6 = openat64(iVar1,__file,0x10900)" identifier = (call_expression "openat64(iVar1,__file,0x10900)" identifier (argument_list "(iVar1,__file,0x10900)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }" if (parenthesized_expression "(iVar6 < 0)" ( (binary_expression "iVar6 < 0" identifier < number_literal) )) (compound_statement "{\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }" { (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;) })) (if_statement "if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;" if (parenthesized_expression "((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0))" ( (binary_expression "(-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "(iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)" ( (comma_expression "iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0" (assignment_expression "iVar8 = close(iVar1)" identifier = (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) , (comma_expression "iVar1 = iVar6, iVar8 != 0" (assignment_expression "iVar1 = iVar6" identifier = identifier) , (binary_expression "iVar8 != 0" identifier != number_literal))) ))) )) (goto_statement "goto LAB_0001d52d;" goto statement_identifier ;)) (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (expression_statement "sVar3 = strspn(puVar5 + 1,"/");" (assignment_expression "sVar3 = strspn(puVar5 + 1,"/")" identifier = (call_expression "strspn(puVar5 + 1,"/")" identifier (argument_list "(puVar5 + 1,"/")" ( (binary_expression "puVar5 + 1" identifier + number_literal) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar1 = iVar6;" (assignment_expression "iVar1 = iVar6" identifier = identifier) ;) (expression_statement "__file = puVar5 + 1 + sVar3;" (assignment_expression "__file = puVar5 + 1 + sVar3" identifier = (binary_expression "puVar5 + 1 + sVar3" (binary_expression "puVar5 + 1" identifier + number_literal) + identifier)) ;) })) (expression_statement "iVar6 = iVar1;" (assignment_expression "iVar6 = iVar1" identifier = identifier) ;) (if_statement "if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" if (parenthesized_expression "(__file < param_1)" ( (binary_expression "__file < param_1" identifier < identifier) )) (compound_statement "{\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }" { (expression_statement "iVar7 = openat64(iVar1,__file,0x10900);" (assignment_expression "iVar7 = openat64(iVar1,__file,0x10900)" identifier = (call_expression "openat64(iVar1,__file,0x10900)" identifier (argument_list "(iVar1,__file,0x10900)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar7 < 0) goto LAB_0001d538;" if (parenthesized_expression "(iVar7 < 0)" ( (binary_expression "iVar7 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;)) (if_statement "if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" if (parenthesized_expression "((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0))" ( (binary_expression "(iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) || (parenthesized_expression "(iVar8 = close(iVar1), iVar8 == 0)" ( (comma_expression "iVar8 = close(iVar1), iVar8 == 0" (assignment_expression "iVar8 = close(iVar1)" identifier = (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) , (binary_expression "iVar8 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" { (expression_statement "iVar8 = fchdir(iVar7);" (assignment_expression "iVar8 = fchdir(iVar7)" identifier = (call_expression "fchdir(iVar7)" identifier (argument_list "(iVar7)" ( identifier )))) ;) (if_statement "if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }" if (parenthesized_expression "(iVar8 != 0)" ( (binary_expression "iVar8 != 0" identifier != number_literal) )) (compound_statement "{\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }" { (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (goto_statement "goto LAB_0001d697;" goto statement_identifier ;) })) (goto_statement "goto LAB_0001d654;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" else (compound_statement "{\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" { (expression_statement "iVar7 = fchdir(iVar1);" (assignment_expression "iVar7 = fchdir(iVar1)" identifier = (call_expression "fchdir(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (iVar7 != 0) goto LAB_0001d538;" if (parenthesized_expression "(iVar7 != 0)" ( (binary_expression "iVar7 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;)) (expression_statement "iVar7 = iVar1;" (assignment_expression "iVar7 = iVar1" identifier = identifier) ;) (if_statement "if (iVar1 < 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (labeled_statement "LAB_0001d654:\n    iVar8 = close(iVar7);" statement_identifier : (expression_statement "iVar8 = close(iVar7);" (assignment_expression "iVar8 = close(iVar7)" identifier = (call_expression "close(iVar7)" identifier (argument_list "(iVar7)" ( identifier )))) ;)) (if_statement "if (iVar8 == 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar8 == 0)" ( (binary_expression "iVar8 == 0" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (labeled_statement "LAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);" statement_identifier : (do_statement "do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);" do (compound_statement "{\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  }" { (expression_statement "FUN_0001d3b0();" (call_expression "FUN_0001d3b0()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar6 = iVar1;" (assignment_expression "iVar6 = iVar1" identifier = identifier) ;) (expression_statement "iVar8 = iVar1;" (assignment_expression "iVar8 = iVar1" identifier = identifier) ;) (labeled_statement "LAB_0001d538:\n    iVar9 = *piVar2;" statement_identifier : (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;)) (expression_statement "iVar1 = iVar6;" (assignment_expression "iVar1 = iVar6" identifier = identifier) ;) (expression_statement "iVar7 = iVar8;" (assignment_expression "iVar7 = iVar8" identifier = identifier) ;) (if_statement "if (iVar8 < 0) break;" if (parenthesized_expression "(iVar8 < 0)" ( (binary_expression "iVar8 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (labeled_statement "LAB_0001d697:\n    iVar8 = close(iVar7);" statement_identifier : (expression_statement "iVar8 = close(iVar7);" (assignment_expression "iVar8 = close(iVar7)" identifier = (call_expression "close(iVar7)" identifier (argument_list "(iVar7)" ( identifier )))) ;)) }) while (parenthesized_expression "(iVar8 != 0)" ( (binary_expression "iVar8 != 0" identifier != number_literal) )) ;)) (labeled_statement "LAB_0001d546:\n  *piVar2 = iVar9;" statement_identifier : (expression_statement "*piVar2 = iVar9;" (assignment_expression "*piVar2 = iVar9" (pointer_expression "*piVar2" * identifier) = identifier) ;)) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint chdir_long(char *dir)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int *piVar3;\n  size_t sVar4;\n  cd_buf *pcVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  size_t sVar8;\n  int iVar9;\n  int iVar10;\n  char *pcVar11;\n  int iVar12;\n  cd_buf *in_stack_ffffffd4;\n  \n  iVar2 = chdir(dir);\n  if (iVar2 == 0) {\n    return 0;\n  }\n  piVar3 = __errno_location();\n  if (*piVar3 != 0x24) {\n    return iVar2;\n  }\n  sVar4 = strlen(dir);\n  if (sVar4 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar4 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  pcVar5 = (cd_buf *)strspn(dir,"/");\n  if (pcVar5 == (cd_buf *)0x2) {\n    puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);\n    if (puVar7 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar7 = 0;\n    iVar2 = openat64(-100,dir,0x10900);\n    *puVar7 = 0x2f;\n    if (iVar2 < 0) {\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }\n    in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);\n    sVar8 = strspn((char *)in_stack_ffffffd4,"/");\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);\n  }\n  else {\n    iVar2 = -100;\n    pcVar11 = dir;\n    if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }\n  }\n  if (*pcVar11 == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  pcVar1 = dir + sVar4;\n  if (pcVar1 < pcVar11) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  for (; iVar10 = iVar2, 0xfff < (int)pcVar1 - (int)pcVar11; pcVar11 = pcVar11 + sVar4) {\n    in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);\n    if (in_stack_ffffffd4 == (cd_buf *)0x0) {\n      *piVar3 = 0x24;\n      return -1;\n    }\n    *(char *)&in_stack_ffffffd4->fd = '\0';\n    if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar6 < 0) {\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);\n    *(char *)&in_stack_ffffffd4->fd = '/';\n    sVar4 = strspn(pcVar11,"/");\n    iVar2 = iVar6;\n  }\n  iVar6 = iVar2;\n  if (pcVar11 < pcVar1) {\n    iVar9 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar9 < 0) goto LAB_0001d538;\n    if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar9 = fchdir(iVar2);\n    if (iVar9 != 0) goto LAB_0001d538;\n    iVar9 = iVar2;\n    if (iVar2 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar10 = close(iVar9);\n    if (iVar10 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    cdb_free(in_stack_ffffffd4);\n    iVar6 = iVar2;\n    iVar10 = iVar2;\nLAB_0001d538:\n    iVar12 = *piVar3;\n    iVar2 = iVar6;\n    iVar9 = iVar10;\n    if (iVar10 < 0) break;\nLAB_0001d697:\n    iVar10 = close(iVar9);\n  } while (iVar10 != 0);\nLAB_0001d546:\n  *piVar3 = iVar12;\n  return -1;\n}\n\n" comment (function_definition "int chdir_long(char *dir)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int *piVar3;\n  size_t sVar4;\n  cd_buf *pcVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  size_t sVar8;\n  int iVar9;\n  int iVar10;\n  char *pcVar11;\n  int iVar12;\n  cd_buf *in_stack_ffffffd4;\n  \n  iVar2 = chdir(dir);\n  if (iVar2 == 0) {\n    return 0;\n  }\n  piVar3 = __errno_location();\n  if (*piVar3 != 0x24) {\n    return iVar2;\n  }\n  sVar4 = strlen(dir);\n  if (sVar4 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar4 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  pcVar5 = (cd_buf *)strspn(dir,"/");\n  if (pcVar5 == (cd_buf *)0x2) {\n    puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);\n    if (puVar7 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar7 = 0;\n    iVar2 = openat64(-100,dir,0x10900);\n    *puVar7 = 0x2f;\n    if (iVar2 < 0) {\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }\n    in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);\n    sVar8 = strspn((char *)in_stack_ffffffd4,"/");\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);\n  }\n  else {\n    iVar2 = -100;\n    pcVar11 = dir;\n    if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }\n  }\n  if (*pcVar11 == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  pcVar1 = dir + sVar4;\n  if (pcVar1 < pcVar11) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  for (; iVar10 = iVar2, 0xfff < (int)pcVar1 - (int)pcVar11; pcVar11 = pcVar11 + sVar4) {\n    in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);\n    if (in_stack_ffffffd4 == (cd_buf *)0x0) {\n      *piVar3 = 0x24;\n      return -1;\n    }\n    *(char *)&in_stack_ffffffd4->fd = '\0';\n    if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar6 < 0) {\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);\n    *(char *)&in_stack_ffffffd4->fd = '/';\n    sVar4 = strspn(pcVar11,"/");\n    iVar2 = iVar6;\n  }\n  iVar6 = iVar2;\n  if (pcVar11 < pcVar1) {\n    iVar9 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar9 < 0) goto LAB_0001d538;\n    if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar9 = fchdir(iVar2);\n    if (iVar9 != 0) goto LAB_0001d538;\n    iVar9 = iVar2;\n    if (iVar2 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar10 = close(iVar9);\n    if (iVar10 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    cdb_free(in_stack_ffffffd4);\n    iVar6 = iVar2;\n    iVar10 = iVar2;\nLAB_0001d538:\n    iVar12 = *piVar3;\n    iVar2 = iVar6;\n    iVar9 = iVar10;\n    if (iVar10 < 0) break;\nLAB_0001d697:\n    iVar10 = close(iVar9);\n  } while (iVar10 != 0);\nLAB_0001d546:\n  *piVar3 = iVar12;\n  return -1;\n}" primitive_type (function_declarator "chdir_long(char *dir)" identifier (parameter_list "(char *dir)" ( (parameter_declaration "char *dir" primitive_type (pointer_declarator "*dir" * identifier)) ))) (compound_statement "{\n  char *pcVar1;\n  int iVar2;\n  int *piVar3;\n  size_t sVar4;\n  cd_buf *pcVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  size_t sVar8;\n  int iVar9;\n  int iVar10;\n  char *pcVar11;\n  int iVar12;\n  cd_buf *in_stack_ffffffd4;\n  \n  iVar2 = chdir(dir);\n  if (iVar2 == 0) {\n    return 0;\n  }\n  piVar3 = __errno_location();\n  if (*piVar3 != 0x24) {\n    return iVar2;\n  }\n  sVar4 = strlen(dir);\n  if (sVar4 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar4 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  pcVar5 = (cd_buf *)strspn(dir,"/");\n  if (pcVar5 == (cd_buf *)0x2) {\n    puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);\n    if (puVar7 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar7 = 0;\n    iVar2 = openat64(-100,dir,0x10900);\n    *puVar7 = 0x2f;\n    if (iVar2 < 0) {\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }\n    in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);\n    sVar8 = strspn((char *)in_stack_ffffffd4,"/");\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);\n  }\n  else {\n    iVar2 = -100;\n    pcVar11 = dir;\n    if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }\n  }\n  if (*pcVar11 == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  pcVar1 = dir + sVar4;\n  if (pcVar1 < pcVar11) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  for (; iVar10 = iVar2, 0xfff < (int)pcVar1 - (int)pcVar11; pcVar11 = pcVar11 + sVar4) {\n    in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);\n    if (in_stack_ffffffd4 == (cd_buf *)0x0) {\n      *piVar3 = 0x24;\n      return -1;\n    }\n    *(char *)&in_stack_ffffffd4->fd = '\0';\n    if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar6 < 0) {\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);\n    *(char *)&in_stack_ffffffd4->fd = '/';\n    sVar4 = strspn(pcVar11,"/");\n    iVar2 = iVar6;\n  }\n  iVar6 = iVar2;\n  if (pcVar11 < pcVar1) {\n    iVar9 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar9 < 0) goto LAB_0001d538;\n    if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar9 = fchdir(iVar2);\n    if (iVar9 != 0) goto LAB_0001d538;\n    iVar9 = iVar2;\n    if (iVar2 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar10 = close(iVar9);\n    if (iVar10 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    cdb_free(in_stack_ffffffd4);\n    iVar6 = iVar2;\n    iVar10 = iVar2;\nLAB_0001d538:\n    iVar12 = *piVar3;\n    iVar2 = iVar6;\n    iVar9 = iVar10;\n    if (iVar10 < 0) break;\nLAB_0001d697:\n    iVar10 = close(iVar9);\n  } while (iVar10 != 0);\nLAB_0001d546:\n  *piVar3 = iVar12;\n  return -1;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "cd_buf *pcVar5;" type_identifier (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "undefined1 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "size_t sVar8;" primitive_type identifier ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "int iVar10;" primitive_type identifier ;) (declaration "char *pcVar11;" primitive_type (pointer_declarator "*pcVar11" * identifier) ;) (declaration "int iVar12;" primitive_type identifier ;) (declaration "cd_buf *in_stack_ffffffd4;" type_identifier (pointer_declarator "*in_stack_ffffffd4" * identifier) ;) (expression_statement "iVar2 = chdir(dir);" (assignment_expression "iVar2 = chdir(dir)" identifier = (call_expression "chdir(dir)" identifier (argument_list "(dir)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n    return 0;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar3 != 0x24) {\n    return iVar2;\n  }" if (parenthesized_expression "(*piVar3 != 0x24)" ( (binary_expression "*piVar3 != 0x24" (pointer_expression "*piVar3" * identifier) != number_literal) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "sVar4 = strlen(dir);" (assignment_expression "sVar4 = strlen(dir)" identifier = (call_expression "strlen(dir)" identifier (argument_list "(dir)" ( identifier )))) ;) (if_statement "if (sVar4 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" if (parenthesized_expression "(sVar4 == 0)" ( (binary_expression "sVar4 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");" (call_expression "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" identifier (argument_list "("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" ( (string_literal ""0 < len"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (if_statement "if (sVar4 < 0x1000) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" if (parenthesized_expression "(sVar4 < 0x1000)" ( (binary_expression "sVar4 < 0x1000" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");" (call_expression "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" identifier (argument_list "("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" ( (string_literal ""4096 <= len"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "pcVar5 = (cd_buf *)strspn(dir,"/");" (assignment_expression "pcVar5 = (cd_buf *)strspn(dir,"/")" identifier = (cast_expression "(cd_buf *)strspn(dir,"/")" ( (type_descriptor "cd_buf *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "strspn(dir,"/")" identifier (argument_list "(dir,"/")" ( identifier , (string_literal ""/"" " string_content ") ))))) ;) (if_statement "if (pcVar5 == (cd_buf *)0x2) {\n    puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);\n    if (puVar7 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar7 = 0;\n    iVar2 = openat64(-100,dir,0x10900);\n    *puVar7 = 0x2f;\n    if (iVar2 < 0) {\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }\n    in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);\n    sVar8 = strspn((char *)in_stack_ffffffd4,"/");\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);\n  }\n  else {\n    iVar2 = -100;\n    pcVar11 = dir;\n    if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }\n  }" if (parenthesized_expression "(pcVar5 == (cd_buf *)0x2)" ( (binary_expression "pcVar5 == (cd_buf *)0x2" identifier == (cast_expression "(cd_buf *)0x2" ( (type_descriptor "cd_buf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);\n    if (puVar7 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar7 = 0;\n    iVar2 = openat64(-100,dir,0x10900);\n    *puVar7 = 0x2f;\n    if (iVar2 < 0) {\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }\n    in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);\n    sVar8 = strspn((char *)in_stack_ffffffd4,"/");\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);\n  }" { (expression_statement "puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3);" (assignment_expression "puVar7 = (undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3)" identifier = (cast_expression "(undefined1 *)rpl_memchr(dir + 3,0x2f,sVar4 - 3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "rpl_memchr(dir + 3,0x2f,sVar4 - 3)" identifier (argument_list "(dir + 3,0x2f,sVar4 - 3)" ( (binary_expression "dir + 3" identifier + number_literal) , number_literal , (binary_expression "sVar4 - 3" identifier - number_literal) ))))) ;) (if_statement "if (puVar7 == (undefined1 *)0x0) {\n      return -1;\n    }" if (parenthesized_expression "(puVar7 == (undefined1 *)0x0)" ( (binary_expression "puVar7 == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "*puVar7 = 0;" (assignment_expression "*puVar7 = 0" (pointer_expression "*puVar7" * identifier) = number_literal) ;) (expression_statement "iVar2 = openat64(-100,dir,0x10900);" (assignment_expression "iVar2 = openat64(-100,dir,0x10900)" identifier = (call_expression "openat64(-100,dir,0x10900)" identifier (argument_list "(-100,dir,0x10900)" ( number_literal , identifier , number_literal )))) ;) (expression_statement "*puVar7 = 0x2f;" (assignment_expression "*puVar7 = 0x2f" (pointer_expression "*puVar7" * identifier) = number_literal) ;) (if_statement "if (iVar2 < 0) {\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\nLAB_0001d6ef:\n      iVar12 = *piVar3;\n      goto LAB_0001d546;\n    }" { (labeled_statement "LAB_0001d6ef:\n      iVar12 = *piVar3;" statement_identifier : (expression_statement "iVar12 = *piVar3;" (assignment_expression "iVar12 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;)) (goto_statement "goto LAB_0001d546;" goto statement_identifier ;) })) (expression_statement "in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1);" (assignment_expression "in_stack_ffffffd4 = (cd_buf *)(puVar7 + 1)" identifier = (cast_expression "(cd_buf *)(puVar7 + 1)" ( (type_descriptor "cd_buf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar7 + 1)" ( (binary_expression "puVar7 + 1" identifier + number_literal) )))) ;) (expression_statement "sVar8 = strspn((char *)in_stack_ffffffd4,"/");" (assignment_expression "sVar8 = strspn((char *)in_stack_ffffffd4,"/")" identifier = (call_expression "strspn((char *)in_stack_ffffffd4,"/")" identifier (argument_list "((char *)in_stack_ffffffd4,"/")" ( (cast_expression "(char *)in_stack_ffffffd4" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8);" (assignment_expression "pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + sVar8)" identifier = (cast_expression "(char *)((int)&in_stack_ffffffd4->fd + sVar8)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&in_stack_ffffffd4->fd + sVar8)" ( (binary_expression "(int)&in_stack_ffffffd4->fd + sVar8" (cast_expression "(int)&in_stack_ffffffd4->fd" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&in_stack_ffffffd4->fd" & (field_expression "in_stack_ffffffd4->fd" identifier -> field_identifier))) + identifier) )))) ;) }) (else_clause "else {\n    iVar2 = -100;\n    pcVar11 = dir;\n    if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }\n  }" else (compound_statement "{\n    iVar2 = -100;\n    pcVar11 = dir;\n    if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }\n  }" { (expression_statement "iVar2 = -100;" (assignment_expression "iVar2 = -100" identifier = number_literal) ;) (expression_statement "pcVar11 = dir;" (assignment_expression "pcVar11 = dir" identifier = identifier) ;) (if_statement "if (pcVar5 != (cd_buf *)0x0) {\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }" if (parenthesized_expression "(pcVar5 != (cd_buf *)0x0)" ( (binary_expression "pcVar5 != (cd_buf *)0x0" identifier != (cast_expression "(cd_buf *)0x0" ( (type_descriptor "cd_buf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      iVar2 = openat64(-100,"/",0x10900);\n      if (iVar2 < 0) goto LAB_0001d6ef;\n      pcVar11 = dir + (int)pcVar5;\n      in_stack_ffffffd4 = pcVar5;\n    }" { (expression_statement "iVar2 = openat64(-100,"/",0x10900);" (assignment_expression "iVar2 = openat64(-100,"/",0x10900)" identifier = (call_expression "openat64(-100,"/",0x10900)" identifier (argument_list "(-100,"/",0x10900)" ( number_literal , (string_literal ""/"" " string_content ") , number_literal )))) ;) (if_statement "if (iVar2 < 0) goto LAB_0001d6ef;" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0001d6ef;" goto statement_identifier ;)) (expression_statement "pcVar11 = dir + (int)pcVar5;" (assignment_expression "pcVar11 = dir + (int)pcVar5" identifier = (binary_expression "dir + (int)pcVar5" identifier + (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "in_stack_ffffffd4 = pcVar5;" (assignment_expression "in_stack_ffffffd4 = pcVar5" identifier = identifier) ;) })) }))) (if_statement "if (*pcVar11 == '/') {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" if (parenthesized_expression "(*pcVar11 == '/')" ( (binary_expression "*pcVar11 == '/'" (pointer_expression "*pcVar11" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");" (call_expression "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" identifier (argument_list "("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" ( (string_literal ""*dir != \'/\'"" " string_content escape_sequence string_content escape_sequence ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "pcVar1 = dir + sVar4;" (assignment_expression "pcVar1 = dir + sVar4" identifier = (binary_expression "dir + sVar4" identifier + identifier)) ;) (if_statement "if (pcVar1 < pcVar11) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" if (parenthesized_expression "(pcVar1 < pcVar11)" ( (binary_expression "pcVar1 < pcVar11" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" { comment (expression_statement "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");" (call_expression "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" identifier (argument_list "("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" ( (string_literal ""dir <= dir_end"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (for_statement "for (; iVar10 = iVar2, 0xfff < (int)pcVar1 - (int)pcVar11; pcVar11 = pcVar11 + sVar4) {\n    in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);\n    if (in_stack_ffffffd4 == (cd_buf *)0x0) {\n      *piVar3 = 0x24;\n      return -1;\n    }\n    *(char *)&in_stack_ffffffd4->fd = '\0';\n    if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar6 < 0) {\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);\n    *(char *)&in_stack_ffffffd4->fd = '/';\n    sVar4 = strspn(pcVar11,"/");\n    iVar2 = iVar6;\n  }" for ( ; (comma_expression "iVar10 = iVar2, 0xfff < (int)pcVar1 - (int)pcVar11" (assignment_expression "iVar10 = iVar2" identifier = identifier) , (binary_expression "0xfff < (int)pcVar1 - (int)pcVar11" number_literal < (binary_expression "(int)pcVar1 - (int)pcVar11" (cast_expression "(int)pcVar1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pcVar11" ( (type_descriptor "int" primitive_type) ) identifier)))) ; (assignment_expression "pcVar11 = pcVar11 + sVar4" identifier = (binary_expression "pcVar11 + sVar4" identifier + identifier)) ) (compound_statement "{\n    in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);\n    if (in_stack_ffffffd4 == (cd_buf *)0x0) {\n      *piVar3 = 0x24;\n      return -1;\n    }\n    *(char *)&in_stack_ffffffd4->fd = '\0';\n    if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar6 < 0) {\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;\n    pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);\n    *(char *)&in_stack_ffffffd4->fd = '/';\n    sVar4 = strspn(pcVar11,"/");\n    iVar2 = iVar6;\n  }" { (expression_statement "in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000);" (assignment_expression "in_stack_ffffffd4 = (cd_buf *)memrchr(pcVar11,0x2f,0x1000)" identifier = (cast_expression "(cd_buf *)memrchr(pcVar11,0x2f,0x1000)" ( (type_descriptor "cd_buf *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memrchr(pcVar11,0x2f,0x1000)" identifier (argument_list "(pcVar11,0x2f,0x1000)" ( identifier , number_literal , number_literal ))))) ;) (if_statement "if (in_stack_ffffffd4 == (cd_buf *)0x0) {\n      *piVar3 = 0x24;\n      return -1;\n    }" if (parenthesized_expression "(in_stack_ffffffd4 == (cd_buf *)0x0)" ( (binary_expression "in_stack_ffffffd4 == (cd_buf *)0x0" identifier == (cast_expression "(cd_buf *)0x0" ( (type_descriptor "cd_buf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *piVar3 = 0x24;\n      return -1;\n    }" { (expression_statement "*piVar3 = 0x24;" (assignment_expression "*piVar3 = 0x24" (pointer_expression "*piVar3" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })) (expression_statement "*(char *)&in_stack_ffffffd4->fd = '\0';" (assignment_expression "*(char *)&in_stack_ffffffd4->fd = '\0'" (pointer_expression "*(char *)&in_stack_ffffffd4->fd" * (cast_expression "(char *)&in_stack_ffffffd4->fd" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&in_stack_ffffffd4->fd" & (field_expression "in_stack_ffffffd4->fd" identifier -> field_identifier)))) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (0xfff < (int)in_stack_ffffffd4 - (int)pcVar11) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" if (parenthesized_expression "(0xfff < (int)in_stack_ffffffd4 - (int)pcVar11)" ( (binary_expression "0xfff < (int)in_stack_ffffffd4 - (int)pcVar11" number_literal < (binary_expression "(int)in_stack_ffffffd4 - (int)pcVar11" (cast_expression "(int)in_stack_ffffffd4" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pcVar11" ( (type_descriptor "int" primitive_type) ) identifier))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" { comment (expression_statement "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");" (call_expression "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" identifier (argument_list "("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" ( (string_literal ""slash - dir < 4096"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "iVar6 = openat64(iVar2,pcVar11,0x10900);" (assignment_expression "iVar6 = openat64(iVar2,pcVar11,0x10900)" identifier = (call_expression "openat64(iVar2,pcVar11,0x10900)" identifier (argument_list "(iVar2,pcVar11,0x10900)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar6 < 0) {\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }" if (parenthesized_expression "(iVar6 < 0)" ( (binary_expression "iVar6 < 0" identifier < number_literal) )) (compound_statement "{\n      *(char *)&in_stack_ffffffd4->fd = '/';\n      goto LAB_0001d538;\n    }" { (expression_statement "*(char *)&in_stack_ffffffd4->fd = '/';" (assignment_expression "*(char *)&in_stack_ffffffd4->fd = '/'" (pointer_expression "*(char *)&in_stack_ffffffd4->fd" * (cast_expression "(char *)&in_stack_ffffffd4->fd" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&in_stack_ffffffd4->fd" & (field_expression "in_stack_ffffffd4->fd" identifier -> field_identifier)))) = (char_literal "'/'" ' character ')) ;) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;) })) (if_statement "if ((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)) goto LAB_0001d52d;" if (parenthesized_expression "((-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0))" ( (binary_expression "(-1 < iVar2) && (iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)" (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) && (parenthesized_expression "(iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0)" ( (comma_expression "iVar10 = close(iVar2), iVar2 = iVar6, iVar10 != 0" (assignment_expression "iVar10 = close(iVar2)" identifier = (call_expression "close(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) , (comma_expression "iVar2 = iVar6, iVar10 != 0" (assignment_expression "iVar2 = iVar6" identifier = identifier) , (binary_expression "iVar10 != 0" identifier != number_literal))) ))) )) (goto_statement "goto LAB_0001d52d;" goto statement_identifier ;)) (expression_statement "pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1);" (assignment_expression "pcVar11 = (char *)((int)&in_stack_ffffffd4->fd + 1)" identifier = (cast_expression "(char *)((int)&in_stack_ffffffd4->fd + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&in_stack_ffffffd4->fd + 1)" ( (binary_expression "(int)&in_stack_ffffffd4->fd + 1" (cast_expression "(int)&in_stack_ffffffd4->fd" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&in_stack_ffffffd4->fd" & (field_expression "in_stack_ffffffd4->fd" identifier -> field_identifier))) + number_literal) )))) ;) (expression_statement "*(char *)&in_stack_ffffffd4->fd = '/';" (assignment_expression "*(char *)&in_stack_ffffffd4->fd = '/'" (pointer_expression "*(char *)&in_stack_ffffffd4->fd" * (cast_expression "(char *)&in_stack_ffffffd4->fd" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&in_stack_ffffffd4->fd" & (field_expression "in_stack_ffffffd4->fd" identifier -> field_identifier)))) = (char_literal "'/'" ' character ')) ;) (expression_statement "sVar4 = strspn(pcVar11,"/");" (assignment_expression "sVar4 = strspn(pcVar11,"/")" identifier = (call_expression "strspn(pcVar11,"/")" identifier (argument_list "(pcVar11,"/")" ( identifier , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) })) (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" identifier = identifier) ;) (if_statement "if (pcVar11 < pcVar1) {\n    iVar9 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar9 < 0) goto LAB_0001d538;\n    if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar9 = fchdir(iVar2);\n    if (iVar9 != 0) goto LAB_0001d538;\n    iVar9 = iVar2;\n    if (iVar2 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar10 = close(iVar9);\n    if (iVar10 == 0) {\n      return 0;\n    }\n  }" if (parenthesized_expression "(pcVar11 < pcVar1)" ( (binary_expression "pcVar11 < pcVar1" identifier < identifier) )) (compound_statement "{\n    iVar9 = openat64(iVar2,pcVar11,0x10900);\n    if (iVar9 < 0) goto LAB_0001d538;\n    if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }" { (expression_statement "iVar9 = openat64(iVar2,pcVar11,0x10900);" (assignment_expression "iVar9 = openat64(iVar2,pcVar11,0x10900)" identifier = (call_expression "openat64(iVar2,pcVar11,0x10900)" identifier (argument_list "(iVar2,pcVar11,0x10900)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar9 < 0) goto LAB_0001d538;" if (parenthesized_expression "(iVar9 < 0)" ( (binary_expression "iVar9 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;)) (if_statement "if ((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)) {\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" if (parenthesized_expression "((iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0))" ( (binary_expression "(iVar2 < 0) || (iVar10 = close(iVar2), iVar10 == 0)" (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) || (parenthesized_expression "(iVar10 = close(iVar2), iVar10 == 0)" ( (comma_expression "iVar10 = close(iVar2), iVar10 == 0" (assignment_expression "iVar10 = close(iVar2)" identifier = (call_expression "close(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) , (binary_expression "iVar10 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      iVar10 = fchdir(iVar9);\n      if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" { (expression_statement "iVar10 = fchdir(iVar9);" (assignment_expression "iVar10 = fchdir(iVar9)" identifier = (call_expression "fchdir(iVar9)" identifier (argument_list "(iVar9)" ( identifier )))) ;) (if_statement "if (iVar10 != 0) {\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }" if (parenthesized_expression "(iVar10 != 0)" ( (binary_expression "iVar10 != 0" identifier != number_literal) )) (compound_statement "{\n        iVar12 = *piVar3;\n        goto LAB_0001d697;\n      }" { (expression_statement "iVar12 = *piVar3;" (assignment_expression "iVar12 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (goto_statement "goto LAB_0001d697;" goto statement_identifier ;) })) (goto_statement "goto LAB_0001d654;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar9 = fchdir(iVar2);\n    if (iVar9 != 0) goto LAB_0001d538;\n    iVar9 = iVar2;\n    if (iVar2 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar10 = close(iVar9);\n    if (iVar10 == 0) {\n      return 0;\n    }\n  }" else (compound_statement "{\n    iVar9 = fchdir(iVar2);\n    if (iVar9 != 0) goto LAB_0001d538;\n    iVar9 = iVar2;\n    if (iVar2 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar10 = close(iVar9);\n    if (iVar10 == 0) {\n      return 0;\n    }\n  }" { (expression_statement "iVar9 = fchdir(iVar2);" (assignment_expression "iVar9 = fchdir(iVar2)" identifier = (call_expression "fchdir(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (if_statement "if (iVar9 != 0) goto LAB_0001d538;" if (parenthesized_expression "(iVar9 != 0)" ( (binary_expression "iVar9 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;)) (expression_statement "iVar9 = iVar2;" (assignment_expression "iVar9 = iVar2" identifier = identifier) ;) (if_statement "if (iVar2 < 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (labeled_statement "LAB_0001d654:\n    iVar10 = close(iVar9);" statement_identifier : (expression_statement "iVar10 = close(iVar9);" (assignment_expression "iVar10 = close(iVar9)" identifier = (call_expression "close(iVar9)" identifier (argument_list "(iVar9)" ( identifier )))) ;)) (if_statement "if (iVar10 == 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar10 == 0)" ( (binary_expression "iVar10 == 0" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (labeled_statement "LAB_0001d52d:\n  do {\n    cdb_free(in_stack_ffffffd4);\n    iVar6 = iVar2;\n    iVar10 = iVar2;\nLAB_0001d538:\n    iVar12 = *piVar3;\n    iVar2 = iVar6;\n    iVar9 = iVar10;\n    if (iVar10 < 0) break;\nLAB_0001d697:\n    iVar10 = close(iVar9);\n  } while (iVar10 != 0);" statement_identifier : (do_statement "do {\n    cdb_free(in_stack_ffffffd4);\n    iVar6 = iVar2;\n    iVar10 = iVar2;\nLAB_0001d538:\n    iVar12 = *piVar3;\n    iVar2 = iVar6;\n    iVar9 = iVar10;\n    if (iVar10 < 0) break;\nLAB_0001d697:\n    iVar10 = close(iVar9);\n  } while (iVar10 != 0);" do (compound_statement "{\n    cdb_free(in_stack_ffffffd4);\n    iVar6 = iVar2;\n    iVar10 = iVar2;\nLAB_0001d538:\n    iVar12 = *piVar3;\n    iVar2 = iVar6;\n    iVar9 = iVar10;\n    if (iVar10 < 0) break;\nLAB_0001d697:\n    iVar10 = close(iVar9);\n  }" { (expression_statement "cdb_free(in_stack_ffffffd4);" (call_expression "cdb_free(in_stack_ffffffd4)" identifier (argument_list "(in_stack_ffffffd4)" ( identifier ))) ;) (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" identifier = identifier) ;) (expression_statement "iVar10 = iVar2;" (assignment_expression "iVar10 = iVar2" identifier = identifier) ;) (labeled_statement "LAB_0001d538:\n    iVar12 = *piVar3;" statement_identifier : (expression_statement "iVar12 = *piVar3;" (assignment_expression "iVar12 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;)) (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (expression_statement "iVar9 = iVar10;" (assignment_expression "iVar9 = iVar10" identifier = identifier) ;) (if_statement "if (iVar10 < 0) break;" if (parenthesized_expression "(iVar10 < 0)" ( (binary_expression "iVar10 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (labeled_statement "LAB_0001d697:\n    iVar10 = close(iVar9);" statement_identifier : (expression_statement "iVar10 = close(iVar9);" (assignment_expression "iVar10 = close(iVar9)" identifier = (call_expression "close(iVar9)" identifier (argument_list "(iVar9)" ( identifier )))) ;)) }) while (parenthesized_expression "(iVar10 != 0)" ( (binary_expression "iVar10 != 0" identifier != number_literal) )) ;)) (labeled_statement "LAB_0001d546:\n  *piVar3 = iVar12;" statement_identifier : (expression_statement "*piVar3 = iVar12;" (assignment_expression "*piVar3 = iVar12" (pointer_expression "*piVar3" * identifier) = identifier) ;)) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "int FUN_0001d3e0(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}\n\n" (function_definition "int FUN_0001d3e0(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}" primitive_type (function_declarator "FUN_0001d3e0(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "char *__file;" primitive_type (pointer_declarator "*__file" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (expression_statement "iVar1 = chdir(param_1);" (assignment_expression "iVar1 = chdir(param_1)" identifier = (call_expression "chdir(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n    return 0;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 0x24) {\n    return iVar1;\n  }" if (parenthesized_expression "(*piVar2 != 0x24)" ( (binary_expression "*piVar2 != 0x24" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "sVar3 = strlen(param_1);" (assignment_expression "sVar3 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" if (parenthesized_expression "(sVar3 == 0)" ( (binary_expression "sVar3 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" { (expression_statement "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");" (call_expression "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" identifier (argument_list "("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" ( (string_literal ""0 < len"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (if_statement "if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" if (parenthesized_expression "(sVar3 < 0x1000)" ( (binary_expression "sVar3 < 0x1000" identifier < number_literal) )) (compound_statement "{\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" { (expression_statement "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");" (call_expression "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" identifier (argument_list "("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" ( (string_literal ""4096 <= len"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "sVar4 = strspn(param_1,"/");" (assignment_expression "sVar4 = strspn(param_1,"/")" identifier = (call_expression "strspn(param_1,"/")" identifier (argument_list "(param_1,"/")" ( identifier , (string_literal ""/"" " string_content ") )))) ;) (if_statement "if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" if (parenthesized_expression "(sVar4 == 2)" ( (binary_expression "sVar4 == 2" identifier == number_literal) )) (compound_statement "{\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }" { (expression_statement "puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);" (assignment_expression "puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" identifier = (cast_expression "(undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" identifier (argument_list "(param_1 + 3,0x2f,sVar3 - 3)" ( (binary_expression "param_1 + 3" identifier + number_literal) , number_literal , (binary_expression "sVar3 - 3" identifier - number_literal) ))))) ;) (if_statement "if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }" if (parenthesized_expression "(puVar5 == (undefined1 *)0x0)" ( (binary_expression "puVar5 == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (expression_statement "iVar1 = openat64(-100,param_1,0x10900);" (assignment_expression "iVar1 = openat64(-100,param_1,0x10900)" identifier = (call_expression "openat64(-100,param_1,0x10900)" identifier (argument_list "(-100,param_1,0x10900)" ( number_literal , identifier , number_literal )))) ;) (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (if_statement "if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }" { (labeled_statement "LAB_0001d6ef:\n      iVar9 = *piVar2;" statement_identifier : (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;)) (goto_statement "goto LAB_0001d546;" goto statement_identifier ;) })) (expression_statement "sVar4 = strspn(puVar5 + 1,"/");" (assignment_expression "sVar4 = strspn(puVar5 + 1,"/")" identifier = (call_expression "strspn(puVar5 + 1,"/")" identifier (argument_list "(puVar5 + 1,"/")" ( (binary_expression "puVar5 + 1" identifier + number_literal) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "__file = puVar5 + 1 + sVar4;" (assignment_expression "__file = puVar5 + 1 + sVar4" identifier = (binary_expression "puVar5 + 1 + sVar4" (binary_expression "puVar5 + 1" identifier + number_literal) + identifier)) ;) }) (else_clause "else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" else (compound_statement "{\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" { (expression_statement "iVar1 = -100;" (assignment_expression "iVar1 = -100" identifier = number_literal) ;) (expression_statement "__file = param_1;" (assignment_expression "__file = param_1" identifier = identifier) ;) (if_statement "if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }" { (expression_statement "iVar1 = openat64(-100,"/",0x10900);" (assignment_expression "iVar1 = openat64(-100,"/",0x10900)" identifier = (call_expression "openat64(-100,"/",0x10900)" identifier (argument_list "(-100,"/",0x10900)" ( number_literal , (string_literal ""/"" " string_content ") , number_literal )))) ;) (if_statement "if (iVar1 < 0) goto LAB_0001d6ef;" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0001d6ef;" goto statement_identifier ;)) (expression_statement "__file = param_1 + sVar4;" (assignment_expression "__file = param_1 + sVar4" identifier = (binary_expression "param_1 + sVar4" identifier + identifier)) ;) })) }))) (if_statement "if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" if (parenthesized_expression "(*__file == '/')" ( (binary_expression "*__file == '/'" (pointer_expression "*__file" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" { (expression_statement "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");" (call_expression "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" identifier (argument_list "("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" ( (string_literal ""*dir != \'/\'"" " string_content escape_sequence string_content escape_sequence ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "param_1 = param_1 + sVar3;" (assignment_expression "param_1 = param_1 + sVar3" identifier = (binary_expression "param_1 + sVar3" identifier + identifier)) ;) (if_statement "if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" if (parenthesized_expression "(param_1 < __file)" ( (binary_expression "param_1 < __file" identifier < identifier) )) (compound_statement "{\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" { (expression_statement "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");" (call_expression "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" identifier (argument_list "("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" ( (string_literal ""dir <= dir_end"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (while_statement "while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }" while (parenthesized_expression "(iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file)" ( (comma_expression "iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file" (assignment_expression "iVar8 = iVar1" identifier = identifier) , (binary_expression "0xfff < (int)param_1 - (int)__file" number_literal < (binary_expression "(int)param_1 - (int)__file" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)__file" ( (type_descriptor "int" primitive_type) ) identifier)))) )) (compound_statement "{\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }" { (expression_statement "puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);" (assignment_expression "puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000)" identifier = (cast_expression "(undefined1 *)memrchr(__file,0x2f,0x1000)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memrchr(__file,0x2f,0x1000)" identifier (argument_list "(__file,0x2f,0x1000)" ( identifier , number_literal , number_literal ))))) ;) (if_statement "if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }" if (parenthesized_expression "(puVar5 == (undefined1 *)0x0)" ( (binary_expression "puVar5 == (undefined1 *)0x0" identifier == (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *piVar2 = 0x24;\n      return -1;\n    }" { (expression_statement "*piVar2 = 0x24;" (assignment_expression "*piVar2 = 0x24" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (if_statement "if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" if (parenthesized_expression "(0xfff < (int)puVar5 - (int)__file)" ( (binary_expression "0xfff < (int)puVar5 - (int)__file" number_literal < (binary_expression "(int)puVar5 - (int)__file" (cast_expression "(int)puVar5" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)__file" ( (type_descriptor "int" primitive_type) ) identifier))) )) (compound_statement "{\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" { (expression_statement "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");" (call_expression "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" identifier (argument_list "("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" ( (string_literal ""slash - dir < 4096"" " string_content ") , (string_literal ""lib/chdir-long.c"" " string_content ") , number_literal , (string_literal ""chdir_long"" " string_content ") ))) ;) })) (expression_statement "iVar6 = openat64(iVar1,__file,0x10900);" (assignment_expression "iVar6 = openat64(iVar1,__file,0x10900)" identifier = (call_expression "openat64(iVar1,__file,0x10900)" identifier (argument_list "(iVar1,__file,0x10900)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }" if (parenthesized_expression "(iVar6 < 0)" ( (binary_expression "iVar6 < 0" identifier < number_literal) )) (compound_statement "{\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }" { (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;) })) (if_statement "if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;" if (parenthesized_expression "((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0))" ( (binary_expression "(-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "(iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)" ( (comma_expression "iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0" (assignment_expression "iVar8 = close(iVar1)" identifier = (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) , (comma_expression "iVar1 = iVar6, iVar8 != 0" (assignment_expression "iVar1 = iVar6" identifier = identifier) , (binary_expression "iVar8 != 0" identifier != number_literal))) ))) )) (goto_statement "goto LAB_0001d52d;" goto statement_identifier ;)) (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (expression_statement "sVar3 = strspn(puVar5 + 1,"/");" (assignment_expression "sVar3 = strspn(puVar5 + 1,"/")" identifier = (call_expression "strspn(puVar5 + 1,"/")" identifier (argument_list "(puVar5 + 1,"/")" ( (binary_expression "puVar5 + 1" identifier + number_literal) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar1 = iVar6;" (assignment_expression "iVar1 = iVar6" identifier = identifier) ;) (expression_statement "__file = puVar5 + 1 + sVar3;" (assignment_expression "__file = puVar5 + 1 + sVar3" identifier = (binary_expression "puVar5 + 1 + sVar3" (binary_expression "puVar5 + 1" identifier + number_literal) + identifier)) ;) })) (expression_statement "iVar6 = iVar1;" (assignment_expression "iVar6 = iVar1" identifier = identifier) ;) (if_statement "if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" if (parenthesized_expression "(__file < param_1)" ( (binary_expression "__file < param_1" identifier < identifier) )) (compound_statement "{\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }" { (expression_statement "iVar7 = openat64(iVar1,__file,0x10900);" (assignment_expression "iVar7 = openat64(iVar1,__file,0x10900)" identifier = (call_expression "openat64(iVar1,__file,0x10900)" identifier (argument_list "(iVar1,__file,0x10900)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar7 < 0) goto LAB_0001d538;" if (parenthesized_expression "(iVar7 < 0)" ( (binary_expression "iVar7 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;)) (if_statement "if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" if (parenthesized_expression "((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0))" ( (binary_expression "(iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) || (parenthesized_expression "(iVar8 = close(iVar1), iVar8 == 0)" ( (comma_expression "iVar8 = close(iVar1), iVar8 == 0" (assignment_expression "iVar8 = close(iVar1)" identifier = (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) , (binary_expression "iVar8 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" { (expression_statement "iVar8 = fchdir(iVar7);" (assignment_expression "iVar8 = fchdir(iVar7)" identifier = (call_expression "fchdir(iVar7)" identifier (argument_list "(iVar7)" ( identifier )))) ;) (if_statement "if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }" if (parenthesized_expression "(iVar8 != 0)" ( (binary_expression "iVar8 != 0" identifier != number_literal) )) (compound_statement "{\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }" { (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (goto_statement "goto LAB_0001d697;" goto statement_identifier ;) })) (goto_statement "goto LAB_0001d654;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" else (compound_statement "{\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" { (expression_statement "iVar7 = fchdir(iVar1);" (assignment_expression "iVar7 = fchdir(iVar1)" identifier = (call_expression "fchdir(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (iVar7 != 0) goto LAB_0001d538;" if (parenthesized_expression "(iVar7 != 0)" ( (binary_expression "iVar7 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0001d538;" goto statement_identifier ;)) (expression_statement "iVar7 = iVar1;" (assignment_expression "iVar7 = iVar1" identifier = identifier) ;) (if_statement "if (iVar1 < 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (labeled_statement "LAB_0001d654:\n    iVar8 = close(iVar7);" statement_identifier : (expression_statement "iVar8 = close(iVar7);" (assignment_expression "iVar8 = close(iVar7)" identifier = (call_expression "close(iVar7)" identifier (argument_list "(iVar7)" ( identifier )))) ;)) (if_statement "if (iVar8 == 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar8 == 0)" ( (binary_expression "iVar8 == 0" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (labeled_statement "LAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);" statement_identifier : (do_statement "do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);" do (compound_statement "{\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  }" { (expression_statement "FUN_0001d3b0();" (call_expression "FUN_0001d3b0()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar6 = iVar1;" (assignment_expression "iVar6 = iVar1" identifier = identifier) ;) (expression_statement "iVar8 = iVar1;" (assignment_expression "iVar8 = iVar1" identifier = identifier) ;) (labeled_statement "LAB_0001d538:\n    iVar9 = *piVar2;" statement_identifier : (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;)) (expression_statement "iVar1 = iVar6;" (assignment_expression "iVar1 = iVar6" identifier = identifier) ;) (expression_statement "iVar7 = iVar8;" (assignment_expression "iVar7 = iVar8" identifier = identifier) ;) (if_statement "if (iVar8 < 0) break;" if (parenthesized_expression "(iVar8 < 0)" ( (binary_expression "iVar8 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (labeled_statement "LAB_0001d697:\n    iVar8 = close(iVar7);" statement_identifier : (expression_statement "iVar8 = close(iVar7);" (assignment_expression "iVar8 = close(iVar7)" identifier = (call_expression "close(iVar7)" identifier (argument_list "(iVar7)" ( identifier )))) ;)) }) while (parenthesized_expression "(iVar8 != 0)" ( (binary_expression "iVar8 != 0" identifier != number_literal) )) ;)) (labeled_statement "LAB_0001d546:\n  *piVar2 = iVar9;" statement_identifier : (expression_statement "*piVar2 = iVar9;" (assignment_expression "*piVar2 = iVar9" (pointer_expression "*piVar2" * identifier) = identifier) ;)) (return_statement "return -1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (return_statement return 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 ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , LIT , (binary_expression IDENT - LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;)) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , (string_literal " string_content ") )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + LIT) + IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (string_literal " string_content ") , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) })) }))) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' character ')) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content escape_sequence string_content escape_sequence ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = IDENT) , (binary_expression LIT < (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , LIT , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) , (comma_expression (assignment_expression IDENT = IDENT) , (binary_expression IDENT != LIT))) ))) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , (string_literal " string_content ") )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + LIT) + IDENT)) ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) , (binary_expression IDENT == LIT)) ))) )) (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 = (pointer_expression * IDENT)) ;) (goto_statement goto statement_identifier ;) })) (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) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) }))) (labeled_statement statement_identifier : (do_statement do (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;)) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (break_statement break ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;)) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;)) (return_statement return LIT ;) })))
(function_definition "int FUN_0001d3e0(char *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}" (primitive_type "int") (function_declarator "FUN_0001d3e0(char *param_1)" (identifier "FUN_0001d3e0") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  size_t sVar3;\n  size_t sVar4;\n  undefined1 *puVar5;\n  int iVar6;\n  int iVar7;\n  int iVar8;\n  char *__file;\n  int iVar9;\n  \n  iVar1 = chdir(param_1);\n  if (iVar1 == 0) {\n    return 0;\n  }\n  piVar2 = __errno_location();\n  if (*piVar2 != 0x24) {\n    return iVar1;\n  }\n  sVar3 = strlen(param_1);\n  if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }\n  if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }\n  sVar4 = strspn(param_1,"/");\n  if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }\n  if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }\n  param_1 = param_1 + sVar3;\n  if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }\n  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }\n  iVar6 = iVar1;\n  if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }\nLAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);\nLAB_0001d546:\n  *piVar2 = iVar9;\n  return -1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "undefined1 *puVar5;" (type_identifier "undefined1") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (declaration "char *__file;" (primitive_type "char") (pointer_declarator "*__file" (* "*") (identifier "__file")) (; ";")) (declaration "int iVar9;" (primitive_type "int") (identifier "iVar9") (; ";")) (expression_statement "iVar1 = chdir(param_1);" (assignment_expression "iVar1 = chdir(param_1)" (identifier "iVar1") (= "=") (call_expression "chdir(param_1)" (identifier "chdir") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar2 != 0x24) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(*piVar2 != 0x24)" (( "(") (binary_expression "*piVar2 != 0x24" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (!= "!=") (number_literal "0x24")) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "sVar3 = strlen(param_1);" (assignment_expression "sVar3 = strlen(param_1)" (identifier "sVar3") (= "=") (call_expression "strlen(param_1)" (identifier "strlen") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (sVar3 == 0) {\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" (if "if") (parenthesized_expression "(sVar3 == 0)" (( "(") (binary_expression "sVar3 == 0" (identifier "sVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");\n  }" ({ "{") (expression_statement "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");" (call_expression "__assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" (identifier "__assert_fail") (argument_list "("0 < len","lib/chdir-long.c",0x7e,"chdir_long")" (( "(") (string_literal ""0 < len"" (" """) (string_content "0 < len") (" """)) (, ",") (string_literal ""lib/chdir-long.c"" (" """) (string_content "lib/chdir-long.c") (" """)) (, ",") (number_literal "0x7e") (, ",") (string_literal ""chdir_long"" (" """) (string_content "chdir_long") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if (sVar3 < 0x1000) {\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" (if "if") (parenthesized_expression "(sVar3 < 0x1000)" (( "(") (binary_expression "sVar3 < 0x1000" (identifier "sVar3") (< "<") (number_literal "0x1000")) () ")")) (compound_statement "{\n                    \n    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");\n  }" ({ "{") (expression_statement "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");" (call_expression "__assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" (identifier "__assert_fail") (argument_list "("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long")" (( "(") (string_literal ""4096 <= len"" (" """) (string_content "4096 <= len") (" """)) (, ",") (string_literal ""lib/chdir-long.c"" (" """) (string_content "lib/chdir-long.c") (" """)) (, ",") (number_literal "0x7f") (, ",") (string_literal ""chdir_long"" (" """) (string_content "chdir_long") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "sVar4 = strspn(param_1,"/");" (assignment_expression "sVar4 = strspn(param_1,"/")" (identifier "sVar4") (= "=") (call_expression "strspn(param_1,"/")" (identifier "strspn") (argument_list "(param_1,"/")" (( "(") (identifier "param_1") (, ",") (string_literal ""/"" (" """) (string_content "/") (" """)) () ")")))) (; ";")) (if_statement "if (sVar4 == 2) {\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }\n  else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" (if "if") (parenthesized_expression "(sVar4 == 2)" (( "(") (binary_expression "sVar4 == 2" (identifier "sVar4") (== "==") (number_literal "2")) () ")")) (compound_statement "{\n    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);\n    if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }\n    *puVar5 = 0;\n    iVar1 = openat64(-100,param_1,0x10900);\n    *puVar5 = 0x2f;\n    if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }\n    sVar4 = strspn(puVar5 + 1,"/");\n    __file = puVar5 + 1 + sVar4;\n  }" ({ "{") (expression_statement "puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);" (assignment_expression "puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" (identifier "puVar5") (= "=") (cast_expression "(undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3)" (identifier "FUN_0001e090") (argument_list "(param_1 + 3,0x2f,sVar3 - 3)" (( "(") (binary_expression "param_1 + 3" (identifier "param_1") (+ "+") (number_literal "3")) (, ",") (number_literal "0x2f") (, ",") (binary_expression "sVar3 - 3" (identifier "sVar3") (- "-") (number_literal "3")) () ")"))))) (; ";")) (if_statement "if (puVar5 == (undefined1 *)0x0) {\n      return -1;\n    }" (if "if") (parenthesized_expression "(puVar5 == (undefined1 *)0x0)" (( "(") (binary_expression "puVar5 == (undefined1 *)0x0" (identifier "puVar5") (== "==") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return -1;\n    }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = openat64(-100,param_1,0x10900);" (assignment_expression "iVar1 = openat64(-100,param_1,0x10900)" (identifier "iVar1") (= "=") (call_expression "openat64(-100,param_1,0x10900)" (identifier "openat64") (argument_list "(-100,param_1,0x10900)" (( "(") (number_literal "-100") (, ",") (identifier "param_1") (, ",") (number_literal "0x10900") () ")")))) (; ";")) (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0x2f")) (; ";")) (if_statement "if (iVar1 < 0) {\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\nLAB_0001d6ef:\n      iVar9 = *piVar2;\n      goto LAB_0001d546;\n    }" ({ "{") (labeled_statement "LAB_0001d6ef:\n      iVar9 = *piVar2;" (statement_identifier "LAB_0001d6ef") (: ":") (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" (identifier "iVar9") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";"))) (goto_statement "goto LAB_0001d546;" (goto "goto") (statement_identifier "LAB_0001d546") (; ";")) (} "}"))) (expression_statement "sVar4 = strspn(puVar5 + 1,"/");" (assignment_expression "sVar4 = strspn(puVar5 + 1,"/")" (identifier "sVar4") (= "=") (call_expression "strspn(puVar5 + 1,"/")" (identifier "strspn") (argument_list "(puVar5 + 1,"/")" (( "(") (binary_expression "puVar5 + 1" (identifier "puVar5") (+ "+") (number_literal "1")) (, ",") (string_literal ""/"" (" """) (string_content "/") (" """)) () ")")))) (; ";")) (expression_statement "__file = puVar5 + 1 + sVar4;" (assignment_expression "__file = puVar5 + 1 + sVar4" (identifier "__file") (= "=") (binary_expression "puVar5 + 1 + sVar4" (binary_expression "puVar5 + 1" (identifier "puVar5") (+ "+") (number_literal "1")) (+ "+") (identifier "sVar4"))) (; ";")) (} "}")) (else_clause "else {\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" (else "else") (compound_statement "{\n    iVar1 = -100;\n    __file = param_1;\n    if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }\n  }" ({ "{") (expression_statement "iVar1 = -100;" (assignment_expression "iVar1 = -100" (identifier "iVar1") (= "=") (number_literal "-100")) (; ";")) (expression_statement "__file = param_1;" (assignment_expression "__file = param_1" (identifier "__file") (= "=") (identifier "param_1")) (; ";")) (if_statement "if (sVar4 != 0) {\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }" (if "if") (parenthesized_expression "(sVar4 != 0)" (( "(") (binary_expression "sVar4 != 0" (identifier "sVar4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = openat64(-100,"/",0x10900);\n      if (iVar1 < 0) goto LAB_0001d6ef;\n      __file = param_1 + sVar4;\n    }" ({ "{") (expression_statement "iVar1 = openat64(-100,"/",0x10900);" (assignment_expression "iVar1 = openat64(-100,"/",0x10900)" (identifier "iVar1") (= "=") (call_expression "openat64(-100,"/",0x10900)" (identifier "openat64") (argument_list "(-100,"/",0x10900)" (( "(") (number_literal "-100") (, ",") (string_literal ""/"" (" """) (string_content "/") (" """)) (, ",") (number_literal "0x10900") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) goto LAB_0001d6ef;" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (goto_statement "goto LAB_0001d6ef;" (goto "goto") (statement_identifier "LAB_0001d6ef") (; ";"))) (expression_statement "__file = param_1 + sVar4;" (assignment_expression "__file = param_1 + sVar4" (identifier "__file") (= "=") (binary_expression "param_1 + sVar4" (identifier "param_1") (+ "+") (identifier "sVar4"))) (; ";")) (} "}"))) (} "}")))) (if_statement "if (*__file == '/') {\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" (if "if") (parenthesized_expression "(*__file == '/')" (( "(") (binary_expression "*__file == '/'" (pointer_expression "*__file" (* "*") (identifier "__file")) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n                    \n    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");\n  }" ({ "{") (expression_statement "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");" (call_expression "__assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" (identifier "__assert_fail") (argument_list "("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long")" (( "(") (string_literal ""*dir != \'/\'"" (" """) (string_content "*dir != ") (escape_sequence "\'") (string_content "/") (escape_sequence "\'") (" """)) (, ",") (string_literal ""lib/chdir-long.c"" (" """) (string_content "lib/chdir-long.c") (" """)) (, ",") (number_literal "0xa2") (, ",") (string_literal ""chdir_long"" (" """) (string_content "chdir_long") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "param_1 = param_1 + sVar3;" (assignment_expression "param_1 = param_1 + sVar3" (identifier "param_1") (= "=") (binary_expression "param_1 + sVar3" (identifier "param_1") (+ "+") (identifier "sVar3"))) (; ";")) (if_statement "if (param_1 < __file) {\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" (if "if") (parenthesized_expression "(param_1 < __file)" (( "(") (binary_expression "param_1 < __file" (identifier "param_1") (< "<") (identifier "__file")) () ")")) (compound_statement "{\n                    \n    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");\n  }" ({ "{") (expression_statement "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");" (call_expression "__assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" (identifier "__assert_fail") (argument_list "("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long")" (( "(") (string_literal ""dir <= dir_end"" (" """) (string_content "dir <= dir_end") (" """)) (, ",") (string_literal ""lib/chdir-long.c"" (" """) (string_content "lib/chdir-long.c") (" """)) (, ",") (number_literal "0xa3") (, ",") (string_literal ""chdir_long"" (" """) (string_content "chdir_long") (" """)) () ")"))) (; ";")) (} "}"))) (while_statement "while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }" (while "while") (parenthesized_expression "(iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file)" (( "(") (comma_expression "iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file" (assignment_expression "iVar8 = iVar1" (identifier "iVar8") (= "=") (identifier "iVar1")) (, ",") (binary_expression "0xfff < (int)param_1 - (int)__file" (number_literal "0xfff") (< "<") (binary_expression "(int)param_1 - (int)__file" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (- "-") (cast_expression "(int)__file" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__file"))))) () ")")) (compound_statement "{\n    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);\n    if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }\n    *puVar5 = 0;\n    if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }\n    iVar6 = openat64(iVar1,__file,0x10900);\n    if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }\n    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;\n    *puVar5 = 0x2f;\n    sVar3 = strspn(puVar5 + 1,"/");\n    iVar1 = iVar6;\n    __file = puVar5 + 1 + sVar3;\n  }" ({ "{") (expression_statement "puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);" (assignment_expression "puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000)" (identifier "puVar5") (= "=") (cast_expression "(undefined1 *)memrchr(__file,0x2f,0x1000)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "memrchr(__file,0x2f,0x1000)" (identifier "memrchr") (argument_list "(__file,0x2f,0x1000)" (( "(") (identifier "__file") (, ",") (number_literal "0x2f") (, ",") (number_literal "0x1000") () ")"))))) (; ";")) (if_statement "if (puVar5 == (undefined1 *)0x0) {\n      *piVar2 = 0x24;\n      return -1;\n    }" (if "if") (parenthesized_expression "(puVar5 == (undefined1 *)0x0)" (( "(") (binary_expression "puVar5 == (undefined1 *)0x0" (identifier "puVar5") (== "==") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *piVar2 = 0x24;\n      return -1;\n    }" ({ "{") (expression_statement "*piVar2 = 0x24;" (assignment_expression "*piVar2 = 0x24" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (number_literal "0x24")) (; ";")) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (0xfff < (int)puVar5 - (int)__file) {\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" (if "if") (parenthesized_expression "(0xfff < (int)puVar5 - (int)__file)" (( "(") (binary_expression "0xfff < (int)puVar5 - (int)__file" (number_literal "0xfff") (< "<") (binary_expression "(int)puVar5 - (int)__file" (cast_expression "(int)puVar5" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar5")) (- "-") (cast_expression "(int)__file" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__file")))) () ")")) (compound_statement "{\n                    \n      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");\n    }" ({ "{") (expression_statement "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");" (call_expression "__assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" (identifier "__assert_fail") (argument_list "("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long")" (( "(") (string_literal ""slash - dir < 4096"" (" """) (string_content "slash - dir < 4096") (" """)) (, ",") (string_literal ""lib/chdir-long.c"" (" """) (string_content "lib/chdir-long.c") (" """)) (, ",") (number_literal "0xb3") (, ",") (string_literal ""chdir_long"" (" """) (string_content "chdir_long") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "iVar6 = openat64(iVar1,__file,0x10900);" (assignment_expression "iVar6 = openat64(iVar1,__file,0x10900)" (identifier "iVar6") (= "=") (call_expression "openat64(iVar1,__file,0x10900)" (identifier "openat64") (argument_list "(iVar1,__file,0x10900)" (( "(") (identifier "iVar1") (, ",") (identifier "__file") (, ",") (number_literal "0x10900") () ")")))) (; ";")) (if_statement "if (iVar6 < 0) {\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }" (if "if") (parenthesized_expression "(iVar6 < 0)" (( "(") (binary_expression "iVar6 < 0" (identifier "iVar6") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      *puVar5 = 0x2f;\n      goto LAB_0001d538;\n    }" ({ "{") (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0x2f")) (; ";")) (goto_statement "goto LAB_0001d538;" (goto "goto") (statement_identifier "LAB_0001d538") (; ";")) (} "}"))) (if_statement "if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;" (if "if") (parenthesized_expression "((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0))" (( "(") (binary_expression "(-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)" (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (&& "&&") (parenthesized_expression "(iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)" (( "(") (comma_expression "iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0" (assignment_expression "iVar8 = close(iVar1)" (identifier "iVar8") (= "=") (call_expression "close(iVar1)" (identifier "close") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (, ",") (comma_expression "iVar1 = iVar6, iVar8 != 0" (assignment_expression "iVar1 = iVar6" (identifier "iVar1") (= "=") (identifier "iVar6")) (, ",") (binary_expression "iVar8 != 0" (identifier "iVar8") (!= "!=") (number_literal "0")))) () ")"))) () ")")) (goto_statement "goto LAB_0001d52d;" (goto "goto") (statement_identifier "LAB_0001d52d") (; ";"))) (expression_statement "*puVar5 = 0x2f;" (assignment_expression "*puVar5 = 0x2f" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0x2f")) (; ";")) (expression_statement "sVar3 = strspn(puVar5 + 1,"/");" (assignment_expression "sVar3 = strspn(puVar5 + 1,"/")" (identifier "sVar3") (= "=") (call_expression "strspn(puVar5 + 1,"/")" (identifier "strspn") (argument_list "(puVar5 + 1,"/")" (( "(") (binary_expression "puVar5 + 1" (identifier "puVar5") (+ "+") (number_literal "1")) (, ",") (string_literal ""/"" (" """) (string_content "/") (" """)) () ")")))) (; ";")) (expression_statement "iVar1 = iVar6;" (assignment_expression "iVar1 = iVar6" (identifier "iVar1") (= "=") (identifier "iVar6")) (; ";")) (expression_statement "__file = puVar5 + 1 + sVar3;" (assignment_expression "__file = puVar5 + 1 + sVar3" (identifier "__file") (= "=") (binary_expression "puVar5 + 1 + sVar3" (binary_expression "puVar5 + 1" (identifier "puVar5") (+ "+") (number_literal "1")) (+ "+") (identifier "sVar3"))) (; ";")) (} "}"))) (expression_statement "iVar6 = iVar1;" (assignment_expression "iVar6 = iVar1" (identifier "iVar6") (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (__file < param_1) {\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }\n  else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" (if "if") (parenthesized_expression "(__file < param_1)" (( "(") (binary_expression "__file < param_1" (identifier "__file") (< "<") (identifier "param_1")) () ")")) (compound_statement "{\n    iVar7 = openat64(iVar1,__file,0x10900);\n    if (iVar7 < 0) goto LAB_0001d538;\n    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }\n  }" ({ "{") (expression_statement "iVar7 = openat64(iVar1,__file,0x10900);" (assignment_expression "iVar7 = openat64(iVar1,__file,0x10900)" (identifier "iVar7") (= "=") (call_expression "openat64(iVar1,__file,0x10900)" (identifier "openat64") (argument_list "(iVar1,__file,0x10900)" (( "(") (identifier "iVar1") (, ",") (identifier "__file") (, ",") (number_literal "0x10900") () ")")))) (; ";")) (if_statement "if (iVar7 < 0) goto LAB_0001d538;" (if "if") (parenthesized_expression "(iVar7 < 0)" (( "(") (binary_expression "iVar7 < 0" (identifier "iVar7") (< "<") (number_literal "0")) () ")")) (goto_statement "goto LAB_0001d538;" (goto "goto") (statement_identifier "LAB_0001d538") (; ";"))) (if_statement "if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" (if "if") (parenthesized_expression "((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0))" (( "(") (binary_expression "(iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)" (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar8 = close(iVar1), iVar8 == 0)" (( "(") (comma_expression "iVar8 = close(iVar1), iVar8 == 0" (assignment_expression "iVar8 = close(iVar1)" (identifier "iVar8") (= "=") (call_expression "close(iVar1)" (identifier "close") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (, ",") (binary_expression "iVar8 == 0" (identifier "iVar8") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n      iVar8 = fchdir(iVar7);\n      if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }\n      goto LAB_0001d654;\n    }" ({ "{") (expression_statement "iVar8 = fchdir(iVar7);" (assignment_expression "iVar8 = fchdir(iVar7)" (identifier "iVar8") (= "=") (call_expression "fchdir(iVar7)" (identifier "fchdir") (argument_list "(iVar7)" (( "(") (identifier "iVar7") () ")")))) (; ";")) (if_statement "if (iVar8 != 0) {\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }" (if "if") (parenthesized_expression "(iVar8 != 0)" (( "(") (binary_expression "iVar8 != 0" (identifier "iVar8") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        iVar9 = *piVar2;\n        goto LAB_0001d697;\n      }" ({ "{") (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" (identifier "iVar9") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (goto_statement "goto LAB_0001d697;" (goto "goto") (statement_identifier "LAB_0001d697") (; ";")) (} "}"))) (goto_statement "goto LAB_0001d654;" (goto "goto") (statement_identifier "LAB_0001d654") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" (else "else") (compound_statement "{\n    iVar7 = fchdir(iVar1);\n    if (iVar7 != 0) goto LAB_0001d538;\n    iVar7 = iVar1;\n    if (iVar1 < 0) {\n      return 0;\n    }\nLAB_0001d654:\n    iVar8 = close(iVar7);\n    if (iVar8 == 0) {\n      return 0;\n    }\n  }" ({ "{") (expression_statement "iVar7 = fchdir(iVar1);" (assignment_expression "iVar7 = fchdir(iVar1)" (identifier "iVar7") (= "=") (call_expression "fchdir(iVar1)" (identifier "fchdir") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (if_statement "if (iVar7 != 0) goto LAB_0001d538;" (if "if") (parenthesized_expression "(iVar7 != 0)" (( "(") (binary_expression "iVar7 != 0" (identifier "iVar7") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_0001d538;" (goto "goto") (statement_identifier "LAB_0001d538") (; ";"))) (expression_statement "iVar7 = iVar1;" (assignment_expression "iVar7 = iVar1" (identifier "iVar7") (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (iVar1 < 0) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (labeled_statement "LAB_0001d654:\n    iVar8 = close(iVar7);" (statement_identifier "LAB_0001d654") (: ":") (expression_statement "iVar8 = close(iVar7);" (assignment_expression "iVar8 = close(iVar7)" (identifier "iVar8") (= "=") (call_expression "close(iVar7)" (identifier "close") (argument_list "(iVar7)" (( "(") (identifier "iVar7") () ")")))) (; ";"))) (if_statement "if (iVar8 == 0) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar8 == 0)" (( "(") (binary_expression "iVar8 == 0" (identifier "iVar8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")))) (labeled_statement "LAB_0001d52d:\n  do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);" (statement_identifier "LAB_0001d52d") (: ":") (do_statement "do {\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  } while (iVar8 != 0);" (do "do") (compound_statement "{\n    FUN_0001d3b0();\n    iVar6 = iVar1;\n    iVar8 = iVar1;\nLAB_0001d538:\n    iVar9 = *piVar2;\n    iVar1 = iVar6;\n    iVar7 = iVar8;\n    if (iVar8 < 0) break;\nLAB_0001d697:\n    iVar8 = close(iVar7);\n  }" ({ "{") (expression_statement "FUN_0001d3b0();" (call_expression "FUN_0001d3b0()" (identifier "FUN_0001d3b0") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar6 = iVar1;" (assignment_expression "iVar6 = iVar1" (identifier "iVar6") (= "=") (identifier "iVar1")) (; ";")) (expression_statement "iVar8 = iVar1;" (assignment_expression "iVar8 = iVar1" (identifier "iVar8") (= "=") (identifier "iVar1")) (; ";")) (labeled_statement "LAB_0001d538:\n    iVar9 = *piVar2;" (statement_identifier "LAB_0001d538") (: ":") (expression_statement "iVar9 = *piVar2;" (assignment_expression "iVar9 = *piVar2" (identifier "iVar9") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";"))) (expression_statement "iVar1 = iVar6;" (assignment_expression "iVar1 = iVar6" (identifier "iVar1") (= "=") (identifier "iVar6")) (; ";")) (expression_statement "iVar7 = iVar8;" (assignment_expression "iVar7 = iVar8" (identifier "iVar7") (= "=") (identifier "iVar8")) (; ";")) (if_statement "if (iVar8 < 0) break;" (if "if") (parenthesized_expression "(iVar8 < 0)" (( "(") (binary_expression "iVar8 < 0" (identifier "iVar8") (< "<") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (labeled_statement "LAB_0001d697:\n    iVar8 = close(iVar7);" (statement_identifier "LAB_0001d697") (: ":") (expression_statement "iVar8 = close(iVar7);" (assignment_expression "iVar8 = close(iVar7)" (identifier "iVar8") (= "=") (call_expression "close(iVar7)" (identifier "close") (argument_list "(iVar7)" (( "(") (identifier "iVar7") () ")")))) (; ";"))) (} "}")) (while "while") (parenthesized_expression "(iVar8 != 0)" (( "(") (binary_expression "iVar8 != 0" (identifier "iVar8") (!= "!=") (number_literal "0")) () ")")) (; ";"))) (labeled_statement "LAB_0001d546:\n  *piVar2 = iVar9;" (statement_identifier "LAB_0001d546") (: ":") (expression_statement "*piVar2 = iVar9;" (assignment_expression "*piVar2 = iVar9" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar9")) (; ";"))) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}")))

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

int function_1(char *var_10)

{
  char *var_14;
  int var_2;
  int *piVar3;
  size_t var_5;
  type_1 *var_8;
  int var_18;
  type_2 *var_11;
  size_t var_13;
  int var_21;
  int var_20;
  char *var_15;
  int iVar12;
  type_1 *var_17;
  
  var_2 = var_1(var_10);
  if (var_2 == 0) {
    return 0;
  }
  piVar3 = var_3();
  if (*piVar3 != 0x24) {
    return var_2;
  }
  var_5 = var_4(var_10);
  if (var_5 == 0) {
                    /* WARNING: Subroutine does not return */
    var_6("0 < len","lib/chdir-long.c",0x7e,"chdir_long");
  }
  if (var_5 < 0x1000) {
                    /* WARNING: Subroutine does not return */
    var_6("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");
  }
  var_8 = (type_1 *)var_7(var_10,"/");
  if (var_8 == (type_1 *)0x2) {
    var_11 = (type_2 *)var_9(var_10 + 3,0x2f,var_5 - 3);
    if (var_11 == (type_2 *)0x0) {
      return -1;
    }
    *var_11 = 0;
    var_2 = var_12(-100,var_10,0x10900);
    *var_11 = 0x2f;
    if (var_2 < 0) {
LAB_0001d6ef:
      iVar12 = *piVar3;
      goto LAB_0001d546;
    }
    var_17 = (type_1 *)(var_11 + 1);
    var_13 = var_7((char *)var_17,"/");
    var_15 = (char *)((int)&var_17->fd + var_13);
  }
  else {
    var_2 = -100;
    var_15 = var_10;
    if (var_8 != (type_1 *)0x0) {
      var_2 = var_12(-100,"/",0x10900);
      if (var_2 < 0) goto LAB_0001d6ef;
      var_15 = var_10 + (int)var_8;
      var_17 = var_8;
    }
  }
  if (*var_15 == '/') {
                    /* WARNING: Subroutine does not return */
    var_6("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");
  }
  var_14 = var_10 + var_5;
  if (var_14 < var_15) {
                    /* WARNING: Subroutine does not return */
    var_6("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");
  }
  for (; var_20 = var_2, 0xfff < (int)var_14 - (int)var_15; var_15 = var_15 + var_5) {
    var_17 = (type_1 *)var_16(var_15,0x2f,0x1000);
    if (var_17 == (type_1 *)0x0) {
      *piVar3 = 0x24;
      return -1;
    }
    *(char *)&var_17->fd = '\0';
    if (0xfff < (int)var_17 - (int)var_15) {
                    /* WARNING: Subroutine does not return */
      var_6("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");
    }
    var_18 = var_12(var_2,var_15,0x10900);
    if (var_18 < 0) {
      *(char *)&var_17->fd = '/';
      goto LAB_0001d538;
    }
    if ((-1 < var_2) && (var_20 = var_19(var_2), var_2 = var_18, var_20 != 0)) goto LAB_0001d52d;
    var_15 = (char *)((int)&var_17->fd + 1);
    *(char *)&var_17->fd = '/';
    var_5 = var_7(var_15,"/");
    var_2 = var_18;
  }
  var_18 = var_2;
  if (var_15 < var_14) {
    var_21 = var_12(var_2,var_15,0x10900);
    if (var_21 < 0) goto LAB_0001d538;
    if ((var_2 < 0) || (var_20 = var_19(var_2), var_20 == 0)) {
      var_20 = var_22(var_21);
      if (var_20 != 0) {
        iVar12 = *piVar3;
        goto LAB_0001d697;
      }
      goto LAB_0001d654;
    }
  }
  else {
    var_21 = var_22(var_2);
    if (var_21 != 0) goto LAB_0001d538;
    var_21 = var_2;
    if (var_2 < 0) {
      return 0;
    }
LAB_0001d654:
    var_20 = var_19(var_21);
    if (var_20 == 0) {
      return 0;
    }
  }
LAB_0001d52d:
  do {
    var_23(var_17);
    var_18 = var_2;
    var_20 = var_2;
LAB_0001d538:
    iVar12 = *piVar3;
    var_2 = var_18;
    var_21 = var_20;
    if (var_20 < 0) break;
LAB_0001d697:
    var_20 = var_19(var_21);
  } while (var_20 != 0);
LAB_0001d546:
  *piVar3 = iVar12;
  return -1;
}


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

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

int MASKED(char *param_1)

{
  int iVar1;
  int *piVar2;
  size_t sVar3;
  size_t sVar4;
  undefined1 *puVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  char *__file;
  int iVar9;
  
  iVar1 = chdir(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  piVar2 = __errno_location();
  if (*piVar2 != 0x24) {
    return iVar1;
  }
  sVar3 = strlen(param_1);
  if (sVar3 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("0 < len","lib/chdir-long.c",0x7e,"chdir_long");
  }
  if (sVar3 < 0x1000) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("4096 <= len","lib/chdir-long.c",0x7f,"chdir_long");
  }
  sVar4 = strspn(param_1,"/");
  if (sVar4 == 2) {
    puVar5 = (undefined1 *)FUN_0001e090(param_1 + 3,0x2f,sVar3 - 3);
    if (puVar5 == (undefined1 *)0x0) {
      return -1;
    }
    *puVar5 = 0;
    iVar1 = openat64(-100,param_1,0x10900);
    *puVar5 = 0x2f;
    if (iVar1 < 0) {
LAB_0001d6ef:
      iVar9 = *piVar2;
      goto LAB_0001d546;
    }
    sVar4 = strspn(puVar5 + 1,"/");
    __file = puVar5 + 1 + sVar4;
  }
  else {
    iVar1 = -100;
    __file = param_1;
    if (sVar4 != 0) {
      iVar1 = openat64(-100,"/",0x10900);
      if (iVar1 < 0) goto LAB_0001d6ef;
      __file = param_1 + sVar4;
    }
  }
  if (*__file == '/') {
                    /* WARNING: Subroutine does not return */
    __assert_fail("*dir != \'/\'","lib/chdir-long.c",0xa2,"chdir_long");
  }
  param_1 = param_1 + sVar3;
  if (param_1 < __file) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("dir <= dir_end","lib/chdir-long.c",0xa3,"chdir_long");
  }
  while (iVar8 = iVar1, 0xfff < (int)param_1 - (int)__file) {
    puVar5 = (undefined1 *)memrchr(__file,0x2f,0x1000);
    if (puVar5 == (undefined1 *)0x0) {
      *piVar2 = 0x24;
      return -1;
    }
    *puVar5 = 0;
    if (0xfff < (int)puVar5 - (int)__file) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("slash - dir < 4096","lib/chdir-long.c",0xb3,"chdir_long");
    }
    iVar6 = openat64(iVar1,__file,0x10900);
    if (iVar6 < 0) {
      *puVar5 = 0x2f;
      goto LAB_0001d538;
    }
    if ((-1 < iVar1) && (iVar8 = close(iVar1), iVar1 = iVar6, iVar8 != 0)) goto LAB_0001d52d;
    *puVar5 = 0x2f;
    sVar3 = strspn(puVar5 + 1,"/");
    iVar1 = iVar6;
    __file = puVar5 + 1 + sVar3;
  }
  iVar6 = iVar1;
  if (__file < param_1) {
    iVar7 = openat64(iVar1,__file,0x10900);
    if (iVar7 < 0) goto LAB_0001d538;
    if ((iVar1 < 0) || (iVar8 = close(iVar1), iVar8 == 0)) {
      iVar8 = fchdir(iVar7);
      if (iVar8 != 0) {
        iVar9 = *piVar2;
        goto LAB_0001d697;
      }
      goto LAB_0001d654;
    }
  }
  else {
    iVar7 = fchdir(iVar1);
    if (iVar7 != 0) goto LAB_0001d538;
    iVar7 = iVar1;
    if (iVar1 < 0) {
      return 0;
    }
LAB_0001d654:
    iVar8 = close(iVar7);
    if (iVar8 == 0) {
      return 0;
    }
  }
LAB_0001d52d:
  do {
    FUN_0001d3b0();
    iVar6 = iVar1;
    iVar8 = iVar1;
LAB_0001d538:
    iVar9 = *piVar2;
    iVar1 = iVar6;
    iVar7 = iVar8;
    if (iVar8 < 0) break;
LAB_0001d697:
    iVar8 = close(iVar7);
  } while (iVar8 != 0);
LAB_0001d546:
  *piVar2 = iVar9;
  return -1;
}

