#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*/ assert(int);
int sum_brute_force(int **, int);
int main() {
  int test_data_1[100][100] = {{3}, {7, 4}, {2, 4, 6}, {8, 5, 9, 3}};
  int test_data_2[100][100] = {
      {75},
      {95, 64},
      {17, 47, 82},
      {18, 35, 87, 10},
      {20, 4, 82, 47, 65},
      {19, 1, 23, 75, 3, 34},
      {88, 2, 77, 73, 7, 63, 67},
      {99, 65, 4, 28, 6, 16, 70, 92},
      {41, 41, 26, 56, 83, 40, 80, 70, 33},
      {41, 48, 72, 33, 47, 32, 37, 16, 94, 29},
      {53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14},
      {70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57},
      {91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48},
      {63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31},
      {4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23},
  };
  assert(23 == sum_brute_force(test_data_1, 4));
  assert(1074 == sum_brute_force(test_data_2, 15));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13890,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9c50(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x9c40,%edx
call   1040 <memcpy@plt>
lea    -0x13890(%rbp),%rdi
lea    0xaad8(%rip),%rsi
mov    $0x9c40,%edx
call   1040 <memcpy@plt>
lea    -0x9c50(%rbp),%rdi
mov    $0x4,%esi
call   1050 <sum_brute_force@plt>
mov    %eax,%ecx
mov    $0x17,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x13890(%rbp),%rdi
mov    $0xf,%esi
call   1050 <sum_brute_force@plt>
mov    %eax,%ecx
mov    $0x432,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x13890,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x13888,%rsp
lea    0xebf(%rip),%rsi
lea    0x9c40(%rsp),%rbx
mov    $0x9c40,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0xaae3(%rip),%rsi
mov    %rsp,%r14
mov    $0x9c40,%edx
mov    %r14,%rdi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <sum_brute_force@plt>
xor    %edi,%edi
cmp    $0x17,%eax
sete   %dil
call   1030 <assert@plt>
mov    %r14,%rdi
mov    $0xf,%esi
call   1050 <sum_brute_force@plt>
xor    %edi,%edi
cmp    $0x432,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x13888,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.test_data_1 = <{ <{ i32, [99 x i32] }>, <{ i32, i32, [98 x i32] }>, <{ i32, i32, i32, [97 x i32] }>, <{ i32, i32, i32, i32, [96 x i32] }>, [96 x [100 x i32]] }> <{ <{ i32, [99 x i32] }> <{ i32 3, [99 x i32] zeroinitializer }>, <{ i32, i32, [98 x i32] }> <{ i32 7, i32 4, [98 x i32] zeroinitializer }>, <{ i32, i32, i32, [97 x i32] }> <{ i32 2, i32 4, i32 6, [97 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, [96 x i32] }> <{ i32 8, i32 5, i32 9, i32 3, [96 x i32] zeroinitializer }>, [96 x [100 x i32]] zeroinitializer }>
@__const.main.test_data_2 = <{ <{ i32, [99 x i32] }>, <{ i32, i32, [98 x i32] }>, <{ i32, i32, i32, [97 x i32] }>, <{ i32, i32, i32, i32, [96 x i32] }>, <{ i32, i32, i32, i32, i32, [95 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [94 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [93 x i32] }>, <{ [8 x i32], [92 x i32] }>, <{ [9 x i32], [91 x i32] }>, <{ [10 x i32], [90 x i32] }>, <{ [11 x i32], [89 x i32] }>, <{ [12 x i32], [88 x i32] }>, <{ [13 x i32], [87 x i32] }>, <{ [14 x i32], [86 x i32] }>, <{ [15 x i32], [85 x i32] }>, [85 x [100 x i32]] }> <{ <{ i32, [99 x i32] }> <{ i32 75, [99 x i32] zeroinitializer }>, <{ i32, i32, [98 x i32] }> <{ i32 95, i32 64, [98 x i32] zeroinitializer }>, <{ i32, i32, i32, [97 x i32] }> <{ i32 17, i32 47, i32 82, [97 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, [96 x i32] }> <{ i32 18, i32 35, i32 87, i32 10, [96 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, [95 x i32] }> <{ i32 20, i32 4, i32 82, i32 47, i32 65, [95 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, [94 x i32] }> <{ i32 19, i32 1, i32 23, i32 75, i32 3, i32 34, [94 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, i32, [93 x i32] }> <{ i32 88, i32 2, i32 77, i32 73, i32 7, i32 63, i32 67, [93 x i32] zeroinitializer }>, <{ [8 x i32], [92 x i32] }> <{ [8 x i32] [i32 99, i32 65, i32 4, i32 28, i32 6, i32 16, i32 70, i32 92], [92 x i32] zeroinitializer }>, <{ [9 x i32], [91 x i32] }> <{ [9 x i32] [i32 41, i32 41, i32 26, i32 56, i32 83, i32 40, i32 80, i32 70, i32 33], [91 x i32] zeroinitializer }>, <{ [10 x i32], [90 x i32] }> <{ [10 x i32] [i32 41, i32 48, i32 72, i32 33, i32 47, i32 32, i32 37, i32 16, i32 94, i32 29], [90 x i32] zeroinitializer }>, <{ [11 x i32], [89 x i32] }> <{ [11 x i32] [i32 53, i32 71, i32 44, i32 65, i32 25, i32 43, i32 91, i32 52, i32 97, i32 51, i32 14], [89 x i32] zeroinitializer }>, <{ [12 x i32], [88 x i32] }> <{ [12 x i32] [i32 70, i32 11, i32 33, i32 28, i32 77, i32 73, i32 17, i32 78, i32 39, i32 68, i32 17, i32 57], [88 x i32] zeroinitializer }>, <{ [13 x i32], [87 x i32] }> <{ [13 x i32] [i32 91, i32 71, i32 52, i32 38, i32 17, i32 14, i32 91, i32 43, i32 58, i32 50, i32 27, i32 29, i32 48], [87 x i32] zeroinitializer }>, <{ [14 x i32], [86 x i32] }> <{ [14 x i32] [i32 63, i32 66, i32 4, i32 68, i32 89, i32 53, i32 67, i32 30, i32 73, i32 16, i32 69, i32 87, i32 40, i32 31], [86 x i32] zeroinitializer }>, <{ [15 x i32], [85 x i32] }> <{ [15 x i32] [i32 4, i32 62, i32 98, i32 27, i32 23, i32 9, i32 70, i32 98, i32 73, i32 93, i32 38, i32 53, i32 60, i32 4, i32 23], [85 x i32] zeroinitializer }>, [85 x [100 x i32]] zeroinitializer }>
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x i32]]
%3 = alloca [100 x [100 x i32]]
store i32 0, i32* %1
%4 = bitcast [100 x [100 x i32]]* %2 to i8*
%5 = bitcast [100 x [100 x i32]]* %3 to i8*
%6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 0
%7 = bitcast [100 x i32]* %6 to i32**
%8 = call i32 @sum_brute_force(i32** %7, i32 4)
%9 = icmp eq i32 23, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%13 = bitcast [100 x i32]* %12 to i32**
%14 = call i32 @sum_brute_force(i32** %13, i32 15)
%15 = icmp eq i32 1074, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test_data_1 = <{ <{ i32, [99 x i32] }>, <{ i32, i32, [98 x i32] }>, <{ i32, i32, i32, [97 x i32] }>, <{ i32, i32, i32, i32, [96 x i32] }>, [96 x [100 x i32]] }> <{ <{ i32, [99 x i32] }> <{ i32 3, [99 x i32] zeroinitializer }>, <{ i32, i32, [98 x i32] }> <{ i32 7, i32 4, [98 x i32] zeroinitializer }>, <{ i32, i32, i32, [97 x i32] }> <{ i32 2, i32 4, i32 6, [97 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, [96 x i32] }> <{ i32 8, i32 5, i32 9, i32 3, [96 x i32] zeroinitializer }>, [96 x [100 x i32]] zeroinitializer }>
@__const.main.test_data_2 = <{ <{ i32, [99 x i32] }>, <{ i32, i32, [98 x i32] }>, <{ i32, i32, i32, [97 x i32] }>, <{ i32, i32, i32, i32, [96 x i32] }>, <{ i32, i32, i32, i32, i32, [95 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [94 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [93 x i32] }>, <{ [8 x i32], [92 x i32] }>, <{ [9 x i32], [91 x i32] }>, <{ [10 x i32], [90 x i32] }>, <{ [11 x i32], [89 x i32] }>, <{ [12 x i32], [88 x i32] }>, <{ [13 x i32], [87 x i32] }>, <{ [14 x i32], [86 x i32] }>, <{ [15 x i32], [85 x i32] }>, [85 x [100 x i32]] }> <{ <{ i32, [99 x i32] }> <{ i32 75, [99 x i32] zeroinitializer }>, <{ i32, i32, [98 x i32] }> <{ i32 95, i32 64, [98 x i32] zeroinitializer }>, <{ i32, i32, i32, [97 x i32] }> <{ i32 17, i32 47, i32 82, [97 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, [96 x i32] }> <{ i32 18, i32 35, i32 87, i32 10, [96 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, [95 x i32] }> <{ i32 20, i32 4, i32 82, i32 47, i32 65, [95 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, [94 x i32] }> <{ i32 19, i32 1, i32 23, i32 75, i32 3, i32 34, [94 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, i32, [93 x i32] }> <{ i32 88, i32 2, i32 77, i32 73, i32 7, i32 63, i32 67, [93 x i32] zeroinitializer }>, <{ [8 x i32], [92 x i32] }> <{ [8 x i32] [i32 99, i32 65, i32 4, i32 28, i32 6, i32 16, i32 70, i32 92], [92 x i32] zeroinitializer }>, <{ [9 x i32], [91 x i32] }> <{ [9 x i32] [i32 41, i32 41, i32 26, i32 56, i32 83, i32 40, i32 80, i32 70, i32 33], [91 x i32] zeroinitializer }>, <{ [10 x i32], [90 x i32] }> <{ [10 x i32] [i32 41, i32 48, i32 72, i32 33, i32 47, i32 32, i32 37, i32 16, i32 94, i32 29], [90 x i32] zeroinitializer }>, <{ [11 x i32], [89 x i32] }> <{ [11 x i32] [i32 53, i32 71, i32 44, i32 65, i32 25, i32 43, i32 91, i32 52, i32 97, i32 51, i32 14], [89 x i32] zeroinitializer }>, <{ [12 x i32], [88 x i32] }> <{ [12 x i32] [i32 70, i32 11, i32 33, i32 28, i32 77, i32 73, i32 17, i32 78, i32 39, i32 68, i32 17, i32 57], [88 x i32] zeroinitializer }>, <{ [13 x i32], [87 x i32] }> <{ [13 x i32] [i32 91, i32 71, i32 52, i32 38, i32 17, i32 14, i32 91, i32 43, i32 58, i32 50, i32 27, i32 29, i32 48], [87 x i32] zeroinitializer }>, <{ [14 x i32], [86 x i32] }> <{ [14 x i32] [i32 63, i32 66, i32 4, i32 68, i32 89, i32 53, i32 67, i32 30, i32 73, i32 16, i32 69, i32 87, i32 40, i32 31], [86 x i32] zeroinitializer }>, <{ [15 x i32], [85 x i32] }> <{ [15 x i32] [i32 4, i32 62, i32 98, i32 27, i32 23, i32 9, i32 70, i32 98, i32 73, i32 93, i32 38, i32 53, i32 60, i32 4, i32 23], [85 x i32] zeroinitializer }>, [85 x [100 x i32]] zeroinitializer }>
define i32 @main() {
%1 = alloca [100 x [100 x i32]]
%2 = alloca [100 x [100 x i32]]
%3 = bitcast [100 x [100 x i32]]* %1 to i8*
%4 = bitcast [100 x [100 x i32]]* %2 to i8*
%5 = bitcast [100 x [100 x i32]]* %1 to i32**
%6 = call i32 @sum_brute_force(i32** %5, i32 4)
%7 = icmp eq i32 %6, 23
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = bitcast [100 x [100 x i32]]* %2 to i32**
%11 = call i32 @sum_brute_force(i32** %10, i32 15)
%12 = icmp eq i32 %11, 1074
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}