#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 atoi(char *);
int /*<<< orphan*/ game(int, int);
int /*<<< orphan*/ printf(char *);
int main(int c, char **v) {
  printf("\033[2J");
  int w = 0, h = 0;
  if (c > 1)
    w = atoi(v[1]);
  if (c > 2)
    h = atoi(v[2]);
  if (w <= 0)
    w = 30;
  if (h <= 0)
    h = 30;
  game(w, h);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    117a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1194 <main+0x64>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     11a5 <main+0x75>
movl   $0x1e,-0x14(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     11b6 <main+0x86>
movl   $0x1e,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <game@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmp    $0x2,%ebp
jl     116b <main+0x3b>
mov    0x8(%r14),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
xor    %eax,%eax
cmp    $0x2,%ebp
je     1167 <main+0x37>
mov    0x10(%r14),%rdi
call   1050 <atoi@plt>
test   %ebx,%ebx
jg     1170 <main+0x40>
mov    $0x1e,%ebx
test   %eax,%eax
mov    $0x1e,%esi
cmovg  %eax,%esi
mov    %ebx,%edi
call   1040 <game@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
store i32 0, i32* %7
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %7
br label %24
24: ; preds = %19, %16
%25 = load i32, i32* %6
%26 = icmp sle i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 30, i32* %6
br label %28
28: ; preds = %27, %24
%29 = load i32, i32* %7
%30 = icmp sle i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 30, i32* %7
br label %32
32: ; preds = %31, %28
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = call i32 @game(i32 %33, i32 %34)
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = icmp eq i32 %0, 2
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
br label %14
14: ; preds = %10, %5
%15 = phi i32 [ %13, %10 ], [ 0, %5 ]
%16 = icmp slt i32 %8, 1
br i1 %16, label %17, label %19
17: ; preds = %2, %14
%18 = phi i32 [ %15, %14 ], [ 0, %2 ]
br label %19
19: ; preds = %14, %17
%20 = phi i32 [ %18, %17 ], [ %15, %14 ]
%21 = phi i32 [ 30, %17 ], [ %8, %14 ]
%22 = icmp slt i32 %20, 1
%23 = select i1 %22, i32 30, i32 %20
%24 = tail call i32 @game(i32 %21, i32 %23)
ret i32 0
}