#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 EXIT_SUCCESS;
int /*<<< orphan*/ begin_game(char const **);
int main() {
  const char *gameCommands[] = {"left up",    "left down", "right up",
                                "right down", "up left",   "up right",
                                "down left",  "down right"};
  begin_game(gameCommands);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2c96(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <begin_game@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2cad(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c91(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <begin_game@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"left up\00"
@.str.1 = [10 x i8] c"left down\00"
@.str.2 = [9 x i8] c"right up\00"
@.str.3 = [11 x i8] c"right down\00"
@.str.4 = [8 x i8] c"up left\00"
@.str.5 = [9 x i8] c"up right\00"
@.str.6 = [10 x i8] c"down left\00"
@.str.7 = [11 x i8] c"down right\00"
@__const.main.gameCommands = [8 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i32 0, i32 0)]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8*]
store i32 0, i32* %1
%3 = bitcast [8 x i8*]* %2 to i8*
%4 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 0
%5 = call i32 @begin_game(i8** %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"left up\00"
@.str.1 = [10 x i8] c"left down\00"
@.str.2 = [9 x i8] c"right up\00"
@.str.3 = [11 x i8] c"right down\00"
@.str.4 = [8 x i8] c"up left\00"
@.str.5 = [9 x i8] c"up right\00"
@.str.6 = [10 x i8] c"down left\00"
@.str.7 = [11 x i8] c"down right\00"
@__const.main.gameCommands = [8 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i32 0, i32 0)]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [8 x i8*]
%2 = bitcast [8 x i8*]* %1 to i8*
%3 = getelementptr inbounds [8 x i8*], [8 x i8*]* %1, i64 0, i64 0
%4 = call i32 @begin_game(i8** %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}