#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 /*<<< orphan*/ printf(char *);
page30() {
  printf("You step into the shadows and offer the man a thirty credit bill.  "
         "\"Just drop\n");
  printf("it on the floor,\" he says.  \"So you\'re looking for the Master "
         "Retailer, pssfft?\n");
  printf("I\'ve seen him, he\'s a fat man in a fuzzy red and white jump suit.  "
         "They say\n");
  printf("he\'s a high programmer with no respect for proper security.  If you "
         "want to\n");
  printf("find him then pssfft step behind me and go through the door.\"\n");
  printf("Behind the man is a reinforced plasteel blast door.  The centre of "
         "it has been\n");
  printf("buckled toward you in a manner you only saw once before when you "
         "were field\n");
  printf("testing the rocket assist plasma slingshot (you found it easily "
         "portable but\n");
  printf("prone to misfire).  Luckily it isn\'t buckled too far for you to "
         "make out the\n");
  printf("warning sign.  WARNING!! Don\'t open this door or the same thing "
         "will happen to\n");
  printf("you.  Opening this door is a capital offense.  Do not do it.  Not at "
         "all. This\n");
  printf("is not a joke.\n");
  printf("\nSelect \'a\', \'b\' or \'c\' :\n");
  printf(" a - You use your Precognition mutant power on opening the door.\n");
  printf(" b - You just go through the door anyway.\n");
  printf(" c - You decide it\'s too dangerous and walk away.\n");
  switch (get_char()) {
  case 'a':
    return 56;
  case 'b':
    return 33;
  case 'c':
  default:
    return 22;
  }
}


