#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 A_BOLD;
int COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ attrset(int);
int /*<<< orphan*/ draw_robot();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *);
void instructions() {
  attrset(COLOR_PAIR(0) | A_BOLD);
  move(0, 0);
  printw("robotfindskitten v22July2008\n"
         "Originally by the illustrious Leonard Richardson 1997\n"
         "Written especially for the Nerth Pork robotfindskitten contest\n"
         "ReWritten in PDCurses by Joseph Larson\n"
         "Especially for Cymon's Games 2008 HTTP://WWW.CYMONSGAMES.COM\n\n"
         "   In this game, you are robot (");
  draw_robot();
  attrset(COLOR_PAIR(0) | A_BOLD);
  printw("). Your job is to find kitten. This task\n"
         "is complicated by the existance of various things which are not "
         "kitten.\n"
         "Robot must touch items to determine if they are kitten or not. The "
         "game\n"
         "ends when robotfindskitten. Alternatively, you may end the game by "
         "hitting\n"
         "the Esc key. See the documentation for more information.\n\n"
         "   Press any key to start.\n");
  getch();
}


x86 assembly (clang, -O0):
<instructions>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2e6c(%rip),%rax
or     (%rax),%edi
call   1060 <attrset@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1080 <move@plt>
lea    0xe75(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1070 <draw_robot@plt>
xor    %edi,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2e39(%rip),%rax
or     (%rax),%edi
call   1060 <attrset@plt>
lea    0xf63(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1050 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<instructions>:
push   %rbx
xor    %edi,%edi
call   1040 <COLOR_PAIR@plt>
mov    0x2e71(%rip),%rbx
or     (%rbx),%eax
mov    %eax,%edi
call   1060 <attrset@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1080 <move@plt>
lea    0xe78(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
call   1070 <draw_robot@plt>
xor    %edi,%edi
call   1040 <COLOR_PAIR@plt>
or     (%rbx),%eax
mov    %eax,%edi
call   1060 <attrset@plt>
lea    0xf6d(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <getch@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [280 x i8] c"robotfindskitten v22July2008\0AOriginally by the illustrious Leonard Richardson 1997\0AWritten especially for the Nerth Pork robotfindskitten contest\0AReWritten in PDCurses by Joseph Larson\0AEspecially for Cymon's Games 2008 HTTP://WWW.CYMONSGAMES.COM\0A\0A In this game, you are robot (\00"
@.str.1 = [346 x i8] c"). Your job is to find kitten. This task\0Ais complicated by the existance of various things which are not kitten.\0ARobot must touch items to determine if they are kitten or not. The game\0Aends when robotfindskitten. Alternatively, you may end the game by hitting\0Athe Esc key. See the documentation for more information.\0A\0A Press any key to start.\0A\00"
define void @instructions() {
%1 = call i32 @COLOR_PAIR(i32 0)
%2 = load i32, i32* @A_BOLD
%3 = or i32 %1, %2
%4 = call i32 @attrset(i32 %3)
%5 = call i32 @move(i32 0, i32 0)
%6 = call i32 @printw(i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @draw_robot()
%8 = call i32 @COLOR_PAIR(i32 0)
%9 = load i32, i32* @A_BOLD
%10 = or i32 %8, %9
%11 = call i32 @attrset(i32 %10)
%12 = call i32 @printw(i8* getelementptr inbounds ([346 x i8], [346 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [280 x i8] c"robotfindskitten v22July2008\0AOriginally by the illustrious Leonard Richardson 1997\0AWritten especially for the Nerth Pork robotfindskitten contest\0AReWritten in PDCurses by Joseph Larson\0AEspecially for Cymon's Games 2008 HTTP://WWW.CYMONSGAMES.COM\0A\0A In this game, you are robot (\00"
@.str.1 = [346 x i8] c"). Your job is to find kitten. This task\0Ais complicated by the existance of various things which are not kitten.\0ARobot must touch items to determine if they are kitten or not. The game\0Aends when robotfindskitten. Alternatively, you may end the game by hitting\0Athe Esc key. See the documentation for more information.\0A\0A Press any key to start.\0A\00"
define void @instructions() {
%1 = tail call i32 @COLOR_PAIR(i32 0)
%2 = load i32, i32* @A_BOLD
%3 = or i32 %2, %1
%4 = tail call i32 @attrset(i32 %3)
%5 = tail call i32 @move(i32 0, i32 0)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @draw_robot()
%8 = tail call i32 @COLOR_PAIR(i32 0)
%9 = load i32, i32* @A_BOLD
%10 = or i32 %9, %8
%11 = tail call i32 @attrset(i32 %10)
%12 = tail call i32 @printw(i8* getelementptr inbounds ([346 x i8], [346 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 (...) @getch()
ret void
}