#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*/ Prt(char *, int, int);
int /*<<< orphan*/ clear_screen();
char inkey();
void q__explain_quests() {
  char in_char;
  clear_screen();
  Prt(("Home of Leckin the Arch-Mage"), (2) - 1, (26) - 1);
  Prt(("Greetings, adventurer, and welcome to my humble quarters."), (6) - 1,
      (10) - 1);
  Prt(("I see that you have come, like many before you, in an effort to"),
      (8) - 1, (10) - 1);
  Prt(("defeat the great evil that lies deep within the darkest bowels of"),
      (9) - 1, (10) - 1);
  Prt(("the caves of Moria.  As you well know, none have yet succeeded."),
      (10) - 1, (10) - 1);
  Prt(("You, however . . . I feel that you are going to be different than"),
      (12) - 1, (10) - 1);
  Prt(("the rest.  You have it within you to defeat the accursed Balrog,"),
      (13) - 1, (10) - 1);
  Prt(("and restore peace and happiness to the people of this fair town."),
      (14) - 1, (10) - 1);
  Prt(("But you cannot do it alone.  You will need someone to guide you."),
      (15) - 1, (10) - 1);
  Prt(("I am willing to be that person, if you will have me.  I will aid"),
      (17) - 1, (10) - 1);
  Prt(("you in your quest to defeat the Balrog.  But in return, you must"),
      (18) - 1, (10) - 1);
  Prt(("complete many other, simpler quests.  These will strengthen you"),
      (19) - 1, (10) - 1);
  Prt(("and prepare you for your final conflict, many moons hence."), (20) - 1,
      (10) - 1);
  Prt(("[Hit space to continue]"), (24) - 1, (28) - 1);
  in_char = inkey();
  clear_screen();
  Prt(("Home of Leckin the Arch-Mage"), (2) - 1, (26) - 1);
  Prt(("I will give you a cash reward for the completion of each quest,"),
      (6) - 1, (10) - 1);
  Prt(("to provide incentive for you.  In addition, I may occasionally"),
      (7) - 1, (10) - 1);
  Prt(("give you an item that will aid you in your overall quest."), (8) - 1,
      (10) - 1);
  Prt(("If you agree to these conditions, then select one of the following"),
      (9) - 1, (10) - 1);
  Prt(("quests.  Either way, I wish you the best of luck."), (10) - 1,
      (10) - 1);
  Prt(("[Hit space to continue]"), (24) - 1, (28) - 1);
  in_char = inkey();
}


