#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 get_char();
int new_clone(int);
int /*<<< orphan*/ printf(char *);
page36() {
  printf("\"Congratulations, troubleshooter, you have successfully found the "
         "lair of the\n");
  printf("Master Retailer and completed the Troubleshooter Training Course "
         "test mission,\"\n");
  printf("a muffled voice tells you through the barrel.  \"Once we dislodge "
         "your head\n");
  printf("from the barrel of the \'Ultra Shock\' plasma cannon you can begin "
         "with the\n");
  printf("training seminars, the first of which will concern the 100%% "
         "accurate\n");
  printf("identification and elimination of unregistered mutants.  If you have "
         "any\n");
  printf("objections please voice them now.\"\n");
  printf("\nSelect \'a\', \'b\' or \'c\' :\n");
  printf(" a - You appreciate his courtesy and voice an objection.\n");
  printf(" b - After your head is removed from the cannon, you register as a "
         "mutant.\n");
  printf(" c - After your head is removed from the cannon, you go to the "
         "unregistered\n");
  printf("     mutant identification and elimination seminar.\n");
  switch (get_char()) {
  case 'a':
    return new_clone(32);
  case 'b':
    return 23;
  case 'c':
  default:
    return 37;
  }
}


x86 assembly (clang, -O0):
<page36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
lea    0xf49(%rip),%rdi
call   1030 <printf@plt>
lea    0xf89(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc8(%rip),%rdi
call   1030 <printf@plt>
lea    0x1003(%rip),%rdi
call   1030 <printf@plt>
lea    0x1041(%rip),%rdi
call   1030 <printf@plt>
lea    0x1059(%rip),%rdi
call   1030 <printf@plt>
lea    0x1068(%rip),%rdi
call   1030 <printf@plt>
lea    0x1096(%rip),%rdi
call   1030 <printf@plt>
lea    0x10d6(%rip),%rdi
call   1030 <printf@plt>
lea    0x1117(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <get_char@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x61,%eax
je     1204 <page36+0xd4>
jmp    11e2 <page36+0xb2>
mov    -0x8(%rbp),%eax
sub    $0x62,%eax
je     1216 <page36+0xe6>
jmp    11f3 <page36+0xc3>
mov    -0x8(%rbp),%eax
sub    $0x63,%eax
je     1222 <page36+0xf2>
jmp    1227 <page36+0xf7>
mov    $0x20,%edi
call   1040 <new_clone@plt>
mov    %eax,-0x4(%rbp)
jmp    122e <page36+0xfe>
movl   $0x17,-0x4(%rbp)
jmp    122e <page36+0xfe>
jmp    1227 <page36+0xf7>
movl   $0x25,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page36>:
push   %rax
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf41(%rip),%rdi
call   1030 <puts@plt>
lea    0xf85(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
lea    0xff6(%rip),%rdi
call   1030 <puts@plt>
lea    0x1033(%rip),%rdi
call   1030 <puts@plt>
lea    0x104a(%rip),%rdi
call   1030 <puts@plt>
lea    0x1058(%rip),%rdi
call   1030 <puts@plt>
lea    0x1085(%rip),%rdi
call   1030 <puts@plt>
lea    0x10c4(%rip),%rdi
call   1030 <puts@plt>
lea    0x1104(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <get_char@plt>
cmp    $0x62,%eax
je     11ed <page36+0xad>
cmp    $0x61,%eax
jne    11f4 <page36+0xb4>
mov    $0x20,%edi
pop    %rax
jmp    1050 <new_clone@plt>
mov    $0x17,%eax
pop    %rcx
ret
mov    $0x25,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"\22Congratulations, troubleshooter, you have successfully found the lair of the\0A\00"
@.str.1 = [81 x i8] c"Master Retailer and completed the Troubleshooter Training Course test mission,\22\0A\00"
@.str.2 = [76 x i8] c"a muffled voice tells you through the barrel. \22Once we dislodge your head\0A\00"
@.str.3 = [75 x i8] c"from the barrel of the 'Ultra Shock' plasma cannon you can begin with the\0A\00"
@.str.4 = [71 x i8] c"training seminars, the first of which will concern the 100%% accurate\0A\00"
@.str.5 = [74 x i8] c"identification and elimination of unregistered mutants. If you have any\0A\00"
@.str.6 = [36 x i8] c"objections please voice them now.\22\0A\00"
@.str.7 = [27 x i8] c"\0ASelect 'a', 'b' or 'c' :\0A\00"
@.str.8 = [58 x i8] c" a - You appreciate his courtesy and voice an objection.\0A\00"
@.str.9 = [76 x i8] c" b - After your head is removed from the cannon, you register as a mutant.\0A\00"
@.str.10 = [77 x i8] c" c - After your head is removed from the cannon, you go to the unregistered\0A\00"
@.str.11 = [53 x i8] c" mutant identification and elimination seminar.\0A\00"
define i32 @page36() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 (...) @get_char()
switch i32 %14, label %19 [
i32 97, label %15
i32 98, label %17
i32 99, label %18
]
15: ; preds = %0
%16 = call i32 @new_clone(i32 32)
store i32 %16, i32* %1
br label %20
17: ; preds = %0
store i32 23, i32* %1
br label %20
18: ; preds = %0
br label %19
19: ; preds = %0, %18
store i32 37, i32* %1
br label %20
20: ; preds = %19, %17, %15
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str.4 = [71 x i8] c"training seminars, the first of which will concern the 100%% accurate\0A\00"
@str = [78 x i8] c"\22Congratulations, troubleshooter, you have successfully found the lair of the\00"
@str.12 = [80 x i8] c"Master Retailer and completed the Troubleshooter Training Course test mission,\22\00"
@str.13 = [75 x i8] c"a muffled voice tells you through the barrel. \22Once we dislodge your head\00"
@str.14 = [74 x i8] c"from the barrel of the 'Ultra Shock' plasma cannon you can begin with the\00"
@str.15 = [73 x i8] c"identification and elimination of unregistered mutants. If you have any\00"
@str.16 = [35 x i8] c"objections please voice them now.\22\00"
@str.17 = [26 x i8] c"\0ASelect 'a', 'b' or 'c' :\00"
@str.18 = [57 x i8] c" a - You appreciate his courtesy and voice an objection.\00"
@str.19 = [75 x i8] c" b - After your head is removed from the cannon, you register as a mutant.\00"
@str.20 = [76 x i8] c" c - After your head is removed from the cannon, you go to the unregistered\00"
@str.21 = [52 x i8] c" mutant identification and elimination seminar.\00"
define i32 @page36() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.12, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.13, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.14, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 (...) @get_char()
switch i32 %13, label %16 [
i32 97, label %14
i32 98, label %17
]
14: ; preds = %0
%15 = tail call i32 @new_clone(i32 32)
br label %17
16: ; preds = %0
br label %17
17: ; preds = %0, %16, %14
%18 = phi i32 [ 37, %16 ], [ %15, %14 ], [ 23, %0 ]
ret i32 %18
}