#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 compute(int **, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int matrix[200][200] = {0};
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      scanf("%d", &matrix[i + 1][j]);
    }
  }
  printf("%d\n", compute(matrix, n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x27120,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x27110(%rbp),%rdi
xor    %esi,%esi
mov    $0x27100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x27114(%rbp)
mov    -0x27114(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120a <main+0xca>
movl   $0x0,-0x27118(%rbp)
mov    -0x27118(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f1 <main+0xb1>
mov    -0x27114(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x27110(%rbp),%rsi
imul   $0x320,%rax,%rax
add    %rax,%rsi
movslq -0x27118(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe28(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x27118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x27118(%rbp)
jmp    1198 <main+0x58>
jmp    11f6 <main+0xb6>
mov    -0x27114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x27114(%rbp)
jmp    117f <main+0x3f>
lea    -0x27110(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <compute@plt>
mov    %eax,%esi
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x27120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x27110,%rsp
lea    0xea9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rdi
mov    $0x27100,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11cf <main+0x8f>
lea    0x330(%rsp),%r15
xor    %r12d,%r12d
lea    0xe74(%rip),%r14
jmp    119f <main+0x5f>
xchg   %ax,%ax
movslq %esi,%rax
add    $0x320,%r15
cmp    %rax,%r12
jge    11cf <main+0x8f>
add    $0x1,%r12
test   %esi,%esi
jle    1190 <main+0x50>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rsi
add    $0x4,%r13
cmp    %rsi,%rbx
jl     11b0 <main+0x70>
jmp    1190 <main+0x50>
lea    0x10(%rsp),%rdi
call   1060 <compute@plt>
lea    0xe23(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x27110,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 [200 x [200 x i32]]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = bitcast [200 x [200 x i32]]* %3 to i8*
store i32 0, i32* %4
br label %8
8: ; preds = %30, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %33
12: ; preds = %8
store i32 0, i32* %5
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [200 x [200 x i32]], [200 x [200 x i32]]* %3, i64 0, i64 %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [200 x i32], [200 x i32]* %21, i64 0, i64 %23
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %17
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %13
29: ; preds = %13
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %8
33: ; preds = %8
%34 = getelementptr inbounds [200 x [200 x i32]], [200 x [200 x i32]]* %3, i64 0, i64 0
%35 = bitcast [200 x i32]* %34 to i32**
%36 = load i32, i32* %2
%37 = call i32 @compute(i32** %35, i32 %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %1
ret i32 %39
}

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