#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*/ scanf(char *, ...);
int main() {
  int size, counter, counter2, array[size][size];
  do {
    scanf("%d", &size);
  } while (size >= 0 && size <= 999);
  for (counter = 0; counter < size; counter++) {
    for (counter2 = 0; counter2 < size; counter2++)
      scanf("%d\n", array[counter][counter2]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
lea    0xe9f(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x39(%rbp)
jl     1188 <main+0x78>
cmpl   $0x3e7,-0x8(%rbp)
setle  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    115a <main+0x4a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1206 <main+0xf6>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f3 <main+0xe3>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rdx
movslq -0xc(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ad <main+0x9d>
jmp    11f8 <main+0xe8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119a <main+0x8a>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%r14
lea    0xeda(%rip),%rbx
lea    0xc(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3e8,%eax
jb     1130 <main+0x20>
test   %eax,%eax
jle    119c <main+0x8c>
lea    0xeb0(%rip),%r12
xor    %r15d,%r15d
jmp    116c <main+0x5c>
nopl   0x0(%rax,%rax,1)
movslq %eax,%rcx
add    $0x1,%r15
cmp    %rcx,%r15
jge    119c <main+0x8c>
test   %eax,%eax
jle    1160 <main+0x50>
mov    (%rsp),%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1180 <main+0x70>
jmp    1160 <main+0x50>
mov    %r14,%rsp
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = mul nuw i64 %9, %11
%14 = alloca i32, i64 %13
store i64 %9, i64* %6
store i64 %11, i64* %7
br label %15
15: ; preds = %23, %0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %17
17: ; preds = %15
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 999
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
br i1 %24, label %15, label %25
25: ; preds = %23
store i32 0, i32* %3
br label %26
26: ; preds = %49, %25
%27 = load i32, i32* %3
%28 = load i32, i32* %2
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %52
30: ; preds = %26
store i32 0, i32* %4
br label %31
31: ; preds = %45, %30
%32 = load i32, i32* %4
%33 = load i32, i32* %2
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %48
35: ; preds = %31
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = mul nsw i64 %37, %11
%39 = getelementptr inbounds i32, i32* %14, i64 %38
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %35
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %31
48: ; preds = %31
br label %49
49: ; preds = %48
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
br label %26
52: ; preds = %26
store i32 0, i32* %1
%53 = load i8*, i8** %5
%54 = load i32, i32* %1
ret i32 %54
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [0 x i32]
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i8* @llvm.stacksave()
br label %5
5: ; preds = %5, %0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp ult i32 %7, 1000
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = icmp sgt i32 %7, 0
br i1 %10, label %11, label %31
11: ; preds = %9
%12 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 0
br label %13
13: ; preds = %11, %26
%14 = phi i32 [ %7, %11 ], [ %27, %26 ]
%15 = phi i64 [ 0, %11 ], [ %29, %26 ]
%16 = icmp sgt i32 %14, 0
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i32, i32* %12
br label %19
19: ; preds = %17, %19
%20 = phi i64 [ 0, %17 ], [ %22, %19 ]
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%22 = add nuw nsw i64 %20, 1
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %19, label %26
26: ; preds = %19, %13
%27 = phi i32 [ %14, %13 ], [ %23, %19 ]
%28 = sext i32 %27 to i64
%29 = add nuw nsw i64 %15, 1
%30 = icmp slt i64 %29, %28
br i1 %30, label %13, label %31
31: ; preds = %26, %9
ret i32 0
}