#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*/ get_parms_addr();
int /*<<< orphan*/ move_down(int /*<<< orphan*/);
int /*<<< orphan*/ move_left(int /*<<< orphan*/);
int /*<<< orphan*/ move_right(int /*<<< orphan*/);
int /*<<< orphan*/ move_up(int /*<<< orphan*/);
void special_kbdfunc(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_DOWN:
    move_down(get_parms_addr());
    break;
  case GLUT_KEY_UP:
    move_up(get_parms_addr());
    break;
  case GLUT_KEY_LEFT:
    move_left(get_parms_addr());
    break;
  case GLUT_KEY_RIGHT:
    move_right(get_parms_addr());
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<special_kbdfunc>:
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     11d6 <special_kbdfunc+0x86>
mov    -0x18(%rbp),%rax
lea    0xe7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
call   1070 <move_down@plt>
jmp    11db <special_kbdfunc+0x8b>
mov    $0x0,%al
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
call   1040 <move_up@plt>
jmp    11db <special_kbdfunc+0x8b>
mov    $0x0,%al
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
call   1060 <move_left@plt>
jmp    11db <special_kbdfunc+0x8b>
mov    $0x0,%al
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
call   1050 <move_right@plt>
jmp    11db <special_kbdfunc+0x8b>
jmp    11db <special_kbdfunc+0x8b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special_kbdfunc>:
push   %rax
add    $0xffffff80,%edi
cmp    $0x3,%edi
ja     1178 <special_kbdfunc+0x28>
lea    0xea0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <move_up@plt>
pop    %rax
ret
xor    %eax,%eax
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <move_right@plt>
xor    %eax,%eax
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <move_left@plt>
xor    %eax,%eax
call   1030 <get_parms_addr@plt>
mov    %eax,%edi
pop    %rax
jmp    1070 <move_down@plt>

LLVM IR (-O0):
define void @special_kbdfunc(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 %20 [
i32 131, label %8
i32 128, label %11
i32 130, label %14
i32 129, label %17
]
8: ; preds = %3
%9 = call i32 (...) @get_parms_addr()
%10 = call i32 @move_down(i32 %9)
br label %21
11: ; preds = %3
%12 = call i32 (...) @get_parms_addr()
%13 = call i32 @move_up(i32 %12)
br label %21
14: ; preds = %3
%15 = call i32 (...) @get_parms_addr()
%16 = call i32 @move_left(i32 %15)
br label %21
17: ; preds = %3
%18 = call i32 (...) @get_parms_addr()
%19 = call i32 @move_right(i32 %18)
br label %21
20: ; preds = %3
br label %21
21: ; preds = %20, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
define void @special_kbdfunc(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %16 [
i32 131, label %4
i32 128, label %7
i32 130, label %10
i32 129, label %13
]
4: ; preds = %3
%5 = tail call i32 (...) @get_parms_addr()
%6 = tail call i32 @move_down(i32 %5)
br label %16
7: ; preds = %3
%8 = tail call i32 (...) @get_parms_addr()
%9 = tail call i32 @move_up(i32 %8)
br label %16
10: ; preds = %3
%11 = tail call i32 (...) @get_parms_addr()
%12 = tail call i32 @move_left(i32 %11)
br label %16
13: ; preds = %3
%14 = tail call i32 (...) @get_parms_addr()
%15 = tail call i32 @move_right(i32 %14)
br label %16
16: ; preds = %3, %13, %10, %7, %4
ret void
}