#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_SUCCESS;
int /*<<< orphan*/ close_controller();
int /*<<< orphan*/ close_screen();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initialize_screen();
int /*<<< orphan*/ open_controller();
int /*<<< orphan*/ play();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World, I'm game!\n");
  open_controller();
  initialize_screen();
  play();
  printf("Done playing \n");
  close_controller();
  close_screen();
  exit(EXIT_SUCCESS);
  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)
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <open_controller@plt>
mov    $0x0,%al
call   1030 <initialize_screen@plt>
mov    $0x0,%al
call   1070 <play@plt>
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <close_controller@plt>
mov    $0x0,%al
call   1060 <close_screen@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <open_controller@plt>
xor    %eax,%eax
call   1040 <initialize_screen@plt>
xor    %eax,%eax
call   1070 <play@plt>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <close_controller@plt>
xor    %eax,%eax
call   1060 <close_screen@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Hello World, I'm game!\0A\00"
@.str.1 = [15 x i8] c"Done playing \0A\00"
@EXIT_SUCCESS = global i32 0
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 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @open_controller()
%8 = call i32 (...) @initialize_screen()
%9 = call i32 (...) @play()
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @close_controller()
%12 = call i32 (...) @close_screen()
%13 = load i32, i32* @EXIT_SUCCESS
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [23 x i8] c"Hello World, I'm game!\00"
@str.2 = [14 x i8] c"Done playing \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @open_controller()
%5 = tail call i32 (...) @initialize_screen()
%6 = tail call i32 (...) @play()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%8 = tail call i32 (...) @close_controller()
%9 = tail call i32 (...) @close_screen()
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
}