#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 */
scalar_t__ EOF;
int /*<<< orphan*/ imprimirMatriz(int **, int);
int /*<<< orphan*/ montarMatriz(int **, int);
scalar_t__ scanf(char *, int *);
int main(void) {
  int n, matriz[128][128];
  while (scanf("%d\n", &n) != EOF) {
    montarMatriz(matriz, n);
    imprimirMatriz(matriz, n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
je     1185 <main+0x55>
lea    -0x10010(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <montarMatriz@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <imprimirMatriz@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10018,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x2e92(%rip),%r12
cmp    (%r12),%rax
je     1199 <main+0x69>
lea    0x10(%rsp),%rbx
lea    0xe98(%rip),%r14
lea    0xc(%rsp),%r15
nopl   (%rax)
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1050 <montarMatriz@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <imprimirMatriz@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
cmp    (%r12),%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10018,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [128 x [128 x i32]]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = getelementptr inbounds [128 x [128 x i32]], [128 x [128 x i32]]* %3, i64 0, i64 0
%10 = bitcast [128 x i32]* %9 to i32**
%11 = load i32, i32* %2
%12 = call i32 @montarMatriz(i32** %10, i32 %11)
%13 = getelementptr inbounds [128 x [128 x i32]], [128 x [128 x i32]]* %3, i64 0, i64 0
%14 = bitcast [128 x i32]* %13 to i32**
%15 = load i32, i32* %2
%16 = call i32 @imprimirMatriz(i32** %14, i32 %15)
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x [128 x i32]]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [128 x [128 x i32]]* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %18, label %8
8: ; preds = %0
%9 = bitcast [128 x [128 x i32]]* %2 to i32**
br label %10
10: ; preds = %8, %10
%11 = load i32, i32* %1
%12 = call i32 @montarMatriz(i32** %9, i32 %11)
%13 = load i32, i32* %1
%14 = call i32 @imprimirMatriz(i32** %9, i32 %13)
%15 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %10
18: ; preds = %10, %0
ret i32 0
}