#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 A_NORMAL;
int /*<<< orphan*/ COLOR_CYAN;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_MAGENTA;
int COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ attrset(int);
int /*<<< orphan*/ flushinp();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ gplot(char *, int, int, int);
int /*<<< orphan*/ mvaddch(int, int, char);
int /*<<< orphan*/ mvprintw(int, int, char *, ...);
int /*<<< orphan*/ mysleep(int);
int /*<<< orphan*/ refresh();
scalar_t__ strlen(char *);
void splash(void) {
  int x;
  attrset(COLOR_PAIR(COLOR_RED) | A_BOLD);
  gplot("htext", 20, 1, 1);
  attrset(COLOR_PAIR(COLOR_GREEN));
  gplot("tdesc", 42, 9, 1);
  attrset(COLOR_PAIR(COLOR_RED));
  mvprintw(4, 80 - strlen("0.5.1"), "%s", "0.5.1");
  attrset(COLOR_PAIR(COLOR_CYAN));
  for (x = 0; x < 80; x++) {
    mvaddch(23 - 1, x, ':');
    mvaddch(0, x, ':');
  }
  attrset(COLOR_PAIR(COLOR_MAGENTA));
  mvprintw(23, 0,
           "CAVEZ of PHEAR Copyright 2003-2007 Tom Rune Flo <tom@x86.no>");
  mvprintw(23 + 1, 0, "Distributed under the terms of the GPL license");
  refresh();
  attrset(COLOR_PAIR(COLOR_WHITE) | A_NORMAL);
  mysleep(100000);
  for (x = -40; x < 0; x++) {
    gplot("spgraf", x, 1, 0);
    refresh();
    mysleep(7000);
  }
  attrset(COLOR_PAIR(COLOR_YELLOW));
  mvprintw(15, 42, "PRESS ANY KEY TO START!");
  attrset(A_NORMAL);
  refresh();
  flushinp();
  getch();
  return;
}


