#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*/ erase();
int getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ refresh();
int splash_screen() {
  int key;
  mvprintw(0, 22, "II");
  mvprintw(1, 14, "IIIIIIIIIIII");
  mvprintw(2, 6, "IIIIIIIIIIIIIIIIIIIIIII");
  mvprintw(3, 4, "?IIIIIIIIIII7....IIIIIIIIIII");
  mvprintw(4, 4, "??IIIIIIIIIII....IIIIIIIIIIII");
  mvprintw(5, 5, "???IIIIIIIIIIIIIIIIIIIIIIIIII");
  mvprintw(6, 5, "?????IIIIIIIIIIIIIII777777777");
  mvprintw(7, 5, "?..????IIIIII7777777777.....7");
  mvprintw(8, 5, "??.???????777777777777.....77");
  mvprintw(9, 5, "??.???????77....777777....777");
  mvprintw(10, 5, "??????????7.....777777777777");
  mvprintw(11, 6, "?????????7.... 777777777777");
  mvprintw(12, 6, "?????????77777777....777777");
  mvprintw(13, 6, "?????????7777777.....777777");
  mvprintw(14, 6, "????..???77777777...7777..7");
  mvprintw(15, 7, "???...??7777777777777....7");
  mvprintw(16, 8, "???..??7777777777777....7");
  mvprintw(17, 9, "??????7....7777777777777");
  mvprintw(18, 11, "????.....77777777");
  mvprintw(19, 12, "???7..77777");
  mvprintw(20, 13, "??7777       MaxDice");
  mvprintw(22, 0, "Press 'Enter' to start, press 'q' to quit");
  refresh();
  do {
    key = getch();
  } while (key != '\n' && key != '\r' && key != 459 && key != 'q');
  erase();
  if (key == 'q')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<splash_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x16,%esi
lea    0xec4(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x1,%edi
mov    $0xe,%esi
lea    0xec2(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x2,%edi
mov    $0x6,%esi
lea    0xebf(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x3,%edi
mov    $0x4,%esi
lea    0xe68(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x4,%esi
lea    0xe74(%rip),%rdx
mov    %esi,%edi
call   1060 <mvprintw@plt>
mov    $0x5,%esi
lea    0xe7f(%rip),%rdx
mov    %esi,%edi
call   1060 <mvprintw@plt>
mov    $0x6,%edi
mov    $0x5,%esi
lea    0xe85(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x7,%edi
mov    $0x5,%esi
lea    0xe8d(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x8,%edi
mov    $0x5,%esi
lea    0xe95(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x9,%edi
mov    $0x5,%esi
lea    0xe9d(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0xa,%edi
mov    $0x5,%esi
lea    0xea5(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0xb,%edi
mov    $0x6,%esi
lea    0xeac(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0xc,%edi
mov    $0x6,%esi
lea    0xeb2(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0xd,%edi
mov    $0x6,%esi
lea    0xeb8(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0xe,%edi
mov    $0x6,%esi
lea    0xebe(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0xf,%edi
mov    $0x7,%esi
lea    0xec4(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x10,%edi
mov    $0x8,%esi
lea    0xec9(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x11,%edi
mov    $0x9,%esi
lea    0xecd(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x12,%edi
mov    $0xb,%esi
lea    0xed0(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x13,%edi
mov    $0xc,%esi
lea    0xecc(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x14,%edi
mov    $0xd,%esi
lea    0xec2(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x16,%edi
xor    %esi,%esi
lea    0xec4(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     136b <splash_screen+0x22b>
xor    %eax,%eax
cmpl   $0xd,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     136b <splash_screen+0x22b>
xor    %eax,%eax
cmpl   $0x1cb,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     136b <splash_screen+0x22b>
cmpl   $0x71,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1327 <splash_screen+0x1e7>
mov    $0x0,%al
call   1030 <erase@plt>
cmpl   $0x71,-0x8(%rbp)
jne    1393 <splash_screen+0x253>
movl   $0x1,-0x4(%rbp)
jmp    139a <splash_screen+0x25a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splash_screen>:
push   %rbx
lea    0xed2(%rip),%rdx
xor    %edi,%edi
mov    $0x16,%esi
call   1060 <mvprintw@plt>
lea    0xed3(%rip),%rdx
mov    $0x1,%edi
mov    $0xe,%esi
call   1060 <mvprintw@plt>
lea    0xed0(%rip),%rdx
mov    $0x2,%edi
mov    $0x6,%esi
call   1060 <mvprintw@plt>
lea    0xe79(%rip),%rdx
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <mvprintw@plt>
lea    0xe80(%rip),%rdx
mov    $0x4,%edi
mov    $0x4,%esi
call   1060 <mvprintw@plt>
lea    0xe88(%rip),%rdx
mov    $0x5,%edi
mov    $0x5,%esi
call   1060 <mvprintw@plt>
lea    0xe90(%rip),%rdx
mov    $0x6,%edi
mov    $0x5,%esi
call   1060 <mvprintw@plt>
lea    0xe98(%rip),%rdx
mov    $0x7,%edi
mov    $0x5,%esi
call   1060 <mvprintw@plt>
lea    0xea0(%rip),%rdx
mov    $0x8,%edi
mov    $0x5,%esi
call   1060 <mvprintw@plt>
lea    0xea8(%rip),%rdx
mov    $0x9,%edi
mov    $0x5,%esi
call   1060 <mvprintw@plt>
lea    0xeb0(%rip),%rdx
mov    $0xa,%edi
mov    $0x5,%esi
call   1060 <mvprintw@plt>
lea    0xeb7(%rip),%rdx
mov    $0xb,%edi
mov    $0x6,%esi
call   1060 <mvprintw@plt>
lea    0xebd(%rip),%rdx
mov    $0xc,%edi
mov    $0x6,%esi
call   1060 <mvprintw@plt>
lea    0xec3(%rip),%rdx
mov    $0xd,%edi
mov    $0x6,%esi
call   1060 <mvprintw@plt>
lea    0xec9(%rip),%rdx
mov    $0xe,%edi
mov    $0x6,%esi
call   1060 <mvprintw@plt>
lea    0xecf(%rip),%rdx
mov    $0xf,%edi
mov    $0x7,%esi
call   1060 <mvprintw@plt>
lea    0xed4(%rip),%rdx
mov    $0x10,%edi
mov    $0x8,%esi
call   1060 <mvprintw@plt>
lea    0xed8(%rip),%rdx
mov    $0x11,%edi
mov    $0x9,%esi
call   1060 <mvprintw@plt>
lea    0xedb(%rip),%rdx
mov    $0x12,%edi
mov    $0xb,%esi
call   1060 <mvprintw@plt>
lea    0xed7(%rip),%rdx
mov    $0x13,%edi
mov    $0xc,%esi
call   1060 <mvprintw@plt>
lea    0xecd(%rip),%rdx
mov    $0x14,%edi
mov    $0xd,%esi
call   1060 <mvprintw@plt>
lea    0xecc(%rip),%rdx
mov    $0x16,%edi
xor    %esi,%esi
call   1060 <mvprintw@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getch@plt>
mov    %eax,%ebx
cmp    $0x70,%eax
jg     1350 <splash_screen+0x210>
cmp    $0xa,%ebx
je     135d <splash_screen+0x21d>
cmp    $0xd,%ebx
jne    1330 <splash_screen+0x1f0>
jmp    135d <splash_screen+0x21d>
nopw   0x0(%rax,%rax,1)
cmp    $0x1cb,%ebx
je     135d <splash_screen+0x21d>
cmp    $0x71,%ebx
jne    1330 <splash_screen+0x1f0>
xor    %eax,%eax
call   1030 <erase@plt>
xor    %eax,%eax
cmp    $0x71,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"II\00"
@.str.1 = [13 x i8] c"IIIIIIIIIIII\00"
@.str.2 = [24 x i8] c"IIIIIIIIIIIIIIIIIIIIIII\00"
@.str.3 = [29 x i8] c"?IIIIIIIIIII7....IIIIIIIIIII\00"
@.str.4 = [30 x i8] c"??IIIIIIIIIII....IIIIIIIIIIII\00"
@.str.5 = [30 x i8] c"???IIIIIIIIIIIIIIIIIIIIIIIIII\00"
@.str.6 = [30 x i8] c"?????IIIIIIIIIIIIIII777777777\00"
@.str.7 = [30 x i8] c"?..????IIIIII7777777777.....7\00"
@.str.8 = [30 x i8] c"??.???????777777777777.....77\00"
@.str.9 = [30 x i8] c"??.???????77....777777....777\00"
@.str.10 = [29 x i8] c"??????????7.....777777777777\00"
@.str.11 = [28 x i8] c"?????????7.... 777777777777\00"
@.str.12 = [28 x i8] c"?????????77777777....777777\00"
@.str.13 = [28 x i8] c"?????????7777777.....777777\00"
@.str.14 = [28 x i8] c"????..???77777777...7777..7\00"
@.str.15 = [27 x i8] c"???...??7777777777777....7\00"
@.str.16 = [26 x i8] c"???..??7777777777777....7\00"
@.str.17 = [25 x i8] c"??????7....7777777777777\00"
@.str.18 = [18 x i8] c"????.....77777777\00"
@.str.19 = [12 x i8] c"???7..77777\00"
@.str.20 = [21 x i8] c"??7777 MaxDice\00"
@.str.21 = [42 x i8] c"Press 'Enter' to start, press 'q' to quit\00"
define i32 @splash_screen() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @mvprintw(i32 0, i32 22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @mvprintw(i32 1, i32 14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @mvprintw(i32 2, i32 6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @mvprintw(i32 3, i32 4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @mvprintw(i32 4, i32 4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @mvprintw(i32 5, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @mvprintw(i32 6, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @mvprintw(i32 7, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @mvprintw(i32 8, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @mvprintw(i32 9, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 @mvprintw(i32 10, i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 @mvprintw(i32 11, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @mvprintw(i32 12, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0))
%16 = call i32 @mvprintw(i32 13, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%17 = call i32 @mvprintw(i32 14, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%18 = call i32 @mvprintw(i32 15, i32 7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0))
%19 = call i32 @mvprintw(i32 16, i32 8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0))
%20 = call i32 @mvprintw(i32 17, i32 9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0))
%21 = call i32 @mvprintw(i32 18, i32 11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0))
%22 = call i32 @mvprintw(i32 19, i32 12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0))
%23 = call i32 @mvprintw(i32 20, i32 13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0))
%24 = call i32 @mvprintw(i32 22, i32 0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.21, i64 0, i64 0))
%25 = call i32 (...) @refresh()
br label %26
26: ; preds = %40, %0
%27 = call i32 (...) @getch()
store i32 %27, i32* %2
br label %28
28: ; preds = %26
%29 = load i32, i32* %2
%30 = icmp ne i32 %29, 10
br i1 %30, label %31, label %40
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp ne i32 %32, 13
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 459
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp ne i32 %38, 113
br label %40
40: ; preds = %37, %34, %31, %28
%41 = phi i1 [ false, %34 ], [ false, %31 ], [ false, %28 ], [ %39, %37 ]
br i1 %41, label %26, label %42
42: ; preds = %40
%43 = call i32 (...) @erase()
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 113
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 1, i32* %1
br label %48
47: ; preds = %42
store i32 0, i32* %1
br label %48
48: ; preds = %47, %46
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@.str = [3 x i8] c"II\00"
@.str.1 = [13 x i8] c"IIIIIIIIIIII\00"
@.str.2 = [24 x i8] c"IIIIIIIIIIIIIIIIIIIIIII\00"
@.str.3 = [29 x i8] c"?IIIIIIIIIII7....IIIIIIIIIII\00"
@.str.4 = [30 x i8] c"??IIIIIIIIIII....IIIIIIIIIIII\00"
@.str.5 = [30 x i8] c"???IIIIIIIIIIIIIIIIIIIIIIIIII\00"
@.str.6 = [30 x i8] c"?????IIIIIIIIIIIIIII777777777\00"
@.str.7 = [30 x i8] c"?..????IIIIII7777777777.....7\00"
@.str.8 = [30 x i8] c"??.???????777777777777.....77\00"
@.str.9 = [30 x i8] c"??.???????77....777777....777\00"
@.str.10 = [29 x i8] c"??????????7.....777777777777\00"
@.str.11 = [28 x i8] c"?????????7.... 777777777777\00"
@.str.12 = [28 x i8] c"?????????77777777....777777\00"
@.str.13 = [28 x i8] c"?????????7777777.....777777\00"
@.str.14 = [28 x i8] c"????..???77777777...7777..7\00"
@.str.15 = [27 x i8] c"???...??7777777777777....7\00"
@.str.16 = [26 x i8] c"???..??7777777777777....7\00"
@.str.17 = [25 x i8] c"??????7....7777777777777\00"
@.str.18 = [18 x i8] c"????.....77777777\00"
@.str.19 = [12 x i8] c"???7..77777\00"
@.str.20 = [21 x i8] c"??7777 MaxDice\00"
@.str.21 = [42 x i8] c"Press 'Enter' to start, press 'q' to quit\00"
define i32 @splash_screen() {
%1 = tail call i32 @mvprintw(i32 0, i32 22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @mvprintw(i32 1, i32 14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @mvprintw(i32 2, i32 6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @mvprintw(i32 3, i32 4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @mvprintw(i32 4, i32 4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @mvprintw(i32 5, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @mvprintw(i32 6, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 @mvprintw(i32 7, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @mvprintw(i32 8, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%10 = tail call i32 @mvprintw(i32 9, i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%11 = tail call i32 @mvprintw(i32 10, i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%12 = tail call i32 @mvprintw(i32 11, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 @mvprintw(i32 12, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0))
%14 = tail call i32 @mvprintw(i32 13, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%15 = tail call i32 @mvprintw(i32 14, i32 6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%16 = tail call i32 @mvprintw(i32 15, i32 7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0))
%17 = tail call i32 @mvprintw(i32 16, i32 8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0))
%18 = tail call i32 @mvprintw(i32 17, i32 9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0))
%19 = tail call i32 @mvprintw(i32 18, i32 11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0))
%20 = tail call i32 @mvprintw(i32 19, i32 12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0))
%21 = tail call i32 @mvprintw(i32 20, i32 13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0))
%22 = tail call i32 @mvprintw(i32 22, i32 0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.21, i64 0, i64 0))
%23 = tail call i32 (...) @refresh()
br label %24
24: ; preds = %24, %0
%25 = tail call i32 (...) @getch()
switch i32 %25, label %24 [
i32 459, label %26
i32 113, label %26
i32 13, label %26
i32 10, label %26
]
26: ; preds = %24, %24, %24, %24
%27 = tail call i32 (...) @erase()
%28 = icmp eq i32 %25, 113
%29 = zext i1 %28 to i32
ret i32 %29
}