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


x86 assembly (clang, -O0):
<InitTapeDirectory>:
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 <getTapeDir@plt>
mov    %eax,%edi
lea    0xea5(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
mov    -0x8(%rbp),%rdi
call   1050 <getTapeDir@plt>
mov    %eax,%edi
lea    0xe96(%rip),%rsi
xor    %edx,%edx
call   1030 <createDirectory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitTapeDirectory>:
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 <getTapeDir@plt>
lea    0xeb1(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <createDirectory@plt>
mov    %rbx,%rdi
call   1050 <getTapeDir@plt>
lea    0xea3(%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 = [10 x i8] c"main tape\00"
@.str.2 = [11 x i8] c"level tape\00"
define void @InitTapeDirectory(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 @getTapeDir(i8* null)
%6 = call i32 @createDirectory(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%7 = load i8*, i8** %2
%8 = call i32 @getTapeDir(i8* %7)
%9 = call i32 @createDirectory(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 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 = [10 x i8] c"main tape\00"
@.str.2 = [11 x i8] c"level tape\00"
define void @InitTapeDirectory(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 @getTapeDir(i8* null)
%5 = tail call i32 @createDirectory(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = tail call i32 @getTapeDir(i8* %0)
%7 = tail call i32 @createDirectory(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}