#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ parse_args(int, char **);
int /*<<< orphan*/ print_help(char **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
scalar_t__ window_init(char *, int, int);
int /*<<< orphan*/ window_main_loop();
int /*<<< orphan*/ window_terminate();
int main(int argc, char *argv[]) {
  if (parse_args(argc, argv) < 0) {
    print_help(argv);
    exit(EXIT_FAILURE);
  }
  srand(time(NULL));
  if (window_init("gusgrav", 1024, 800) < 0) {
    printf("Error: could not create game manager!\n");
    exit(EXIT_FAILURE);
  }
  window_main_loop();
  window_terminate();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <parse_args@plt>
cmp    $0x0,%rax
jge    11d3 <main+0x43>
mov    -0x10(%rbp),%rdi
call   10a0 <print_help@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe16(%rip),%rdi
mov    $0x400,%esi
mov    $0x320,%edx
call   1090 <window_init@plt>
cmp    $0x0,%rax
jge    121d <main+0x8d>
lea    0xdfe(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    $0x0,%al
call   1030 <window_main_loop@plt>
mov    $0x0,%al
call   1050 <window_terminate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
call   1060 <parse_args@plt>
test   %rax,%rax
js     11d9 <main+0x49>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe4d(%rip),%rdi
mov    $0x400,%esi
mov    $0x320,%edx
call   1090 <window_init@plt>
test   %rax,%rax
js     11e3 <main+0x53>
xor    %eax,%eax
call   1030 <window_main_loop@plt>
xor    %eax,%eax
call   1050 <window_terminate@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   10a0 <print_help@plt>
jmp    11ef <main+0x5f>
lea    0xe1e(%rip),%rdi
call   1040 <puts@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [8 x i8] c"gusgrav\00"
@.str.1 = [39 x i8] c"Error: could not create game manager!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i64 @parse_args(i32 %6, i8** %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = call i32 @print_help(i8** %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = call i32 @time(i32* null)
%17 = call i32 @srand(i32 %16)
%18 = call i64 @window_init(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1024, i32 800)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %15
%25 = call i32 (...) @window_main_loop()
%26 = call i32 (...) @window_terminate()
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [8 x i8] c"gusgrav\00"
@str = [38 x i8] c"Error: could not create game manager!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @parse_args(i32 %0, i8** %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @print_help(i8** %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = tail call i32 @time(i32* null)
%11 = tail call i32 @srand(i32 %10)
%12 = tail call i64 @window_init(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1024, i32 800)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %9
%19 = tail call i32 (...) @window_main_loop()
%20 = tail call i32 (...) @window_terminate()
ret i32 0
}