#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*/ ExitProgram(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdscr;
void CheckScreenSize() {
  int h, w;
  getmaxyx(stdscr, h, w);
  if ((h < 32) || (w < 29)) {
    endwin();
    fprintf(stderr, "\nSorry.\n");
    fprintf(stderr,
            "To edit levels for Pacman for Console, your console window\n");
    fprintf(stderr,
            "must be at least 32x29 Please resize your window/resolution\n");
    fprintf(stderr, "and re-run the program.\n\n");
    ExitProgram("");
  }
}


x86 assembly (clang, -O0):
<CheckScreenSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <getmaxyx@plt>
cmpl   $0x20,-0x4(%rbp)
jl     1170 <CheckScreenSize+0x30>
cmpl   $0x1d,-0x8(%rbp)
jge    11d7 <CheckScreenSize+0x97>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xe6d(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec9(%rip),%rdi
call   1050 <ExitProgram@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckScreenSize>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getmaxyx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@stderr = global i32 0
@.str = [9 x i8] c"\0ASorry.\0A\00"
@.str.1 = [60 x i8] c"To edit levels for Pacman for Console, your console window\0A\00"
@.str.2 = [61 x i8] c"must be at least 32x29 Please resize your window/resolution\0A\00"
@.str.3 = [26 x i8] c"and re-run the program.\0A\0A\00"
@.str.4 = [1 x i8] zeroinitializer
define void @CheckScreenSize() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @stdscr
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @getmaxyx(i32 %3, i32 %4, i32 %5)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 32
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 29
br i1 %11, label %12, label %23
12: ; preds = %9, %0
%13 = call i32 (...) @endwin()
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @ExitProgram(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@stderr = global i32 0
define void @CheckScreenSize() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getmaxyx(i32 %1, i32 undef, i32 undef)
ret void
}