#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    fprintf(stderr, "ERROR: Please provide %s with a size\n", argv[0]);
    return 1;
  } else if (atoi(argv[1]) <= 10240) {
    int size = atoi(argv[1]);
    srand(time(NULL));
    int i, j;
    for (i = 0; i < size; i++) {
      for (j = 0; j < size; j++) {
        int random = (rand() % 201) + (-100);
        fprintf(stdout, "%d ", random);
      }
      fprintf(stdout, "\n");
    }
  } else {
    fprintf(stderr, "ERROR: Size is too big\n");
  }
  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   $0x1,-0x8(%rbp)
jg     119a <main+0x4a>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1282 <main+0x132>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
cmp    $0x2800,%eax
jg     125f <main+0x10f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    125a <main+0x10a>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1235 <main+0xe5>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0xc9,%ecx
cltd
idiv   %ecx
add    $0xffffff9c,%edx
mov    %edx,-0x20(%rbp)
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%edx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ec <main+0x9c>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d9 <main+0x89>
jmp    1276 <main+0x126>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    127b <main+0x12b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     1185 <main+0x35>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe8d(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%r12d
jmp    1256 <main+0x106>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
cmp    $0x2800,%eax
jg     123c <main+0xec>
mov    %eax,%r15d
xor    %r12d,%r12d
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %r15d,%r15d
jle    1256 <main+0x106>
mov    0x2e1b(%rip),%rbp
lea    0xe62(%rip),%r14
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r15d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x28c1979,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
imul   $0xc9,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0xffffff9c,%edx
mov    0x0(%rbp),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xffffffff,%ebx
jne    11e0 <main+0x90>
mov    0x0(%rbp),%edi
xor    %r12d,%r12d
lea    0xdfa(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r13d
cmp    %r15d,%r13d
jne    11d0 <main+0x80>
jmp    1256 <main+0x106>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
xor    %r12d,%r12d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"ERROR: Please provide %s with a size\0A\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [24 x i8] c"ERROR: Size is too big\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 1, i32* %3
br label %62
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
%23 = icmp sle i32 %22, 10240
br i1 %23, label %24, label %57
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %6
%29 = call i32 @time(i32* null)
%30 = call i32 @srand(i32 %29)
store i32 0, i32* %7
br label %31
31: ; preds = %53, %24
%32 = load i32, i32* %7
%33 = load i32, i32* %6
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %56
35: ; preds = %31
store i32 0, i32* %8
br label %36
36: ; preds = %47, %35
%37 = load i32, i32* %8
%38 = load i32, i32* %6
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %50
40: ; preds = %36
%41 = call i32 (...) @rand()
%42 = srem i32 %41, 201
%43 = add nsw i32 %42, -100
store i32 %43, i32* %9
%44 = load i32, i32* @stdout
%45 = load i32, i32* %9
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %40
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %36
50: ; preds = %36
%51 = load i32, i32* @stdout
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %50
%54 = load i32, i32* %7
%55 = add nsw i32 %54, 1
store i32 %55, i32* %7
br label %31
56: ; preds = %31
br label %60
57: ; preds = %18
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %60
60: ; preds = %57, %56
br label %61
61: ; preds = %60
store i32 0, i32* %3
br label %62
62: ; preds = %61, %12
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"ERROR: Please provide %s with a size\0A\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [24 x i8] c"ERROR: Size is too big\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %36
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = icmp slt i32 %11, 10241
br i1 %12, label %13, label %33
13: ; preds = %8
%14 = tail call i32 @time(i32* null)
%15 = tail call i32 @srand(i32 %14)
%16 = icmp sgt i32 %11, 0
br i1 %16, label %17, label %36
17: ; preds = %13, %28
%18 = phi i32 [ %31, %28 ], [ 0, %13 ]
br label %19
19: ; preds = %17, %19
%20 = phi i32 [ %26, %19 ], [ 0, %17 ]
%21 = tail call i32 (...) @rand()
%22 = srem i32 %21, 201
%23 = add nsw i32 %22, -100
%24 = load i32, i32* @stdout
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%26 = add nuw nsw i32 %20, 1
%27 = icmp eq i32 %26, %11
br i1 %27, label %28, label %19
28: ; preds = %19
%29 = load i32, i32* @stdout
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = add nuw nsw i32 %18, 1
%32 = icmp eq i32 %31, %11
br i1 %32, label %36, label %17
33: ; preds = %8
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %28, %13, %33, %4
%37 = phi i32 [ 1, %4 ], [ 0, %33 ], [ 0, %13 ], [ 0, %28 ]
ret i32 %37
}