#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*/ createDirectory(int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ getLevelSetupDir(char *);
int /*<<< orphan*/ getUserGameDataDir();
void InitLevelSetupDirectory(char *level_subdir) {
  createDirectory(getUserGameDataDir(), "user data", 0);
  createDirectory(getLevelSetupDir(NULL), "main level setup", 0);
  createDirectory(getLevelSetupDir(level_subdir), "level setup", 0);
}


x86 assembly (clang, -O0):
<InitLevelSetupDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getUserGameDataDir@plt>
mov    %eax,%edi
lea    0xeb4(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <getLevelSetupDir@plt>
mov    %eax,%edi
lea    0xea5(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
mov    -0x8(%rbp),%rdi
call   1050 <getLevelSetupDir@plt>
mov    %eax,%edi
lea    0xe91(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitLevelSetupDirectory>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getUserGameDataDir@plt>
lea    0xebe(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <createDirectory@plt>
xor    %edi,%edi
call   1050 <getLevelSetupDir@plt>
lea    0xeb1(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <createDirectory@plt>
mov    %rbx,%rdi
call   1050 <getLevelSetupDir@plt>
lea    0xe9e(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
pop    %rbx
jmp    1030 <createDirectory@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"user data\00"
@.str.1 = [17 x i8] c"main level setup\00"
@.str.2 = [12 x i8] c"level setup\00"
define void @InitLevelSetupDirectory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getUserGameDataDir()
%4 = call i32 @createDirectory(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = call i32 @getLevelSetupDir(i8* null)
%6 = call i32 @createDirectory(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 0)
%7 = load i8*, i8** %2
%8 = call i32 @getLevelSetupDir(i8* %7)
%9 = call i32 @createDirectory(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"user data\00"
@.str.1 = [17 x i8] c"main level setup\00"
@.str.2 = [12 x i8] c"level setup\00"
define void @InitLevelSetupDirectory(i8* %0) {
%2 = tail call i32 (...) @getUserGameDataDir()
%3 = tail call i32 @createDirectory(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @getLevelSetupDir(i8* null)
%5 = tail call i32 @createDirectory(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = tail call i32 @getLevelSetupDir(i8* %0)
%7 = tail call i32 @createDirectory(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}