#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*/ afunc();
int /*<<< orphan*/ bfunc();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ help();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'A':
  case 'a':
    afunc();
    break;
  case 'B':
  case 'b':
    bfunc();
    break;
  case 'H':
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
    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     1203 <key+0xb3>
jmp    1179 <key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x41,%eax
je     11df <key+0x8f>
jmp    118a <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x42,%eax
je     11eb <key+0x9b>
jmp    119b <key+0x4b>
mov    -0x10(%rbp),%eax
sub    $0x48,%eax
je     11f7 <key+0xa7>
jmp    11ac <key+0x5c>
mov    -0x10(%rbp),%eax
sub    $0x61,%eax
je     11df <key+0x8f>
jmp    11bd <key+0x6d>
mov    -0x10(%rbp),%eax
sub    $0x62,%eax
je     11eb <key+0x9b>
jmp    11ce <key+0x7e>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     11f7 <key+0xa7>
jmp    120a <key+0xba>
mov    $0x0,%al
call   1030 <afunc@plt>
jmp    120f <key+0xbf>
mov    $0x0,%al
call   1050 <bfunc@plt>
jmp    120f <key+0xbf>
mov    $0x0,%al
call   1060 <help@plt>
jmp    120f <key+0xbf>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    120f <key+0xbf>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
lea    -0x41(%rdi),%eax
cmp    $0x27,%al
ja     11a6 <key+0x56>
movzbl %al,%eax
movabs $0x100000001,%rcx
bt     %rax,%rcx
jb     1194 <key+0x44>
movabs $0x200000002,%rcx
bt     %rax,%rcx
jb     119d <key+0x4d>
movabs $0x8000000080,%rcx
bt     %rax,%rcx
jae    11a6 <key+0x56>
xor    %eax,%eax
call   1060 <help@plt>
jmp    11ac <key+0x5c>
xor    %eax,%eax
call   1030 <afunc@plt>
jmp    11ac <key+0x5c>
xor    %eax,%eax
call   1050 <bfunc@plt>
jmp    11ac <key+0x5c>
cmp    $0x1b,%dil
je     11b4 <key+0x64>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
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 %17 [
i32 65, label %9
i32 97, label %9
i32 66, label %11
i32 98, label %11
i32 72, label %13
i32 104, label %13
i32 27, label %15
]
9: ; preds = %3, %3
%10 = call i32 (...) @afunc()
br label %18
11: ; preds = %3, %3
%12 = call i32 (...) @bfunc()
br label %18
13: ; preds = %3, %3
%14 = call i32 (...) @help()
br label %18
15: ; preds = %3
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %3
br label %18
18: ; preds = %17, %13, %11, %9
%19 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %12 [
i8 65, label %4
i8 97, label %4
i8 66, label %6
i8 98, label %6
i8 72, label %8
i8 104, label %8
i8 27, label %10
]
4: ; preds = %3, %3
%5 = tail call i32 (...) @afunc()
br label %12
6: ; preds = %3, %3
%7 = tail call i32 (...) @bfunc()
br label %12
8: ; preds = %3, %3
%9 = tail call i32 (...) @help()
br label %12
10: ; preds = %3
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %3, %8, %6, %4
%13 = tail call i32 (...) @glutPostRedisplay()
ret void
}