#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*/ TRUE;
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ error_at_line(int, int /*<<< orphan*/, char *, int, char *,
                                 int, int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ restore_terminal();
int /*<<< orphan*/ scrollok(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
void initialize_terminal(void) {
  initscr();
  if (COLS < 80 || LINES < 25) {
    restore_terminal();
    error_at_line(-1, 0,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/PaulWWeaver/Whack-A-Mole/"
                  "refs/heads/master/wam.c",
                  506, "Minimum terminal size is 80x25 (Yours is %dx%d).", COLS,
                  LINES);
  }
  scrollok(stdscr, TRUE);
  curs_set(0);
}


x86 assembly (clang, -O0):
<initialize_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    0x2e6a(%rip),%rax
cmpl   $0x50,(%rax)
jl     117f <initialize_terminal+0x2f>
mov    0x2e72(%rip),%rax
cmpl   $0x19,(%rax)
jge    11bb <initialize_terminal+0x6b>
mov    $0x0,%al
call   1050 <restore_terminal@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%r9d
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
mov    $0xffffffff,%edi
xor    %esi,%esi
lea    0xe59(%rip),%rdx
mov    $0x1fa,%ecx
lea    0xed8(%rip),%r8
mov    %eax,(%rsp)
call   1030 <error_at_line@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
mov    0x2e0d(%rip),%rax
mov    (%rax),%esi
call   1060 <scrollok@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_terminal>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
mov    0x2e6e(%rip),%rbx
cmpl   $0x50,(%rbx)
mov    0x2e7c(%rip),%r14
jl     1174 <initialize_terminal+0x24>
cmpl   $0x18,(%r14)
jg     11a3 <initialize_terminal+0x53>
xor    %eax,%eax
call   1050 <restore_terminal@plt>
mov    (%rbx),%r9d
mov    (%r14),%eax
mov    %eax,(%rsp)
lea    0xe75(%rip),%rdx
lea    0xef9(%rip),%r8
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x1fa,%ecx
call   1030 <error_at_line@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
mov    0x2e25(%rip),%rax
mov    (%rax),%esi
call   1060 <scrollok@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <curs_set@plt>

LLVM IR (-O0):
@COLS = global i32 0
@LINES = global i32 0
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PaulWWeaver/Whack-A-Mole/refs/heads/master/wam.c\00"
@.str.1 = [49 x i8] c"Minimum terminal size is 80x25 (Yours is %dx%d).\00"
@stdscr = global i32 0
@TRUE = global i32 0
define void @initialize_terminal() {
%1 = call i32 (...) @initscr()
%2 = load i32, i32* @COLS
%3 = icmp slt i32 %2, 80
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load i32, i32* @LINES
%6 = icmp slt i32 %5, 25
br i1 %6, label %7, label %12
7: ; preds = %4, %0
%8 = call i32 (...) @restore_terminal()
%9 = load i32, i32* @COLS
%10 = load i32, i32* @LINES
%11 = call i32 @error_at_line(i32 -1, i32 0, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 506, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %7, %4
%13 = load i32, i32* @stdscr
%14 = load i32, i32* @TRUE
%15 = call i32 @scrollok(i32 %13, i32 %14)
%16 = call i32 @curs_set(i32 0)
ret void
}

LLVM IR (-O2):
@COLS = global i32 0
@LINES = global i32 0
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PaulWWeaver/Whack-A-Mole/refs/heads/master/wam.c\00"
@.str.1 = [49 x i8] c"Minimum terminal size is 80x25 (Yours is %dx%d).\00"
@stdscr = global i32 0
@TRUE = global i32 0
define void @initialize_terminal() {
%1 = tail call i32 (...) @initscr()
%2 = load i32, i32* @COLS
%3 = icmp slt i32 %2, 80
%4 = load i32, i32* @LINES
%5 = icmp slt i32 %4, 25
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = tail call i32 (...) @restore_terminal()
%9 = load i32, i32* @COLS
%10 = load i32, i32* @LINES
%11 = tail call i32 @error_at_line(i32 -1, i32 0, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 506, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %0, %7
%13 = load i32, i32* @stdscr
%14 = load i32, i32* @TRUE
%15 = tail call i32 @scrollok(i32 %13, i32 %14)
%16 = tail call i32 @curs_set(i32 0)
ret void
}