#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 atoi(char *);
int /*<<< orphan*/ bench_file_depth(char *, int);
int /*<<< orphan*/ destroy_all();
int /*<<< orphan*/ engine_shell();
int /*<<< orphan*/ init_all(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int thread_count = 1;
  if (argc >= 2) {
    thread_count = atoi(argv[1]);
  }
  init_all(thread_count);
  if (argc == 4) {
    bench_file_depth(argv[2], atoi(argv[3]));
  } else {
    engine_shell();
  }
  destroy_all();
  printf("%s", "\n\"Well, you've shown me something today . . . You've shown "
               "me that I'm still a threat. \n\t- Dalinar Kholin\n");
  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)
movl   $0x1,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1197 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <init_all@plt>
cmpl   $0x4,-0x8(%rbp)
jne    11d2 <main+0x72>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <bench_file_depth@plt>
jmp    11d9 <main+0x79>
mov    $0x0,%al
call   1050 <engine_shell@plt>
mov    $0x0,%al
call   1070 <destroy_all@plt>
lea    0xe19(%rip),%rdi
lea    0xe15(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jle    119b <main+0x3b>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1080 <atoi@plt>
mov    %eax,%edi
call   1060 <init_all@plt>
cmp    $0x4,%ebp
jne    11a5 <main+0x45>
mov    0x10(%rbx),%rbp
mov    0x18(%rbx),%rdi
call   1080 <atoi@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1040 <bench_file_depth@plt>
jmp    11ac <main+0x4c>
mov    $0x1,%edi
call   1060 <init_all@plt>
xor    %eax,%eax
call   1050 <engine_shell@plt>
xor    %eax,%eax
call   1070 <destroy_all@plt>
lea    0xe46(%rip),%rdi
lea    0xe42(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [107 x i8] c"\0A\22Well, you've shown me something today . . . You've shown me that I'm still a threat. \0A\09- Dalinar Kholin\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 1, i32* %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
%16 = call i32 @init_all(i32 %15)
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 4
br i1 %18, label %19, label %28
19: ; preds = %14
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = call i32 @bench_file_depth(i8* %22, i32 %26)
br label %30
28: ; preds = %14
%29 = call i32 (...) @engine_shell()
br label %30
30: ; preds = %28, %19
%31 = call i32 (...) @destroy_all()
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [107 x i8] c"\0A\22Well, you've shown me something today . . . You've shown me that I'm still a threat. \0A\09- Dalinar Kholin\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @init_all(i32 1)
br label %19
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @init_all(i32 %9)
%11 = icmp eq i32 %0, 4
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = tail call i32 @bench_file_depth(i8* %14, i32 %17)
br label %21
19: ; preds = %4, %6
%20 = tail call i32 (...) @engine_shell()
br label %21
21: ; preds = %19, %12
%22 = tail call i32 (...) @destroy_all()
%23 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}