#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*/ afunc();
int /*<<< orphan*/ bfunc();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fourfunc();
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ help();
int /*<<< orphan*/ sfunc();
int /*<<< orphan*/ tfunc();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'a':
    afunc();
    break;
  case 'b':
    bfunc();
    break;
  case 'h':
    help();
    break;
  case 's':
    sfunc();
    break;
  case 't':
    tfunc();
    break;
  case '4':
    fourfunc();
    break;
  case '\033':
    exit(EXIT_SUCCESS);
    break;
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     1257 <key+0xd7>
jmp    11a9 <key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x34,%eax
je     124b <key+0xcb>
jmp    11ba <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x61,%eax
je     120f <key+0x8f>
jmp    11cb <key+0x4b>
mov    -0x10(%rbp),%eax
sub    $0x62,%eax
je     121b <key+0x9b>
jmp    11dc <key+0x5c>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     1227 <key+0xa7>
jmp    11ed <key+0x6d>
mov    -0x10(%rbp),%eax
sub    $0x73,%eax
je     1233 <key+0xb3>
jmp    11fe <key+0x7e>
mov    -0x10(%rbp),%eax
sub    $0x74,%eax
je     123f <key+0xbf>
jmp    1265 <key+0xe5>
mov    $0x0,%al
call   1030 <afunc@plt>
jmp    126a <key+0xea>
mov    $0x0,%al
call   1060 <bfunc@plt>
jmp    126a <key+0xea>
mov    $0x0,%al
call   1090 <help@plt>
jmp    126a <key+0xea>
mov    $0x0,%al
call   1040 <sfunc@plt>
jmp    126a <key+0xea>
mov    $0x0,%al
call   1070 <tfunc@plt>
jmp    126a <key+0xea>
mov    $0x0,%al
call   1080 <fourfunc@plt>
jmp    126a <key+0xea>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    126a <key+0xea>
mov    $0x0,%al
call   1050 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
lea    -0x61(%rdi),%eax
cmp    $0x13,%al
ja     11a4 <key+0x24>
movzbl %al,%eax
lea    0xe6e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1030 <afunc@plt>
jmp    11e9 <key+0x69>
cmp    $0x34,%dil
je     11e2 <key+0x62>
cmp    $0x1b,%dil
jne    11e9 <key+0x69>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
xor    %eax,%eax
call   1060 <bfunc@plt>
jmp    11e9 <key+0x69>
xor    %eax,%eax
call   1090 <help@plt>
jmp    11e9 <key+0x69>
xor    %eax,%eax
call   1040 <sfunc@plt>
jmp    11e9 <key+0x69>
xor    %eax,%eax
call   1070 <tfunc@plt>
jmp    11e9 <key+0x69>
xor    %eax,%eax
call   1080 <fourfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutPostRedisplay@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 %24 [
i32 97, label %9
i32 98, label %11
i32 104, label %13
i32 115, label %15
i32 116, label %17
i32 52, label %19
i32 27, label %21
]
9: ; preds = %3
%10 = call i32 (...) @afunc()
br label %25
11: ; preds = %3
%12 = call i32 (...) @bfunc()
br label %25
13: ; preds = %3
%14 = call i32 (...) @help()
br label %25
15: ; preds = %3
%16 = call i32 (...) @sfunc()
br label %25
17: ; preds = %3
%18 = call i32 (...) @tfunc()
br label %25
19: ; preds = %3
%20 = call i32 (...) @fourfunc()
br label %25
21: ; preds = %3
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %3
br label %25
25: ; preds = %24, %19, %17, %15, %13, %11, %9
%26 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %19 [
i8 97, label %4
i8 98, label %6
i8 104, label %8
i8 115, label %10
i8 116, label %12
i8 52, label %14
i8 27, label %16
]
4: ; preds = %3
%5 = tail call i32 (...) @afunc()
br label %19
6: ; preds = %3
%7 = tail call i32 (...) @bfunc()
br label %19
8: ; preds = %3
%9 = tail call i32 (...) @help()
br label %19
10: ; preds = %3
%11 = tail call i32 (...) @sfunc()
br label %19
12: ; preds = %3
%13 = tail call i32 (...) @tfunc()
br label %19
14: ; preds = %3
%15 = tail call i32 (...) @fourfunc()
br label %19
16: ; preds = %3
%17 = load i32, i32* @EXIT_SUCCESS
%18 = tail call i32 @exit(i32 %17)
unreachable
19: ; preds = %3, %14, %12, %10, %8, %6, %4
%20 = tail call i32 (...) @glutPostRedisplay()
ret void
}