#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 */
#define GLUT_KEY_DOWN 131
#define GLUT_KEY_LEFT 130
#define GLUT_KEY_RIGHT 129
#define GLUT_KEY_UP 128
int /*<<< orphan*/ RotateCamera(int, int, int /*<<< orphan*/);
void HandleSpecialKeyboard(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_LEFT:
    RotateCamera(-1, 0, 0);
    break;
  case GLUT_KEY_RIGHT:
    RotateCamera(1, 0, 0);
    break;
  case GLUT_KEY_UP:
    RotateCamera(0, 1, 0);
    break;
  case GLUT_KEY_DOWN:
    RotateCamera(0, -1, 0);
    break;
  }
}


x86 assembly (clang, -O0):
<HandleSpecialKeyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     1191 <HandleSpecialKeyboard+0x81>
mov    -0x18(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xffffffff,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <RotateCamera@plt>
jmp    1191 <HandleSpecialKeyboard+0x81>
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <RotateCamera@plt>
jmp    1191 <HandleSpecialKeyboard+0x81>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <RotateCamera@plt>
jmp    1191 <HandleSpecialKeyboard+0x81>
xor    %edx,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
call   1030 <RotateCamera@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleSpecialKeyboard>:
add    $0xffffff80,%edi
cmp    $0x3,%edi
ja     1136 <HandleSpecialKeyboard+0x26>
lea    0xee1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <RotateCamera@plt>
ret
mov    $0x1,%edi
jmp    1143 <HandleSpecialKeyboard+0x33>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <RotateCamera@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
jmp    1030 <RotateCamera@plt>

LLVM IR (-O0):
define void @HandleSpecialKeyboard(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %16 [
i32 130, label %8
i32 129, label %10
i32 128, label %12
i32 131, label %14
]
8: ; preds = %3
%9 = call i32 @RotateCamera(i32 -1, i32 0, i32 0)
br label %16
10: ; preds = %3
%11 = call i32 @RotateCamera(i32 1, i32 0, i32 0)
br label %16
12: ; preds = %3
%13 = call i32 @RotateCamera(i32 0, i32 1, i32 0)
br label %16
14: ; preds = %3
%15 = call i32 @RotateCamera(i32 0, i32 -1, i32 0)
br label %16
16: ; preds = %3, %14, %12, %10, %8
ret void
}

LLVM IR (-O2):
define void @HandleSpecialKeyboard(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %12 [
i32 130, label %4
i32 129, label %6
i32 128, label %8
i32 131, label %10
]
4: ; preds = %3
%5 = tail call i32 @RotateCamera(i32 -1, i32 0, i32 0)
br label %12
6: ; preds = %3
%7 = tail call i32 @RotateCamera(i32 1, i32 0, i32 0)
br label %12
8: ; preds = %3
%9 = tail call i32 @RotateCamera(i32 0, i32 1, i32 0)
br label %12
10: ; preds = %3
%11 = tail call i32 @RotateCamera(i32 0, i32 -1, i32 0)
br label %12
12: ; preds = %3, %10, %8, %6, %4
ret void
}