#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*/ generateFood(int *, int, int, int **, int);
int getGameSpeed();
int /*<<< orphan*/ loadEnviroment(int, int);
int /*<<< orphan*/ loadSnake(int **, int);
int /*<<< orphan*/ prepairSnakeArray(int **, int);
int /*<<< orphan*/ refreshInfoBar(int, int);
int /*<<< orphan*/ startGame(int **, int *, int, int, int, int, int, int);
void loadGame(void) {
  int snakeXY[2][310];
  int snakeLength = 4;
  int direction = (char)'D';
  int foodXY[] = {5, 5};
  int score = 0;
  int consoleWidth = 80;
  int consoleHeight = 25;
  int speed = getGameSpeed();
  snakeXY[0][0] = 40;
  snakeXY[1][0] = 10;
  loadEnviroment(consoleWidth, consoleHeight);
  prepairSnakeArray(snakeXY, snakeLength);
  loadSnake(snakeXY, snakeLength);
  generateFood(foodXY, consoleWidth, consoleHeight, snakeXY, snakeLength);
  refreshInfoBar(score, speed);
  startGame(snakeXY, foodXY, consoleWidth, consoleHeight, snakeLength,
            direction, score, speed);
  return;
}


x86 assembly (clang, -O0):
<loadGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9e0,%rsp
movl   $0x4,-0x9b4(%rbp)
movl   $0x44,-0x9b8(%rbp)
mov    0xe6a(%rip),%rax
mov    %rax,-0x9c0(%rbp)
movl   $0x0,-0x9c4(%rbp)
movl   $0x50,-0x9c8(%rbp)
movl   $0x19,-0x9cc(%rbp)
mov    $0x0,%al
call   1060 <getGameSpeed@plt>
mov    %eax,-0x9d0(%rbp)
movl   $0x28,-0x9b0(%rbp)
movl   $0xa,-0x4d8(%rbp)
mov    -0x9c8(%rbp),%edi
mov    -0x9cc(%rbp),%esi
call   1070 <loadEnviroment@plt>
lea    -0x9b0(%rbp),%rdi
mov    -0x9b4(%rbp),%esi
call   1080 <prepairSnakeArray@plt>
lea    -0x9b0(%rbp),%rdi
mov    -0x9b4(%rbp),%esi
call   1030 <loadSnake@plt>
lea    -0x9c0(%rbp),%rdi
mov    -0x9c8(%rbp),%esi
mov    -0x9cc(%rbp),%edx
lea    -0x9b0(%rbp),%rcx
mov    -0x9b4(%rbp),%r8d
call   1050 <generateFood@plt>
mov    -0x9c4(%rbp),%edi
mov    -0x9d0(%rbp),%esi
call   1090 <refreshInfoBar@plt>
lea    -0x9b0(%rbp),%rdi
lea    -0x9c0(%rbp),%rsi
mov    -0x9c8(%rbp),%edx
mov    -0x9cc(%rbp),%ecx
mov    -0x9b4(%rbp),%r8d
mov    -0x9b8(%rbp),%r9d
mov    -0x9c4(%rbp),%r10d
mov    -0x9d0(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <startGame@plt>
add    $0x9e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadGame>:
push   %r15
push   %r14
push   %rbx
sub    $0x9c0,%rsp
movabs $0x500000005,%rax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1060 <getGameSpeed@plt>
mov    %eax,%r14d
movl   $0x28,0x10(%rsp)
movl   $0xa,0x4e8(%rsp)
mov    $0x50,%edi
mov    $0x19,%esi
call   1070 <loadEnviroment@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1080 <prepairSnakeArray@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <loadSnake@plt>
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    $0x50,%esi
mov    $0x19,%edx
mov    %rbx,%rcx
mov    $0x4,%r8d
call   1050 <generateFood@plt>
xor    %edi,%edi
mov    %r14d,%esi
call   1090 <refreshInfoBar@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x50,%edx
mov    $0x19,%ecx
mov    $0x4,%r8d
mov    $0x44,%r9d
push   %r14
push   $0x0
call   1040 <startGame@plt>
add    $0x9d0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.loadGame.foodXY = [2 x i32] [i32 5, i32 5]
define void @loadGame() {
%1 = alloca [2 x [310 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 4, i32* %2
store i32 68, i32* %3
%9 = bitcast [2 x i32]* %4 to i8*
store i32 0, i32* %5
store i32 80, i32* %6
store i32 25, i32* %7
%10 = call i32 (...) @getGameSpeed()
store i32 %10, i32* %8
%11 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 0
%12 = getelementptr inbounds [310 x i32], [310 x i32]* %11, i64 0, i64 0
store i32 40, i32* %12
%13 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 1
%14 = getelementptr inbounds [310 x i32], [310 x i32]* %13, i64 0, i64 0
store i32 10, i32* %14
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = call i32 @loadEnviroment(i32 %15, i32 %16)
%18 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 0
%19 = bitcast [310 x i32]* %18 to i32**
%20 = load i32, i32* %2
%21 = call i32 @prepairSnakeArray(i32** %19, i32 %20)
%22 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 0
%23 = bitcast [310 x i32]* %22 to i32**
%24 = load i32, i32* %2
%25 = call i32 @loadSnake(i32** %23, i32 %24)
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 0
%30 = bitcast [310 x i32]* %29 to i32**
%31 = load i32, i32* %2
%32 = call i32 @generateFood(i32* %26, i32 %27, i32 %28, i32** %30, i32 %31)
%33 = load i32, i32* %5
%34 = load i32, i32* %8
%35 = call i32 @refreshInfoBar(i32 %33, i32 %34)
%36 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 0
%37 = bitcast [310 x i32]* %36 to i32**
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = load i32, i32* %5
%44 = load i32, i32* %8
%45 = call i32 @startGame(i32** %37, i32* %38, i32 %39, i32 %40, i32 %41, i32 %42, i32 %43, i32 %44)
ret void
}

LLVM IR (-O2):
define void @loadGame() {
%1 = alloca [2 x [310 x i32]]
%2 = alloca i64
%3 = bitcast [2 x [310 x i32]]* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 21474836485, i64* %2
%5 = tail call i32 (...) @getGameSpeed()
%6 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 0, i64 0
store i32 40, i32* %6
%7 = getelementptr inbounds [2 x [310 x i32]], [2 x [310 x i32]]* %1, i64 0, i64 1, i64 0
store i32 10, i32* %7
%8 = tail call i32 @loadEnviroment(i32 80, i32 25)
%9 = bitcast [2 x [310 x i32]]* %1 to i32**
%10 = call i32 @prepairSnakeArray(i32** %9, i32 4)
%11 = call i32 @loadSnake(i32** %9, i32 4)
%12 = bitcast i64* %2 to i32*
%13 = call i32 @generateFood(i32* %12, i32 80, i32 25, i32** %9, i32 4)
%14 = call i32 @refreshInfoBar(i32 0, i32 %5)
%15 = call i32 @startGame(i32** %9, i32* %12, i32 80, i32 25, i32 4, i32 68, i32 0, i32 %5)
ret void
}