x86 assembly (clang, -O0):
<q__explain_quests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clear_screen@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <Prt@plt>
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xee5(%rip),%rdi
mov    $0x7,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf0f(%rip),%rdi
mov    $0x8,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf3b(%rip),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1030 <Prt@plt>
lea    0xf68(%rip),%rdi
mov    $0xb,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf94(%rip),%rdi
mov    $0xc,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xfbf(%rip),%rdi
mov    $0xd,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xfea(%rip),%rdi
mov    $0xe,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1015(%rip),%rdi
mov    $0x10,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1040(%rip),%rdi
mov    $0x11,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x106b(%rip),%rdi
mov    $0x12,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1095(%rip),%rdi
mov    $0x13,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x10ba(%rip),%rdi
mov    $0x17,%esi
mov    $0x1b,%edx
call   1030 <Prt@plt>
mov    $0x0,%al
call   1050 <inkey@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <clear_screen@plt>
lea    0xd78(%rip),%rdi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <Prt@plt>
lea    0x1095(%rip),%rdi
mov    $0x5,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x10bf(%rip),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x10e8(%rip),%rdi
mov    $0x7,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x110c(%rip),%rdi
mov    $0x8,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1139(%rip),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1030 <Prt@plt>
lea    0x1012(%rip),%rdi
mov    $0x17,%esi
mov    $0x1b,%edx
call   1030 <Prt@plt>
mov    $0x0,%al
call   1050 <inkey@plt>
mov    %al,-0x1(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q__explain_quests>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clear_screen@plt>
lea    0xebe(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <Prt@plt>
lea    0xec2(%rip),%rdi
mov    $0x5,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xee6(%rip),%rdi
mov    $0x7,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf10(%rip),%rdi
mov    $0x8,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf3c(%rip),%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf66(%rip),%rdi
mov    $0xb,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xf92(%rip),%rdi
mov    $0xc,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xfbd(%rip),%rdi
mov    $0xd,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0xfe8(%rip),%rdi
mov    $0xe,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1013(%rip),%rdi
mov    $0x10,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x103e(%rip),%rdi
mov    $0x11,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1069(%rip),%rdi
mov    $0x12,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x1093(%rip),%rdi
mov    $0x13,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x10b8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x17,%esi
mov    $0x1b,%edx
call   1030 <Prt@plt>
xor    %eax,%eax
call   1050 <inkey@plt>
xor    %eax,%eax
call   1040 <clear_screen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <Prt@plt>
lea    0x1097(%rip),%rdi
mov    $0x5,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x10c1(%rip),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x10ea(%rip),%rdi
mov    $0x7,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x110e(%rip),%rdi
mov    $0x8,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
lea    0x113b(%rip),%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1030 <Prt@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
mov    $0x1b,%edx
call   1030 <Prt@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <inkey@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Home of Leckin the Arch-Mage\00"
@.str.1 = [58 x i8] c"Greetings, adventurer, and welcome to my humble quarters.\00"
@.str.2 = [64 x i8] c"I see that you have come, like many before you, in an effort to\00"
@.str.3 = [66 x i8] c"defeat the great evil that lies deep within the darkest bowels of\00"
@.str.4 = [64 x i8] c"the caves of Moria. As you well know, none have yet succeeded.\00"
@.str.5 = [66 x i8] c"You, however . . . I feel that you are going to be different than\00"
@.str.6 = [65 x i8] c"the rest. You have it within you to defeat the accursed Balrog,\00"
@.str.7 = [65 x i8] c"and restore peace and happiness to the people of this fair town.\00"
@.str.8 = [65 x i8] c"But you cannot do it alone. You will need someone to guide you.\00"
@.str.9 = [65 x i8] c"I am willing to be that person, if you will have me. I will aid\00"
@.str.10 = [65 x i8] c"you in your quest to defeat the Balrog. But in return, you must\00"
@.str.11 = [64 x i8] c"complete many other, simpler quests. These will strengthen you\00"
@.str.12 = [59 x i8] c"and prepare you for your final conflict, many moons hence.\00"
@.str.13 = [24 x i8] c"[Hit space to continue]\00"
@.str.14 = [64 x i8] c"I will give you a cash reward for the completion of each quest,\00"
@.str.15 = [63 x i8] c"to provide incentive for you. In addition, I may occasionally\00"
@.str.16 = [58 x i8] c"give you an item that will aid you in your overall quest.\00"
@.str.17 = [67 x i8] c"If you agree to these conditions, then select one of the following\00"
@.str.18 = [50 x i8] c"quests. Either way, I wish you the best of luck.\00"
define void @q__explain_quests() {
%1 = alloca i8
%2 = call i32 (...) @clear_screen()
%3 = call i32 @Prt(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1, i32 25)
%4 = call i32 @Prt(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 9)
%5 = call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 9)
%6 = call i32 @Prt(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i32 8, i32 9)
%7 = call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), i32 9, i32 9)
%8 = call i32 @Prt(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), i32 11, i32 9)
%9 = call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i32 12, i32 9)
%10 = call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0), i32 13, i32 9)
%11 = call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.8, i64 0, i64 0), i32 14, i32 9)
%12 = call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0), i32 16, i32 9)
%13 = call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0), i32 17, i32 9)
%14 = call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.11, i64 0, i64 0), i32 18, i32 9)
%15 = call i32 @Prt(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0), i32 19, i32 9)
%16 = call i32 @Prt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i32 23, i32 27)
%17 = call signext i8 (...) @inkey()
store i8 %17, i8* %1
%18 = call i32 (...) @clear_screen()
%19 = call i32 @Prt(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1, i32 25)
%20 = call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.14, i64 0, i64 0), i32 5, i32 9)
%21 = call i32 @Prt(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i32 6, i32 9)
%22 = call i32 @Prt(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0), i32 7, i32 9)
%23 = call i32 @Prt(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.17, i64 0, i64 0), i32 8, i32 9)
%24 = call i32 @Prt(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.18, i64 0, i64 0), i32 9, i32 9)
%25 = call i32 @Prt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i32 23, i32 27)
%26 = call signext i8 (...) @inkey()
store i8 %26, i8* %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Home of Leckin the Arch-Mage\00"
@.str.1 = [58 x i8] c"Greetings, adventurer, and welcome to my humble quarters.\00"
@.str.2 = [64 x i8] c"I see that you have come, like many before you, in an effort to\00"
@.str.3 = [66 x i8] c"defeat the great evil that lies deep within the darkest bowels of\00"
@.str.4 = [64 x i8] c"the caves of Moria. As you well know, none have yet succeeded.\00"
@.str.5 = [66 x i8] c"You, however . . . I feel that you are going to be different than\00"
@.str.6 = [65 x i8] c"the rest. You have it within you to defeat the accursed Balrog,\00"
@.str.7 = [65 x i8] c"and restore peace and happiness to the people of this fair town.\00"
@.str.8 = [65 x i8] c"But you cannot do it alone. You will need someone to guide you.\00"
@.str.9 = [65 x i8] c"I am willing to be that person, if you will have me. I will aid\00"
@.str.10 = [65 x i8] c"you in your quest to defeat the Balrog. But in return, you must\00"
@.str.11 = [64 x i8] c"complete many other, simpler quests. These will strengthen you\00"
@.str.12 = [59 x i8] c"and prepare you for your final conflict, many moons hence.\00"
@.str.13 = [24 x i8] c"[Hit space to continue]\00"
@.str.14 = [64 x i8] c"I will give you a cash reward for the completion of each quest,\00"
@.str.15 = [63 x i8] c"to provide incentive for you. In addition, I may occasionally\00"
@.str.16 = [58 x i8] c"give you an item that will aid you in your overall quest.\00"
@.str.17 = [67 x i8] c"If you agree to these conditions, then select one of the following\00"
@.str.18 = [50 x i8] c"quests. Either way, I wish you the best of luck.\00"
define void @q__explain_quests() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @Prt(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1, i32 25)
%3 = tail call i32 @Prt(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 9)
%4 = tail call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 9)
%5 = tail call i32 @Prt(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i32 8, i32 9)
%6 = tail call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), i32 9, i32 9)
%7 = tail call i32 @Prt(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), i32 11, i32 9)
%8 = tail call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i32 12, i32 9)
%9 = tail call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0), i32 13, i32 9)
%10 = tail call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.8, i64 0, i64 0), i32 14, i32 9)
%11 = tail call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0), i32 16, i32 9)
%12 = tail call i32 @Prt(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0), i32 17, i32 9)
%13 = tail call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.11, i64 0, i64 0), i32 18, i32 9)
%14 = tail call i32 @Prt(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0), i32 19, i32 9)
%15 = tail call i32 @Prt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i32 23, i32 27)
%16 = tail call signext i8 (...) @inkey()
%17 = tail call i32 (...) @clear_screen()
%18 = tail call i32 @Prt(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1, i32 25)
%19 = tail call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.14, i64 0, i64 0), i32 5, i32 9)
%20 = tail call i32 @Prt(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i32 6, i32 9)
%21 = tail call i32 @Prt(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0), i32 7, i32 9)
%22 = tail call i32 @Prt(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.17, i64 0, i64 0), i32 8, i32 9)
%23 = tail call i32 @Prt(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.18, i64 0, i64 0), i32 9, i32 9)
%24 = tail call i32 @Prt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i32 23, i32 27)
%25 = tail call signext i8 (...) @inkey()
ret void
}