#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ Pfunc();
int /*<<< orphan*/ Ufunc();
int /*<<< orphan*/ Xfunc();
int /*<<< orphan*/ bfunc();
int /*<<< orphan*/ cfunc();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ffunc();
int /*<<< orphan*/ lfunc();
int /*<<< orphan*/ nfunc();
int /*<<< orphan*/ pfunc();
int /*<<< orphan*/ tfunc();
int /*<<< orphan*/ ufunc();
int /*<<< orphan*/ wfunc();
int /*<<< orphan*/ xfunc();
int /*<<< orphan*/ yfunc();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'b':
    bfunc();
    break;
  case 'c':
    cfunc();
    break;
  case 'l':
    lfunc();
    break;
  case 't':
    tfunc();
    break;
  case 'f':
    ffunc();
    break;
  case 'n':
    nfunc();
    break;
  case 'u':
    ufunc();
    break;
  case 'U':
    Ufunc();
    break;
  case 'p':
    pfunc();
    break;
  case 'P':
    Pfunc();
    break;
  case 'w':
    wfunc();
    break;
  case 'x':
    xfunc();
    break;
  case 'X':
    Xfunc();
    break;
  case 'y':
    yfunc();
    break;
  case '\033':
    exit(EXIT_SUCCESS);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<key>:
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    $0xffffffe5,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5e,%eax
ja     12e4 <key+0xf4>
mov    -0x18(%rbp),%rax
lea    0xddb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1090 <bfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1080 <cfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1060 <lfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   10b0 <tfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1070 <ffunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   10c0 <nfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   10e0 <ufunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1110 <Ufunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1050 <pfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   10a0 <Pfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1040 <wfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   10f0 <xfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   1030 <Xfunc@plt>
jmp    12e9 <key+0xf9>
mov    $0x0,%al
call   10d0 <yfunc@plt>
jmp    12e9 <key+0xf9>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
jmp    12e9 <key+0xf9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
add    $0xe5,%dil
cmp    $0x5e,%dil
ja     1217 <key+0x27>
movzbl %dil,%eax
lea    0xdfa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rcx
jmp    10a0 <Pfunc@plt>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1110 <Ufunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Xfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <bfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <cfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <ffunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <lfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    10c0 <nfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <pfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <tfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    10e0 <ufunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <wfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    10f0 <xfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    10d0 <yfunc@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @key(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 %40 [
i32 98, label %9
i32 99, label %11
i32 108, label %13
i32 116, label %15
i32 102, label %17
i32 110, label %19
i32 117, label %21
i32 85, label %23
i32 112, label %25
i32 80, label %27
i32 119, label %29
i32 120, label %31
i32 88, label %33
i32 121, label %35
i32 27, label %37
]
9: ; preds = %3
%10 = call i32 (...) @bfunc()
br label %41
11: ; preds = %3
%12 = call i32 (...) @cfunc()
br label %41
13: ; preds = %3
%14 = call i32 (...) @lfunc()
br label %41
15: ; preds = %3
%16 = call i32 (...) @tfunc()
br label %41
17: ; preds = %3
%18 = call i32 (...) @ffunc()
br label %41
19: ; preds = %3
%20 = call i32 (...) @nfunc()
br label %41
21: ; preds = %3
%22 = call i32 (...) @ufunc()
br label %41
23: ; preds = %3
%24 = call i32 (...) @Ufunc()
br label %41
25: ; preds = %3
%26 = call i32 (...) @pfunc()
br label %41
27: ; preds = %3
%28 = call i32 (...) @Pfunc()
br label %41
29: ; preds = %3
%30 = call i32 (...) @wfunc()
br label %41
31: ; preds = %3
%32 = call i32 (...) @xfunc()
br label %41
33: ; preds = %3
%34 = call i32 (...) @Xfunc()
br label %41
35: ; preds = %3
%36 = call i32 (...) @yfunc()
br label %41
37: ; preds = %3
%38 = load i32, i32* @EXIT_SUCCESS
%39 = call i32 @exit(i32 %38)
unreachable
40: ; preds = %3
br label %41
41: ; preds = %40, %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %35 [
i8 98, label %4
i8 99, label %6
i8 108, label %8
i8 116, label %10
i8 102, label %12
i8 110, label %14
i8 117, label %16
i8 85, label %18
i8 112, label %20
i8 80, label %22
i8 119, label %24
i8 120, label %26
i8 88, label %28
i8 121, label %30
i8 27, label %32
]
4: ; preds = %3
%5 = tail call i32 (...) @bfunc()
br label %35
6: ; preds = %3
%7 = tail call i32 (...) @cfunc()
br label %35
8: ; preds = %3
%9 = tail call i32 (...) @lfunc()
br label %35
10: ; preds = %3
%11 = tail call i32 (...) @tfunc()
br label %35
12: ; preds = %3
%13 = tail call i32 (...) @ffunc()
br label %35
14: ; preds = %3
%15 = tail call i32 (...) @nfunc()
br label %35
16: ; preds = %3
%17 = tail call i32 (...) @ufunc()
br label %35
18: ; preds = %3
%19 = tail call i32 (...) @Ufunc()
br label %35
20: ; preds = %3
%21 = tail call i32 (...) @pfunc()
br label %35
22: ; preds = %3
%23 = tail call i32 (...) @Pfunc()
br label %35
24: ; preds = %3
%25 = tail call i32 (...) @wfunc()
br label %35
26: ; preds = %3
%27 = tail call i32 (...) @xfunc()
br label %35
28: ; preds = %3
%29 = tail call i32 (...) @Xfunc()
br label %35
30: ; preds = %3
%31 = tail call i32 (...) @yfunc()
br label %35
32: ; preds = %3
%33 = load i32, i32* @EXIT_SUCCESS
%34 = tail call i32 @exit(i32 %33)
unreachable
35: ; preds = %3, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}