#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 getch();
int /*<<< orphan*/ puthex(int);
int /*<<< orphan*/ puts0(char *);
void pause(void) {
  int c;
  puts0(" Pause. Press any key ");
  c = getch();
  puts0("Keycode ");
  puthex(c);
  switch (c) {
  case ' ':
    puts0(" SPACE ");
    break;
  case 'z':
    puts0(" z ");
    break;
  case 'a':
    puts0(" a ");
    break;
  case 'b':
    puts0(" b ");
    break;
  default:
    puts0(" fucking thing ");
  }
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <puts0@plt>
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
lea    0xec2(%rip),%rdi
call   1050 <puts0@plt>
mov    -0x4(%rbp),%edi
call   1030 <puthex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x20,%eax
je     11a9 <pause+0x79>
jmp    1176 <pause+0x46>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
je     11cb <pause+0x9b>
jmp    1187 <pause+0x57>
mov    -0x8(%rbp),%eax
sub    $0x62,%eax
je     11dc <pause+0xac>
jmp    1198 <pause+0x68>
mov    -0x8(%rbp),%eax
sub    $0x7a,%eax
je     11ba <pause+0x8a>
jmp    11ed <pause+0xbd>
lea    0xe70(%rip),%rdi
call   1050 <puts0@plt>
jmp    11f9 <pause+0xc9>
lea    0xe67(%rip),%rdi
call   1050 <puts0@plt>
jmp    11f9 <pause+0xc9>
lea    0xe5a(%rip),%rdi
call   1050 <puts0@plt>
jmp    11f9 <pause+0xc9>
lea    0xe4d(%rip),%rdi
call   1050 <puts0@plt>
jmp    11f9 <pause+0xc9>
lea    0xe40(%rip),%rdi
call   1050 <puts0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <puts0@plt>
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ebx
lea    0xeca(%rip),%rdi
call   1050 <puts0@plt>
mov    %ebx,%edi
call   1030 <puthex@plt>
cmp    $0x61,%ebx
jg     1175 <pause+0x45>
cmp    $0x20,%ebx
je     1199 <pause+0x69>
cmp    $0x61,%ebx
jne    118c <pause+0x5c>
lea    0xebd(%rip),%rdi
pop    %rbx
jmp    1050 <puts0@plt>
cmp    $0x62,%ebx
je     11a6 <pause+0x76>
cmp    $0x7a,%ebx
jne    118c <pause+0x5c>
lea    0xea2(%rip),%rdi
pop    %rbx
jmp    1050 <puts0@plt>
lea    0xea1(%rip),%rdi
pop    %rbx
jmp    1050 <puts0@plt>
lea    0xe80(%rip),%rdi
pop    %rbx
jmp    1050 <puts0@plt>
lea    0xe83(%rip),%rdi
pop    %rbx
jmp    1050 <puts0@plt>

LLVM IR (-O0):
@.str = [23 x i8] c" Pause. Press any key \00"
@.str.1 = [9 x i8] c"Keycode \00"
@.str.2 = [8 x i8] c" SPACE \00"
@.str.3 = [4 x i8] c" z \00"
@.str.4 = [4 x i8] c" a \00"
@.str.5 = [4 x i8] c" b \00"
@.str.6 = [16 x i8] c" fucking thing \00"
define void @pause() {
%1 = alloca i32
%2 = call i32 @puts0(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
%4 = call i32 @puts0(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @puthex(i32 %5)
%7 = load i32, i32* %1
switch i32 %7, label %16 [
i32 32, label %8
i32 122, label %10
i32 97, label %12
i32 98, label %14
]
8: ; preds = %0
%9 = call i32 @puts0(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %18
10: ; preds = %0
%11 = call i32 @puts0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %18
12: ; preds = %0
%13 = call i32 @puts0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %18
14: ; preds = %0
%15 = call i32 @puts0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @puts0(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10, %8
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c" Pause. Press any key \00"
@.str.1 = [9 x i8] c"Keycode \00"
@.str.2 = [8 x i8] c" SPACE \00"
@.str.3 = [4 x i8] c" z \00"
@.str.4 = [4 x i8] c" a \00"
@.str.5 = [4 x i8] c" b \00"
@.str.6 = [16 x i8] c" fucking thing \00"
define void @pause() {
%1 = tail call i32 @puts0(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
%3 = tail call i32 @puts0(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puthex(i32 %2)
switch i32 %2, label %8 [
i32 32, label %9
i32 122, label %5
i32 97, label %6
i32 98, label %7
]
5: ; preds = %0
br label %9
6: ; preds = %0
br label %9
7: ; preds = %0
br label %9
8: ; preds = %0
br label %9
9: ; preds = %0, %8, %7, %6, %5
%10 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %0 ]
%11 = tail call i32 @puts0(i8* %10)
ret void
}