#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*/ findmaxrect(int **, int *, int *, int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void main() {
  int a[5][5] = {{-1, 3, 4, 0, 2},
                 {3, 5, 7, -5, 2},
                 {-7 - 10, 3, 5, 1},
                 {9, -8, -7, 1, 6},
                 {3, 2, 4, 2, 0}};
  int startcol, endcol, startrow, endrow, maxsum;
  findmaxrect(a, &startcol, &endcol, &startrow, &endrow, &maxsum);
  printf("Max sum is %d and startcol = %d, endcol = %d, startrow = %d, endrow "
         "= %d",
         maxsum, startcol, endcol, startrow, endrow);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    -0x74(%rbp),%rsi
lea    -0x78(%rbp),%rdx
lea    -0x7c(%rbp),%rcx
lea    -0x80(%rbp),%r8
lea    -0x84(%rbp),%r9
call   1050 <findmaxrect@plt>
mov    -0x84(%rbp),%esi
mov    -0x74(%rbp),%edx
mov    -0x78(%rbp),%ecx
mov    -0x7c(%rbp),%r8d
mov    -0x80(%rbp),%r9d
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    0xf33(%rip),%eax
mov    %eax,0x80(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe89(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
call   1040 <findmaxrect@plt>
mov    0xc(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x [5 x i32]] [[5 x i32] [i32 -1, i32 3, i32 4, i32 0, i32 2], [5 x i32] [i32 3, i32 5, i32 7, i32 -5, i32 2], [5 x i32] [i32 -17, i32 3, i32 5, i32 1, i32 0], [5 x i32] [i32 9, i32 -8, i32 -7, i32 1, i32 6], [5 x i32] [i32 3, i32 2, i32 4, i32 2, i32 0]]
@.str = [73 x i8] c"Max sum is %d and startcol = %d, endcol = %d, startrow = %d, endrow = %d\00"
define void @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [5 x [5 x i32]]* %1 to i8*
%8 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%9 = bitcast [5 x i32]* %8 to i32**
%10 = call i32 @findmaxrect(i32** %9, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%11 = load i32, i32* %6
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@__const.main.a = [5 x [5 x i32]] [[5 x i32] [i32 -1, i32 3, i32 4, i32 0, i32 2], [5 x i32] [i32 3, i32 5, i32 7, i32 -5, i32 2], [5 x i32] [i32 -17, i32 3, i32 5, i32 1, i32 0], [5 x i32] [i32 9, i32 -8, i32 -7, i32 1, i32 6], [5 x i32] [i32 3, i32 2, i32 4, i32 2, i32 0]]
@.str = [73 x i8] c"Max sum is %d and startcol = %d, endcol = %d, startrow = %d, endrow = %d\00"
define void @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [5 x [5 x i32]]* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast [5 x [5 x i32]]* %1 to i32**
%14 = call i32 @findmaxrect(i32** %13, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%15 = load i32, i32* %6
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}