#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*/ TRUE;
int /*<<< orphan*/ abortGame();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ err(char *, int);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ init_colors();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *, ...);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int strlen(char *);
void init_screen() {
  err("<init_screen>", +1);
  int lines, columns;
  initscr();
  init_colors();
  keypad(stdscr, TRUE);
  noecho();
  curs_set(0);
  getmaxyx(stdscr, lines, columns);
  if (columns < 118 + 2 + 50 || lines < 36 + 2 + 6) {
    char *tooSmall =
        "Votre fenêtre est trop petite ! Elle doit faire au minimum :";
    mvprintw(lines / 2 - 1, (columns - strlen(tooSmall)) / 2, "%s", tooSmall);
    mvprintw(lines / 2 + 1, (columns - 8) / 2, "%i x %i", 118 + 2 + 50,
             36 + 2 + 6);
    getch();
    abortGame();
  }
  refresh();
  err("</init_screen>", -1);
}


x86 assembly (clang, -O0):
<init_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe31(%rip),%rdi
mov    $0x1,%esi
call   1070 <err@plt>
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   10c0 <init_colors@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1060 <getmaxyx@plt>
cmpl   $0xaa,-0x8(%rbp)
jl     1237 <init_screen+0x77>
cmpl   $0x2c,-0x4(%rbp)
jge    12cf <init_screen+0x10f>
lea    0xdd0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%rcx
lea    0xdcb(%rip),%rdx
mov    $0x0,%al
call   10e0 <mvprintw@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x1,%edi
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xda0(%rip),%rdx
mov    $0xaa,%ecx
mov    $0x2c,%r8d
mov    $0x0,%al
call   10e0 <mvprintw@plt>
mov    $0x0,%al
call   1090 <getch@plt>
mov    $0x0,%al
call   10a0 <abortGame@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
lea    0xd7a(%rip),%rdi
mov    $0xffffffff,%esi
call   1070 <err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_screen>:
push   %rbx
lea    0xe78(%rip),%rdi
mov    $0x1,%esi
call   1060 <err@plt>
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1090 <init_colors@plt>
mov    0x2e41(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
xor    %edi,%edi
call   10a0 <curs_set@plt>
mov    (%rbx),%edi
call   1050 <getmaxyx@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
lea    0xe34(%rip),%rdi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1060 <err@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"<init_screen>\00"
@stdscr = global i32 0
@TRUE = global i32 0
@.str.1 = [62 x i8] c"Votre fen\C3\AAtre est trop petite ! Elle doit faire au minimum :\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [8 x i8] c"%i x %i\00"
@.str.4 = [15 x i8] c"</init_screen>\00"
define void @init_screen() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = call i32 @err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 (...) @initscr()
%6 = call i32 (...) @init_colors()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @TRUE
%9 = call i32 @keypad(i32 %7, i32 %8)
%10 = call i32 (...) @noecho()
%11 = call i32 @curs_set(i32 0)
%12 = load i32, i32* @stdscr
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @getmaxyx(i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 170
br i1 %17, label %21, label %18
18: ; preds = %0
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 44
br i1 %20, label %21, label %41
21: ; preds = %18, %0
store i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8** %3
%22 = load i32, i32* %1
%23 = sdiv i32 %22, 2
%24 = sub nsw i32 %23, 1
%25 = load i32, i32* %2
%26 = load i8*, i8** %3
%27 = call i32 @strlen(i8* %26)
%28 = sub nsw i32 %25, %27
%29 = sdiv i32 %28, 2
%30 = load i8*, i8** %3
%31 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %24, i32 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %30)
%32 = load i32, i32* %1
%33 = sdiv i32 %32, 2
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 8
%37 = sdiv i32 %36, 2
%38 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %34, i32 %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 170, i32 44)
%39 = call i32 (...) @getch()
%40 = call i32 (...) @abortGame()
br label %41
41: ; preds = %21, %18
%42 = call i32 (...) @refresh()
%43 = call i32 @err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"<init_screen>\00"
@stdscr = global i32 0
@TRUE = global i32 0
@.str.4 = [15 x i8] c"</init_screen>\00"
define void @init_screen() {
%1 = tail call i32 @err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @initscr()
%3 = tail call i32 (...) @init_colors()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @noecho()
%8 = tail call i32 @curs_set(i32 0)
%9 = load i32, i32* @stdscr
%10 = tail call i32 @getmaxyx(i32 %9, i32 undef, i32 undef)
%11 = tail call i32 (...) @refresh()
%12 = tail call i32 @err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 -1)
ret void
}