#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 */
typedef int chtype;

/* Variables and functions */
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ init_pair(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/, int, int, char *);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
char wgetch(int /*<<< orphan*/);
void help() {
  char c;
  initscr();
  start_color();
  init_pair(1, 7, 0);
  while (1) {
    noecho();
    curs_set(0);
    attron((((chtype)(1) << 24) & (chtype)0xff000000));
    mvwprintw(stdscr, 5, 2, "Use arrows to move around the maze...");
    mvwprintw(stdscr, 6, 2, "Try to realise how mummy moves !");
    mvwprintw(stdscr, 7, 2, "If you ever get stuck, just press H ;)");
    mvwprintw(stdscr, 8, 2, "Good luck and have fun !");
    mvwprintw(stdscr, 10, 5, "Esc-Back");
    attroff((((chtype)(1) << 24) & (chtype)0xff000000));
    c = wgetch(stdscr);
    if (c == 27)
      break;
    refresh();
  }
  endwin();
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1060 <start_color@plt>
mov    $0x1,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x0,%al
call   10c0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    $0x1000000,%edi
call   1070 <attron@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
mov    $0x5,%esi
mov    $0x2,%edx
lea    0xdf7(%rip),%rcx
call   10b0 <mvwprintw@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
mov    $0x6,%esi
mov    $0x2,%edx
lea    0xdfe(%rip),%rcx
call   10b0 <mvwprintw@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
mov    $0x7,%esi
mov    $0x2,%edx
lea    0xe00(%rip),%rcx
call   10b0 <mvwprintw@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
mov    $0x8,%esi
mov    $0x2,%edx
lea    0xe08(%rip),%rcx
call   10b0 <mvwprintw@plt>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
mov    $0xa,%esi
mov    $0x5,%edx
lea    0xe02(%rip),%rcx
call   10b0 <mvwprintw@plt>
mov    $0x1000000,%edi
call   1030 <attroff@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
call   10a0 <wgetch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    12b7 <help+0x107>
jmp    12c3 <help+0x113>
mov    $0x0,%al
call   1080 <refresh@plt>
jmp    11d7 <help+0x27>
mov    $0x0,%al
call   1090 <endwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1060 <start_color@plt>
mov    $0x1,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    0x2e07(%rip),%rbp
lea    0xe18(%rip),%r14
lea    0xe37(%rip),%r15
lea    0xe51(%rip),%r12
lea    0xe71(%rip),%r13
lea    0xe83(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   10c0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    $0x1000000,%edi
call   1070 <attron@plt>
mov    0x0(%rbp),%edi
mov    $0x5,%esi
mov    $0x2,%edx
mov    %r14,%rcx
call   10b0 <mvwprintw@plt>
mov    0x0(%rbp),%edi
mov    $0x6,%esi
mov    $0x2,%edx
mov    %r15,%rcx
call   10b0 <mvwprintw@plt>
mov    0x0(%rbp),%edi
mov    $0x7,%esi
mov    $0x2,%edx
mov    %r12,%rcx
call   10b0 <mvwprintw@plt>
mov    0x0(%rbp),%edi
mov    $0x8,%esi
mov    $0x2,%edx
mov    %r13,%rcx
call   10b0 <mvwprintw@plt>
mov    0x0(%rbp),%edi
mov    $0xa,%esi
mov    $0x5,%edx
mov    %rbx,%rcx
call   10b0 <mvwprintw@plt>
mov    $0x1000000,%edi
call   1030 <attroff@plt>
mov    0x0(%rbp),%edi
call   10a0 <wgetch@plt>
cmp    $0x1b,%al
je     12b3 <help+0x103>
xor    %eax,%eax
call   1080 <refresh@plt>
jmp    1210 <help+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <endwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@.str = [38 x i8] c"Use arrows to move around the maze...\00"
@.str.1 = [33 x i8] c"Try to realise how mummy moves !\00"
@.str.2 = [39 x i8] c"If you ever get stuck, just press H ;)\00"
@.str.3 = [25 x i8] c"Good luck and have fun !\00"
@.str.4 = [9 x i8] c"Esc-Back\00"
define void @help() {
%1 = alloca i8
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @start_color()
%4 = call i32 @init_pair(i32 1, i32 7, i32 0)
br label %5
5: ; preds = %0, %26
%6 = call i32 (...) @noecho()
%7 = call i32 @curs_set(i32 0)
%8 = call i32 @attron(i32 16777216)
%9 = load i32, i32* @stdscr
%10 = call i32 @mvwprintw(i32 %9, i32 5, i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdscr
%12 = call i32 @mvwprintw(i32 %11, i32 6, i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @stdscr
%14 = call i32 @mvwprintw(i32 %13, i32 7, i32 2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stdscr
%16 = call i32 @mvwprintw(i32 %15, i32 8, i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* @stdscr
%18 = call i32 @mvwprintw(i32 %17, i32 10, i32 5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @attroff(i32 16777216)
%20 = load i32, i32* @stdscr
%21 = call signext i8 @wgetch(i32 %20)
store i8 %21, i8* %1
%22 = load i8, i8* %1
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 27
br i1 %24, label %25, label %26
25: ; preds = %5
br label %28
26: ; preds = %5
%27 = call i32 (...) @refresh()
br label %5
28: ; preds = %25
%29 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@.str = [38 x i8] c"Use arrows to move around the maze...\00"
@.str.1 = [33 x i8] c"Try to realise how mummy moves !\00"
@.str.2 = [39 x i8] c"If you ever get stuck, just press H ;)\00"
@.str.3 = [25 x i8] c"Good luck and have fun !\00"
@.str.4 = [9 x i8] c"Esc-Back\00"
define void @help() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @start_color()
%3 = tail call i32 @init_pair(i32 1, i32 7, i32 0)
br label %4
4: ; preds = %22, %0
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 @curs_set(i32 0)
%7 = tail call i32 @attron(i32 16777216)
%8 = load i32, i32* @stdscr
%9 = tail call i32 @mvwprintw(i32 %8, i32 5, i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdscr
%11 = tail call i32 @mvwprintw(i32 %10, i32 6, i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @stdscr
%13 = tail call i32 @mvwprintw(i32 %12, i32 7, i32 2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @stdscr
%15 = tail call i32 @mvwprintw(i32 %14, i32 8, i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @stdscr
%17 = tail call i32 @mvwprintw(i32 %16, i32 10, i32 5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @attroff(i32 16777216)
%19 = load i32, i32* @stdscr
%20 = tail call signext i8 @wgetch(i32 %19)
%21 = icmp eq i8 %20, 27
br i1 %21, label %24, label %22
22: ; preds = %4
%23 = tail call i32 (...) @refresh()
br label %4
24: ; preds = %4
%25 = tail call i32 (...) @endwin()
ret void
}