#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*/ glutPostRedisplay();
int /*<<< orphan*/ help();
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 't':
    tfunc();
    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     11fd <key+0x9d>
jmp    1189 <key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x61,%eax
je     11cd <key+0x6d>
jmp    119a <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x62,%eax
je     11d9 <key+0x79>
jmp    11ab <key+0x4b>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     11e5 <key+0x85>
jmp    11bc <key+0x5c>
mov    -0x10(%rbp),%eax
sub    $0x74,%eax
je     11f1 <key+0x91>
jmp    120b <key+0xab>
mov    $0x0,%al
call   1030 <afunc@plt>
jmp    1210 <key+0xb0>
mov    $0x0,%al
call   1050 <bfunc@plt>
jmp    1210 <key+0xb0>
mov    $0x0,%al
call   1070 <help@plt>
jmp    1210 <key+0xb0>
mov    $0x0,%al
call   1060 <tfunc@plt>
jmp    1210 <key+0xb0>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1210 <key+0xb0>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
lea    -0x61(%rdi),%eax
cmp    $0x13,%al
ja     119f <key+0x3f>
movzbl %al,%eax
lea    0xe8e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1030 <afunc@plt>
jmp    11a5 <key+0x45>
xor    %eax,%eax
call   1050 <bfunc@plt>
jmp    11a5 <key+0x45>
xor    %eax,%eax
call   1070 <help@plt>
jmp    11a5 <key+0x45>
xor    %eax,%eax
call   1060 <tfunc@plt>
jmp    11a5 <key+0x45>
cmp    $0x1b,%dil
je     11ad <key+0x4d>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1080 <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 %20 [
i32 97, label %9
i32 98, label %11
i32 104, label %13
i32 116, label %15
i32 27, label %17
]
9: ; preds = %3
%10 = call i32 (...) @afunc()
br label %21
11: ; preds = %3
%12 = call i32 (...) @bfunc()
br label %21
13: ; preds = %3
%14 = call i32 (...) @help()
br label %21
15: ; preds = %3
%16 = call i32 (...) @tfunc()
br label %21
17: ; preds = %3
%18 = load i32, i32* @EXIT_SUCCESS
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %3
br label %21
21: ; preds = %20, %15, %13, %11, %9
%22 = 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 %15 [
i8 97, label %4
i8 98, label %6
i8 104, label %8
i8 116, label %10
i8 27, label %12
]
4: ; preds = %3
%5 = tail call i32 (...) @afunc()
br label %15
6: ; preds = %3
%7 = tail call i32 (...) @bfunc()
br label %15
8: ; preds = %3
%9 = tail call i32 (...) @help()
br label %15
10: ; preds = %3
%11 = tail call i32 (...) @tfunc()
br label %15
12: ; preds = %3
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %3, %10, %8, %6, %4
%16 = tail call i32 (...) @glutPostRedisplay()
ret void
}