#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 S_IROTH;
int S_IRWXG;
int S_IRWXU;
int S_IXOTH;
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ omb_utils_dir_exists(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void omb_utils_create_dir_tree() {
  char tmp[255];
  if (!omb_utils_dir_exists("/omb"))
    mkdir("/omb", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
  sprintf(tmp, "%s/.kernels", "/omb");
  if (!omb_utils_dir_exists(tmp))
    mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}


x86 assembly (clang, -O0):
<omb_utils_create_dir_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1050 <omb_utils_dir_exists@plt>
cmp    $0x0,%eax
jne    1180 <omb_utils_create_dir_tree+0x50>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2e78(%rip),%rax
or     (%rax),%esi
mov    0x2e5f(%rip),%rax
or     (%rax),%esi
mov    0x2e6e(%rip),%rax
or     (%rax),%esi
lea    0xe85(%rip),%rdi
call   1030 <mkdir@plt>
lea    -0x100(%rbp),%rdi
lea    0xe77(%rip),%rsi
lea    0xe6b(%rip),%rdx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1050 <omb_utils_dir_exists@plt>
cmp    $0x0,%eax
jne    11df <omb_utils_create_dir_tree+0xaf>
lea    -0x100(%rbp),%rdi
mov    0x2e2b(%rip),%rax
mov    (%rax),%esi
mov    0x2e12(%rip),%rax
or     (%rax),%esi
mov    0x2df9(%rip),%rax
or     (%rax),%esi
mov    0x2e08(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omb_utils_create_dir_tree>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
call   1050 <omb_utils_dir_exists@plt>
test   %eax,%eax
jne    1178 <omb_utils_create_dir_tree+0x48>
mov    0x2e99(%rip),%rax
mov    0x2e82(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e67(%rip),%rax
or     (%rax),%esi
mov    0x2e76(%rip),%rax
or     (%rax),%esi
lea    0xe8d(%rip),%rdi
call   1030 <mkdir@plt>
lea    0xe86(%rip),%rsi
lea    0xe7a(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <omb_utils_dir_exists@plt>
test   %eax,%eax
jne    11c9 <omb_utils_create_dir_tree+0x99>
mov    0x2e44(%rip),%rax
mov    0x2e2d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e12(%rip),%rax
or     (%rax),%esi
mov    0x2e21(%rip),%rax
or     (%rax),%esi
mov    %rsp,%rdi
call   1030 <mkdir@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/omb\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@.str.1 = [12 x i8] c"%s/.kernels\00"
define void @omb_utils_create_dir_tree() {
%1 = alloca [255 x i8]
%2 = call i32 @omb_utils_dir_exists(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %0
%5 = load i32, i32* @S_IRWXU
%6 = load i32, i32* @S_IRWXG
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IROTH
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IXOTH
%11 = or i32 %9, %10
%12 = call i32 @mkdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %4, %0
%14 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%17 = call i32 @omb_utils_dir_exists(i8* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %13
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%21 = load i32, i32* @S_IRWXU
%22 = load i32, i32* @S_IRWXG
%23 = or i32 %21, %22
%24 = load i32, i32* @S_IROTH
%25 = or i32 %23, %24
%26 = load i32, i32* @S_IXOTH
%27 = or i32 %25, %26
%28 = call i32 @mkdir(i8* %20, i32 %27)
br label %29
29: ; preds = %19, %13
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"/omb\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@.str.1 = [12 x i8] c"%s/.kernels\00"
define void @omb_utils_create_dir_tree() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @omb_utils_dir_exists(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %0
%6 = load i32, i32* @S_IRWXU
%7 = load i32, i32* @S_IRWXG
%8 = or i32 %7, %6
%9 = load i32, i32* @S_IROTH
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IXOTH
%12 = or i32 %10, %11
%13 = tail call i32 @mkdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %5, %0
%15 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @omb_utils_dir_exists(i8* %2)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load i32, i32* @S_IRWXU
%20 = load i32, i32* @S_IRWXG
%21 = or i32 %20, %19
%22 = load i32, i32* @S_IROTH
%23 = or i32 %21, %22
%24 = load i32, i32* @S_IXOTH
%25 = or i32 %23, %24
%26 = call i32 @mkdir(i8* %2, i32 %25)
br label %27
27: ; preds = %18, %14
ret void
}