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

char * make_dir_path(char *path,mode_t mode)

{
  char cVar1;
  size_t sVar2;
  char *__path;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  int iVar6;
  
  iVar6 = 0;
  while( true ) {
    sVar2 = strcspn(path + iVar6,"/");
    iVar6 = iVar6 + sVar2;
    if (iVar6 < 1) {
      cVar1 = path[iVar6];
    }
    else {
      __path = dupprintf("%.*s",iVar6,path);
      iVar3 = mkdir(__path,mode);
      if (iVar3 < 0) {
        piVar4 = __errno_location();
        if (*piVar4 != 0x11) {
          pcVar5 = strerror(*piVar4);
          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);
          safefree(__path);
          return pcVar5;
        }
      }
      safefree(__path);
      cVar1 = path[iVar6];
    }
    if (cVar1 == '\0') break;
    sVar2 = strspn(path + iVar6,"/");
    iVar6 = iVar6 + sVar2;
  }
  return (char *)0x0;
}



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

undefined4 FUN_0004a9b0(int param_1,__mode_t param_2)

{
  char cVar1;
  size_t sVar2;
  char *__path;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  undefined4 uVar6;
  int iVar7;
  
  iVar7 = 0;
  while( true ) {
    sVar2 = strcspn((char *)(param_1 + iVar7),"/");
    iVar7 = iVar7 + sVar2;
    if (iVar7 < 1) {
      cVar1 = *(char *)(param_1 + iVar7);
    }
    else {
      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);
      iVar3 = mkdir(__path,param_2);
      if (iVar3 < 0) {
        piVar4 = __errno_location();
        if (*piVar4 != 0x11) {
          pcVar5 = strerror(*piVar4);
          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);
          FUN_0001ed20(__path);
          return uVar6;
        }
      }
      FUN_0001ed20(__path);
      cVar1 = *(char *)(param_1 + iVar7);
    }
    if (cVar1 == '\0') break;
    sVar2 = strspn((char *)(param_1 + iVar7),"/");
    iVar7 = iVar7 + sVar2;
  }
  return 0;
}