x86 assembly (clang, -O0):
<splash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2df1(%rip),%rax
or     (%rax),%edi
call   1090 <attrset@plt>
lea    0xe33(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1050 <gplot@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
lea    0xe0c(%rip),%rdi
mov    $0x2a,%esi
mov    $0x9,%edx
mov    $0x1,%ecx
call   1050 <gplot@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
lea    0xde2(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    $0x50,%eax
sub    %rcx,%rax
mov    %eax,%esi
mov    $0x4,%edi
lea    0xdca(%rip),%rdx
lea    0xdbd(%rip),%rcx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    12ab <splash+0x10b>
mov    -0x4(%rbp),%esi
mov    $0x16,%edi
mov    $0x3a,%edx
call   10a0 <mvaddch@plt>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
mov    $0x3a,%edx
call   10a0 <mvaddch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1272 <splash+0xd2>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
mov    $0x17,%edi
xor    %esi,%esi
lea    0xd47(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    $0x18,%edi
xor    %esi,%esi
lea    0xd6f(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2ce0(%rip),%rax
or     (%rax),%edi
call   1090 <attrset@plt>
mov    $0x186a0,%edi
call   1030 <mysleep@plt>
movl   $0xffffffd8,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    135f <splash+0x1bf>
mov    -0x4(%rbp),%esi
lea    0xd4d(%rip),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <gplot@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x1b58,%edi
call   1030 <mysleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1320 <splash+0x180>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
mov    $0xf,%edi
mov    $0x2a,%esi
lea    0xd03(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
call   1090 <attrset@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   10b0 <flushinp@plt>
mov    $0x0,%al
call   1080 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splash>:
push   %r15
push   %r14
push   %rbx
mov    0x2e0c(%rip),%rbx
mov    (%rbx),%edi
call   1050 <COLOR_PAIR@plt>
mov    0x2e06(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xe46(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1040 <gplot@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xe1c(%rip),%rdi
mov    $0x2a,%esi
mov    $0x9,%edx
mov    $0x1,%ecx
call   1040 <gplot@plt>
mov    (%rbx),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xdff(%rip),%rdx
lea    0xdf2(%rip),%rcx
xor    %ebx,%ebx
mov    $0x4,%edi
mov    $0x4b,%esi
xor    %eax,%eax
call   10b0 <mvprintw@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x16,%edi
mov    %ebx,%esi
mov    $0x3a,%edx
call   1090 <mvaddch@plt>
xor    %edi,%edi
mov    %ebx,%esi
mov    $0x3a,%edx
call   1090 <mvaddch@plt>
add    $0x1,%ebx
cmp    $0x50,%ebx
jne    1250 <splash+0xc0>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xd82(%rip),%rdx
mov    $0x17,%edi
xor    %esi,%esi
xor    %eax,%eax
call   10b0 <mvprintw@plt>
lea    0xdaa(%rip),%rdx
mov    $0x18,%edi
xor    %esi,%esi
xor    %eax,%eax
call   10b0 <mvprintw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    0x2cfc(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    0x2d16(%rip),%r15
or     (%r15),%eax
mov    %eax,%edi
call   1080 <attrset@plt>
mov    $0x186a0,%edi
call   1030 <mysleep@plt>
mov    $0xffffffd8,%ebx
lea    0xd8f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <gplot@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x1b58,%edi
call   1030 <mysleep@plt>
inc    %ebx
jne    1300 <splash+0x170>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xd46(%rip),%rdx
mov    $0xf,%edi
mov    $0x2a,%esi
xor    %eax,%eax
call   10b0 <mvprintw@plt>
mov    (%r15),%edi
call   1080 <attrset@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
xor    %eax,%eax
call   10a0 <flushinp@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1070 <getch@plt>

LLVM IR (-O0):
@COLOR_RED = global i32 0
@A_BOLD = global i32 0
@.str = [6 x i8] c"htext\00"
@COLOR_GREEN = global i32 0
@.str.1 = [6 x i8] c"tdesc\00"
@.str.2 = [6 x i8] c"0.5.1\00"
@.str.3 = [3 x i8] c"%s\00"
@COLOR_CYAN = global i32 0
@COLOR_MAGENTA = global i32 0
@.str.4 = [61 x i8] c"CAVEZ of PHEAR Copyright 2003-2007 Tom Rune Flo <tom@x86.no>\00"
@.str.5 = [47 x i8] c"Distributed under the terms of the GPL license\00"
@COLOR_WHITE = global i32 0
@A_NORMAL = global i32 0
@.str.6 = [7 x i8] c"spgraf\00"
@COLOR_YELLOW = global i32 0
@.str.7 = [24 x i8] c"PRESS ANY KEY TO START!\00"
define void @splash() {
%1 = alloca i32
%2 = load i32, i32* @COLOR_RED
%3 = call i32 @COLOR_PAIR(i32 %2)
%4 = load i32, i32* @A_BOLD
%5 = or i32 %3, %4
%6 = call i32 @attrset(i32 %5)
%7 = call i32 @gplot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 20, i32 1, i32 1)
%8 = load i32, i32* @COLOR_GREEN
%9 = call i32 @COLOR_PAIR(i32 %8)
%10 = call i32 @attrset(i32 %9)
%11 = call i32 @gplot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 42, i32 9, i32 1)
%12 = load i32, i32* @COLOR_RED
%13 = call i32 @COLOR_PAIR(i32 %12)
%14 = call i32 @attrset(i32 %13)
%15 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%16 = sub nsw i64 80, %15
%17 = trunc i64 %16 to i32
%18 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* @COLOR_CYAN
%20 = call i32 @COLOR_PAIR(i32 %19)
%21 = call i32 @attrset(i32 %20)
store i32 0, i32* %1
br label %22
22: ; preds = %30, %0
%23 = load i32, i32* %1
%24 = icmp slt i32 %23, 80
br i1 %24, label %25, label %33
25: ; preds = %22
%26 = load i32, i32* %1
%27 = call i32 @mvaddch(i32 22, i32 %26, i8 signext 58)
%28 = load i32, i32* %1
%29 = call i32 @mvaddch(i32 0, i32 %28, i8 signext 58)
br label %30
30: ; preds = %25
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %22
33: ; preds = %22
%34 = load i32, i32* @COLOR_MAGENTA
%35 = call i32 @COLOR_PAIR(i32 %34)
%36 = call i32 @attrset(i32 %35)
%37 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 23, i32 0, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 24, i32 0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%39 = call i32 (...) @refresh()
%40 = load i32, i32* @COLOR_WHITE
%41 = call i32 @COLOR_PAIR(i32 %40)
%42 = load i32, i32* @A_NORMAL
%43 = or i32 %41, %42
%44 = call i32 @attrset(i32 %43)
%45 = call i32 @mysleep(i32 100000)
store i32 -40, i32* %1
br label %46
46: ; preds = %54, %33
%47 = load i32, i32* %1
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %57
49: ; preds = %46
%50 = load i32, i32* %1
%51 = call i32 @gplot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %50, i32 1, i32 0)
%52 = call i32 (...) @refresh()
%53 = call i32 @mysleep(i32 7000)
br label %54
54: ; preds = %49
%55 = load i32, i32* %1
%56 = add nsw i32 %55, 1
store i32 %56, i32* %1
br label %46
57: ; preds = %46
%58 = load i32, i32* @COLOR_YELLOW
%59 = call i32 @COLOR_PAIR(i32 %58)
%60 = call i32 @attrset(i32 %59)
%61 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 15, i32 42, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%62 = load i32, i32* @A_NORMAL
%63 = call i32 @attrset(i32 %62)
%64 = call i32 (...) @refresh()
%65 = call i32 (...) @flushinp()
%66 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@COLOR_RED = global i32 0
@A_BOLD = global i32 0
@.str = [6 x i8] c"htext\00"
@COLOR_GREEN = global i32 0
@.str.1 = [6 x i8] c"tdesc\00"
@.str.2 = [6 x i8] c"0.5.1\00"
@.str.3 = [3 x i8] c"%s\00"
@COLOR_CYAN = global i32 0
@COLOR_MAGENTA = global i32 0
@.str.4 = [61 x i8] c"CAVEZ of PHEAR Copyright 2003-2007 Tom Rune Flo <tom@x86.no>\00"
@.str.5 = [47 x i8] c"Distributed under the terms of the GPL license\00"
@COLOR_WHITE = global i32 0
@A_NORMAL = global i32 0
@.str.6 = [7 x i8] c"spgraf\00"
@COLOR_YELLOW = global i32 0
@.str.7 = [24 x i8] c"PRESS ANY KEY TO START!\00"
define void @splash() {
%1 = load i32, i32* @COLOR_RED
%2 = tail call i32 @COLOR_PAIR(i32 %1)
%3 = load i32, i32* @A_BOLD
%4 = or i32 %3, %2
%5 = tail call i32 @attrset(i32 %4)
%6 = tail call i32 @gplot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 20, i32 1, i32 1)
%7 = load i32, i32* @COLOR_GREEN
%8 = tail call i32 @COLOR_PAIR(i32 %7)
%9 = tail call i32 @attrset(i32 %8)
%10 = tail call i32 @gplot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 42, i32 9, i32 1)
%11 = load i32, i32* @COLOR_RED
%12 = tail call i32 @COLOR_PAIR(i32 %11)
%13 = tail call i32 @attrset(i32 %12)
%14 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @COLOR_CYAN
%16 = tail call i32 @COLOR_PAIR(i32 %15)
%17 = tail call i32 @attrset(i32 %16)
br label %18
18: ; preds = %0, %18
%19 = phi i32 [ 0, %0 ], [ %22, %18 ]
%20 = tail call i32 @mvaddch(i32 22, i32 %19, i8 signext 58)
%21 = tail call i32 @mvaddch(i32 0, i32 %19, i8 signext 58)
%22 = add nuw nsw i32 %19, 1
%23 = icmp eq i32 %22, 80
br i1 %23, label %24, label %18
24: ; preds = %18
%25 = load i32, i32* @COLOR_MAGENTA
%26 = tail call i32 @COLOR_PAIR(i32 %25)
%27 = tail call i32 @attrset(i32 %26)
%28 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 23, i32 0, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
%29 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 24, i32 0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%30 = tail call i32 (...) @refresh()
%31 = load i32, i32* @COLOR_WHITE
%32 = tail call i32 @COLOR_PAIR(i32 %31)
%33 = load i32, i32* @A_NORMAL
%34 = or i32 %33, %32
%35 = tail call i32 @attrset(i32 %34)
%36 = tail call i32 @mysleep(i32 100000)
br label %37
37: ; preds = %24, %37
%38 = phi i32 [ -40, %24 ], [ %42, %37 ]
%39 = tail call i32 @gplot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %38, i32 1, i32 0)
%40 = tail call i32 (...) @refresh()
%41 = tail call i32 @mysleep(i32 7000)
%42 = add nsw i32 %38, 1
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %37
44: ; preds = %37
%45 = load i32, i32* @COLOR_YELLOW
%46 = tail call i32 @COLOR_PAIR(i32 %45)
%47 = tail call i32 @attrset(i32 %46)
%48 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 15, i32 42, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%49 = load i32, i32* @A_NORMAL
%50 = tail call i32 @attrset(i32 %49)
%51 = tail call i32 (...) @refresh()
%52 = tail call i32 (...) @flushinp()
%53 = tail call i32 (...) @getch()
ret void
}