#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*/ display();
int /*<<< orphan*/ movePlayer(double);
int /*<<< orphan*/ rotatePlayer(double);
void keyPress(unsigned char key, int x, int y) {
  switch (key) {
  case 'w':
    movePlayer(0.1);
    display();
    break;
  case 's':
    movePlayer(-0.1);
    display();
    break;
  case 'd':
    rotatePlayer(-0.1);
    display();
    break;
  case 'a':
    rotatePlayer(0.1);
    display();
    break;
  }
}


x86 assembly (clang, -O0):
<keyPress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x16,%eax
ja     11cd <keyPress+0x9d>
mov    -0x18(%rbp),%rax
lea    0xeab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xe8a(%rip),%xmm0
call   1050 <movePlayer@plt>
mov    $0x0,%al
call   1040 <display@plt>
jmp    11cd <keyPress+0x9d>
movsd  0xe79(%rip),%xmm0
call   1050 <movePlayer@plt>
mov    $0x0,%al
call   1040 <display@plt>
jmp    11cd <keyPress+0x9d>
movsd  0xe60(%rip),%xmm0
call   1030 <rotatePlayer@plt>
mov    $0x0,%al
call   1040 <display@plt>
jmp    11cd <keyPress+0x9d>
movsd  0xe3f(%rip),%xmm0
call   1030 <rotatePlayer@plt>
mov    $0x0,%al
call   1040 <display@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyPress>:
push   %rax
add    $0x9f,%dil
cmp    $0x16,%dil
ja     1159 <keyPress+0x29>
movzbl %dil,%eax
lea    0xeca(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xea9(%rip),%xmm0
jmp    1163 <keyPress+0x33>
pop    %rax
ret
movsd  0xea5(%rip),%xmm0
call   1030 <rotatePlayer@plt>
jmp    1181 <keyPress+0x51>
movsd  0xe96(%rip),%xmm0
jmp    117c <keyPress+0x4c>
movsd  0xe84(%rip),%xmm0
call   1050 <movePlayer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <display@plt>

LLVM IR (-O0):
define void @keyPress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %21 [
i32 119, label %9
i32 115, label %12
i32 100, label %15
i32 97, label %18
]
9: ; preds = %3
%10 = call i32 @movePlayer(double 1.000000e-01)
%11 = call i32 (...) @display()
br label %21
12: ; preds = %3
%13 = call i32 @movePlayer(double -1.000000e-01)
%14 = call i32 (...) @display()
br label %21
15: ; preds = %3
%16 = call i32 @rotatePlayer(double -1.000000e-01)
%17 = call i32 (...) @display()
br label %21
18: ; preds = %3
%19 = call i32 @rotatePlayer(double 1.000000e-01)
%20 = call i32 (...) @display()
br label %21
21: ; preds = %3, %18, %15, %12, %9
ret void
}

LLVM IR (-O2):
define void @keyPress(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %14 [
i8 119, label %4
i8 115, label %6
i8 100, label %8
i8 97, label %10
]
4: ; preds = %3
%5 = tail call i32 @movePlayer(double 1.000000e-01)
br label %12
6: ; preds = %3
%7 = tail call i32 @movePlayer(double -1.000000e-01)
br label %12
8: ; preds = %3
%9 = tail call i32 @rotatePlayer(double -1.000000e-01)
br label %12
10: ; preds = %3
%11 = tail call i32 @rotatePlayer(double 1.000000e-01)
br label %12
12: ; preds = %4, %6, %8, %10
%13 = tail call i32 (...) @display()
br label %14
14: ; preds = %12, %3
ret void
}