#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 /*<<< orphan*/ getlet(char *);
int /*<<< orphan*/ puts(char *);
void print_instructions() {
  puts(
      "\tWelcome to 'Hunt the Wumpus'\n\n"
      "  The Wumpus lives in a cave of 20 rooms. Each room has 3 tunnels\n"
      "leading to other rooms. (look at a dodecahedron to see how this works.\n"
      "If you don't know what a dodecahedron is, ask someone)\n");
  puts(
      "     HAZARDS:\n"
      " Bottomless Pits - Two rooms have bottomless pits in them. If you go\n"
      "     there, you fall into the pit (& lose!)\n"
      " Super Bats - Two other rooms have super bats. If you go there a bat\n"
      "     grabs you and takes you to some other room at random. (Which may "
      "be\n"
      "     troublesome)\n\n"
      "     THE WUMPUS:\n"
      " The wumpus is not bothered by hazards (he has sucker feet and is too\n"
      " big for a bat to lift). Usually he is asleep. Two things wake him up:\n"
      " you shooting an arrow or you entering his room. If the wumpus wakes "
      "he\n"
      " moves (P=.75) one room or stays still (P=.25). After that, if he is\n"
      " where you are he eats you up and you lose!\n");
  (void)getlet("Type an E then RETURN ");
  puts("     YOU:\n"
       " Each turn you may move or shoot a crooked arrow\n"
       "   Moving: You can move one room (thru one tunnel)\n"
       "   Arrows: You have 5 arrows. You lose when you run out. Each arrow "
       "can\n"
       "           go from 1 to 5 rooms. you aim by telling the computer the\n"
       "           room #s you want the arrow to go to. If the arrow can't go\n"
       "           that way (if no tunnel) it moves at random to the next "
       "room.\n"
       "           If the arrow hits the wumpus, you win.\n"
       "           If the arrow hits you, you lose.\n\n"
       "     WARNINGS:\n"
       "When you are one room away from a wumpus or hazard the computer says:\n"
       " Wumpus:  'I smell a wumpus'\n"
       " BAT   :  'Bats nearby'\n"
       " PIT   :  'I feel a draft'\n");
  (void)getlet("Type an E then RETURN ");
}


x86 assembly (clang, -O0):
<print_instructions>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa9(%rip),%rdi
call   1030 <puts@plt>
lea    0x1215(%rip),%rdi
call   1040 <getlet@plt>
lea    0x1220(%rip),%rdi
call   1030 <puts@plt>
lea    0x11fd(%rip),%rdi
call   1040 <getlet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_instructions>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
lea    0x1218(%rip),%rbx
mov    %rbx,%rdi
call   1040 <getlet@plt>
lea    0x1220(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <getlet@plt>

LLVM IR (-O0):
@.str = [224 x i8] c"\09Welcome to 'Hunt the Wumpus'\0A\0A The Wumpus lives in a cave of 20 rooms. Each room has 3 tunnels\0Aleading to other rooms. (look at a dodecahedron to see how this works.\0AIf you don't know what a dodecahedron is, ask someone)\0A\00"
@.str.1 = [632 x i8] c" HAZARDS:\0A Bottomless Pits - Two rooms have bottomless pits in them. If you go\0A there, you fall into the pit (& lose!)\0A Super Bats - Two other rooms have super bats. If you go there a bat\0A grabs you and takes you to some other room at random. (Which may be\0A troublesome)\0A\0A THE WUMPUS:\0A The wumpus is not bothered by hazards (he has sucker feet and is too\0A big for a bat to lift). Usually he is asleep. Two things wake him up:\0A you shooting an arrow or you entering his room. If the wumpus wakes he\0A moves (P=.75) one room or stays still (P=.25). After that, if he is\0A where you are he eats you up and you lose!\0A\00"
@.str.2 = [23 x i8] c"Type an E then RETURN \00"
@.str.3 = [654 x i8] c" YOU:\0A Each turn you may move or shoot a crooked arrow\0A Moving: You can move one room (thru one tunnel)\0A Arrows: You have 5 arrows. You lose when you run out. Each arrow can\0A go from 1 to 5 rooms. you aim by telling the computer the\0A room #s you want the arrow to go to. If the arrow can't go\0A that way (if no tunnel) it moves at random to the next room.\0A If the arrow hits the wumpus, you win.\0A If the arrow hits you, you lose.\0A\0A WARNINGS:\0AWhen you are one room away from a wumpus or hazard the computer says:\0A Wumpus: 'I smell a wumpus'\0A BAT : 'Bats nearby'\0A PIT : 'I feel a draft'\0A\00"
define void @print_instructions() {
%1 = call i32 @puts(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([632 x i8], [632 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @getlet(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([654 x i8], [654 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @getlet(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [224 x i8] c"\09Welcome to 'Hunt the Wumpus'\0A\0A The Wumpus lives in a cave of 20 rooms. Each room has 3 tunnels\0Aleading to other rooms. (look at a dodecahedron to see how this works.\0AIf you don't know what a dodecahedron is, ask someone)\0A\00"
@.str.1 = [632 x i8] c" HAZARDS:\0A Bottomless Pits - Two rooms have bottomless pits in them. If you go\0A there, you fall into the pit (& lose!)\0A Super Bats - Two other rooms have super bats. If you go there a bat\0A grabs you and takes you to some other room at random. (Which may be\0A troublesome)\0A\0A THE WUMPUS:\0A The wumpus is not bothered by hazards (he has sucker feet and is too\0A big for a bat to lift). Usually he is asleep. Two things wake him up:\0A you shooting an arrow or you entering his room. If the wumpus wakes he\0A moves (P=.75) one room or stays still (P=.25). After that, if he is\0A where you are he eats you up and you lose!\0A\00"
@.str.2 = [23 x i8] c"Type an E then RETURN \00"
@.str.3 = [654 x i8] c" YOU:\0A Each turn you may move or shoot a crooked arrow\0A Moving: You can move one room (thru one tunnel)\0A Arrows: You have 5 arrows. You lose when you run out. Each arrow can\0A go from 1 to 5 rooms. you aim by telling the computer the\0A room #s you want the arrow to go to. If the arrow can't go\0A that way (if no tunnel) it moves at random to the next room.\0A If the arrow hits the wumpus, you win.\0A If the arrow hits you, you lose.\0A\0A WARNINGS:\0AWhen you are one room away from a wumpus or hazard the computer says:\0A Wumpus: 'I smell a wumpus'\0A BAT : 'Bats nearby'\0A PIT : 'I feel a draft'\0A\00"
define void @print_instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([632 x i8], [632 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @getlet(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([654 x i8], [654 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @getlet(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}