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

char * enum_settings_next(void *handle,char *buffer,int buflen)

{
  int iVar1;
  char cVar2;
  char cVar3;
  char cVar4;
  char *__s;
  size_t sVar5;
  dirent64 *pdVar6;
  size_t sVar7;
  int iVar8;
  char *__src;
  int iVar9;
  char *pcVar10;
  char *__s_00;
  int in_GS_OFFSET;
  size_t local_a0;
  stat st;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  __s = make_filename(4,(char *)0x0);
  sVar5 = strlen(__s);
  local_a0 = sVar5;
  do {
    pdVar6 = readdir64((DIR *)handle);
    if (pdVar6 == (dirent64 *)0x0) {
      safefree(__s);
      buffer = (char *)0x0;
      goto LAB_0006b10d;
    }
    __s_00 = pdVar6->d_name;
    sVar7 = strlen(__s_00);
    iVar8 = sVar5 + sVar7;
    sVar7 = iVar8 + 1;
    if ((int)local_a0 < (int)sVar7) {
      __s = (char *)saferealloc(__s,iVar8 + 2,1);
      local_a0 = sVar7;
    }
    __s[sVar5] = '/';
    strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));
    __s[iVar8 + 1] = '\0';
    iVar8 = __xstat64(3,__s,(stat64 *)&st);
  } while ((iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000));
  sVar5 = strlen(__s_00);
  __src = (char *)safemalloc(sVar5 + 1,1);
  pcVar10 = __src;
  while (cVar2 = *__s_00, cVar2 != '\0') {
    if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')
       ) {
      iVar8 = cVar3 + -0x30;
      if (9 < iVar8) {
        iVar8 = cVar3 + -0x37;
      }
      iVar9 = cVar4 + -0x30;
      if (9 < iVar9) {
        iVar9 = cVar4 + -0x37;
      }
      __s_00 = __s_00 + 3;
      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);
    }
    else {
      *pcVar10 = cVar2;
      __s_00 = __s_00 + 1;
    }
    pcVar10 = pcVar10 + 1;
  }
  *pcVar10 = '\0';
  strncpy(buffer,__src,buflen);
  buffer[buflen + -1] = '\0';
  safefree(__src);
  safefree(__s);
LAB_0006b10d:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return buffer;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

char * FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)

{
  char cVar1;
  char cVar2;
  char cVar3;
  char *__s;
  size_t sVar4;
  dirent64 *pdVar5;
  size_t sVar6;
  int iVar7;
  char *__src;
  int iVar8;
  char *pcVar9;
  char *__s_00;
  int in_GS_OFFSET;
  size_t local_a0;
  stat64 local_80;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x6af3b;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __s = (char *)FUN_00069f00();
  sVar4 = strlen(__s);
  local_a0 = sVar4;
  do {
    pdVar5 = readdir64(param_1);
    if (pdVar5 == (dirent64 *)0x0) {
      FUN_0001d220(__s);
      param_2 = (char *)0x0;
      goto LAB_0006b10d;
    }
    __s_00 = pdVar5->d_name;
    sVar6 = strlen(__s_00);
    iVar7 = sVar4 + sVar6;
    sVar6 = iVar7 + 1;
    if ((int)local_a0 < (int)sVar6) {
      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);
      local_a0 = sVar6;
    }
    __s[sVar4] = '/';
    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));
    __s[iVar7 + 1] = '\0';
    iVar7 = __xstat64(3,__s,&local_80);
  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));
  sVar4 = strlen(__s_00);
  __src = (char *)FUN_0001c990(sVar4 + 1,1);
  pcVar9 = __src;
  while (cVar1 = *__s_00, cVar1 != '\0') {
    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')
       ) {
      iVar7 = cVar2 + -0x30;
      if (9 < iVar7) {
        iVar7 = cVar2 + -0x37;
      }
      iVar8 = cVar3 + -0x30;
      if (9 < iVar8) {
        iVar8 = cVar3 + -0x37;
      }
      __s_00 = __s_00 + 3;
      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);
    }
    else {
      *pcVar9 = cVar1;
      __s_00 = __s_00 + 1;
    }
    pcVar9 = pcVar9 + 1;
  }
  *pcVar9 = '\0';
  strncpy(param_2,__src,param_3);
  param_2[param_3 - 1] = '\0';
  FUN_0001d220(__src);
  FUN_0001d220(__s);
LAB_0006b10d:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return param_2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006dad0();
}


