#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*/ solve(int, int);
int main(int c, char **v) {
  int w, h;
  if (c < 2 || (w = atoi(v[1])) <= 0)
    w = 8;
  if (c < 3 || (h = atoi(v[2])) <= 0)
    h = w;
  solve(w, h);
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     1159 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jg     1160 <main+0x40>
movl   $0x8,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     1183 <main+0x63>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jg     1189 <main+0x69>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    $0x2,%edi
jl     1144 <main+0x24>
mov    0x8(%r14),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1144 <main+0x24>
cmp    $0x3,%ebp
jge    114e <main+0x2e>
jmp    115d <main+0x3d>
mov    $0x8,%ebx
cmp    $0x3,%ebp
jl     115d <main+0x3d>
mov    0x10(%r14),%rdi
call   1040 <atoi@plt>
mov    %eax,%esi
test   %eax,%eax
jg     115f <main+0x3f>
mov    %ebx,%esi
mov    %ebx,%edi
call   1030 <solve@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10, %2
store i32 8, i32* %6
br label %17
17: ; preds = %16, %10
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 3
br i1 %19, label %26, label %20
20: ; preds = %17
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %7
%25 = icmp sle i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %20, %17
%27 = load i32, i32* %6
store i32 %27, i32* %7
br label %28
28: ; preds = %26, %20
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = call i32 @solve(i32 %29, i32 %30)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %4, %2
br label %10
10: ; preds = %9, %4
%11 = phi i32 [ 8, %9 ], [ %7, %4 ]
%12 = icmp slt i32 %0, 3
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %13, %10
br label %19
19: ; preds = %18, %13
%20 = phi i32 [ %11, %18 ], [ %16, %13 ]
%21 = tail call i32 @solve(i32 %11, i32 %20)
ret i32 0
}