#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*/ loadGrid(int, int);
int my_getnbr(char *);
int main(int argc, char *argv[]) {
  int x;
  int y;
  x = (*(argv + 1) ? my_getnbr(*(argv + 1)) : 10);
  y = (*(argv + 2) ? my_getnbr(*(argv + 2)) : 15);
  loadGrid(x, y);
  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)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     115a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <my_getnbr@plt>
mov    %eax,-0x1c(%rbp)
jmp    1167 <main+0x47>
mov    $0xa,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <main+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     1191 <main+0x71>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <my_getnbr@plt>
mov    %eax,-0x20(%rbp)
jmp    119e <main+0x7e>
mov    $0xf,%eax
mov    %eax,-0x20(%rbp)
jmp    119e <main+0x7e>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <loadGrid@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1138 <main+0x18>
call   1030 <my_getnbr@plt>
mov    %eax,%ebp
jmp    113d <main+0x1d>
mov    $0xa,%ebp
mov    0x10(%rbx),%rdi
test   %rdi,%rdi
je     114f <main+0x2f>
call   1030 <my_getnbr@plt>
mov    %eax,%esi
jmp    1154 <main+0x34>
mov    $0xf,%esi
mov    %ebp,%edi
call   1040 <loadGrid@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @my_getnbr(i8* %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 10, %17 ]
store i32 %19, i32* %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %29
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @my_getnbr(i8* %27)
br label %30
29: ; preds = %18
br label %30
30: ; preds = %29, %24
%31 = phi i32 [ %28, %24 ], [ 15, %29 ]
store i32 %31, i32* %7
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = call i32 @loadGrid(i32 %32, i32 %33)
ret i32 0
}

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