PUSH EBP
XOR EDX,EDX
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015fa0
ADD EBX,0x39e35
SUB ESP,0x9c
MOV EAX,dword ptr [ESP + 0xb0]
MOV dword ptr [ESP + 0x10],EAX
MOV EAX,dword ptr [ESP + 0xb4]
MOV dword ptr [ESP + 0x1c],EAX
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x8c],EAX
XOR EAX,EAX
MOV EAX,0x4
CALL 0x00069f00
SUB ESP,0xc
PUSH EAX
MOV EDI,EAX
CALL 0x00014440
ADD ESP,0x10
MOV EBP,EAX
MOV dword ptr [ESP + 0xc],EAX
ADD EAX,0x1
MOV dword ptr [ESP + 0x14],EAX
LEA EAX,[ESP + 0x2c]
MOV dword ptr [ESP + 0x18],EAX
SUB ESP,0xc
PUSH dword ptr [ESP + 0x1c]
CALL 0x000146e0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0006b130
SUB ESP,0xc
LEA ESI,[EAX + 0x13]
PUSH ESI
CALL 0x00014440
ADD ESP,0x10
LEA EDX,[EBP + EAX*0x1]
LEA ECX,[EDX + 0x1]
CMP dword ptr [ESP + 0xc],ECX
JL 0x0006b0a0
MOV dword ptr [ESP + 0x8],EDX
SUB ESP,0x4
MOV EAX,dword ptr [ESP + 0x18]
MOV byte ptr [EDI + EBP*0x1],0x2f
SUB ECX,EAX
ADD EAX,EDI
PUSH ECX
PUSH ESI
PUSH EAX
CALL 0x00014570
MOV EDX,dword ptr [ESP + 0x18]
ADD ESP,0xc
MOV byte ptr [EDI + EDX*0x1 + 0x1],0x0
PUSH dword ptr [ESP + 0x1c]
PUSH EDI
PUSH 0x3
CALL 0x000147b0
ADD ESP,0x10
TEST EAX,EAX
JS 0x0006af99
MOV EAX,dword ptr [ESP + 0x3c]
AND EAX,0xf000
CMP EAX,0x8000
JNZ 0x0006af99
SUB ESP,0xc
PUSH ESI
CALL 0x00014440
POP EDX
POP ECX
PUSH 0x1
ADD EAX,0x1
PUSH EAX
CALL 0x0001c990
MOV dword ptr [ESP + 0x1c],EAX
MOV EDX,EAX
ADD ESP,0x10
JMP 0x0006b048
MOV byte ptr [EDX],AL
ADD ESI,0x1
ADD EDX,0x1
MOVZX EAX,byte ptr [ESI]
TEST AL,AL
JZ 0x0006b0d0
CMP AL,0x25
JNZ 0x0006b040
MOVZX ECX,byte ptr [ESI + 0x1]
MOV byte ptr [ESP + 0x8],CL
TEST CL,CL
JZ 0x0006b040
MOVZX EBP,byte ptr [ESI + 0x2]
MOV ECX,EBP
TEST CL,CL
JZ 0x0006b040
MOVSX ECX,byte ptr [ESP + 0x8]
LEA EAX,[ECX + -0x30]
SUB ECX,0x37
CMP EAX,0x9
CMOVG EAX,ECX
MOV ECX,EBP
MOVSX EBP,CL
LEA ECX,[EBP + -0x30]
SUB EBP,0x37
CMP ECX,0x9
CMOVG ECX,EBP
SHL EAX,0x4
ADD ESI,0x3
ADD ECX,EAX
MOV byte ptr [EDX],CL
JMP 0x0006b045
MOV dword ptr [ESP + 0xc],ECX
SUB ESP,0x4
LEA EAX,[EDX + 0x2]
PUSH 0x1
MOV dword ptr [ESP + 0x10],EDX
PUSH EAX
PUSH EDI
CALL 0x0001cd90
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0xc]
MOV EDX,dword ptr [ESP + 0x8]
MOV EDI,EAX
JMP 0x0006afd0
SUB ESP,0x4
MOV byte ptr [EDX],0x0
PUSH dword ptr [ESP + 0xbc]
MOV EBP,dword ptr [ESP + 0x14]
PUSH EBP
MOV ESI,dword ptr [ESP + 0x28]
PUSH ESI
CALL 0x00014570
MOV ECX,dword ptr [ESP + 0xc8]
MOV byte ptr [ESI + ECX*0x1 + -0x1],0x0
MOV dword ptr [ESP],EBP
CALL 0x0001d220
MOV dword ptr [ESP],EDI
CALL 0x0001d220
ADD ESP,0x10
MOV EAX,ESI
MOV EDI,dword ptr [ESP + 0x8c]
XOR EDI,dword ptr GS:[0x14]
JNZ 0x0006b146
ADD ESP,0x9c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV dword ptr [ESP + 0x8],EAX
SUB ESP,0xc
PUSH EDI
CALL 0x0001d220
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0x8]
JMP 0x0006b10d
CALL 0x0006dad0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)\n\n{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006dad0();\n}\n\n" comment (function_definition "char * FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)\n\n{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006dad0();\n}" primitive_type (pointer_declarator "* FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)" * (function_declarator "FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)" identifier (parameter_list "(DIR *param_1,char *param_2,size_t param_3)" ( (parameter_declaration "DIR *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) )))) (compound_statement "{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006dad0();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "char cVar3;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "dirent64 *pdVar5;" type_identifier (pointer_declarator "*pdVar5" * identifier) ;) (declaration "size_t sVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "char *pcVar9;" primitive_type (pointer_declarator "*pcVar9" * identifier) ;) (declaration "char *__s_00;" primitive_type (pointer_declarator "*__s_00" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "size_t local_a0;" primitive_type identifier ;) (declaration "stat64 local_80;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x6af3b;" (assignment_expression "uStack_14 = 0x6af3b" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__s = (char *)FUN_00069f00();" (assignment_expression "__s = (char *)FUN_00069f00()" identifier = (cast_expression "(char *)FUN_00069f00()" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00069f00()" identifier (argument_list "()" ( ))))) ;) (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "local_a0 = sVar4;" (assignment_expression "local_a0 = sVar4" identifier = identifier) ;) (do_statement "do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));" do (compound_statement "{\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  }" { (expression_statement "pdVar5 = readdir64(param_1);" (assignment_expression "pdVar5 = readdir64(param_1)" identifier = (call_expression "readdir64(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }" if (parenthesized_expression "(pdVar5 == (dirent64 *)0x0)" ( (binary_expression "pdVar5 == (dirent64 *)0x0" identifier == (cast_expression "(dirent64 *)0x0" ( (type_descriptor "dirent64 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }" { (expression_statement "FUN_0001d220(__s);" (call_expression "FUN_0001d220(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (expression_statement "param_2 = (char *)0x0;" (assignment_expression "param_2 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_0006b10d;" goto statement_identifier ;) })) (expression_statement "__s_00 = pdVar5->d_name;" (assignment_expression "__s_00 = pdVar5->d_name" identifier = (field_expression "pdVar5->d_name" identifier -> field_identifier)) ;) (expression_statement "sVar6 = strlen(__s_00);" (assignment_expression "sVar6 = strlen(__s_00)" identifier = (call_expression "strlen(__s_00)" identifier (argument_list "(__s_00)" ( identifier )))) ;) (expression_statement "iVar7 = sVar4 + sVar6;" (assignment_expression "iVar7 = sVar4 + sVar6" identifier = (binary_expression "sVar4 + sVar6" identifier + identifier)) ;) (expression_statement "sVar6 = iVar7 + 1;" (assignment_expression "sVar6 = iVar7 + 1" identifier = (binary_expression "iVar7 + 1" identifier + number_literal)) ;) (if_statement "if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }" if (parenthesized_expression "((int)local_a0 < (int)sVar6)" ( (binary_expression "(int)local_a0 < (int)sVar6" (cast_expression "(int)local_a0" ( (type_descriptor "int" primitive_type) ) identifier) < (cast_expression "(int)sVar6" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }" { (expression_statement "__s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);" (assignment_expression "__s = (char *)FUN_0001cd90(__s,iVar7 + 2,1)" identifier = (cast_expression "(char *)FUN_0001cd90(__s,iVar7 + 2,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001cd90(__s,iVar7 + 2,1)" identifier (argument_list "(__s,iVar7 + 2,1)" ( identifier , (binary_expression "iVar7 + 2" identifier + number_literal) , number_literal ))))) ;) (expression_statement "local_a0 = sVar6;" (assignment_expression "local_a0 = sVar6" identifier = identifier) ;) })) (expression_statement "__s[sVar4] = '/';" (assignment_expression "__s[sVar4] = '/'" (subscript_expression "__s[sVar4]" identifier [ identifier ]) = (char_literal "'/'" ' character ')) ;) (expression_statement "strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));" (call_expression "strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1))" identifier (argument_list "(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1))" ( (binary_expression "__s + sVar4 + 1" (binary_expression "__s + sVar4" identifier + identifier) + number_literal) , identifier , (binary_expression "sVar6 - (sVar4 + 1)" identifier - (parenthesized_expression "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) ))) ))) ;) (expression_statement "__s[iVar7 + 1] = '\0';" (assignment_expression "__s[iVar7 + 1] = '\0'" (subscript_expression "__s[iVar7 + 1]" identifier [ (binary_expression "iVar7 + 1" identifier + number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar7 = __xstat64(3,__s,&local_80);" (assignment_expression "iVar7 = __xstat64(3,__s,&local_80)" identifier = (call_expression "__xstat64(3,__s,&local_80)" identifier (argument_list "(3,__s,&local_80)" ( number_literal , identifier , (pointer_expression "&local_80" & identifier) )))) ;) }) while (parenthesized_expression "((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000))" ( (binary_expression "(iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000)" (parenthesized_expression "(iVar7 < 0)" ( (binary_expression "iVar7 < 0" identifier < number_literal) )) || (parenthesized_expression "((local_80.st_mode & 0xf000) != 0x8000)" ( (binary_expression "(local_80.st_mode & 0xf000) != 0x8000" (parenthesized_expression "(local_80.st_mode & 0xf000)" ( (binary_expression "local_80.st_mode & 0xf000" (field_expression "local_80.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) ))) )) ;) (expression_statement "sVar4 = strlen(__s_00);" (assignment_expression "sVar4 = strlen(__s_00)" identifier = (call_expression "strlen(__s_00)" identifier (argument_list "(__s_00)" ( identifier )))) ;) (expression_statement "__src = (char *)FUN_0001c990(sVar4 + 1,1);" (assignment_expression "__src = (char *)FUN_0001c990(sVar4 + 1,1)" identifier = (cast_expression "(char *)FUN_0001c990(sVar4 + 1,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001c990(sVar4 + 1,1)" identifier (argument_list "(sVar4 + 1,1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "pcVar9 = __src;" (assignment_expression "pcVar9 = __src" identifier = identifier) ;) (while_statement "while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }" while (parenthesized_expression "(cVar1 = *__s_00, cVar1 != '\0')" ( (comma_expression "cVar1 = *__s_00, cVar1 != '\0'" (assignment_expression "cVar1 = *__s_00" identifier = (pointer_expression "*__s_00" * identifier)) , (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) )) (compound_statement "{\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }" { (if_statement "if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" if (parenthesized_expression "(((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       )" ( (binary_expression "((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')" (parenthesized_expression "((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0'))" ( (binary_expression "(cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')" (parenthesized_expression "(cVar1 == '%')" ( (binary_expression "cVar1 == '%'" identifier == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(cVar2 = __s_00[1], cVar2 != '\0')" ( (comma_expression "cVar2 = __s_00[1], cVar2 != '\0'" (assignment_expression "cVar2 = __s_00[1]" identifier = (subscript_expression "__s_00[1]" identifier [ number_literal ])) , (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) ))) )) && (parenthesized_expression "(cVar3 = __s_00[2], cVar3 != '\0')" ( (comma_expression "cVar3 = __s_00[2], cVar3 != '\0'" (assignment_expression "cVar3 = __s_00[2]" identifier = (subscript_expression "__s_00[2]" identifier [ number_literal ])) , (binary_expression "cVar3 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) ))) )) (compound_statement "{\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }" { (expression_statement "iVar7 = cVar2 + -0x30;" (assignment_expression "iVar7 = cVar2 + -0x30" identifier = (binary_expression "cVar2 + -0x30" identifier + number_literal)) ;) (if_statement "if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }" if (parenthesized_expression "(9 < iVar7)" ( (binary_expression "9 < iVar7" number_literal < identifier) )) (compound_statement "{\n        iVar7 = cVar2 + -0x37;\n      }" { (expression_statement "iVar7 = cVar2 + -0x37;" (assignment_expression "iVar7 = cVar2 + -0x37" identifier = (binary_expression "cVar2 + -0x37" identifier + number_literal)) ;) })) (expression_statement "iVar8 = cVar3 + -0x30;" (assignment_expression "iVar8 = cVar3 + -0x30" identifier = (binary_expression "cVar3 + -0x30" identifier + number_literal)) ;) (if_statement "if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }" if (parenthesized_expression "(9 < iVar8)" ( (binary_expression "9 < iVar8" number_literal < identifier) )) (compound_statement "{\n        iVar8 = cVar3 + -0x37;\n      }" { (expression_statement "iVar8 = cVar3 + -0x37;" (assignment_expression "iVar8 = cVar3 + -0x37" identifier = (binary_expression "cVar3 + -0x37" identifier + number_literal)) ;) })) (expression_statement "__s_00 = __s_00 + 3;" (assignment_expression "__s_00 = __s_00 + 3" identifier = (binary_expression "__s_00 + 3" identifier + number_literal)) ;) (expression_statement "*pcVar9 = (char)iVar8 + (char)(iVar7 << 4);" (assignment_expression "*pcVar9 = (char)iVar8 + (char)(iVar7 << 4)" (pointer_expression "*pcVar9" * identifier) = (binary_expression "(char)iVar8 + (char)(iVar7 << 4)" (cast_expression "(char)iVar8" ( (type_descriptor "char" primitive_type) ) identifier) + (cast_expression "(char)(iVar7 << 4)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "(iVar7 << 4)" ( (binary_expression "iVar7 << 4" identifier << number_literal) ))))) ;) }) (else_clause "else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" else (compound_statement "{\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" { (expression_statement "*pcVar9 = cVar1;" (assignment_expression "*pcVar9 = cVar1" (pointer_expression "*pcVar9" * identifier) = identifier) ;) (expression_statement "__s_00 = __s_00 + 1;" (assignment_expression "__s_00 = __s_00 + 1" identifier = (binary_expression "__s_00 + 1" identifier + number_literal)) ;) }))) (expression_statement "pcVar9 = pcVar9 + 1;" (assignment_expression "pcVar9 = pcVar9 + 1" identifier = (binary_expression "pcVar9 + 1" identifier + number_literal)) ;) })) (expression_statement "*pcVar9 = '\0';" (assignment_expression "*pcVar9 = '\0'" (pointer_expression "*pcVar9" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "strncpy(param_2,__src,param_3);" (call_expression "strncpy(param_2,__src,param_3)" identifier (argument_list "(param_2,__src,param_3)" ( identifier , identifier , identifier ))) ;) (expression_statement "param_2[param_3 - 1] = '\0';" (assignment_expression "param_2[param_3 - 1] = '\0'" (subscript_expression "param_2[param_3 - 1]" identifier [ (binary_expression "param_3 - 1" identifier - number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "FUN_0001d220(__src);" (call_expression "FUN_0001d220(__src)" identifier (argument_list "(__src)" ( identifier ))) ;) (expression_statement "FUN_0001d220(__s);" (call_expression "FUN_0001d220(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (labeled_statement "LAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return param_2;\n  }" { (return_statement "return param_2;" return identifier ;) }))) comment (expression_statement "FUN_0006dad0();" (call_expression "FUN_0006dad0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * enum_settings_next(void *handle,char *buffer,int buflen)\n\n{\n  int iVar1;\n  char cVar2;\n  char cVar3;\n  char cVar4;\n  char *__s;\n  size_t sVar5;\n  dirent64 *pdVar6;\n  size_t sVar7;\n  int iVar8;\n  char *__src;\n  int iVar9;\n  char *pcVar10;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat st;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = make_filename(4,(char *)0x0);\n  sVar5 = strlen(__s);\n  local_a0 = sVar5;\n  do {\n    pdVar6 = readdir64((DIR *)handle);\n    if (pdVar6 == (dirent64 *)0x0) {\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar6->d_name;\n    sVar7 = strlen(__s_00);\n    iVar8 = sVar5 + sVar7;\n    sVar7 = iVar8 + 1;\n    if ((int)local_a0 < (int)sVar7) {\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }\n    __s[sVar5] = '/';\n    strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));\n    __s[iVar8 + 1] = '\0';\n    iVar8 = __xstat64(3,__s,(stat64 *)&st);\n  } while ((iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000));\n  sVar5 = strlen(__s_00);\n  __src = (char *)safemalloc(sVar5 + 1,1);\n  pcVar10 = __src;\n  while (cVar2 = *__s_00, cVar2 != '\0') {\n    if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       ) {\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }\n    else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar10 = pcVar10 + 1;\n  }\n  *pcVar10 = '\0';\n  strncpy(buffer,__src,buflen);\n  buffer[buflen + -1] = '\0';\n  safefree(__src);\n  safefree(__s);\nLAB_0006b10d:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return buffer;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "char * enum_settings_next(void *handle,char *buffer,int buflen)\n\n{\n  int iVar1;\n  char cVar2;\n  char cVar3;\n  char cVar4;\n  char *__s;\n  size_t sVar5;\n  dirent64 *pdVar6;\n  size_t sVar7;\n  int iVar8;\n  char *__src;\n  int iVar9;\n  char *pcVar10;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat st;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = make_filename(4,(char *)0x0);\n  sVar5 = strlen(__s);\n  local_a0 = sVar5;\n  do {\n    pdVar6 = readdir64((DIR *)handle);\n    if (pdVar6 == (dirent64 *)0x0) {\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar6->d_name;\n    sVar7 = strlen(__s_00);\n    iVar8 = sVar5 + sVar7;\n    sVar7 = iVar8 + 1;\n    if ((int)local_a0 < (int)sVar7) {\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }\n    __s[sVar5] = '/';\n    strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));\n    __s[iVar8 + 1] = '\0';\n    iVar8 = __xstat64(3,__s,(stat64 *)&st);\n  } while ((iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000));\n  sVar5 = strlen(__s_00);\n  __src = (char *)safemalloc(sVar5 + 1,1);\n  pcVar10 = __src;\n  while (cVar2 = *__s_00, cVar2 != '\0') {\n    if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       ) {\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }\n    else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar10 = pcVar10 + 1;\n  }\n  *pcVar10 = '\0';\n  strncpy(buffer,__src,buflen);\n  buffer[buflen + -1] = '\0';\n  safefree(__src);\n  safefree(__s);\nLAB_0006b10d:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return buffer;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (pointer_declarator "* enum_settings_next(void *handle,char *buffer,int buflen)" * (function_declarator "enum_settings_next(void *handle,char *buffer,int buflen)" identifier (parameter_list "(void *handle,char *buffer,int buflen)" ( (parameter_declaration "void *handle" primitive_type (pointer_declarator "*handle" * identifier)) , (parameter_declaration "char *buffer" primitive_type (pointer_declarator "*buffer" * identifier)) , (parameter_declaration "int buflen" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  char cVar2;\n  char cVar3;\n  char cVar4;\n  char *__s;\n  size_t sVar5;\n  dirent64 *pdVar6;\n  size_t sVar7;\n  int iVar8;\n  char *__src;\n  int iVar9;\n  char *pcVar10;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat st;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = make_filename(4,(char *)0x0);\n  sVar5 = strlen(__s);\n  local_a0 = sVar5;\n  do {\n    pdVar6 = readdir64((DIR *)handle);\n    if (pdVar6 == (dirent64 *)0x0) {\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar6->d_name;\n    sVar7 = strlen(__s_00);\n    iVar8 = sVar5 + sVar7;\n    sVar7 = iVar8 + 1;\n    if ((int)local_a0 < (int)sVar7) {\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }\n    __s[sVar5] = '/';\n    strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));\n    __s[iVar8 + 1] = '\0';\n    iVar8 = __xstat64(3,__s,(stat64 *)&st);\n  } while ((iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000));\n  sVar5 = strlen(__s_00);\n  __src = (char *)safemalloc(sVar5 + 1,1);\n  pcVar10 = __src;\n  while (cVar2 = *__s_00, cVar2 != '\0') {\n    if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       ) {\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }\n    else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar10 = pcVar10 + 1;\n  }\n  *pcVar10 = '\0';\n  strncpy(buffer,__src,buflen);\n  buffer[buflen + -1] = '\0';\n  safefree(__src);\n  safefree(__s);\nLAB_0006b10d:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return buffer;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "char cVar3;" primitive_type identifier ;) (declaration "char cVar4;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar5;" primitive_type identifier ;) (declaration "dirent64 *pdVar6;" type_identifier (pointer_declarator "*pdVar6" * identifier) ;) (declaration "size_t sVar7;" primitive_type identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "char *pcVar10;" primitive_type (pointer_declarator "*pcVar10" * identifier) ;) (declaration "char *__s_00;" primitive_type (pointer_declarator "*__s_00" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "size_t local_a0;" primitive_type identifier ;) (declaration "stat st;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__s = make_filename(4,(char *)0x0);" (assignment_expression "__s = make_filename(4,(char *)0x0)" identifier = (call_expression "make_filename(4,(char *)0x0)" identifier (argument_list "(4,(char *)0x0)" ( number_literal , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "sVar5 = strlen(__s);" (assignment_expression "sVar5 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "local_a0 = sVar5;" (assignment_expression "local_a0 = sVar5" identifier = identifier) ;) (do_statement "do {\n    pdVar6 = readdir64((DIR *)handle);\n    if (pdVar6 == (dirent64 *)0x0) {\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar6->d_name;\n    sVar7 = strlen(__s_00);\n    iVar8 = sVar5 + sVar7;\n    sVar7 = iVar8 + 1;\n    if ((int)local_a0 < (int)sVar7) {\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }\n    __s[sVar5] = '/';\n    strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));\n    __s[iVar8 + 1] = '\0';\n    iVar8 = __xstat64(3,__s,(stat64 *)&st);\n  } while ((iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000));" do (compound_statement "{\n    pdVar6 = readdir64((DIR *)handle);\n    if (pdVar6 == (dirent64 *)0x0) {\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar6->d_name;\n    sVar7 = strlen(__s_00);\n    iVar8 = sVar5 + sVar7;\n    sVar7 = iVar8 + 1;\n    if ((int)local_a0 < (int)sVar7) {\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }\n    __s[sVar5] = '/';\n    strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));\n    __s[iVar8 + 1] = '\0';\n    iVar8 = __xstat64(3,__s,(stat64 *)&st);\n  }" { (expression_statement "pdVar6 = readdir64((DIR *)handle);" (assignment_expression "pdVar6 = readdir64((DIR *)handle)" identifier = (call_expression "readdir64((DIR *)handle)" identifier (argument_list "((DIR *)handle)" ( (cast_expression "(DIR *)handle" ( (type_descriptor "DIR *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (pdVar6 == (dirent64 *)0x0) {\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }" if (parenthesized_expression "(pdVar6 == (dirent64 *)0x0)" ( (binary_expression "pdVar6 == (dirent64 *)0x0" identifier == (cast_expression "(dirent64 *)0x0" ( (type_descriptor "dirent64 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      safefree(__s);\n      buffer = (char *)0x0;\n      goto LAB_0006b10d;\n    }" { (expression_statement "safefree(__s);" (call_expression "safefree(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (expression_statement "buffer = (char *)0x0;" (assignment_expression "buffer = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_0006b10d;" goto statement_identifier ;) })) (expression_statement "__s_00 = pdVar6->d_name;" (assignment_expression "__s_00 = pdVar6->d_name" identifier = (field_expression "pdVar6->d_name" identifier -> field_identifier)) ;) (expression_statement "sVar7 = strlen(__s_00);" (assignment_expression "sVar7 = strlen(__s_00)" identifier = (call_expression "strlen(__s_00)" identifier (argument_list "(__s_00)" ( identifier )))) ;) (expression_statement "iVar8 = sVar5 + sVar7;" (assignment_expression "iVar8 = sVar5 + sVar7" identifier = (binary_expression "sVar5 + sVar7" identifier + identifier)) ;) (expression_statement "sVar7 = iVar8 + 1;" (assignment_expression "sVar7 = iVar8 + 1" identifier = (binary_expression "iVar8 + 1" identifier + number_literal)) ;) (if_statement "if ((int)local_a0 < (int)sVar7) {\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }" if (parenthesized_expression "((int)local_a0 < (int)sVar7)" ( (binary_expression "(int)local_a0 < (int)sVar7" (cast_expression "(int)local_a0" ( (type_descriptor "int" primitive_type) ) identifier) < (cast_expression "(int)sVar7" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      __s = (char *)saferealloc(__s,iVar8 + 2,1);\n      local_a0 = sVar7;\n    }" { (expression_statement "__s = (char *)saferealloc(__s,iVar8 + 2,1);" (assignment_expression "__s = (char *)saferealloc(__s,iVar8 + 2,1)" identifier = (cast_expression "(char *)saferealloc(__s,iVar8 + 2,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(__s,iVar8 + 2,1)" identifier (argument_list "(__s,iVar8 + 2,1)" ( identifier , (binary_expression "iVar8 + 2" identifier + number_literal) , number_literal ))))) ;) (expression_statement "local_a0 = sVar7;" (assignment_expression "local_a0 = sVar7" identifier = identifier) ;) })) (expression_statement "__s[sVar5] = '/';" (assignment_expression "__s[sVar5] = '/'" (subscript_expression "__s[sVar5]" identifier [ identifier ]) = (char_literal "'/'" ' character ')) ;) (expression_statement "strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1));" (call_expression "strncpy(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1))" identifier (argument_list "(__s + sVar5 + 1,__s_00,sVar7 - (sVar5 + 1))" ( (binary_expression "__s + sVar5 + 1" (binary_expression "__s + sVar5" identifier + identifier) + number_literal) , identifier , (binary_expression "sVar7 - (sVar5 + 1)" identifier - (parenthesized_expression "(sVar5 + 1)" ( (binary_expression "sVar5 + 1" identifier + number_literal) ))) ))) ;) (expression_statement "__s[iVar8 + 1] = '\0';" (assignment_expression "__s[iVar8 + 1] = '\0'" (subscript_expression "__s[iVar8 + 1]" identifier [ (binary_expression "iVar8 + 1" identifier + number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar8 = __xstat64(3,__s,(stat64 *)&st);" (assignment_expression "iVar8 = __xstat64(3,__s,(stat64 *)&st)" identifier = (call_expression "__xstat64(3,__s,(stat64 *)&st)" identifier (argument_list "(3,__s,(stat64 *)&st)" ( number_literal , identifier , (cast_expression "(stat64 *)&st" ( (type_descriptor "stat64 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&st" & identifier)) )))) ;) }) while (parenthesized_expression "((iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000))" ( (binary_expression "(iVar8 < 0) || ((st.st_mode & 0xf000) != 0x8000)" (parenthesized_expression "(iVar8 < 0)" ( (binary_expression "iVar8 < 0" identifier < number_literal) )) || (parenthesized_expression "((st.st_mode & 0xf000) != 0x8000)" ( (binary_expression "(st.st_mode & 0xf000) != 0x8000" (parenthesized_expression "(st.st_mode & 0xf000)" ( (binary_expression "st.st_mode & 0xf000" (field_expression "st.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) ))) )) ;) (expression_statement "sVar5 = strlen(__s_00);" (assignment_expression "sVar5 = strlen(__s_00)" identifier = (call_expression "strlen(__s_00)" identifier (argument_list "(__s_00)" ( identifier )))) ;) (expression_statement "__src = (char *)safemalloc(sVar5 + 1,1);" (assignment_expression "__src = (char *)safemalloc(sVar5 + 1,1)" identifier = (cast_expression "(char *)safemalloc(sVar5 + 1,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(sVar5 + 1,1)" identifier (argument_list "(sVar5 + 1,1)" ( (binary_expression "sVar5 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "pcVar10 = __src;" (assignment_expression "pcVar10 = __src" identifier = identifier) ;) (while_statement "while (cVar2 = *__s_00, cVar2 != '\0') {\n    if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       ) {\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }\n    else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar10 = pcVar10 + 1;\n  }" while (parenthesized_expression "(cVar2 = *__s_00, cVar2 != '\0')" ( (comma_expression "cVar2 = *__s_00, cVar2 != '\0'" (assignment_expression "cVar2 = *__s_00" identifier = (pointer_expression "*__s_00" * identifier)) , (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) )) (compound_statement "{\n    if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       ) {\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }\n    else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar10 = pcVar10 + 1;\n  }" { (if_statement "if (((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       ) {\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }\n    else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }" if (parenthesized_expression "(((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')\n       )" ( (binary_expression "((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')) && (cVar4 = __s_00[2], cVar4 != '\0')" (parenthesized_expression "((cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0'))" ( (binary_expression "(cVar2 == '%') && (cVar3 = __s_00[1], cVar3 != '\0')" (parenthesized_expression "(cVar2 == '%')" ( (binary_expression "cVar2 == '%'" identifier == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(cVar3 = __s_00[1], cVar3 != '\0')" ( (comma_expression "cVar3 = __s_00[1], cVar3 != '\0'" (assignment_expression "cVar3 = __s_00[1]" identifier = (subscript_expression "__s_00[1]" identifier [ number_literal ])) , (binary_expression "cVar3 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) ))) )) && (parenthesized_expression "(cVar4 = __s_00[2], cVar4 != '\0')" ( (comma_expression "cVar4 = __s_00[2], cVar4 != '\0'" (assignment_expression "cVar4 = __s_00[2]" identifier = (subscript_expression "__s_00[2]" identifier [ number_literal ])) , (binary_expression "cVar4 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) ))) )) (compound_statement "{\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      iVar9 = cVar4 + -0x30;\n      if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar10 = (char)iVar9 + (char)(iVar8 << 4);\n    }" { (expression_statement "iVar8 = cVar3 + -0x30;" (assignment_expression "iVar8 = cVar3 + -0x30" identifier = (binary_expression "cVar3 + -0x30" identifier + number_literal)) ;) (if_statement "if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }" if (parenthesized_expression "(9 < iVar8)" ( (binary_expression "9 < iVar8" number_literal < identifier) )) (compound_statement "{\n        iVar8 = cVar3 + -0x37;\n      }" { (expression_statement "iVar8 = cVar3 + -0x37;" (assignment_expression "iVar8 = cVar3 + -0x37" identifier = (binary_expression "cVar3 + -0x37" identifier + number_literal)) ;) })) (expression_statement "iVar9 = cVar4 + -0x30;" (assignment_expression "iVar9 = cVar4 + -0x30" identifier = (binary_expression "cVar4 + -0x30" identifier + number_literal)) ;) (if_statement "if (9 < iVar9) {\n        iVar9 = cVar4 + -0x37;\n      }" if (parenthesized_expression "(9 < iVar9)" ( (binary_expression "9 < iVar9" number_literal < identifier) )) (compound_statement "{\n        iVar9 = cVar4 + -0x37;\n      }" { (expression_statement "iVar9 = cVar4 + -0x37;" (assignment_expression "iVar9 = cVar4 + -0x37" identifier = (binary_expression "cVar4 + -0x37" identifier + number_literal)) ;) })) (expression_statement "__s_00 = __s_00 + 3;" (assignment_expression "__s_00 = __s_00 + 3" identifier = (binary_expression "__s_00 + 3" identifier + number_literal)) ;) (expression_statement "*pcVar10 = (char)iVar9 + (char)(iVar8 << 4);" (assignment_expression "*pcVar10 = (char)iVar9 + (char)(iVar8 << 4)" (pointer_expression "*pcVar10" * identifier) = (binary_expression "(char)iVar9 + (char)(iVar8 << 4)" (cast_expression "(char)iVar9" ( (type_descriptor "char" primitive_type) ) identifier) + (cast_expression "(char)(iVar8 << 4)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "(iVar8 << 4)" ( (binary_expression "iVar8 << 4" identifier << number_literal) ))))) ;) }) (else_clause "else {\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }" else (compound_statement "{\n      *pcVar10 = cVar2;\n      __s_00 = __s_00 + 1;\n    }" { (expression_statement "*pcVar10 = cVar2;" (assignment_expression "*pcVar10 = cVar2" (pointer_expression "*pcVar10" * identifier) = identifier) ;) (expression_statement "__s_00 = __s_00 + 1;" (assignment_expression "__s_00 = __s_00 + 1" identifier = (binary_expression "__s_00 + 1" identifier + number_literal)) ;) }))) (expression_statement "pcVar10 = pcVar10 + 1;" (assignment_expression "pcVar10 = pcVar10 + 1" identifier = (binary_expression "pcVar10 + 1" identifier + number_literal)) ;) })) (expression_statement "*pcVar10 = '\0';" (assignment_expression "*pcVar10 = '\0'" (pointer_expression "*pcVar10" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "strncpy(buffer,__src,buflen);" (call_expression "strncpy(buffer,__src,buflen)" identifier (argument_list "(buffer,__src,buflen)" ( identifier , identifier , identifier ))) ;) (expression_statement "buffer[buflen + -1] = '\0';" (assignment_expression "buffer[buflen + -1] = '\0'" (subscript_expression "buffer[buflen + -1]" identifier [ (binary_expression "buflen + -1" identifier + number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "safefree(__src);" (call_expression "safefree(__src)" identifier (argument_list "(__src)" ( identifier ))) ;) (expression_statement "safefree(__s);" (call_expression "safefree(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (labeled_statement "LAB_0006b10d:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return buffer;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return buffer;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return buffer;\n  }" { (return_statement "return buffer;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "char * FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)\n\n{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    \n  FUN_0006dad0();\n}\n\n" (function_definition "char * FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)\n\n{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    \n  FUN_0006dad0();\n}" primitive_type (pointer_declarator "* FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)" * (function_declarator "FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)" identifier (parameter_list "(DIR *param_1,char *param_2,size_t param_3)" ( (parameter_declaration "DIR *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) )))) (compound_statement "{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    \n  FUN_0006dad0();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "char cVar3;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "dirent64 *pdVar5;" type_identifier (pointer_declarator "*pdVar5" * identifier) ;) (declaration "size_t sVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "char *pcVar9;" primitive_type (pointer_declarator "*pcVar9" * identifier) ;) (declaration "char *__s_00;" primitive_type (pointer_declarator "*__s_00" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "size_t local_a0;" primitive_type identifier ;) (declaration "stat64 local_80;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x6af3b;" (assignment_expression "uStack_14 = 0x6af3b" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__s = (char *)FUN_00069f00();" (assignment_expression "__s = (char *)FUN_00069f00()" identifier = (cast_expression "(char *)FUN_00069f00()" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00069f00()" identifier (argument_list "()" ( ))))) ;) (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "local_a0 = sVar4;" (assignment_expression "local_a0 = sVar4" identifier = identifier) ;) (do_statement "do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));" do (compound_statement "{\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  }" { (expression_statement "pdVar5 = readdir64(param_1);" (assignment_expression "pdVar5 = readdir64(param_1)" identifier = (call_expression "readdir64(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }" if (parenthesized_expression "(pdVar5 == (dirent64 *)0x0)" ( (binary_expression "pdVar5 == (dirent64 *)0x0" identifier == (cast_expression "(dirent64 *)0x0" ( (type_descriptor "dirent64 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }" { (expression_statement "FUN_0001d220(__s);" (call_expression "FUN_0001d220(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (expression_statement "param_2 = (char *)0x0;" (assignment_expression "param_2 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_0006b10d;" goto statement_identifier ;) })) (expression_statement "__s_00 = pdVar5->d_name;" (assignment_expression "__s_00 = pdVar5->d_name" identifier = (field_expression "pdVar5->d_name" identifier -> field_identifier)) ;) (expression_statement "sVar6 = strlen(__s_00);" (assignment_expression "sVar6 = strlen(__s_00)" identifier = (call_expression "strlen(__s_00)" identifier (argument_list "(__s_00)" ( identifier )))) ;) (expression_statement "iVar7 = sVar4 + sVar6;" (assignment_expression "iVar7 = sVar4 + sVar6" identifier = (binary_expression "sVar4 + sVar6" identifier + identifier)) ;) (expression_statement "sVar6 = iVar7 + 1;" (assignment_expression "sVar6 = iVar7 + 1" identifier = (binary_expression "iVar7 + 1" identifier + number_literal)) ;) (if_statement "if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }" if (parenthesized_expression "((int)local_a0 < (int)sVar6)" ( (binary_expression "(int)local_a0 < (int)sVar6" (cast_expression "(int)local_a0" ( (type_descriptor "int" primitive_type) ) identifier) < (cast_expression "(int)sVar6" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }" { (expression_statement "__s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);" (assignment_expression "__s = (char *)FUN_0001cd90(__s,iVar7 + 2,1)" identifier = (cast_expression "(char *)FUN_0001cd90(__s,iVar7 + 2,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001cd90(__s,iVar7 + 2,1)" identifier (argument_list "(__s,iVar7 + 2,1)" ( identifier , (binary_expression "iVar7 + 2" identifier + number_literal) , number_literal ))))) ;) (expression_statement "local_a0 = sVar6;" (assignment_expression "local_a0 = sVar6" identifier = identifier) ;) })) (expression_statement "__s[sVar4] = '/';" (assignment_expression "__s[sVar4] = '/'" (subscript_expression "__s[sVar4]" identifier [ identifier ]) = (char_literal "'/'" ' character ')) ;) (expression_statement "strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));" (call_expression "strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1))" identifier (argument_list "(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1))" ( (binary_expression "__s + sVar4 + 1" (binary_expression "__s + sVar4" identifier + identifier) + number_literal) , identifier , (binary_expression "sVar6 - (sVar4 + 1)" identifier - (parenthesized_expression "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) ))) ))) ;) (expression_statement "__s[iVar7 + 1] = '\0';" (assignment_expression "__s[iVar7 + 1] = '\0'" (subscript_expression "__s[iVar7 + 1]" identifier [ (binary_expression "iVar7 + 1" identifier + number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar7 = __xstat64(3,__s,&local_80);" (assignment_expression "iVar7 = __xstat64(3,__s,&local_80)" identifier = (call_expression "__xstat64(3,__s,&local_80)" identifier (argument_list "(3,__s,&local_80)" ( number_literal , identifier , (pointer_expression "&local_80" & identifier) )))) ;) }) while (parenthesized_expression "((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000))" ( (binary_expression "(iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000)" (parenthesized_expression "(iVar7 < 0)" ( (binary_expression "iVar7 < 0" identifier < number_literal) )) || (parenthesized_expression "((local_80.st_mode & 0xf000) != 0x8000)" ( (binary_expression "(local_80.st_mode & 0xf000) != 0x8000" (parenthesized_expression "(local_80.st_mode & 0xf000)" ( (binary_expression "local_80.st_mode & 0xf000" (field_expression "local_80.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) ))) )) ;) (expression_statement "sVar4 = strlen(__s_00);" (assignment_expression "sVar4 = strlen(__s_00)" identifier = (call_expression "strlen(__s_00)" identifier (argument_list "(__s_00)" ( identifier )))) ;) (expression_statement "__src = (char *)FUN_0001c990(sVar4 + 1,1);" (assignment_expression "__src = (char *)FUN_0001c990(sVar4 + 1,1)" identifier = (cast_expression "(char *)FUN_0001c990(sVar4 + 1,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001c990(sVar4 + 1,1)" identifier (argument_list "(sVar4 + 1,1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "pcVar9 = __src;" (assignment_expression "pcVar9 = __src" identifier = identifier) ;) (while_statement "while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }" while (parenthesized_expression "(cVar1 = *__s_00, cVar1 != '\0')" ( (comma_expression "cVar1 = *__s_00, cVar1 != '\0'" (assignment_expression "cVar1 = *__s_00" identifier = (pointer_expression "*__s_00" * identifier)) , (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) )) (compound_statement "{\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }" { (if_statement "if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" if (parenthesized_expression "(((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       )" ( (binary_expression "((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')" (parenthesized_expression "((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0'))" ( (binary_expression "(cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')" (parenthesized_expression "(cVar1 == '%')" ( (binary_expression "cVar1 == '%'" identifier == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(cVar2 = __s_00[1], cVar2 != '\0')" ( (comma_expression "cVar2 = __s_00[1], cVar2 != '\0'" (assignment_expression "cVar2 = __s_00[1]" identifier = (subscript_expression "__s_00[1]" identifier [ number_literal ])) , (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) ))) )) && (parenthesized_expression "(cVar3 = __s_00[2], cVar3 != '\0')" ( (comma_expression "cVar3 = __s_00[2], cVar3 != '\0'" (assignment_expression "cVar3 = __s_00[2]" identifier = (subscript_expression "__s_00[2]" identifier [ number_literal ])) , (binary_expression "cVar3 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence '))) ))) )) (compound_statement "{\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }" { (expression_statement "iVar7 = cVar2 + -0x30;" (assignment_expression "iVar7 = cVar2 + -0x30" identifier = (binary_expression "cVar2 + -0x30" identifier + number_literal)) ;) (if_statement "if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }" if (parenthesized_expression "(9 < iVar7)" ( (binary_expression "9 < iVar7" number_literal < identifier) )) (compound_statement "{\n        iVar7 = cVar2 + -0x37;\n      }" { (expression_statement "iVar7 = cVar2 + -0x37;" (assignment_expression "iVar7 = cVar2 + -0x37" identifier = (binary_expression "cVar2 + -0x37" identifier + number_literal)) ;) })) (expression_statement "iVar8 = cVar3 + -0x30;" (assignment_expression "iVar8 = cVar3 + -0x30" identifier = (binary_expression "cVar3 + -0x30" identifier + number_literal)) ;) (if_statement "if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }" if (parenthesized_expression "(9 < iVar8)" ( (binary_expression "9 < iVar8" number_literal < identifier) )) (compound_statement "{\n        iVar8 = cVar3 + -0x37;\n      }" { (expression_statement "iVar8 = cVar3 + -0x37;" (assignment_expression "iVar8 = cVar3 + -0x37" identifier = (binary_expression "cVar3 + -0x37" identifier + number_literal)) ;) })) (expression_statement "__s_00 = __s_00 + 3;" (assignment_expression "__s_00 = __s_00 + 3" identifier = (binary_expression "__s_00 + 3" identifier + number_literal)) ;) (expression_statement "*pcVar9 = (char)iVar8 + (char)(iVar7 << 4);" (assignment_expression "*pcVar9 = (char)iVar8 + (char)(iVar7 << 4)" (pointer_expression "*pcVar9" * identifier) = (binary_expression "(char)iVar8 + (char)(iVar7 << 4)" (cast_expression "(char)iVar8" ( (type_descriptor "char" primitive_type) ) identifier) + (cast_expression "(char)(iVar7 << 4)" ( (type_descriptor "char" primitive_type) ) (parenthesized_expression "(iVar7 << 4)" ( (binary_expression "iVar7 << 4" identifier << number_literal) ))))) ;) }) (else_clause "else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" else (compound_statement "{\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" { (expression_statement "*pcVar9 = cVar1;" (assignment_expression "*pcVar9 = cVar1" (pointer_expression "*pcVar9" * identifier) = identifier) ;) (expression_statement "__s_00 = __s_00 + 1;" (assignment_expression "__s_00 = __s_00 + 1" identifier = (binary_expression "__s_00 + 1" identifier + number_literal)) ;) }))) (expression_statement "pcVar9 = pcVar9 + 1;" (assignment_expression "pcVar9 = pcVar9 + 1" identifier = (binary_expression "pcVar9 + 1" identifier + number_literal)) ;) })) (expression_statement "*pcVar9 = '\0';" (assignment_expression "*pcVar9 = '\0'" (pointer_expression "*pcVar9" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "strncpy(param_2,__src,param_3);" (call_expression "strncpy(param_2,__src,param_3)" identifier (argument_list "(param_2,__src,param_3)" ( identifier , identifier , identifier ))) ;) (expression_statement "param_2[param_3 - 1] = '\0';" (assignment_expression "param_2[param_3 - 1] = '\0'" (subscript_expression "param_2[param_3 - 1]" identifier [ (binary_expression "param_3 - 1" identifier - number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "FUN_0001d220(__src);" (call_expression "FUN_0001d220(__src)" identifier (argument_list "(__src)" ( identifier ))) ;) (expression_statement "FUN_0001d220(__s);" (call_expression "FUN_0001d220(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (labeled_statement "LAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return param_2;\n  }" { (return_statement "return param_2;" return identifier ;) }))) (expression_statement "FUN_0006dad0();" (call_expression "FUN_0006dad0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (field_expression IDENT -> field_identifier)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (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 , (binary_expression IDENT + LIT) , LIT ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (char_literal ' character ')) ;) (expression_statement (call_expression IDENT (argument_list ( (binary_expression (binary_expression IDENT + IDENT) + LIT) , IDENT , (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT + LIT) ))) ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT + LIT) ]) = (char_literal ' escape_sequence ')) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , (pointer_expression & IDENT) )))) ;) }) while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT . field_identifier) & LIT) )) != LIT) ))) )) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , LIT ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (pointer_expression * IDENT)) , (binary_expression IDENT != (char_literal ' escape_sequence '))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (char_literal ' character ')) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) , (binary_expression IDENT != (char_literal ' escape_sequence '))) ))) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) , (binary_expression IDENT != (char_literal ' escape_sequence '))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT << LIT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (char_literal ' escape_sequence ')) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT - LIT) ]) = (char_literal ' escape_sequence ')) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "char * FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)\n\n{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    \n  FUN_0006dad0();\n}" (primitive_type "char") (pointer_declarator "* FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)" (* "*") (function_declarator "FUN_0006af30(DIR *param_1,char *param_2,size_t param_3)" (identifier "FUN_0006af30") (parameter_list "(DIR *param_1,char *param_2,size_t param_3)" (( "(") (parameter_declaration "DIR *param_1" (type_identifier "DIR") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) () ")")))) (compound_statement "{\n  char cVar1;\n  char cVar2;\n  char cVar3;\n  char *__s;\n  size_t sVar4;\n  dirent64 *pdVar5;\n  size_t sVar6;\n  int iVar7;\n  char *__src;\n  int iVar8;\n  char *pcVar9;\n  char *__s_00;\n  int in_GS_OFFSET;\n  size_t local_a0;\n  stat64 local_80;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x6af3b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00069f00();\n  sVar4 = strlen(__s);\n  local_a0 = sVar4;\n  do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));\n  sVar4 = strlen(__s_00);\n  __src = (char *)FUN_0001c990(sVar4 + 1,1);\n  pcVar9 = __src;\n  while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }\n  *pcVar9 = '\0';\n  strncpy(param_2,__src,param_3);\n  param_2[param_3 - 1] = '\0';\n  FUN_0001d220(__src);\n  FUN_0001d220(__s);\nLAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }\n                    \n  FUN_0006dad0();\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "char cVar2;" (primitive_type "char") (identifier "cVar2") (; ";")) (declaration "char cVar3;" (primitive_type "char") (identifier "cVar3") (; ";")) (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "dirent64 *pdVar5;" (type_identifier "dirent64") (pointer_declarator "*pdVar5" (* "*") (identifier "pdVar5")) (; ";")) (declaration "size_t sVar6;" (primitive_type "size_t") (identifier "sVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "char *__src;" (primitive_type "char") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (declaration "char *pcVar9;" (primitive_type "char") (pointer_declarator "*pcVar9" (* "*") (identifier "pcVar9")) (; ";")) (declaration "char *__s_00;" (primitive_type "char") (pointer_declarator "*__s_00" (* "*") (identifier "__s_00")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "size_t local_a0;" (primitive_type "size_t") (identifier "local_a0") (; ";")) (declaration "stat64 local_80;" (type_identifier "stat64") (identifier "local_80") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x6af3b;" (assignment_expression "uStack_14 = 0x6af3b" (identifier "uStack_14") (= "=") (number_literal "0x6af3b")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "__s = (char *)FUN_00069f00();" (assignment_expression "__s = (char *)FUN_00069f00()" (identifier "__s") (= "=") (cast_expression "(char *)FUN_00069f00()" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00069f00()" (identifier "FUN_00069f00") (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" (identifier "sVar4") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (expression_statement "local_a0 = sVar4;" (assignment_expression "local_a0 = sVar4" (identifier "local_a0") (= "=") (identifier "sVar4")) (; ";")) (do_statement "do {\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));" (do "do") (compound_statement "{\n    pdVar5 = readdir64(param_1);\n    if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }\n    __s_00 = pdVar5->d_name;\n    sVar6 = strlen(__s_00);\n    iVar7 = sVar4 + sVar6;\n    sVar6 = iVar7 + 1;\n    if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }\n    __s[sVar4] = '/';\n    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));\n    __s[iVar7 + 1] = '\0';\n    iVar7 = __xstat64(3,__s,&local_80);\n  }" ({ "{") (expression_statement "pdVar5 = readdir64(param_1);" (assignment_expression "pdVar5 = readdir64(param_1)" (identifier "pdVar5") (= "=") (call_expression "readdir64(param_1)" (identifier "readdir64") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (pdVar5 == (dirent64 *)0x0) {\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }" (if "if") (parenthesized_expression "(pdVar5 == (dirent64 *)0x0)" (( "(") (binary_expression "pdVar5 == (dirent64 *)0x0" (identifier "pdVar5") (== "==") (cast_expression "(dirent64 *)0x0" (( "(") (type_descriptor "dirent64 *" (type_identifier "dirent64") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      FUN_0001d220(__s);\n      param_2 = (char *)0x0;\n      goto LAB_0006b10d;\n    }" ({ "{") (expression_statement "FUN_0001d220(__s);" (call_expression "FUN_0001d220(__s)" (identifier "FUN_0001d220") (argument_list "(__s)" (( "(") (identifier "__s") () ")"))) (; ";")) (expression_statement "param_2 = (char *)0x0;" (assignment_expression "param_2 = (char *)0x0" (identifier "param_2") (= "=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (goto_statement "goto LAB_0006b10d;" (goto "goto") (statement_identifier "LAB_0006b10d") (; ";")) (} "}"))) (expression_statement "__s_00 = pdVar5->d_name;" (assignment_expression "__s_00 = pdVar5->d_name" (identifier "__s_00") (= "=") (field_expression "pdVar5->d_name" (identifier "pdVar5") (-> "->") (field_identifier "d_name"))) (; ";")) (expression_statement "sVar6 = strlen(__s_00);" (assignment_expression "sVar6 = strlen(__s_00)" (identifier "sVar6") (= "=") (call_expression "strlen(__s_00)" (identifier "strlen") (argument_list "(__s_00)" (( "(") (identifier "__s_00") () ")")))) (; ";")) (expression_statement "iVar7 = sVar4 + sVar6;" (assignment_expression "iVar7 = sVar4 + sVar6" (identifier "iVar7") (= "=") (binary_expression "sVar4 + sVar6" (identifier "sVar4") (+ "+") (identifier "sVar6"))) (; ";")) (expression_statement "sVar6 = iVar7 + 1;" (assignment_expression "sVar6 = iVar7 + 1" (identifier "sVar6") (= "=") (binary_expression "iVar7 + 1" (identifier "iVar7") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if ((int)local_a0 < (int)sVar6) {\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }" (if "if") (parenthesized_expression "((int)local_a0 < (int)sVar6)" (( "(") (binary_expression "(int)local_a0 < (int)sVar6" (cast_expression "(int)local_a0" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_a0")) (< "<") (cast_expression "(int)sVar6" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar6"))) () ")")) (compound_statement "{\n      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);\n      local_a0 = sVar6;\n    }" ({ "{") (expression_statement "__s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);" (assignment_expression "__s = (char *)FUN_0001cd90(__s,iVar7 + 2,1)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_0001cd90(__s,iVar7 + 2,1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001cd90(__s,iVar7 + 2,1)" (identifier "FUN_0001cd90") (argument_list "(__s,iVar7 + 2,1)" (( "(") (identifier "__s") (, ",") (binary_expression "iVar7 + 2" (identifier "iVar7") (+ "+") (number_literal "2")) (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "local_a0 = sVar6;" (assignment_expression "local_a0 = sVar6" (identifier "local_a0") (= "=") (identifier "sVar6")) (; ";")) (} "}"))) (expression_statement "__s[sVar4] = '/';" (assignment_expression "__s[sVar4] = '/'" (subscript_expression "__s[sVar4]" (identifier "__s") ([ "[") (identifier "sVar4") (] "]")) (= "=") (char_literal "'/'" (' "'") (character "/") (' "'"))) (; ";")) (expression_statement "strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));" (call_expression "strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1))" (identifier "strncpy") (argument_list "(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1))" (( "(") (binary_expression "__s + sVar4 + 1" (binary_expression "__s + sVar4" (identifier "__s") (+ "+") (identifier "sVar4")) (+ "+") (number_literal "1")) (, ",") (identifier "__s_00") (, ",") (binary_expression "sVar6 - (sVar4 + 1)" (identifier "sVar6") (- "-") (parenthesized_expression "(sVar4 + 1)" (( "(") (binary_expression "sVar4 + 1" (identifier "sVar4") (+ "+") (number_literal "1")) () ")"))) () ")"))) (; ";")) (expression_statement "__s[iVar7 + 1] = '\0';" (assignment_expression "__s[iVar7 + 1] = '\0'" (subscript_expression "__s[iVar7 + 1]" (identifier "__s") ([ "[") (binary_expression "iVar7 + 1" (identifier "iVar7") (+ "+") (number_literal "1")) (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "iVar7 = __xstat64(3,__s,&local_80);" (assignment_expression "iVar7 = __xstat64(3,__s,&local_80)" (identifier "iVar7") (= "=") (call_expression "__xstat64(3,__s,&local_80)" (identifier "__xstat64") (argument_list "(3,__s,&local_80)" (( "(") (number_literal "3") (, ",") (identifier "__s") (, ",") (pointer_expression "&local_80" (& "&") (identifier "local_80")) () ")")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000))" (( "(") (binary_expression "(iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000)" (parenthesized_expression "(iVar7 < 0)" (( "(") (binary_expression "iVar7 < 0" (identifier "iVar7") (< "<") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "((local_80.st_mode & 0xf000) != 0x8000)" (( "(") (binary_expression "(local_80.st_mode & 0xf000) != 0x8000" (parenthesized_expression "(local_80.st_mode & 0xf000)" (( "(") (binary_expression "local_80.st_mode & 0xf000" (field_expression "local_80.st_mode" (identifier "local_80") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xf000")) () ")")) (!= "!=") (number_literal "0x8000")) () ")"))) () ")")) (; ";")) (expression_statement "sVar4 = strlen(__s_00);" (assignment_expression "sVar4 = strlen(__s_00)" (identifier "sVar4") (= "=") (call_expression "strlen(__s_00)" (identifier "strlen") (argument_list "(__s_00)" (( "(") (identifier "__s_00") () ")")))) (; ";")) (expression_statement "__src = (char *)FUN_0001c990(sVar4 + 1,1);" (assignment_expression "__src = (char *)FUN_0001c990(sVar4 + 1,1)" (identifier "__src") (= "=") (cast_expression "(char *)FUN_0001c990(sVar4 + 1,1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001c990(sVar4 + 1,1)" (identifier "FUN_0001c990") (argument_list "(sVar4 + 1,1)" (( "(") (binary_expression "sVar4 + 1" (identifier "sVar4") (+ "+") (number_literal "1")) (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "pcVar9 = __src;" (assignment_expression "pcVar9 = __src" (identifier "pcVar9") (= "=") (identifier "__src")) (; ";")) (while_statement "while (cVar1 = *__s_00, cVar1 != '\0') {\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }" (while "while") (parenthesized_expression "(cVar1 = *__s_00, cVar1 != '\0')" (( "(") (comma_expression "cVar1 = *__s_00, cVar1 != '\0'" (assignment_expression "cVar1 = *__s_00" (identifier "cVar1") (= "=") (pointer_expression "*__s_00" (* "*") (identifier "__s_00"))) (, ",") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'")))) () ")")) (compound_statement "{\n    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }\n    pcVar9 = pcVar9 + 1;\n  }" ({ "{") (if_statement "if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       ) {\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }\n    else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" (if "if") (parenthesized_expression "(((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')\n       )" (( "(") (binary_expression "((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')" (parenthesized_expression "((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0'))" (( "(") (binary_expression "(cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')" (parenthesized_expression "(cVar1 == '%')" (( "(") (binary_expression "cVar1 == '%'" (identifier "cVar1") (== "==") (char_literal "'%'" (' "'") (character "%") (' "'"))) () ")")) (&& "&&") (parenthesized_expression "(cVar2 = __s_00[1], cVar2 != '\0')" (( "(") (comma_expression "cVar2 = __s_00[1], cVar2 != '\0'" (assignment_expression "cVar2 = __s_00[1]" (identifier "cVar2") (= "=") (subscript_expression "__s_00[1]" (identifier "__s_00") ([ "[") (number_literal "1") (] "]"))) (, ",") (binary_expression "cVar2 != '\0'" (identifier "cVar2") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'")))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(cVar3 = __s_00[2], cVar3 != '\0')" (( "(") (comma_expression "cVar3 = __s_00[2], cVar3 != '\0'" (assignment_expression "cVar3 = __s_00[2]" (identifier "cVar3") (= "=") (subscript_expression "__s_00[2]" (identifier "__s_00") ([ "[") (number_literal "2") (] "]"))) (, ",") (binary_expression "cVar3 != '\0'" (identifier "cVar3") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'")))) () ")"))) () ")")) (compound_statement "{\n      iVar7 = cVar2 + -0x30;\n      if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }\n      iVar8 = cVar3 + -0x30;\n      if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }\n      __s_00 = __s_00 + 3;\n      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);\n    }" ({ "{") (expression_statement "iVar7 = cVar2 + -0x30;" (assignment_expression "iVar7 = cVar2 + -0x30" (identifier "iVar7") (= "=") (binary_expression "cVar2 + -0x30" (identifier "cVar2") (+ "+") (number_literal "-0x30"))) (; ";")) (if_statement "if (9 < iVar7) {\n        iVar7 = cVar2 + -0x37;\n      }" (if "if") (parenthesized_expression "(9 < iVar7)" (( "(") (binary_expression "9 < iVar7" (number_literal "9") (< "<") (identifier "iVar7")) () ")")) (compound_statement "{\n        iVar7 = cVar2 + -0x37;\n      }" ({ "{") (expression_statement "iVar7 = cVar2 + -0x37;" (assignment_expression "iVar7 = cVar2 + -0x37" (identifier "iVar7") (= "=") (binary_expression "cVar2 + -0x37" (identifier "cVar2") (+ "+") (number_literal "-0x37"))) (; ";")) (} "}"))) (expression_statement "iVar8 = cVar3 + -0x30;" (assignment_expression "iVar8 = cVar3 + -0x30" (identifier "iVar8") (= "=") (binary_expression "cVar3 + -0x30" (identifier "cVar3") (+ "+") (number_literal "-0x30"))) (; ";")) (if_statement "if (9 < iVar8) {\n        iVar8 = cVar3 + -0x37;\n      }" (if "if") (parenthesized_expression "(9 < iVar8)" (( "(") (binary_expression "9 < iVar8" (number_literal "9") (< "<") (identifier "iVar8")) () ")")) (compound_statement "{\n        iVar8 = cVar3 + -0x37;\n      }" ({ "{") (expression_statement "iVar8 = cVar3 + -0x37;" (assignment_expression "iVar8 = cVar3 + -0x37" (identifier "iVar8") (= "=") (binary_expression "cVar3 + -0x37" (identifier "cVar3") (+ "+") (number_literal "-0x37"))) (; ";")) (} "}"))) (expression_statement "__s_00 = __s_00 + 3;" (assignment_expression "__s_00 = __s_00 + 3" (identifier "__s_00") (= "=") (binary_expression "__s_00 + 3" (identifier "__s_00") (+ "+") (number_literal "3"))) (; ";")) (expression_statement "*pcVar9 = (char)iVar8 + (char)(iVar7 << 4);" (assignment_expression "*pcVar9 = (char)iVar8 + (char)(iVar7 << 4)" (pointer_expression "*pcVar9" (* "*") (identifier "pcVar9")) (= "=") (binary_expression "(char)iVar8 + (char)(iVar7 << 4)" (cast_expression "(char)iVar8" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "iVar8")) (+ "+") (cast_expression "(char)(iVar7 << 4)" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (parenthesized_expression "(iVar7 << 4)" (( "(") (binary_expression "iVar7 << 4" (identifier "iVar7") (<< "<<") (number_literal "4")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" (else "else") (compound_statement "{\n      *pcVar9 = cVar1;\n      __s_00 = __s_00 + 1;\n    }" ({ "{") (expression_statement "*pcVar9 = cVar1;" (assignment_expression "*pcVar9 = cVar1" (pointer_expression "*pcVar9" (* "*") (identifier "pcVar9")) (= "=") (identifier "cVar1")) (; ";")) (expression_statement "__s_00 = __s_00 + 1;" (assignment_expression "__s_00 = __s_00 + 1" (identifier "__s_00") (= "=") (binary_expression "__s_00 + 1" (identifier "__s_00") (+ "+") (number_literal "1"))) (; ";")) (} "}")))) (expression_statement "pcVar9 = pcVar9 + 1;" (assignment_expression "pcVar9 = pcVar9 + 1" (identifier "pcVar9") (= "=") (binary_expression "pcVar9 + 1" (identifier "pcVar9") (+ "+") (number_literal "1"))) (; ";")) (} "}"))) (expression_statement "*pcVar9 = '\0';" (assignment_expression "*pcVar9 = '\0'" (pointer_expression "*pcVar9" (* "*") (identifier "pcVar9")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "strncpy(param_2,__src,param_3);" (call_expression "strncpy(param_2,__src,param_3)" (identifier "strncpy") (argument_list "(param_2,__src,param_3)" (( "(") (identifier "param_2") (, ",") (identifier "__src") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "param_2[param_3 - 1] = '\0';" (assignment_expression "param_2[param_3 - 1] = '\0'" (subscript_expression "param_2[param_3 - 1]" (identifier "param_2") ([ "[") (binary_expression "param_3 - 1" (identifier "param_3") (- "-") (number_literal "1")) (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "FUN_0001d220(__src);" (call_expression "FUN_0001d220(__src)" (identifier "FUN_0001d220") (argument_list "(__src)" (( "(") (identifier "__src") () ")"))) (; ";")) (expression_statement "FUN_0001d220(__s);" (call_expression "FUN_0001d220(__s)" (identifier "FUN_0001d220") (argument_list "(__s)" (( "(") (identifier "__s") () ")"))) (; ";")) (labeled_statement "LAB_0006b10d:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }" (statement_identifier "LAB_0006b10d") (: ":") (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return param_2;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return param_2;\n  }" ({ "{") (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}")))) (expression_statement "FUN_0006dad0();" (call_expression "FUN_0006dad0()" (identifier "FUN_0006dad0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

char * function_1(void *handle,char *buffer,int var_21)

{
  int var_22;
  char var_15;
  char var_16;
  char var_17;
  char *var_12;
  size_t var_7;
  type_1 *var_5;
  size_t var_8;
  int var_9;
  char *__src;
  int var_18;
  char *var_20;
  char *var_19;
  int var_1;
  size_t local_a0;
  type_2 st;
  
  var_22 = *(int *)(var_1 + 0x14);
  var_12 = var_2(4,(char *)0x0);
  var_7 = var_3(var_12);
  local_a0 = var_7;
  do {
    var_5 = var_4((type_3 *)handle);
    if (var_5 == (type_1 *)0x0) {
      var_6(var_12);
      buffer = (char *)0x0;
      goto LAB_0006b10d;
    }
    var_19 = var_5->d_name;
    var_8 = var_3(var_19);
    var_9 = var_7 + var_8;
    var_8 = var_9 + 1;
    if ((int)local_a0 < (int)var_8) {
      var_12 = (char *)var_10(var_12,var_9 + 2,1);
      local_a0 = var_8;
    }
    var_12[var_7] = '/';
    var_11(var_12 + var_7 + 1,var_19,var_8 - (var_7 + 1));
    var_12[var_9 + 1] = '\0';
    var_9 = var_13(3,var_12,(type_4 *)&st);
  } while ((var_9 < 0) || ((st.st_mode & 0xf000) != 0x8000));
  var_7 = var_3(var_19);
  __src = (char *)var_14(var_7 + 1,1);
  var_20 = __src;
  while (var_15 = *var_19, var_15 != '\0') {
    if (((var_15 == '%') && (var_16 = var_19[1], var_16 != '\0')) && (var_17 = var_19[2], var_17 != '\0')
       ) {
      var_9 = var_16 + -0x30;
      if (9 < var_9) {
        var_9 = var_16 + -0x37;
      }
      var_18 = var_17 + -0x30;
      if (9 < var_18) {
        var_18 = var_17 + -0x37;
      }
      var_19 = var_19 + 3;
      *var_20 = (char)var_18 + (char)(var_9 << 4);
    }
    else {
      *var_20 = var_15;
      var_19 = var_19 + 1;
    }
    var_20 = var_20 + 1;
  }
  *var_20 = '\0';
  var_11(buffer,__src,var_21);
  buffer[var_21 + -1] = '\0';
  var_6(__src);
  var_6(var_12);
LAB_0006b10d:
  if (var_22 == *(int *)(var_1 + 0x14)) {
    return buffer;
  }
                    /* WARNING: Subroutine does not return */
  var_23();
}


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

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

char * MASKED(DIR *param_1,char *param_2,size_t param_3)

{
  char cVar1;
  char cVar2;
  char cVar3;
  char *__s;
  size_t sVar4;
  dirent64 *pdVar5;
  size_t sVar6;
  int iVar7;
  char *__src;
  int iVar8;
  char *pcVar9;
  char *__s_00;
  int in_GS_OFFSET;
  size_t local_a0;
  stat64 local_80;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x6af3b;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __s = (char *)FUN_00069f00();
  sVar4 = strlen(__s);
  local_a0 = sVar4;
  do {
    pdVar5 = readdir64(param_1);
    if (pdVar5 == (dirent64 *)0x0) {
      FUN_0001d220(__s);
      param_2 = (char *)0x0;
      goto LAB_0006b10d;
    }
    __s_00 = pdVar5->d_name;
    sVar6 = strlen(__s_00);
    iVar7 = sVar4 + sVar6;
    sVar6 = iVar7 + 1;
    if ((int)local_a0 < (int)sVar6) {
      __s = (char *)FUN_0001cd90(__s,iVar7 + 2,1);
      local_a0 = sVar6;
    }
    __s[sVar4] = '/';
    strncpy(__s + sVar4 + 1,__s_00,sVar6 - (sVar4 + 1));
    __s[iVar7 + 1] = '\0';
    iVar7 = __xstat64(3,__s,&local_80);
  } while ((iVar7 < 0) || ((local_80.st_mode & 0xf000) != 0x8000));
  sVar4 = strlen(__s_00);
  __src = (char *)FUN_0001c990(sVar4 + 1,1);
  pcVar9 = __src;
  while (cVar1 = *__s_00, cVar1 != '\0') {
    if (((cVar1 == '%') && (cVar2 = __s_00[1], cVar2 != '\0')) && (cVar3 = __s_00[2], cVar3 != '\0')
       ) {
      iVar7 = cVar2 + -0x30;
      if (9 < iVar7) {
        iVar7 = cVar2 + -0x37;
      }
      iVar8 = cVar3 + -0x30;
      if (9 < iVar8) {
        iVar8 = cVar3 + -0x37;
      }
      __s_00 = __s_00 + 3;
      *pcVar9 = (char)iVar8 + (char)(iVar7 << 4);
    }
    else {
      *pcVar9 = cVar1;
      __s_00 = __s_00 + 1;
    }
    pcVar9 = pcVar9 + 1;
  }
  *pcVar9 = '\0';
  strncpy(param_2,__src,param_3);
  param_2[param_3 - 1] = '\0';
  FUN_0001d220(__src);
  FUN_0001d220(__s);
LAB_0006b10d:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return param_2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006dad0();
}

