#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 dice_roll(int, int);
int /*<<< orphan*/ printf(char *);
page18() {
  printf("You walk to the centre of the hall, ogling like an infrared fresh "
         "from the\n");
  printf("clone vats.  Towering before you is the most unearthly thing you "
         "have ever\n");
  printf("seen, a green multi armed mutant horror hulking 15 feet above your "
         "head.\n");
  printf("Its skeletal body is draped with hundreds of metallic strips "
         "(probably to\n");
  printf("negate the effects of some insidious mutant power), and the entire "
         "hideous\n");
  printf("creature is wrapped in a thousand blinking hazard lights.  It\'s "
         "times like\n");
  printf("this when you wish you\'d had some training for this job.  Luckily "
         "the\n");
  printf("creature doesn\'t take notice of you but stands unmoving, as though "
         "waiting for\n");
  printf("a summons from its dark lord, the Master Retailer.\n");
  printf("WHAM, suddenly you are struck from behind.\n");
  if (dice_roll(2, 10) < 15)
    return 19;
  else
    return 20;
}


x86 assembly (clang, -O0):
<page18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
lea    0xf51(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfce(%rip),%rdi
call   1030 <printf@plt>
lea    0x100e(%rip),%rdi
call   1030 <printf@plt>
lea    0x104e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1089(%rip),%rdi
call   1030 <printf@plt>
lea    0x10cd(%rip),%rdi
call   1030 <printf@plt>
lea    0x10f5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <dice_roll@plt>
cmp    $0xf,%eax
jge    11c4 <page18+0xa4>
movl   $0x13,-0x4(%rbp)
jmp    11cb <page18+0xab>
movl   $0x14,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page18>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xf56(%rip),%rdi
call   1030 <puts@plt>
lea    0xf93(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd1(%rip),%rdi
call   1030 <puts@plt>
lea    0x1010(%rip),%rdi
call   1030 <puts@plt>
lea    0x104f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1089(%rip),%rdi
call   1030 <puts@plt>
lea    0x10cc(%rip),%rdi
call   1030 <puts@plt>
lea    0x10f3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <dice_roll@plt>
xor    %ecx,%ecx
cmp    $0xf,%eax
setl   %cl
mov    $0x14,%eax
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"You walk to the centre of the hall, ogling like an infrared fresh from the\0A\00"
@.str.1 = [76 x i8] c"clone vats. Towering before you is the most unearthly thing you have ever\0A\00"
@.str.2 = [74 x i8] c"seen, a green multi armed mutant horror hulking 15 feet above your head.\0A\00"
@.str.3 = [75 x i8] c"Its skeletal body is draped with hundreds of metallic strips (probably to\0A\00"
@.str.4 = [76 x i8] c"negate the effects of some insidious mutant power), and the entire hideous\0A\00"
@.str.5 = [76 x i8] c"creature is wrapped in a thousand blinking hazard lights. It's times like\0A\00"
@.str.6 = [71 x i8] c"this when you wish you'd had some training for this job. Luckily the\0A\00"
@.str.7 = [80 x i8] c"creature doesn't take notice of you but stands unmoving, as though waiting for\0A\00"
@.str.8 = [52 x i8] c"a summons from its dark lord, the Master Retailer.\0A\00"
@.str.9 = [44 x i8] c"WHAM, suddenly you are struck from behind.\0A\00"
define i32 @page18() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 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 ([76 x i8], [76 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @dice_roll(i32 2, i32 10)
%13 = icmp slt i32 %12, 15
br i1 %13, label %14, label %15
14: ; preds = %0
store i32 19, i32* %1
br label %16
15: ; preds = %0
store i32 20, i32* %1
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@str = [75 x i8] c"You walk to the centre of the hall, ogling like an infrared fresh from the\00"
@str.10 = [75 x i8] c"clone vats. Towering before you is the most unearthly thing you have ever\00"
@str.11 = [73 x i8] c"seen, a green multi armed mutant horror hulking 15 feet above your head.\00"
@str.12 = [74 x i8] c"Its skeletal body is draped with hundreds of metallic strips (probably to\00"
@str.13 = [75 x i8] c"negate the effects of some insidious mutant power), and the entire hideous\00"
@str.14 = [75 x i8] c"creature is wrapped in a thousand blinking hazard lights. It's times like\00"
@str.15 = [70 x i8] c"this when you wish you'd had some training for this job. Luckily the\00"
@str.16 = [79 x i8] c"creature doesn't take notice of you but stands unmoving, as though waiting for\00"
@str.17 = [51 x i8] c"a summons from its dark lord, the Master Retailer.\00"
@str.18 = [43 x i8] c"WHAM, suddenly you are struck from behind.\00"
define i32 @page18() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.10, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.11, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.12, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 @dice_roll(i32 2, i32 10)
%12 = icmp slt i32 %11, 15
%13 = select i1 %12, i32 19, i32 20
ret i32 %13
}