PUSH EBP
XOR EBP,EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00014560
ADD EBX,0x254a9
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
LEA EAX,[EBX + 0xfffdfc4f]
LEA EDI,[EBX + 0xfffea59f]
MOV dword ptr [ESP + 0xc],EAX
JMP 0x0004a9f7
LEA EAX,[ESI + EBP*0x1]
CMP byte ptr [EAX],0x0
JZ 0x0004aa55
SUB ESP,0x8
PUSH EDI
PUSH EAX
CALL 0x00012520
ADD ESP,0x10
ADD EBP,EAX
SUB ESP,0x8
LEA EAX,[ESI + EBP*0x1]
PUSH EDI
PUSH EAX
CALL 0x000120b0
ADD ESP,0x10
ADD EBP,EAX
TEST EBP,EBP
JLE 0x0004a9e0
SUB ESP,0x4
PUSH ESI
PUSH EBP
PUSH dword ptr [ESP + 0x18]
CALL 0x0001de90
MOV dword ptr [ESP + 0x18],EAX
POP EDX
POP ECX
PUSH dword ptr [ESP + 0x3c]
PUSH EAX
CALL 0x00012390
ADD ESP,0x10
TEST EAX,EAX
JNS 0x0004aa3e
CALL 0x000123a0
MOV EAX,dword ptr [EAX]
CMP EAX,0x11
JNZ 0x0004aa60
SUB ESP,0xc
PUSH dword ptr [ESP + 0x14]
CALL 0x0001ed20
LEA EAX,[ESI + EBP*0x1]
ADD ESP,0x10
CMP byte ptr [EAX],0x0
JNZ 0x0004a9e8
ADD ESP,0x1c
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EAX
CALL 0x00012280
ADD ESP,0xc
PUSH EAX
MOV EDI,dword ptr [ESP + 0x10]
LEA EAX,[EBX + 0xfffea584]
PUSH EDI
PUSH EAX
CALL 0x0001de90
MOV dword ptr [ESP],EDI
MOV dword ptr [ESP + 0x18],EAX
CALL 0x0001ed20
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0x8]
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_0004a9b0(int param_1,__mode_t param_2)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}\n\n" comment (function_definition "undefined4 FUN_0004a9b0(int param_1,__mode_t param_2)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_0004a9b0(int param_1,__mode_t param_2)" identifier (parameter_list "(int param_1,__mode_t param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "__mode_t param_2" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *__path;" primitive_type (pointer_declarator "*__path" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }" { (expression_statement "sVar2 = strcspn((char *)(param_1 + iVar7),"/");" (assignment_expression "sVar2 = strcspn((char *)(param_1 + iVar7),"/")" identifier = (call_expression "strcspn((char *)(param_1 + iVar7),"/")" identifier (argument_list "((char *)(param_1 + iVar7),"/")" ( (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar7 = iVar7 + sVar2;" (assignment_expression "iVar7 = iVar7 + sVar2" identifier = (binary_expression "iVar7 + sVar2" identifier + identifier)) ;) (if_statement "if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" if (parenthesized_expression "(iVar7 < 1)" ( (binary_expression "iVar7 < 1" identifier < number_literal) )) (compound_statement "{\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" { (expression_statement "cVar1 = *(char *)(param_1 + iVar7);" (assignment_expression "cVar1 = *(char *)(param_1 + iVar7)" identifier = (pointer_expression "*(char *)(param_1 + iVar7)" * (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))))) ;) }) (else_clause "else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" else (compound_statement "{\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" { (expression_statement "__path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);" (assignment_expression "__path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" identifier = (cast_expression "(char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" identifier (argument_list "(&DAT_0004fab3,iVar7,param_1)" ( (pointer_expression "&DAT_0004fab3" & identifier) , identifier , identifier ))))) ;) (expression_statement "iVar3 = mkdir(__path,param_2);" (assignment_expression "iVar3 = mkdir(__path,param_2)" identifier = (call_expression "mkdir(__path,param_2)" identifier (argument_list "(__path,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }" if (parenthesized_expression "(*piVar4 != 0x11)" ( (binary_expression "*piVar4 != 0x11" (pointer_expression "*piVar4" * identifier) != number_literal) )) (compound_statement "{\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }" { (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);" (assignment_expression "uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5)" identifier = (call_expression "FUN_0001de90("%s: mkdir: %s",__path,pcVar5)" identifier (argument_list "("%s: mkdir: %s",__path,pcVar5)" ( (string_literal ""%s: mkdir: %s"" " string_content ") , identifier , identifier )))) ;) (expression_statement "FUN_0001ed20(__path);" (call_expression "FUN_0001ed20(__path)" identifier (argument_list "(__path)" ( identifier ))) ;) (return_statement "return uVar6;" return identifier ;) })) })) (expression_statement "FUN_0001ed20(__path);" (call_expression "FUN_0001ed20(__path)" identifier (argument_list "(__path)" ( identifier ))) ;) (expression_statement "cVar1 = *(char *)(param_1 + iVar7);" (assignment_expression "cVar1 = *(char *)(param_1 + iVar7)" identifier = (pointer_expression "*(char *)(param_1 + iVar7)" * (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))))) ;) }))) (if_statement "if (cVar1 == '\0') break;" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (break_statement "break;" break ;)) (expression_statement "sVar2 = strspn((char *)(param_1 + iVar7),"/");" (assignment_expression "sVar2 = strspn((char *)(param_1 + iVar7),"/")" identifier = (call_expression "strspn((char *)(param_1 + iVar7),"/")" identifier (argument_list "((char *)(param_1 + iVar7),"/")" ( (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar7 = iVar7 + sVar2;" (assignment_expression "iVar7 = iVar7 + sVar2" identifier = (binary_expression "iVar7 + sVar2" identifier + identifier)) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * make_dir_path(char *path,mode_t mode)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  while( true ) {\n    sVar2 = strcspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n    if (iVar6 < 1) {\n      cVar1 = path[iVar6];\n    }\n    else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n  }\n  return (char *)0x0;\n}\n\n" comment comment (function_definition "char * make_dir_path(char *path,mode_t mode)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  while( true ) {\n    sVar2 = strcspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n    if (iVar6 < 1) {\n      cVar1 = path[iVar6];\n    }\n    else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n  }\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* make_dir_path(char *path,mode_t mode)" * (function_declarator "make_dir_path(char *path,mode_t mode)" identifier (parameter_list "(char *path,mode_t mode)" ( (parameter_declaration "char *path" primitive_type (pointer_declarator "*path" * identifier)) , (parameter_declaration "mode_t mode" type_identifier identifier) )))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  while( true ) {\n    sVar2 = strcspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n    if (iVar6 < 1) {\n      cVar1 = path[iVar6];\n    }\n    else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n  }\n  return (char *)0x0;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *__path;" primitive_type (pointer_declarator "*__path" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar2 = strcspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n    if (iVar6 < 1) {\n      cVar1 = path[iVar6];\n    }\n    else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar2 = strcspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n    if (iVar6 < 1) {\n      cVar1 = path[iVar6];\n    }\n    else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn(path + iVar6,"/");\n    iVar6 = iVar6 + sVar2;\n  }" { (expression_statement "sVar2 = strcspn(path + iVar6,"/");" (assignment_expression "sVar2 = strcspn(path + iVar6,"/")" identifier = (call_expression "strcspn(path + iVar6,"/")" identifier (argument_list "(path + iVar6,"/")" ( (binary_expression "path + iVar6" identifier + identifier) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar6 = iVar6 + sVar2;" (assignment_expression "iVar6 = iVar6 + sVar2" identifier = (binary_expression "iVar6 + sVar2" identifier + identifier)) ;) (if_statement "if (iVar6 < 1) {\n      cVar1 = path[iVar6];\n    }\n    else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }" if (parenthesized_expression "(iVar6 < 1)" ( (binary_expression "iVar6 < 1" identifier < number_literal) )) (compound_statement "{\n      cVar1 = path[iVar6];\n    }" { (expression_statement "cVar1 = path[iVar6];" (assignment_expression "cVar1 = path[iVar6]" identifier = (subscript_expression "path[iVar6]" identifier [ identifier ])) ;) }) (else_clause "else {\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }" else (compound_statement "{\n      __path = dupprintf("%.*s",iVar6,path);\n      iVar3 = mkdir(__path,mode);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }\n      safefree(__path);\n      cVar1 = path[iVar6];\n    }" { (expression_statement "__path = dupprintf("%.*s",iVar6,path);" (assignment_expression "__path = dupprintf("%.*s",iVar6,path)" identifier = (call_expression "dupprintf("%.*s",iVar6,path)" identifier (argument_list "("%.*s",iVar6,path)" ( (string_literal ""%.*s"" " string_content ") , identifier , identifier )))) ;) (expression_statement "iVar3 = mkdir(__path,mode);" (assignment_expression "iVar3 = mkdir(__path,mode)" identifier = (call_expression "mkdir(__path,mode)" identifier (argument_list "(__path,mode)" ( identifier , identifier )))) ;) (if_statement "if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }\n      }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }" if (parenthesized_expression "(*piVar4 != 0x11)" ( (binary_expression "*piVar4 != 0x11" (pointer_expression "*piVar4" * identifier) != number_literal) )) (compound_statement "{\n          pcVar5 = strerror(*piVar4);\n          pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);\n          safefree(__path);\n          return pcVar5;\n        }" { (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5);" (assignment_expression "pcVar5 = dupprintf("%s: mkdir: %s",__path,pcVar5)" identifier = (call_expression "dupprintf("%s: mkdir: %s",__path,pcVar5)" identifier (argument_list "("%s: mkdir: %s",__path,pcVar5)" ( (string_literal ""%s: mkdir: %s"" " string_content ") , identifier , identifier )))) ;) (expression_statement "safefree(__path);" (call_expression "safefree(__path)" identifier (argument_list "(__path)" ( identifier ))) ;) (return_statement "return pcVar5;" return identifier ;) })) })) (expression_statement "safefree(__path);" (call_expression "safefree(__path)" identifier (argument_list "(__path)" ( identifier ))) ;) (expression_statement "cVar1 = path[iVar6];" (assignment_expression "cVar1 = path[iVar6]" identifier = (subscript_expression "path[iVar6]" identifier [ identifier ])) ;) }))) (if_statement "if (cVar1 == '\0') break;" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (break_statement "break;" break ;)) (expression_statement "sVar2 = strspn(path + iVar6,"/");" (assignment_expression "sVar2 = strspn(path + iVar6,"/")" identifier = (call_expression "strspn(path + iVar6,"/")" identifier (argument_list "(path + iVar6,"/")" ( (binary_expression "path + iVar6" identifier + identifier) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar6 = iVar6 + sVar2;" (assignment_expression "iVar6 = iVar6 + sVar2" identifier = (binary_expression "iVar6 + sVar2" identifier + identifier)) ;) })) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "undefined4 FUN_0004a9b0(int param_1,__mode_t param_2)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}\n\n" (function_definition "undefined4 FUN_0004a9b0(int param_1,__mode_t param_2)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_0004a9b0(int param_1,__mode_t param_2)" identifier (parameter_list "(int param_1,__mode_t param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "__mode_t param_2" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *__path;" primitive_type (pointer_declarator "*__path" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }" { (expression_statement "sVar2 = strcspn((char *)(param_1 + iVar7),"/");" (assignment_expression "sVar2 = strcspn((char *)(param_1 + iVar7),"/")" identifier = (call_expression "strcspn((char *)(param_1 + iVar7),"/")" identifier (argument_list "((char *)(param_1 + iVar7),"/")" ( (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar7 = iVar7 + sVar2;" (assignment_expression "iVar7 = iVar7 + sVar2" identifier = (binary_expression "iVar7 + sVar2" identifier + identifier)) ;) (if_statement "if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" if (parenthesized_expression "(iVar7 < 1)" ( (binary_expression "iVar7 < 1" identifier < number_literal) )) (compound_statement "{\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" { (expression_statement "cVar1 = *(char *)(param_1 + iVar7);" (assignment_expression "cVar1 = *(char *)(param_1 + iVar7)" identifier = (pointer_expression "*(char *)(param_1 + iVar7)" * (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))))) ;) }) (else_clause "else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" else (compound_statement "{\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" { (expression_statement "__path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);" (assignment_expression "__path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" identifier = (cast_expression "(char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" identifier (argument_list "(&DAT_0004fab3,iVar7,param_1)" ( (pointer_expression "&DAT_0004fab3" & identifier) , identifier , identifier ))))) ;) (expression_statement "iVar3 = mkdir(__path,param_2);" (assignment_expression "iVar3 = mkdir(__path,param_2)" identifier = (call_expression "mkdir(__path,param_2)" identifier (argument_list "(__path,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }" if (parenthesized_expression "(iVar3 < 0)" ( (binary_expression "iVar3 < 0" identifier < number_literal) )) (compound_statement "{\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }" if (parenthesized_expression "(*piVar4 != 0x11)" ( (binary_expression "*piVar4 != 0x11" (pointer_expression "*piVar4" * identifier) != number_literal) )) (compound_statement "{\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }" { (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);" (assignment_expression "uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5)" identifier = (call_expression "FUN_0001de90("%s: mkdir: %s",__path,pcVar5)" identifier (argument_list "("%s: mkdir: %s",__path,pcVar5)" ( (string_literal ""%s: mkdir: %s"" " string_content ") , identifier , identifier )))) ;) (expression_statement "FUN_0001ed20(__path);" (call_expression "FUN_0001ed20(__path)" identifier (argument_list "(__path)" ( identifier ))) ;) (return_statement "return uVar6;" return identifier ;) })) })) (expression_statement "FUN_0001ed20(__path);" (call_expression "FUN_0001ed20(__path)" identifier (argument_list "(__path)" ( identifier ))) ;) (expression_statement "cVar1 = *(char *)(param_1 + iVar7);" (assignment_expression "cVar1 = *(char *)(param_1 + iVar7)" identifier = (pointer_expression "*(char *)(param_1 + iVar7)" * (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))))) ;) }))) (if_statement "if (cVar1 == '\0') break;" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (break_statement "break;" break ;)) (expression_statement "sVar2 = strspn((char *)(param_1 + iVar7),"/");" (assignment_expression "sVar2 = strspn((char *)(param_1 + iVar7),"/")" identifier = (call_expression "strspn((char *)(param_1 + iVar7),"/")" identifier (argument_list "((char *)(param_1 + iVar7),"/")" ( (cast_expression "(char *)(param_1 + iVar7)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + iVar7)" ( (binary_expression "param_1 + iVar7" identifier + identifier) ))) , (string_literal ""/"" " string_content ") )))) ;) (expression_statement "iVar7 = iVar7 + sVar2;" (assignment_expression "iVar7 = iVar7 + sVar2" identifier = (binary_expression "iVar7 + sVar2" identifier + identifier)) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (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 ;) (expression_statement (assignment_expression IDENT = LIT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , (string_literal " string_content ") )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT , IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT , IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , (string_literal " string_content ") )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) })) (return_statement return LIT ;) })))
(function_definition "undefined4 FUN_0004a9b0(int param_1,__mode_t param_2)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "FUN_0004a9b0(int param_1,__mode_t param_2)" (identifier "FUN_0004a9b0") (parameter_list "(int param_1,__mode_t param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "__mode_t param_2" (type_identifier "__mode_t") (identifier "param_2")) () ")"))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  char *__path;\n  int iVar3;\n  int *piVar4;\n  char *pcVar5;\n  undefined4 uVar6;\n  int iVar7;\n  \n  iVar7 = 0;\n  while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }\n  return 0;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "char *__path;" (primitive_type "char") (pointer_declarator "*__path" (* "*") (identifier "__path")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "char *pcVar5;" (primitive_type "char") (pointer_declarator "*pcVar5" (* "*") (identifier "pcVar5")) (; ";")) (declaration "undefined4 uVar6;" (type_identifier "undefined4") (identifier "uVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" (identifier "iVar7") (= "=") (number_literal "0")) (; ";")) (while_statement "while( true ) {\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    sVar2 = strcspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n    if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    if (cVar1 == '\0') break;\n    sVar2 = strspn((char *)(param_1 + iVar7),"/");\n    iVar7 = iVar7 + sVar2;\n  }" ({ "{") (expression_statement "sVar2 = strcspn((char *)(param_1 + iVar7),"/");" (assignment_expression "sVar2 = strcspn((char *)(param_1 + iVar7),"/")" (identifier "sVar2") (= "=") (call_expression "strcspn((char *)(param_1 + iVar7),"/")" (identifier "strcspn") (argument_list "((char *)(param_1 + iVar7),"/")" (( "(") (cast_expression "(char *)(param_1 + iVar7)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + iVar7)" (( "(") (binary_expression "param_1 + iVar7" (identifier "param_1") (+ "+") (identifier "iVar7")) () ")"))) (, ",") (string_literal ""/"" (" """) (string_content "/") (" """)) () ")")))) (; ";")) (expression_statement "iVar7 = iVar7 + sVar2;" (assignment_expression "iVar7 = iVar7 + sVar2" (identifier "iVar7") (= "=") (binary_expression "iVar7 + sVar2" (identifier "iVar7") (+ "+") (identifier "sVar2"))) (; ";")) (if_statement "if (iVar7 < 1) {\n      cVar1 = *(char *)(param_1 + iVar7);\n    }\n    else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" (if "if") (parenthesized_expression "(iVar7 < 1)" (( "(") (binary_expression "iVar7 < 1" (identifier "iVar7") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" ({ "{") (expression_statement "cVar1 = *(char *)(param_1 + iVar7);" (assignment_expression "cVar1 = *(char *)(param_1 + iVar7)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(param_1 + iVar7)" (* "*") (cast_expression "(char *)(param_1 + iVar7)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + iVar7)" (( "(") (binary_expression "param_1 + iVar7" (identifier "param_1") (+ "+") (identifier "iVar7")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" (else "else") (compound_statement "{\n      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);\n      iVar3 = mkdir(__path,param_2);\n      if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }\n      FUN_0001ed20(__path);\n      cVar1 = *(char *)(param_1 + iVar7);\n    }" ({ "{") (expression_statement "__path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);" (assignment_expression "__path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" (identifier "__path") (= "=") (cast_expression "(char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001de90(&DAT_0004fab3,iVar7,param_1)" (identifier "FUN_0001de90") (argument_list "(&DAT_0004fab3,iVar7,param_1)" (( "(") (pointer_expression "&DAT_0004fab3" (& "&") (identifier "DAT_0004fab3")) (, ",") (identifier "iVar7") (, ",") (identifier "param_1") () ")"))))) (; ";")) (expression_statement "iVar3 = mkdir(__path,param_2);" (assignment_expression "iVar3 = mkdir(__path,param_2)" (identifier "iVar3") (= "=") (call_expression "mkdir(__path,param_2)" (identifier "mkdir") (argument_list "(__path,param_2)" (( "(") (identifier "__path") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar3 < 0) {\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }" (if "if") (parenthesized_expression "(iVar3 < 0)" (( "(") (binary_expression "iVar3 < 0" (identifier "iVar3") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n        piVar4 = __errno_location();\n        if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }\n      }" ({ "{") (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" (identifier "piVar4") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar4 != 0x11) {\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }" (if "if") (parenthesized_expression "(*piVar4 != 0x11)" (( "(") (binary_expression "*piVar4 != 0x11" (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) (!= "!=") (number_literal "0x11")) () ")")) (compound_statement "{\n          pcVar5 = strerror(*piVar4);\n          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);\n          FUN_0001ed20(__path);\n          return uVar6;\n        }" ({ "{") (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" (identifier "pcVar5") (= "=") (call_expression "strerror(*piVar4)" (identifier "strerror") (argument_list "(*piVar4)" (( "(") (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) () ")")))) (; ";")) (expression_statement "uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);" (assignment_expression "uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5)" (identifier "uVar6") (= "=") (call_expression "FUN_0001de90("%s: mkdir: %s",__path,pcVar5)" (identifier "FUN_0001de90") (argument_list "("%s: mkdir: %s",__path,pcVar5)" (( "(") (string_literal ""%s: mkdir: %s"" (" """) (string_content "%s: mkdir: %s") (" """)) (, ",") (identifier "__path") (, ",") (identifier "pcVar5") () ")")))) (; ";")) (expression_statement "FUN_0001ed20(__path);" (call_expression "FUN_0001ed20(__path)" (identifier "FUN_0001ed20") (argument_list "(__path)" (( "(") (identifier "__path") () ")"))) (; ";")) (return_statement "return uVar6;" (return "return") (identifier "uVar6") (; ";")) (} "}"))) (} "}"))) (expression_statement "FUN_0001ed20(__path);" (call_expression "FUN_0001ed20(__path)" (identifier "FUN_0001ed20") (argument_list "(__path)" (( "(") (identifier "__path") () ")"))) (; ";")) (expression_statement "cVar1 = *(char *)(param_1 + iVar7);" (assignment_expression "cVar1 = *(char *)(param_1 + iVar7)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(param_1 + iVar7)" (* "*") (cast_expression "(char *)(param_1 + iVar7)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + iVar7)" (( "(") (binary_expression "param_1 + iVar7" (identifier "param_1") (+ "+") (identifier "iVar7")) () ")"))))) (; ";")) (} "}")))) (if_statement "if (cVar1 == '\0') break;" (if "if") (parenthesized_expression "(cVar1 == '\0')" (( "(") (binary_expression "cVar1 == '\0'" (identifier "cVar1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "sVar2 = strspn((char *)(param_1 + iVar7),"/");" (assignment_expression "sVar2 = strspn((char *)(param_1 + iVar7),"/")" (identifier "sVar2") (= "=") (call_expression "strspn((char *)(param_1 + iVar7),"/")" (identifier "strspn") (argument_list "((char *)(param_1 + iVar7),"/")" (( "(") (cast_expression "(char *)(param_1 + iVar7)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + iVar7)" (( "(") (binary_expression "param_1 + iVar7" (identifier "param_1") (+ "+") (identifier "iVar7")) () ")"))) (, ",") (string_literal ""/"" (" """) (string_content "/") (" """)) () ")")))) (; ";")) (expression_statement "iVar7 = iVar7 + sVar2;" (assignment_expression "iVar7 = iVar7 + sVar2" (identifier "iVar7") (= "=") (binary_expression "iVar7 + sVar2" (identifier "iVar7") (+ "+") (identifier "sVar2"))) (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

char * function_1(char *var_2,type_1 mode)

{
  char var_11;
  size_t var_4;
  char *__path;
  int var_7;
  int *piVar4;
  char *pcVar5;
  int var_3;
  
  var_3 = 0;
  while( true ) {
    var_4 = var_1(var_2 + var_3,"/");
    var_3 = var_3 + var_4;
    if (var_3 < 1) {
      var_11 = var_2[var_3];
    }
    else {
      __path = var_5("%.*s",var_3,var_2);
      var_7 = var_6(__path,mode);
      if (var_7 < 0) {
        piVar4 = var_8();
        if (*piVar4 != 0x11) {
          pcVar5 = var_9(*piVar4);
          pcVar5 = var_5("%s: mkdir: %s",__path,pcVar5);
          var_10(__path);
          return pcVar5;
        }
      }
      var_10(__path);
      var_11 = var_2[var_3];
    }
    if (var_11 == '\0') break;
    var_4 = var_12(var_2 + var_3,"/");
    var_3 = var_3 + var_4;
  }
  return (char *)0x0;
}


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

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

undefined4 MASKED(int param_1,__mode_t param_2)

{
  char cVar1;
  size_t sVar2;
  char *__path;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  undefined4 uVar6;
  int iVar7;
  
  iVar7 = 0;
  while( true ) {
    sVar2 = strcspn((char *)(param_1 + iVar7),"/");
    iVar7 = iVar7 + sVar2;
    if (iVar7 < 1) {
      cVar1 = *(char *)(param_1 + iVar7);
    }
    else {
      __path = (char *)FUN_0001de90(&DAT_0004fab3,iVar7,param_1);
      iVar3 = mkdir(__path,param_2);
      if (iVar3 < 0) {
        piVar4 = __errno_location();
        if (*piVar4 != 0x11) {
          pcVar5 = strerror(*piVar4);
          uVar6 = FUN_0001de90("%s: mkdir: %s",__path,pcVar5);
          FUN_0001ed20(__path);
          return uVar6;
        }
      }
      FUN_0001ed20(__path);
      cVar1 = *(char *)(param_1 + iVar7);
    }
    if (cVar1 == '\0') break;
    sVar2 = strspn((char *)(param_1 + iVar7),"/");
    iVar7 = iVar7 + sVar2;
  }
  return 0;
}

