#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 COLS;
int LINES;
int /*<<< orphan*/ erase();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ print_color(int /*<<< orphan*/, int, int, int, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int strlen(char *);
void run_splash() {
  char str_title[] = "Game Of Life";
  char str_press[] = "Press a key to continue";
  print_color(stdscr, LINES / 2, (COLS - strlen(str_title)) / 2, 0, str_title);
  print_color(stdscr, LINES - 1.0, 0, 1, str_press);
  refresh();
  getch();
  erase();
}


x86 assembly (clang, -O0):
<run_splash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xea9(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xea7(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xea2(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2e3f(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    0x2e1b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    -0xd(%rbp),%r8
xor    %ecx,%ecx
call   1070 <print_color@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
mov    0x2deb(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xdf7(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    -0x30(%rbp),%r8
xor    %edx,%edx
mov    $0x1,%ecx
call   1070 <print_color@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1040 <erase@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_splash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movabs $0x6566694c20664f,%rax
mov    %rax,0x5(%rsp)
movabs $0x20664f20656d6147,%rax
4f 66 20
mov    %rax,(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x65756e69746e6f,%rax
mov    %rax,0x20(%rsp)
mov    0x2e43(%rip),%r15
mov    (%r15),%r13d
mov    0x2e41(%rip),%r12
mov    (%r12),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    0x2e1d(%rip),%rax
mov    (%rax),%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebx
mov    %ebx,%edx
shr    $0x1f,%edx
add    %ebx,%edx
sar    %edx
mov    %r13d,%edi
mov    %ebp,%esi
xor    %ecx,%ecx
mov    %r14,%r8
call   1070 <print_color@plt>
mov    (%r15),%edi
mov    (%r12),%esi
add    $0xffffffff,%esi
lea    0x10(%rsp),%r8
xor    %edx,%edx
mov    $0x1,%ecx
call   1070 <print_color@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1040 <erase@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.run_splash.str_title = [13 x i8] c"Game Of Life\00"
@__const.run_splash.str_press = [24 x i8] c"Press a key to continue\00"
@stdscr = global i32 0
@LINES = global i32 0
@COLS = global i32 0
define void @run_splash() {
%1 = alloca [13 x i8]
%2 = alloca [24 x i8]
%3 = bitcast [13 x i8]* %1 to i8*
%4 = bitcast [24 x i8]* %2 to i8*
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @LINES
%7 = sdiv i32 %6, 2
%8 = load i32, i32* @COLS
%9 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 %8, %10
%12 = sdiv i32 %11, 2
%13 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%14 = call i32 @print_color(i32 %5, i32 %7, i32 %12, i32 0, i8* %13)
%15 = load i32, i32* @stdscr
%16 = load i32, i32* @LINES
%17 = sitofp i32 %16 to double
%18 = fsub double %17, 1.000000e+00
%19 = fptosi double %18 to i32
%20 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%21 = call i32 @print_color(i32 %15, i32 %19, i32 0, i32 1, i8* %20)
%22 = call i32 (...) @refresh()
%23 = call i32 (...) @getch()
%24 = call i32 (...) @erase()
ret void
}

LLVM IR (-O2):
@__const.run_splash.str_title = [13 x i8] c"Game Of Life\00"
@__const.run_splash.str_press = [24 x i8] c"Press a key to continue\00"
@stdscr = global i32 0
@LINES = global i32 0
@COLS = global i32 0
define void @run_splash() {
%1 = alloca [13 x i8]
%2 = alloca [24 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @LINES
%7 = sdiv i32 %6, 2
%8 = load i32, i32* @COLS
%9 = call i32 @strlen(i8* %3)
%10 = sub nsw i32 %8, %9
%11 = sdiv i32 %10, 2
%12 = call i32 @print_color(i32 %5, i32 %7, i32 %11, i32 0, i8* %3)
%13 = load i32, i32* @stdscr
%14 = load i32, i32* @LINES
%15 = add i32 %14, -1
%16 = call i32 @print_color(i32 %13, i32 %15, i32 0, i32 1, i8* %4)
%17 = call i32 (...) @refresh()
%18 = call i32 (...) @getch()
%19 = call i32 (...) @erase()
ret void
}