#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*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ stdscr;
int strlen(char *);
void splash_screen() {
  int row, col;
  getmaxyx(stdscr, row, col);
  char msg[] = "Mastermind";
  char msg2[] = "Programado por cristobal liendo";
  attron(COLOR_PAIR(1));
  mvprintw(row / 2, (col - strlen(msg)) / 2, msg);
  attroff(COLOR_PAIR(1));
  mvprintw(row / 2 + 1, (col - strlen(msg2)) / 2, msg2);
  mvprintw(row - 1, 0, "Presiona cualquier tecla para iniciar...");
  getch();
}


x86 assembly (clang, -O0):
<splash_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1060 <getmaxyx@plt>
mov    0xe6d(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xe6a(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xe62(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4c(%rbp)
lea    -0x13(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x50(%rbp),%edi
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    -0x13(%rbp),%rdx
call   1090 <mvprintw@plt>
mov    $0x1,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x48(%rbp),%edi
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    -0x40(%rbp),%rdx
call   1090 <mvprintw@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
xor    %esi,%esi
lea    0xd8c(%rip),%rdx
call   1090 <mvprintw@plt>
mov    $0x0,%al
call   1080 <getch@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splash_screen>:
push   %rbx
sub    $0x30,%rsp
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1060 <getmaxyx@plt>
movabs $0x696d72657473614d,%rax
72 6d 69
mov    %rax,(%rsp)
movl   $0x646e69,0x7(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    $0x1,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1090 <mvprintw@plt>
mov    $0x1,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1090 <mvprintw@plt>
lea    0xdfe(%rip),%rdx
xor    %esi,%esi
call   1090 <mvprintw@plt>
xor    %eax,%eax
call   1080 <getch@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdscr = global i32 0
@__const.splash_screen.msg = [11 x i8] c"Mastermind\00"
@__const.splash_screen.msg2 = [32 x i8] c"Programado por cristobal liendo\00"
@.str = [41 x i8] c"Presiona cualquier tecla para iniciar...\00"
define void @splash_screen() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca [32 x i8]
%5 = load i32, i32* @stdscr
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @getmaxyx(i32 %5, i32 %6, i32 %7)
%9 = bitcast [11 x i8]* %3 to i8*
%10 = bitcast [32 x i8]* %4 to i8*
%11 = call i32 @COLOR_PAIR(i32 1)
%12 = call i32 @attron(i32 %11)
%13 = load i32, i32* %1
%14 = sdiv i32 %13, 2
%15 = load i32, i32* %2
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = sub nsw i32 %15, %17
%19 = sdiv i32 %18, 2
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%21 = call i32 @mvprintw(i32 %14, i32 %19, i8* %20)
%22 = call i32 @COLOR_PAIR(i32 1)
%23 = call i32 @attroff(i32 %22)
%24 = load i32, i32* %1
%25 = sdiv i32 %24, 2
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %2
%28 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%29 = call i32 @strlen(i8* %28)
%30 = sub nsw i32 %27, %29
%31 = sdiv i32 %30, 2
%32 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%33 = call i32 @mvprintw(i32 %26, i32 %31, i8* %32)
%34 = load i32, i32* %1
%35 = sub nsw i32 %34, 1
%36 = call i32 @mvprintw(i32 %35, i32 0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%37 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@__const.splash_screen.msg = [11 x i8] c"Mastermind\00"
@__const.splash_screen.msg2 = [32 x i8] c"Programado por cristobal liendo\00"
@.str = [41 x i8] c"Presiona cualquier tecla para iniciar...\00"
define void @splash_screen() {
%1 = alloca [11 x i8]
%2 = alloca [32 x i8]
%3 = load i32, i32* @stdscr
%4 = tail call i32 @getmaxyx(i32 %3, i32 undef, i32 undef)
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = tail call i32 @COLOR_PAIR(i32 1)
%8 = tail call i32 @attron(i32 %7)
%9 = call i32 @strlen(i8* %5)
%10 = call i32 @mvprintw(i32 0, i32 0, i8* %5)
%11 = call i32 @COLOR_PAIR(i32 1)
%12 = call i32 @attroff(i32 %11)
%13 = call i32 @strlen(i8* %6)
%14 = call i32 @mvprintw(i32 1, i32 0, i8* %6)
%15 = call i32 @mvprintw(i32 undef, i32 0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (...) @getch()
ret void
}