#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(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ help();
int /*<<< orphan*/ light();
int /*<<< orphan*/ toggle_t();
int /*<<< orphan*/ wire();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'l':
    light();
    break;
  case 't':
    toggle_t();
    break;
  case 'w':
    wire();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
    break;
  default:
    return;
  }
  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    $0x68,%eax
je     11f1 <key+0x91>
jmp    119a <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x6c,%eax
je     11cd <key+0x6d>
jmp    11ab <key+0x4b>
mov    -0x10(%rbp),%eax
sub    $0x74,%eax
je     11d9 <key+0x79>
jmp    11bc <key+0x5c>
mov    -0x10(%rbp),%eax
sub    $0x77,%eax
je     11e5 <key+0x85>
jmp    1204 <key+0xa4>
mov    $0x0,%al
call   1060 <light@plt>
jmp    1209 <key+0xa9>
mov    $0x0,%al
call   1050 <toggle_t@plt>
jmp    1209 <key+0xa9>
mov    $0x0,%al
call   1030 <wire@plt>
jmp    1209 <key+0xa9>
mov    $0x0,%al
call   1070 <help@plt>
jmp    1209 <key+0xa9>
xor    %edi,%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    -0x68(%rdi),%eax
cmp    $0xf,%al
ja     11a5 <key+0x45>
movzbl %al,%eax
lea    0xe8e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <help@plt>
jmp    119d <key+0x3d>
xor    %eax,%eax
call   1060 <light@plt>
jmp    119d <key+0x3d>
xor    %eax,%eax
call   1050 <toggle_t@plt>
jmp    119d <key+0x3d>
xor    %eax,%eax
call   1030 <wire@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>
cmp    $0x1b,%dil
je     11ad <key+0x4d>
pop    %rax
ret
xor    %edi,%edi
call   1080 <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 %19 [
i32 108, label %9
i32 116, label %11
i32 119, label %13
i32 104, label %15
i32 27, label %17
]
9: ; preds = %3
%10 = call i32 (...) @light()
br label %20
11: ; preds = %3
%12 = call i32 (...) @toggle_t()
br label %20
13: ; preds = %3
%14 = call i32 (...) @wire()
br label %20
15: ; preds = %3
%16 = call i32 (...) @help()
br label %20
17: ; preds = %3
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %3
br label %22
20: ; preds = %15, %13, %11, %9
%21 = call i32 (...) @glutPostRedisplay()
br label %22
22: ; preds = %20, %19
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %16 [
i8 108, label %4
i8 116, label %6
i8 119, label %8
i8 104, label %10
i8 27, label %12
]
4: ; preds = %3
%5 = tail call i32 (...) @light()
br label %14
6: ; preds = %3
%7 = tail call i32 (...) @toggle_t()
br label %14
8: ; preds = %3
%9 = tail call i32 (...) @wire()
br label %14
10: ; preds = %3
%11 = tail call i32 (...) @help()
br label %14
12: ; preds = %3
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %10, %8, %6, %4
%15 = tail call i32 (...) @glutPostRedisplay()
br label %16
16: ; preds = %3, %14
ret void
}