#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int submatrix_max(int **, int);
int main() {
  int n = 0;
  int m[100 + 1][100 + 1] = {0};
  while (EOF != scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        scanf("%d", &m[i][j]);
    printf("%d\n", submatrix_max(m, n));
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9f80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x9f70(%rbp),%rdi
xor    %esi,%esi
mov    $0x9f64,%edx
call   1040 <memset@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x9f80(%rbp)
lea    0xe7c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rax,%rcx
mov    -0x9f80(%rbp),%rax
cmp    %rcx,%rax
je     1253 <main+0x113>
movl   $0x1,-0x9f74(%rbp)
mov    -0x9f74(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1231 <main+0xf1>
movl   $0x1,-0x9f78(%rbp)
mov    -0x9f78(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1218 <main+0xd8>
movslq -0x9f74(%rbp),%rax
lea    -0x9f70(%rbp),%rsi
imul   $0x194,%rax,%rax
add    %rax,%rsi
movslq -0x9f78(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe01(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x9f78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9f78(%rbp)
jmp    11c3 <main+0x83>
jmp    121d <main+0xdd>
mov    -0x9f74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9f74(%rbp)
jmp    11aa <main+0x6a>
lea    -0x9f70(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <submatrix_max@plt>
mov    %eax,%esi
lea    0xdba(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <main+0x2c>
mov    0x2d7e(%rip),%rax
mov    (%rax),%eax
add    $0x9f80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9f78,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x9f64,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%rbx
lea    0xe85(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmp    %rax,%rbx
jne    11a5 <main+0x65>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
add    $0x9f78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe54(%rip),%r13
lea    0xc(%rsp),%r12
jmp    11f2 <main+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x10(%rsp),%rdi
call   1060 <submatrix_max@plt>
lea    0xe32(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%rbx
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
cmp    %rax,%rbx
je     118a <main+0x4a>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11c0 <main+0x80>
mov    $0x1,%r14d
lea    0x1a8(%rsp),%rbp
jmp    1226 <main+0xe6>
nopw   0x0(%rax,%rax,1)
movslq %esi,%rax
lea    0x1(%r14),%rcx
add    $0x194,%rbp
cmp    %rax,%r14
mov    %rcx,%r14
jge    11c0 <main+0x80>
test   %esi,%esi
jle    1210 <main+0xd0>
mov    %rbp,%rbx
xor    %r15d,%r15d
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rsi
add    $0x1,%r15
add    $0x4,%rbx
cmp    %rsi,%r15
jl     1230 <main+0xf0>
jmp    1210 <main+0xd0>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [101 x [101 x i32]]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%6 = bitcast [101 x [101 x i32]]* %3 to i8*
br label %7
7: ; preds = %36, %0
%8 = load i64, i64* @EOF
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %42
11: ; preds = %7
store i32 1, i32* %4
br label %12
12: ; preds = %33, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %36
16: ; preds = %12
store i32 1, i32* %5
br label %17
17: ; preds = %29, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [101 x [101 x i32]], [101 x [101 x i32]]* %3, i64 0, i64 %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [101 x i32], [101 x i32]* %24, i64 0, i64 %26
%28 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
br label %29
29: ; preds = %21
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %17
32: ; preds = %17
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %12
36: ; preds = %12
%37 = getelementptr inbounds [101 x [101 x i32]], [101 x [101 x i32]]* %3, i64 0, i64 0
%38 = bitcast [101 x i32]* %37 to i32**
%39 = load i32, i32* %2
%40 = call i32 @submatrix_max(i32** %38, i32 %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %7
42: ; preds = %7
%43 = load i32, i32* @EXIT_SUCCESS
ret i32 %43
}

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