#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ erase();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ usleep(int);
void story_mode() {
  int i;
  erase();
  attron(COLOR_PAIR(4));
  mvprintw(10, 10, "[LOADING]   ");
  refresh();
  usleep(500000);
  for (i = 0; i < 20; i++) {
    printw("|");
    refresh();
    usleep(150000);
  }
  mvprintw(12, 20, "Venga ya...");
  getch();
  erase();
}


x86 assembly (clang, -O0):
<story_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <erase@plt>
mov    $0x4,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    $0xa,%esi
lea    0xe54(%rip),%rdx
mov    %esi,%edi
call   1090 <mvprintw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x7a120,%edi
call   10a0 <usleep@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1200 <story_mode+0x80>
lea    0xe31(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11cb <story_mode+0x4b>
mov    $0xc,%edi
mov    $0x14,%esi
lea    0xdfe(%rip),%rdx
call   1090 <mvprintw@plt>
mov    $0x0,%al
call   1080 <getch@plt>
mov    $0x0,%al
call   1030 <erase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<story_mode>:
push   %rbx
xor    %eax,%eax
call   1030 <erase@plt>
mov    $0x4,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xe60(%rip),%rdx
mov    $0xa,%edi
mov    $0xa,%esi
call   1090 <mvprintw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x7a120,%edi
call   10a0 <usleep@plt>
lea    0xe46(%rip),%rbx
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x249f0,%edi
call   10a0 <usleep@plt>
lea    0xc4d(%rip),%rdx
mov    $0xc,%edi
mov    $0x14,%esi
call   1090 <mvprintw@plt>
xor    %eax,%eax
call   1080 <getch@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <erase@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[LOADING] \00"
@.str.1 = [2 x i8] c"|\00"
@.str.2 = [12 x i8] c"Venga ya...\00"
define void @story_mode() {
%1 = alloca i32
%2 = call i32 (...) @erase()
%3 = call i32 @COLOR_PAIR(i32 4)
%4 = call i32 @attron(i32 %3)
%5 = call i32 @mvprintw(i32 10, i32 10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @refresh()
%7 = call i32 @usleep(i32 500000)
store i32 0, i32* %1
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @refresh()
%14 = call i32 @usleep(i32 150000)
br label %15
15: ; preds = %11
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %8
18: ; preds = %8
%19 = call i32 @mvprintw(i32 12, i32 20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (...) @getch()
%21 = call i32 (...) @erase()
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"[LOADING] \00"
@.str.1 = [2 x i8] c"|\00"
@.str.2 = [12 x i8] c"Venga ya...\00"
define void @story_mode() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 @COLOR_PAIR(i32 4)
%3 = tail call i32 @attron(i32 %2)
%4 = tail call i32 @mvprintw(i32 10, i32 10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 @usleep(i32 500000)
%7 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 @usleep(i32 150000)
%10 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 (...) @refresh()
%12 = tail call i32 @usleep(i32 150000)
%13 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 (...) @refresh()
%15 = tail call i32 @usleep(i32 150000)
%16 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 (...) @refresh()
%18 = tail call i32 @usleep(i32 150000)
%19 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 (...) @refresh()
%21 = tail call i32 @usleep(i32 150000)
%22 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i32 (...) @refresh()
%24 = tail call i32 @usleep(i32 150000)
%25 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%26 = tail call i32 (...) @refresh()
%27 = tail call i32 @usleep(i32 150000)
%28 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = tail call i32 (...) @refresh()
%30 = tail call i32 @usleep(i32 150000)
%31 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%32 = tail call i32 (...) @refresh()
%33 = tail call i32 @usleep(i32 150000)
%34 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%35 = tail call i32 (...) @refresh()
%36 = tail call i32 @usleep(i32 150000)
%37 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = tail call i32 (...) @refresh()
%39 = tail call i32 @usleep(i32 150000)
%40 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%41 = tail call i32 (...) @refresh()
%42 = tail call i32 @usleep(i32 150000)
%43 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%44 = tail call i32 (...) @refresh()
%45 = tail call i32 @usleep(i32 150000)
%46 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%47 = tail call i32 (...) @refresh()
%48 = tail call i32 @usleep(i32 150000)
%49 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%50 = tail call i32 (...) @refresh()
%51 = tail call i32 @usleep(i32 150000)
%52 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%53 = tail call i32 (...) @refresh()
%54 = tail call i32 @usleep(i32 150000)
%55 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%56 = tail call i32 (...) @refresh()
%57 = tail call i32 @usleep(i32 150000)
%58 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%59 = tail call i32 (...) @refresh()
%60 = tail call i32 @usleep(i32 150000)
%61 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%62 = tail call i32 (...) @refresh()
%63 = tail call i32 @usleep(i32 150000)
%64 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%65 = tail call i32 (...) @refresh()
%66 = tail call i32 @usleep(i32 150000)
%67 = tail call i32 @mvprintw(i32 12, i32 20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%68 = tail call i32 (...) @getch()
%69 = tail call i32 (...) @erase()
ret void
}