#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*/ cleanup_evaluator();
scalar_t__ evaluate();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_banner();
int /*<<< orphan*/ seed_random();
int /*<<< orphan*/ stderr;
int main(void) {
  print_banner();
  seed_random();
  fprintf(stderr, "> ");
  while (evaluate() >= 0) {
    fprintf(stderr, "> ");
  }
  fprintf(stderr, "\n");
  cleanup_evaluator();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <print_banner@plt>
mov    $0x0,%al
call   1030 <seed_random@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1050 <evaluate@plt>
cmp    $0x0,%rax
jl     11ad <main+0x5d>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1182 <main+0x32>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xe46(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1060 <cleanup_evaluator@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <print_banner@plt>
xor    %eax,%eax
call   1030 <seed_random@plt>
mov    0x2e77(%rip),%r14
mov    (%r14),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1050 <evaluate@plt>
test   %rax,%rax
js     11a7 <main+0x57>
lea    0xe75(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1050 <evaluate@plt>
test   %rax,%rax
jns    1190 <main+0x40>
mov    (%r14),%edi
lea    0xe52(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1060 <cleanup_evaluator@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"> \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_banner()
%3 = call i32 (...) @seed_random()
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %9, %0
%7 = call i64 (...) @evaluate()
%8 = icmp sge i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %6
12: ; preds = %6
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (...) @cleanup_evaluator()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"> \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @print_banner()
%2 = tail call i32 (...) @seed_random()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 (...) @evaluate()
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = tail call i64 (...) @evaluate()
%11 = icmp sgt i64 %10, -1
br i1 %11, label %7, label %12
12: ; preds = %7, %0
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 (...) @cleanup_evaluator()
ret i32 0
}