#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 KEY_DOWN 132
#define KEY_LEFT 131
#define KEY_NPAGE 130
#define KEY_PPAGE 129
#define KEY_UP 128
int /*<<< orphan*/ pin_higher();
int /*<<< orphan*/ pin_lower();
int /*<<< orphan*/ pin_pgdown();
int /*<<< orphan*/ pin_pgup();
int /*<<< orphan*/ pin_to_clean_shell();
int /*<<< orphan*/ pin_to_shell();
void input_pin(int key) {
  switch (key) {
  case KEY_DOWN:
    pin_lower();
    break;
  case KEY_UP:
    pin_higher();
    break;
  case KEY_NPAGE:
    pin_pgdown();
    break;
  case KEY_PPAGE:
    pin_pgup();
    break;
  case KEY_LEFT:
    pin_to_clean_shell();
    break;
  case 10:
    pin_to_shell();
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<input_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xa,%eax
je     121a <input_pin+0xba>
jmp    117f <input_pin+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
je     11ea <input_pin+0x8a>
jmp    1192 <input_pin+0x32>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     1202 <input_pin+0xa2>
jmp    11a5 <input_pin+0x45>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
je     11f6 <input_pin+0x96>
jmp    11b8 <input_pin+0x58>
mov    -0x8(%rbp),%eax
sub    $0x83,%eax
je     120e <input_pin+0xae>
jmp    11cb <input_pin+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x84,%eax
jne    1226 <input_pin+0xc6>
jmp    11de <input_pin+0x7e>
mov    $0x0,%al
call   1060 <pin_lower@plt>
jmp    122b <input_pin+0xcb>
mov    $0x0,%al
call   1080 <pin_higher@plt>
jmp    122b <input_pin+0xcb>
mov    $0x0,%al
call   1030 <pin_pgdown@plt>
jmp    122b <input_pin+0xcb>
mov    $0x0,%al
call   1040 <pin_pgup@plt>
jmp    122b <input_pin+0xcb>
mov    $0x0,%al
call   1050 <pin_to_clean_shell@plt>
jmp    122b <input_pin+0xcb>
mov    $0x0,%al
call   1070 <pin_to_shell@plt>
jmp    122b <input_pin+0xcb>
jmp    122b <input_pin+0xcb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_pin>:
lea    -0x80(%rdi),%eax
cmp    $0x4,%eax
ja     117f <input_pin+0x1f>
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
jmp    1080 <pin_higher@plt>
cmp    $0xa,%edi
jne    11a7 <input_pin+0x47>
xor    %eax,%eax
jmp    1070 <pin_to_shell@plt>
xor    %eax,%eax
jmp    1040 <pin_pgup@plt>
xor    %eax,%eax
jmp    1030 <pin_pgdown@plt>
xor    %eax,%eax
jmp    1050 <pin_to_clean_shell@plt>
xor    %eax,%eax
jmp    1060 <pin_lower@plt>
ret

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

LLVM IR (-O2):
define void @input_pin(i32 %0) {
switch i32 %0, label %14 [
i32 132, label %2
i32 128, label %4
i32 130, label %6
i32 129, label %8
i32 131, label %10
i32 10, label %12
]
2: ; preds = %1
%3 = tail call i32 (...) @pin_lower()
br label %14
4: ; preds = %1
%5 = tail call i32 (...) @pin_higher()
br label %14
6: ; preds = %1
%7 = tail call i32 (...) @pin_pgdown()
br label %14
8: ; preds = %1
%9 = tail call i32 (...) @pin_pgup()
br label %14
10: ; preds = %1
%11 = tail call i32 (...) @pin_to_clean_shell()
br label %14
12: ; preds = %1
%13 = tail call i32 (...) @pin_to_shell()
br label %14
14: ; preds = %1, %12, %10, %8, %6, %4, %2
ret void
}