#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 */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char c;
  puts("Available packages:");
  puts("A - Transportation, Hotel and Meals.");
  puts("B - Transportation and Hotel.");
  puts("C - Transportation only.");
  printf("\nSelect your package: \n\n");
  c = getchar();
  switch (c) {
  case 'A':
  case 'a':
    puts("You get Meals and");
  case 'B':
  case 'b':
    puts("You get Hotel and");
  case 'C':
  case 'c':
    puts("You get transportation.");
    break;
  case 'F':
  case 'f':
    puts("Fuck you bah!");
  default:
    puts("You don't get nuthin!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf52(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf73(%rip),%rdi
call   1030 <puts@plt>
lea    0xf85(%rip),%rdi
call   1030 <puts@plt>
lea    0xf92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x25,%eax
ja     11e4 <main+0xb4>
mov    -0x10(%rbp),%rax
lea    0xe5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf6b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf71(%rip),%rdi
call   1030 <puts@plt>
lea    0xf77(%rip),%rdi
call   1030 <puts@plt>
jmp    11f0 <main+0xc0>
lea    0xf7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf80(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xf78(%rip),%rdi
call   1030 <puts@plt>
lea    0xf91(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa3(%rip),%rdi
call   1030 <puts@plt>
lea    0x1010(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%eax
add    $0xffffffbf,%eax
cmp    $0x25,%eax
ja     11ac <main+0x8c>
lea    0xfb6(%rip),%rbx
lea    0xe83(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf81(%rip),%rdi
call   1030 <puts@plt>
jmp    11b3 <main+0x93>
lea    0xf9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9f(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Available packages:\00"
@.str.1 = [37 x i8] c"A - Transportation, Hotel and Meals.\00"
@.str.2 = [30 x i8] c"B - Transportation and Hotel.\00"
@.str.3 = [25 x i8] c"C - Transportation only.\00"
@.str.4 = [25 x i8] c"\0ASelect your package: \0A\0A\00"
@.str.5 = [18 x i8] c"You get Meals and\00"
@.str.6 = [18 x i8] c"You get Hotel and\00"
@.str.7 = [24 x i8] c"You get transportation.\00"
@.str.8 = [14 x i8] c"Fuck you bah!\00"
@.str.9 = [22 x i8] c"You don't get nuthin!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
switch i32 %10, label %19 [
i32 65, label %11
i32 97, label %11
i32 66, label %13
i32 98, label %13
i32 67, label %15
i32 99, label %15
i32 70, label %17
i32 102, label %17
]
11: ; preds = %0, %0
%12 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %13
13: ; preds = %0, %0, %11
%14 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %15
15: ; preds = %0, %0, %13
%16 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %21
17: ; preds = %0, %0
%18 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %19
19: ; preds = %0, %17
%20 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Available packages:\00"
@.str.1 = [37 x i8] c"A - Transportation, Hotel and Meals.\00"
@.str.2 = [30 x i8] c"B - Transportation and Hotel.\00"
@.str.3 = [25 x i8] c"C - Transportation only.\00"
@.str.5 = [18 x i8] c"You get Meals and\00"
@.str.6 = [18 x i8] c"You get Hotel and\00"
@.str.7 = [24 x i8] c"You get transportation.\00"
@.str.8 = [14 x i8] c"Fuck you bah!\00"
@.str.9 = [22 x i8] c"You don't get nuthin!\00"
@str = [24 x i8] c"\0ASelect your package: \0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = tail call signext i8 (...) @getchar()
%7 = sext i8 %6 to i32
switch i32 %7, label %14 [
i32 65, label %8
i32 97, label %8
i32 66, label %10
i32 98, label %10
i32 67, label %15
i32 99, label %15
i32 70, label %12
i32 102, label %12
]
8: ; preds = %0, %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %10
10: ; preds = %0, %0, %8
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %15
12: ; preds = %0, %0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %14
14: ; preds = %0, %12
br label %15
15: ; preds = %10, %0, %0, %14
%16 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), %14 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), %0 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), %0 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), %10 ]
%17 = tail call i32 @puts(i8* dereferenceable(1) %16)
ret i32 0
}