#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 */
scalar_t__ chaz_DirManip_compile_posix_mkdir(char *);
scalar_t__ chaz_DirManip_compile_win_mkdir();
scalar_t__ chaz_HeadCheck_check_header(char *);
void chaz_DirManip_try_mkdir(void) {
  if (chaz_HeadCheck_check_header("windows.h")) {
    if (chaz_DirManip_compile_win_mkdir()) {
      return;
    }
    if (chaz_DirManip_compile_posix_mkdir("direct.h")) {
      return;
    }
  }
  if (chaz_DirManip_compile_posix_mkdir("sys/stat.h")) {
    return;
  }
}


x86 assembly (clang, -O0):
<chaz_DirManip_try_mkdir>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <chaz_HeadCheck_check_header@plt>
cmp    $0x0,%rax
je     1180 <chaz_DirManip_try_mkdir+0x50>
mov    $0x0,%al
call   1040 <chaz_DirManip_compile_win_mkdir@plt>
cmp    $0x0,%rax
je     1160 <chaz_DirManip_try_mkdir+0x30>
jmp    119b <chaz_DirManip_try_mkdir+0x6b>
lea    0xea3(%rip),%rdi
call   1030 <chaz_DirManip_compile_posix_mkdir@plt>
cmp    $0x0,%rax
je     117b <chaz_DirManip_try_mkdir+0x4b>
jmp    119b <chaz_DirManip_try_mkdir+0x6b>
jmp    1180 <chaz_DirManip_try_mkdir+0x50>
lea    0xe8c(%rip),%rdi
call   1030 <chaz_DirManip_compile_posix_mkdir@plt>
cmp    $0x0,%rax
je     119b <chaz_DirManip_try_mkdir+0x6b>
jmp    119b <chaz_DirManip_try_mkdir+0x6b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_DirManip_try_mkdir>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <chaz_HeadCheck_check_header@plt>
test   %rax,%rax
je     1161 <chaz_DirManip_try_mkdir+0x31>
xor    %eax,%eax
call   1040 <chaz_DirManip_compile_win_mkdir@plt>
test   %rax,%rax
jne    115f <chaz_DirManip_try_mkdir+0x2f>
lea    0xeb5(%rip),%rdi
call   1030 <chaz_DirManip_compile_posix_mkdir@plt>
test   %rax,%rax
je     1161 <chaz_DirManip_try_mkdir+0x31>
pop    %rax
ret
lea    0xeab(%rip),%rdi
pop    %rax
jmp    1030 <chaz_DirManip_compile_posix_mkdir@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"windows.h\00"
@.str.1 = [9 x i8] c"direct.h\00"
@.str.2 = [11 x i8] c"sys/stat.h\00"
define void @chaz_DirManip_try_mkdir() {
%1 = call i64 @chaz_HeadCheck_check_header(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = call i64 (...) @chaz_DirManip_compile_win_mkdir()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %16
7: ; preds = %3
%8 = call i64 @chaz_DirManip_compile_posix_mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %16
11: ; preds = %7
br label %12
12: ; preds = %11, %0
%13 = call i64 @chaz_DirManip_compile_posix_mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %16
16: ; preds = %6, %10, %15, %12
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"windows.h\00"
@.str.1 = [9 x i8] c"direct.h\00"
@.str.2 = [11 x i8] c"sys/stat.h\00"
define void @chaz_DirManip_try_mkdir() {
%1 = tail call i64 @chaz_HeadCheck_check_header(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i64 (...) @chaz_DirManip_compile_win_mkdir()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i64 @chaz_DirManip_compile_posix_mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %0
%10 = tail call i64 @chaz_DirManip_compile_posix_mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6, %3
ret void
}