x86 assembly (clang, -O0):
<page30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
call   1030 <printf@plt>
lea    0xf59(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xfdb(%rip),%rdi
call   1030 <printf@plt>
lea    0x100e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1052(%rip),%rdi
call   1030 <printf@plt>
lea    0x1093(%rip),%rdi
call   1030 <printf@plt>
lea    0x10d5(%rip),%rdi
call   1030 <printf@plt>
lea    0x1117(%rip),%rdi
call   1030 <printf@plt>
lea    0x115b(%rip),%rdi
call   1030 <printf@plt>
lea    0x119f(%rip),%rdi
call   1030 <printf@plt>
lea    0x11a3(%rip),%rdi
call   1030 <printf@plt>
lea    0x11b2(%rip),%rdi
call   1030 <printf@plt>
lea    0x11e8(%rip),%rdi
call   1030 <printf@plt>
lea    0x1207(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <get_char@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x61,%eax
je     1224 <page30+0x104>
jmp    1202 <page30+0xe2>
mov    -0x8(%rbp),%eax
sub    $0x62,%eax
je     1230 <page30+0x110>
jmp    1213 <page30+0xf3>
mov    -0x8(%rbp),%eax
sub    $0x63,%eax
je     123c <page30+0x11c>
jmp    1241 <page30+0x121>
movl   $0x38,-0x4(%rbp)
jmp    1248 <page30+0x128>
movl   $0x21,-0x4(%rbp)
jmp    1248 <page30+0x128>
jmp    1241 <page30+0x121>
movl   $0x16,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page30>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfde(%rip),%rdi
call   1030 <puts@plt>
lea    0x1010(%rip),%rdi
call   1030 <puts@plt>
lea    0x1053(%rip),%rdi
call   1030 <puts@plt>
lea    0x1093(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d4(%rip),%rdi
call   1030 <puts@plt>
lea    0x1115(%rip),%rdi
call   1030 <puts@plt>
lea    0x1158(%rip),%rdi
call   1030 <puts@plt>
lea    0x119b(%rip),%rdi
call   1030 <puts@plt>
lea    0x119e(%rip),%rdi
call   1030 <puts@plt>
lea    0x11ac(%rip),%rdi
call   1030 <puts@plt>
lea    0x11e1(%rip),%rdi
call   1030 <puts@plt>
lea    0x11ff(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <get_char@plt>
cmp    $0x62,%eax
mov    $0x21,%ecx
mov    $0x16,%edx
cmove  %ecx,%edx
cmp    $0x61,%eax
mov    $0x38,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"You step into the shadows and offer the man a thirty credit bill. \22Just drop\0A\00"
@.str.1 = [81 x i8] c"it on the floor,\22 he says. \22So you're looking for the Master Retailer, pssfft?\0A\00"
@.str.2 = [77 x i8] c"I've seen him, he's a fat man in a fuzzy red and white jump suit. They say\0A\00"
@.str.3 = [77 x i8] c"he's a high programmer with no respect for proper security. If you want to\0A\00"
@.str.4 = [63 x i8] c"find him then pssfft step behind me and go through the door.\22\0A\00"
@.str.5 = [80 x i8] c"Behind the man is a reinforced plasteel blast door. The centre of it has been\0A\00"
@.str.6 = [77 x i8] c"buckled toward you in a manner you only saw once before when you were field\0A\00"
@.str.7 = [78 x i8] c"testing the rocket assist plasma slingshot (you found it easily portable but\0A\00"
@.str.8 = [78 x i8] c"prone to misfire). Luckily it isn't buckled too far for you to make out the\0A\00"
@.str.9 = [80 x i8] c"warning sign. WARNING!! Don't open this door or the same thing will happen to\0A\00"
@.str.10 = [80 x i8] c"you. Opening this door is a capital offense. Do not do it. Not at all. This\0A\00"
@.str.11 = [16 x i8] c"is not a joke.\0A\00"
@.str.12 = [27 x i8] c"\0ASelect 'a', 'b' or 'c' :\0A\00"
@.str.13 = [66 x i8] c" a - You use your Precognition mutant power on opening the door.\0A\00"
@.str.14 = [43 x i8] c" b - You just go through the door anyway.\0A\00"
@.str.15 = [51 x i8] c" c - You decide it's too dangerous and walk away.\0A\00"
define i32 @page30() {
%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 ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 (...) @get_char()
switch i32 %18, label %22 [
i32 97, label %19
i32 98, label %20
i32 99, label %21
]
19: ; preds = %0
store i32 56, i32* %1
br label %23
20: ; preds = %0
store i32 33, i32* %1
br label %23
21: ; preds = %0
br label %22
22: ; preds = %0, %21
store i32 22, i32* %1
br label %23
23: ; preds = %22, %20, %19
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@str = [78 x i8] c"You step into the shadows and offer the man a thirty credit bill. \22Just drop\00"
@str.16 = [80 x i8] c"it on the floor,\22 he says. \22So you're looking for the Master Retailer, pssfft?\00"
@str.17 = [76 x i8] c"I've seen him, he's a fat man in a fuzzy red and white jump suit. They say\00"
@str.18 = [76 x i8] c"he's a high programmer with no respect for proper security. If you want to\00"
@str.19 = [62 x i8] c"find him then pssfft step behind me and go through the door.\22\00"
@str.20 = [79 x i8] c"Behind the man is a reinforced plasteel blast door. The centre of it has been\00"
@str.21 = [76 x i8] c"buckled toward you in a manner you only saw once before when you were field\00"
@str.22 = [77 x i8] c"testing the rocket assist plasma slingshot (you found it easily portable but\00"
@str.23 = [77 x i8] c"prone to misfire). Luckily it isn't buckled too far for you to make out the\00"
@str.24 = [79 x i8] c"warning sign. WARNING!! Don't open this door or the same thing will happen to\00"
@str.25 = [79 x i8] c"you. Opening this door is a capital offense. Do not do it. Not at all. This\00"
@str.26 = [15 x i8] c"is not a joke.\00"
@str.27 = [26 x i8] c"\0ASelect 'a', 'b' or 'c' :\00"
@str.28 = [65 x i8] c" a - You use your Precognition mutant power on opening the door.\00"
@str.29 = [42 x i8] c" b - You just go through the door anyway.\00"
@str.30 = [50 x i8] c" c - You decide it's too dangerous and walk away.\00"
define i32 @page30() {
%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.16, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.17, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.18, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.19, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.20, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.21, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.22, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.23, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.24, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.25, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.26, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.27, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.28, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.29, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.30, i64 0, i64 0))
%17 = tail call i32 (...) @get_char()
%18 = icmp eq i32 %17, 98
%19 = select i1 %18, i32 33, i32 22
%20 = icmp eq i32 %17, 97
%21 = select i1 %20, i32 56, i32 %19
ret i32 %21
}