#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Q_mkdir(char *);
void CreatePath(char *path) {
  char *ofs, c;
  if (path[1] == ':')
    path += 2;
  for (ofs = path + 1; *ofs; ofs++) {
    c = *ofs;
    if (c == '/' || c == '\\') {
      *ofs = 0;
      Q_mkdir(path);
      *ofs = c;
    }
  }
}


x86 assembly (clang, -O0):
<CreatePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
jne    1139 <CreatePath+0x29>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a4 <CreatePath+0x94>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x2f,%eax
je     1175 <CreatePath+0x65>
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
jne    118e <CreatePath+0x7e>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <Q_mkdir@plt>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1193 <CreatePath+0x83>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1145 <CreatePath+0x35>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreatePath>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
cmpb   $0x3a,0x1(%rdi)
sete   %al
lea    (%rdi,%rax,2),%r14
lea    (%rdi,%rax,2),%r15
add    $0x1,%r15
jmp    1143 <CreatePath+0x33>
nopl   0x0(%rax)
movb   $0x0,(%r15)
mov    %r14,%rdi
call   1030 <Q_mkdir@plt>
mov    %bl,(%r15)
add    $0x1,%r15
movzbl (%r15),%ebx
cmp    $0x2f,%bl
je     1130 <CreatePath+0x20>
cmp    $0x5c,%bl
je     1130 <CreatePath+0x20>
test   %bl,%bl
je     115b <CreatePath+0x4b>
add    $0x1,%r15
jmp    1143 <CreatePath+0x33>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @CreatePath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 58
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %1
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %3
br label %16
16: ; preds = %37, %13
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %40
20: ; preds = %16
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
store i8 %22, i8* %4
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 47
br i1 %25, label %30, label %26
26: ; preds = %20
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 92
br i1 %29, label %30, label %36
30: ; preds = %26, %20
%31 = load i8*, i8** %3
store i8 0, i8* %31
%32 = load i8*, i8** %2
%33 = call i32 @Q_mkdir(i8* %32)
%34 = load i8, i8* %4
%35 = load i8*, i8** %3
store i8 %34, i8* %35
br label %36
36: ; preds = %30, %26
br label %37
37: ; preds = %36
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %3
br label %16
40: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @CreatePath(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 58
%5 = select i1 %4, i64 2, i64 0
%6 = getelementptr i8, i8* %0, i64 %5
br label %7
7: ; preds = %11, %1
%8 = phi i8* [ %6, %1 ], [ %9, %11 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
switch i8 %10, label %11 [
i8 0, label %14
i8 92, label %12
i8 47, label %12
]
11: ; preds = %7, %12
br label %7
12: ; preds = %7, %7
store i8 0, i8* %9
%13 = tail call i32 @Q_mkdir(i8* %6)
store i8 %10, i8* %9
br label %11
14: ; preds = %7
ret void
}