#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);
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ printf(char *, ...);
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    printf("Exiting...\n");
    exit(1);
  case 'r':
    printf("Redisplaying...\n");
    glutPostRedisplay();
    break;
  default:
    printf("No such key '%c'...\n", key);
    break;
  }
}


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     116a <Key+0x3a>
jmp    1159 <Key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x72,%eax
je     1182 <Key+0x52>
jmp    119c <Key+0x6c>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    11ae <Key+0x7e>
movzbl -0x1(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
push   %rax
cmp    $0x72,%dil
je     1160 <Key+0x20>
cmp    $0x1b,%dil
je     1174 <Key+0x34>
movzbl %dil,%esi
lea    0xea8(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutPostRedisplay@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Exiting...\0A\00"
@.str.1 = [17 x i8] c"Redisplaying...\0A\00"
@.str.2 = [21 x i8] c"No such key '%c'...\0A\00"
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 %15 [
i32 27, label %9
i32 114, label %12
]
9: ; preds = %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (...) @glutPostRedisplay()
br label %19
15: ; preds = %3
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str.2 = [21 x i8] c"No such key '%c'...\0A\00"
@str = [16 x i8] c"Redisplaying...\00"
@str.3 = [11 x i8] c"Exiting...\00"
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %10 [
i8 27, label %4
i8 114, label %7
]
4: ; preds = %3
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (...) @glutPostRedisplay()
br label %13
10: ; preds = %3
%11 = zext i8 %0 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}