#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*/ clrscr();
int /*<<< orphan*/ gotoxy(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ waitForAnyKey();
void controls(void) {
  int x = 10, y = 5;
  clrscr();
  gotoxy(x, y++);
  printf("Controls\n");
  gotoxy(x++, y++);
  printf("Use the following arrow keys to direct the snake to the food: ");
  gotoxy(x, y++);
  printf("Right Arrow");
  gotoxy(x, y++);
  printf("Left Arrow");
  gotoxy(x, y++);
  printf("Top Arrow");
  gotoxy(x, y++);
  printf("Bottom Arrow");
  gotoxy(x, y++);
  gotoxy(x, y++);
  printf("P & Esc pauses the game.");
  gotoxy(x, y++);
  gotoxy(x, y++);
  printf("Press any key to continue...");
  waitForAnyKey();
  return;
}


x86 assembly (clang, -O0):
<controls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clrscr@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe2b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1060 <gotoxy@plt>
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <waitForAnyKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<controls>:
push   %rax
xor    %eax,%eax
call   1030 <clrscr@plt>
mov    $0xa,%edi
mov    $0x5,%esi
call   1070 <gotoxy@plt>
lea    0xf35(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
mov    $0x6,%esi
call   1070 <gotoxy@plt>
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
mov    $0xb,%edi
mov    $0x7,%esi
call   1070 <gotoxy@plt>
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
mov    $0xb,%edi
mov    $0x8,%esi
call   1070 <gotoxy@plt>
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
mov    $0xb,%edi
mov    $0x9,%esi
call   1070 <gotoxy@plt>
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
mov    $0xb,%edi
mov    $0xa,%esi
call   1070 <gotoxy@plt>
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
mov    $0xb,%edi
mov    $0xb,%esi
call   1070 <gotoxy@plt>
mov    $0xb,%edi
mov    $0xc,%esi
call   1070 <gotoxy@plt>
lea    0xe4e(%rip),%rdi
call   1050 <printf@plt>
mov    $0xb,%edi
mov    $0xd,%esi
call   1070 <gotoxy@plt>
mov    $0xb,%edi
mov    $0xe,%esi
call   1070 <gotoxy@plt>
lea    0xe3d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <waitForAnyKey@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Controls\0A\00"
@.str.1 = [63 x i8] c"Use the following arrow keys to direct the snake to the food: \00"
@.str.2 = [12 x i8] c"Right Arrow\00"
@.str.3 = [11 x i8] c"Left Arrow\00"
@.str.4 = [10 x i8] c"Top Arrow\00"
@.str.5 = [13 x i8] c"Bottom Arrow\00"
@.str.6 = [25 x i8] c"P & Esc pauses the game.\00"
@.str.7 = [29 x i8] c"Press any key to continue...\00"
define void @controls() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 5, i32* %2
%3 = call i32 (...) @clrscr()
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = call i32 @gotoxy(i32 %4, i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = call i32 @gotoxy(i32 %9, i32 %11)
%14 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = call i32 @gotoxy(i32 %15, i32 %16)
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
%23 = call i32 @gotoxy(i32 %20, i32 %21)
%24 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32, i32* %1
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
%28 = call i32 @gotoxy(i32 %25, i32 %26)
%29 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32, i32* %1
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
%33 = call i32 @gotoxy(i32 %30, i32 %31)
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
%38 = call i32 @gotoxy(i32 %35, i32 %36)
%39 = load i32, i32* %1
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
%42 = call i32 @gotoxy(i32 %39, i32 %40)
%43 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%44 = load i32, i32* %1
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 1
store i32 %46, i32* %2
%47 = call i32 @gotoxy(i32 %44, i32 %45)
%48 = load i32, i32* %1
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
%51 = call i32 @gotoxy(i32 %48, i32 %49)
%52 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%53 = call i32 (...) @waitForAnyKey()
ret void
}

LLVM IR (-O2):
@.str.1 = [63 x i8] c"Use the following arrow keys to direct the snake to the food: \00"
@.str.2 = [12 x i8] c"Right Arrow\00"
@.str.3 = [11 x i8] c"Left Arrow\00"
@.str.4 = [10 x i8] c"Top Arrow\00"
@.str.5 = [13 x i8] c"Bottom Arrow\00"
@.str.6 = [25 x i8] c"P & Esc pauses the game.\00"
@.str.7 = [29 x i8] c"Press any key to continue...\00"
@str = [9 x i8] c"Controls\00"
define void @controls() {
%1 = tail call i32 (...) @clrscr()
%2 = tail call i32 @gotoxy(i32 10, i32 5)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @gotoxy(i32 10, i32 6)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @gotoxy(i32 11, i32 7)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @gotoxy(i32 11, i32 8)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @gotoxy(i32 11, i32 9)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 @gotoxy(i32 11, i32 10)
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%14 = tail call i32 @gotoxy(i32 11, i32 11)
%15 = tail call i32 @gotoxy(i32 11, i32 12)
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i32 @gotoxy(i32 11, i32 13)
%18 = tail call i32 @gotoxy(i32 11, i32 14)
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%20 = tail call i32 (...) @waitForAnyKey()
ret void
}