#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*/ printf(char *);
int runRepl();
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int mode = 3;
  if (argc == 1) {
    mode = 0;
  } else if (argc == 2 && strcmp(argv[1], "repl") == 0) {
    mode = 0;
  } else if (argc == 2 && strcmp(argv[1], "help") == 0) {
    mode = 2;
  }
  if (mode == 0) {
    return runRepl();
  } else if (mode == 2) {
    printf("Look I haven't made another mode yet so just freakin run "
           "\"clocjure repl\"!\n");
    return 0;
  } else {
    printf("Invalid arguments. Run \"clocure help\" for a help menu.\n");
    return 1;
  }
}


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)
movl   $0x3,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1163 <main+0x33>
movl   $0x0,-0x14(%rbp)
jmp    11d0 <main+0xa0>
cmpl   $0x2,-0x8(%rbp)
jne    1197 <main+0x67>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe84(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1197 <main+0x67>
movl   $0x0,-0x14(%rbp)
jmp    11cb <main+0x9b>
cmpl   $0x2,-0x8(%rbp)
jne    11c6 <main+0x96>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe55(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c6 <main+0x96>
movl   $0x2,-0x14(%rbp)
jmp    11cb <main+0x9b>
jmp    11d0 <main+0xa0>
cmpl   $0x0,-0x14(%rbp)
jne    11e9 <main+0xb9>
mov    $0x0,%al
call   1050 <runRepl@plt>
mov    %eax,-0x4(%rbp)
jmp    121e <main+0xee>
cmpl   $0x2,-0x14(%rbp)
jne    120b <main+0xdb>
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    121e <main+0xee>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
je     117b <main+0x4b>
cmp    $0x2,%edi
jne    1168 <main+0x38>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     117b <main+0x4b>
mov    0x8(%rbx),%rdi
lea    0xea7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1183 <main+0x53>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1050 <runRepl@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"repl\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [75 x i8] c"Look I haven't made another mode yet so just freakin run \22clocjure repl\22!\0A\00"
@.str.3 = [56 x i8] c"Invalid arguments. Run \22clocure help\22 for a help menu.\0A\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
store i32 3, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %6
br label %32
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 0, i32* %6
br label %31
20: ; preds = %13, %10
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 2, i32* %6
br label %30
30: ; preds = %29, %23, %20
br label %31
31: ; preds = %30, %19
br label %32
32: ; preds = %31, %9
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (...) @runRepl()
store i32 %36, i32* %3
br label %44
37: ; preds = %32
%38 = load i32, i32* %6
%39 = icmp eq i32 %38, 2
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %44
42: ; preds = %37
%43 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %44
44: ; preds = %42, %40, %35
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
@.str = [5 x i8] c"repl\00"
@.str.1 = [5 x i8] c"help\00"
@str = [55 x i8] c"Invalid arguments. Run \22clocure help\22 for a help menu.\00"
@str.4 = [74 x i8] c"Look I haven't made another mode yet so just freakin run \22clocjure repl\22!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %16 [
i32 1, label %8
i32 2, label %3
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2, %3
%9 = tail call i32 (...) @runRepl()
br label %18
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.4, i64 0, i64 0))
br label %18
16: ; preds = %2, %10
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %8
%19 = phi i32 [ %9, %8 ], [ 0, %14 ], [ 1, %16 ]
ret i32 %19
}