#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*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int create_head(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ get_dir(char *, char *);
int /*<<< orphan*/ stderr;
int main(int ac, char **av) {
  int fd;
  if (ac <= 1) {
    fprintf(stderr, "hmake header_path\n");
    return (-1);
  }
  if (access(av[1], F_OK) < 0) {
    fprintf(stderr, "%s don't exist.\n", av[1]);
    fprintf(stderr, "Creating %s\n", av[1]);
    fd = create_head(av[1]);
  }
  close(fd);
  get_dir(".", av[1]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1193 <main+0x43>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1224 <main+0xd4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e2e(%rip),%rax
mov    (%rax),%esi
call   1070 <access@plt>
cmp    $0x0,%rax
jge    1201 <main+0xb1>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe48(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <create_head@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe19(%rip),%rdi
call   1040 <get_dir@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     1177 <main+0x27>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebp
jmp    11df <main+0x8f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
call   1070 <access@plt>
mov    0x2e4d(%rip),%r14
mov    (%r14),%edi
mov    0x8(%rbx),%rdx
lea    0xe72(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r14),%edi
mov    0x8(%rbx),%rdx
lea    0xe6c(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x8(%rbx),%rdi
call   1030 <create_head@plt>
mov    %eax,%edi
call   1050 <close@plt>
mov    0x8(%rbx),%rsi
lea    0xe57(%rip),%rdi
call   1040 <get_dir@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"hmake header_path\0A\00"
@F_OK = global i32 0
@.str.1 = [17 x i8] c"%s don't exist.\0A\00"
@.str.2 = [13 x i8] c"Creating %s\0A\00"
@.str.3 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %41
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i32, i32* @F_OK
%17 = call i64 @access(i8* %15, i32 %16)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %34
19: ; preds = %12
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @create_head(i8* %32)
store i32 %33, i32* %6
br label %34
34: ; preds = %19, %12
%35 = load i32, i32* %6
%36 = call i32 @close(i32 %35)
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @get_dir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %39)
store i32 0, i32* %3
br label %41
41: ; preds = %34, %9
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"hmake header_path\0A\00"
@F_OK = global i32 0
@.str.1 = [17 x i8] c"%s don't exist.\0A\00"
@.str.2 = [13 x i8] c"Creating %s\0A\00"
@.str.3 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %24
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = load i32, i32* @F_OK
%11 = tail call i64 @access(i8* %9, i32 %10)
%12 = icmp slt i64 %11, 0
tail call void @llvm.assume(i1 %12)
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %8
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %8
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = load i8*, i8** %8
%20 = tail call i32 @create_head(i8* %19)
%21 = tail call i32 @close(i32 %20)
%22 = load i8*, i8** %8
%23 = tail call i32 @get_dir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %7, %4
%25 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %25
}