#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*/ SaveUserLevelInfo();
int /*<<< orphan*/ createDirectory(int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ fileExists(int /*<<< orphan*/);
int /*<<< orphan*/ getUserGameDataDir();
int /*<<< orphan*/ getUserLevelDir(char *);
void InitUserLevelDirectory(char *level_subdir) {
  if (!fileExists(getUserLevelDir(level_subdir))) {
    createDirectory(getUserGameDataDir(), "user data", 0);
    createDirectory(getUserLevelDir(NULL), "main user level", 0);
    createDirectory(getUserLevelDir(level_subdir), "user level", 0);
    SaveUserLevelInfo();
  }
}


x86 assembly (clang, -O0):
<InitUserLevelDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <getUserLevelDir@plt>
mov    %eax,%edi
call   1030 <fileExists@plt>
cmp    $0x0,%eax
jne    11c5 <InitUserLevelDirectory+0x75>
mov    $0x0,%al
call   1050 <getUserGameDataDir@plt>
mov    %eax,%edi
lea    0xe7b(%rip),%rsi
xor    %edx,%edx
call   1040 <createDirectory@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <getUserLevelDir@plt>
mov    %eax,%edi
lea    0xe6c(%rip),%rsi
xor    %edx,%edx
call   1040 <createDirectory@plt>
mov    -0x8(%rbp),%rdi
call   1070 <getUserLevelDir@plt>
mov    %eax,%edi
lea    0xe58(%rip),%rsi
xor    %edx,%edx
call   1040 <createDirectory@plt>
mov    $0x0,%al
call   1060 <SaveUserLevelInfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitUserLevelDirectory>:
push   %rbx
mov    %rdi,%rbx
call   1070 <getUserLevelDir@plt>
mov    %eax,%edi
call   1030 <fileExists@plt>
test   %eax,%eax
je     1166 <InitUserLevelDirectory+0x16>
pop    %rbx
ret
xor    %eax,%eax
call   1050 <getUserGameDataDir@plt>
lea    0xe8c(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1040 <createDirectory@plt>
xor    %edi,%edi
call   1070 <getUserLevelDir@plt>
lea    0xe7f(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1040 <createDirectory@plt>
mov    %rbx,%rdi
call   1070 <getUserLevelDir@plt>
lea    0xe6c(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1040 <createDirectory@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <SaveUserLevelInfo@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"user data\00"
@.str.1 = [16 x i8] c"main user level\00"
@.str.2 = [11 x i8] c"user level\00"
define void @InitUserLevelDirectory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @getUserLevelDir(i8* %3)
%5 = call i32 @fileExists(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1
%8 = call i32 (...) @getUserGameDataDir()
%9 = call i32 @createDirectory(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%10 = call i32 @getUserLevelDir(i8* null)
%11 = call i32 @createDirectory(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0)
%12 = load i8*, i8** %2
%13 = call i32 @getUserLevelDir(i8* %12)
%14 = call i32 @createDirectory(i32 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0)
%15 = call i32 (...) @SaveUserLevelInfo()
br label %16
16: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"user data\00"
@.str.1 = [16 x i8] c"main user level\00"
@.str.2 = [11 x i8] c"user level\00"
define void @InitUserLevelDirectory(i8* %0) {
%2 = tail call i32 @getUserLevelDir(i8* %0)
%3 = tail call i32 @fileExists(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = tail call i32 (...) @getUserGameDataDir()
%7 = tail call i32 @createDirectory(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%8 = tail call i32 @getUserLevelDir(i8* null)
%9 = tail call i32 @createDirectory(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0)
%10 = tail call i32 @getUserLevelDir(i8* %0)
%11 = tail call i32 @createDirectory(i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0)
%12 = tail call i32 (...) @SaveUserLevelInfo()
br label %13
13: ; preds = %5, %1
ret void
}