#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*/ togglemodel();
int /*<<< orphan*/ togglewire();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 't':
    togglemodel();
    break;
  case 'w':
    togglewire();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
  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     11d0 <key+0x80>
jmp    1179 <key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     11c4 <key+0x74>
jmp    118a <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x74,%eax
je     11ac <key+0x5c>
jmp    119b <key+0x4b>
mov    -0x10(%rbp),%eax
sub    $0x77,%eax
je     11b8 <key+0x68>
jmp    11d7 <key+0x87>
mov    $0x0,%al
call   1070 <togglemodel@plt>
jmp    11dc <key+0x8c>
mov    $0x0,%al
call   1030 <togglewire@plt>
jmp    11dc <key+0x8c>
mov    $0x0,%al
call   1050 <help@plt>
jmp    11dc <key+0x8c>
xor    %edi,%edi
call   1060 <exit@plt>
jmp    11dc <key+0x8c>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
cmp    $0x73,%dil
jle    116c <key+0x1c>
cmp    $0x77,%dil
je     117b <key+0x2b>
cmp    $0x74,%dil
jne    118a <key+0x3a>
xor    %eax,%eax
call   1070 <togglemodel@plt>
jmp    118a <key+0x3a>
cmp    $0x68,%dil
jne    1184 <key+0x34>
xor    %eax,%eax
call   1050 <help@plt>
jmp    118a <key+0x3a>
xor    %eax,%eax
call   1030 <togglewire@plt>
jmp    118a <key+0x3a>
cmp    $0x1b,%dil
je     1192 <key+0x42>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>
xor    %edi,%edi
call   1060 <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 116, label %9
i32 119, label %11
i32 104, label %13
i32 27, label %15
]
9: ; preds = %3
%10 = call i32 (...) @togglemodel()
br label %18
11: ; preds = %3
%12 = call i32 (...) @togglewire()
br label %18
13: ; preds = %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 116, label %4
i8 119, label %6
i8 104, label %8
i8 27, label %10
]
4: ; preds = %3
%5 = tail call i32 (...) @togglemodel()
br label %12
6: ; preds = %3
%7 = tail call i32 (...) @togglewire()
br label %12
8: ; preds = %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
}