#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__ MAX(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int tri[][15] = {
      {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},
  };
  int nrows = 15;
  int i, j;
  for (i = 1; i < nrows; i++)
    for (j = 0; j < nrows - i; j++)
      tri[nrows - i - 1][j] += MAX(tri[nrows - i][j], tri[nrows - i][j + 1]);
  printf("%d\n", tri[0][0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x3a0(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x384,%edx
call   1050 <memcpy@plt>
movl   $0xf,-0x3a4(%rbp)
movl   $0x1,-0x3a8(%rbp)
mov    -0x3a8(%rbp),%eax
cmp    -0x3a4(%rbp),%eax
jge    1264 <main+0x134>
movl   $0x0,-0x3ac(%rbp)
mov    -0x3ac(%rbp),%eax
mov    -0x3a4(%rbp),%ecx
sub    -0x3a8(%rbp),%ecx
cmp    %ecx,%eax
jge    124b <main+0x11b>
mov    -0x3a4(%rbp),%eax
sub    -0x3a8(%rbp),%eax
movslq %eax,%rcx
lea    -0x3a0(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movslq -0x3ac(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x3a4(%rbp),%eax
sub    -0x3a8(%rbp),%eax
movslq %eax,%rcx
lea    -0x3a0(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
mov    -0x3ac(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <MAX@plt>
mov    %rax,%rsi
mov    -0x3a4(%rbp),%eax
sub    -0x3a8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x3a0(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movslq -0x3ac(%rbp),%rcx
movslq (%rax,%rcx,4),%rdx
add    %rsi,%rdx
mov    %edx,(%rax,%rcx,4)
mov    -0x3ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3ac(%rbp)
jmp    1191 <main+0x61>
jmp    1250 <main+0x120>
mov    -0x3a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3a8(%rbp)
jmp    1175 <main+0x45>
mov    -0x3a0(%rbp),%esi
lea    0x1113(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x388,%rsp
lea    0xeb8(%rip),%rsi
mov    %rsp,%rdi
mov    $0x384,%edx
call   1050 <memcpy@plt>
lea    0x30c(%rsp),%r14
mov    $0xe,%r15d
mov    $0x1,%r12d
nopl   0x0(%rax)
mov    $0xf,%eax
sub    %r12,%rax
imul   $0x3c,%rax,%rax
mov    (%rsp,%rax,1),%edi
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r13
mov    0x40(%r14,%rbx,4),%ebp
mov    %ebp,%esi
call   1030 <MAX@plt>
add    %eax,(%r14,%rbx,4)
mov    %ebp,%edi
mov    %r13,%rbx
cmp    %r13,%r15
jne    1190 <main+0x60>
add    $0x1,%r12
add    $0xffffffffffffffff,%r15
add    $0xffffffffffffffc4,%r14
cmp    $0xf,%r12
jne    1170 <main+0x40>
mov    (%rsp),%esi
lea    0x11ba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x388,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.tri = <{ <{ i32, [14 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [8 x i32] }>, [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32] }> <{ <{ i32, [14 x i32] }> <{ i32 75, [14 x i32] zeroinitializer }>, <{ i32, i32, [13 x i32] }> <{ i32 95, i32 64, [13 x i32] zeroinitializer }>, <{ i32, i32, i32, [12 x i32] }> <{ i32 17, i32 47, i32 82, [12 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, [11 x i32] }> <{ i32 18, i32 35, i32 87, i32 10, [11 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, [10 x i32] }> <{ i32 20, i32 4, i32 82, i32 47, i32 65, [10 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }> <{ i32 19, i32 1, i32 23, i32 75, i32 3, i32 34, [9 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, i32, [8 x i32] }> <{ i32 88, i32 2, i32 77, i32 73, i32 7, i32 63, i32 67, [8 x i32] zeroinitializer }>, [15 x i32] [i32 99, i32 65, i32 4, i32 28, i32 6, i32 16, i32 70, i32 92, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [15 x i32] [i32 41, i32 41, i32 26, i32 56, i32 83, i32 40, i32 80, i32 70, i32 33, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [15 x i32] [i32 41, i32 48, i32 72, i32 33, i32 47, i32 32, i32 37, i32 16, i32 94, i32 29, i32 0, i32 0, i32 0, i32 0, i32 0], [15 x i32] [i32 53, i32 71, i32 44, i32 65, i32 25, i32 43, i32 91, i32 52, i32 97, i32 51, i32 14, i32 0, i32 0, i32 0, i32 0], [15 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, i32 0, i32 0, i32 0], [15 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, i32 0, i32 0], [15 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, i32 0], [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] }>
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [15 x [15 x i32]]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [15 x [15 x i32]]* %6 to i8*
store i32 15, i32* %7
store i32 1, i32* %8
br label %11
11: ; preds = %60, %2
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %63
15: ; preds = %11
store i32 0, i32* %9
br label %16
16: ; preds = %56, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = sub nsw i32 %18, %19
%21 = icmp slt i32 %17, %20
br i1 %21, label %22, label %59
22: ; preds = %16
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = sub nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %6, i64 0, i64 %26
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [15 x i32], [15 x i32]* %27, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = sub nsw i32 %32, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %6, i64 0, i64 %35
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [15 x i32], [15 x i32]* %36, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = call i64 @MAX(i32 %31, i32 %41)
%43 = load i32, i32* %7
%44 = load i32, i32* %8
%45 = sub nsw i32 %43, %44
%46 = sub nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %6, i64 0, i64 %47
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [15 x i32], [15 x i32]* %48, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = sext i32 %52 to i64
%54 = add nsw i64 %53, %42
%55 = trunc i64 %54 to i32
store i32 %55, i32* %51
br label %56
56: ; preds = %22
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
br label %16
59: ; preds = %16
br label %60
60: ; preds = %59
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %11
63: ; preds = %11
%64 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %6, i64 0, i64 0
%65 = getelementptr inbounds [15 x i32], [15 x i32]* %64, i64 0, i64 0
%66 = load i32, i32* %65
%67 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %66)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tri = <{ <{ i32, [14 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [8 x i32] }>, [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32], [15 x i32] }> <{ <{ i32, [14 x i32] }> <{ i32 75, [14 x i32] zeroinitializer }>, <{ i32, i32, [13 x i32] }> <{ i32 95, i32 64, [13 x i32] zeroinitializer }>, <{ i32, i32, i32, [12 x i32] }> <{ i32 17, i32 47, i32 82, [12 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, [11 x i32] }> <{ i32 18, i32 35, i32 87, i32 10, [11 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, [10 x i32] }> <{ i32 20, i32 4, i32 82, i32 47, i32 65, [10 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }> <{ i32 19, i32 1, i32 23, i32 75, i32 3, i32 34, [9 x i32] zeroinitializer }>, <{ i32, i32, i32, i32, i32, i32, i32, [8 x i32] }> <{ i32 88, i32 2, i32 77, i32 73, i32 7, i32 63, i32 67, [8 x i32] zeroinitializer }>, [15 x i32] [i32 99, i32 65, i32 4, i32 28, i32 6, i32 16, i32 70, i32 92, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [15 x i32] [i32 41, i32 41, i32 26, i32 56, i32 83, i32 40, i32 80, i32 70, i32 33, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [15 x i32] [i32 41, i32 48, i32 72, i32 33, i32 47, i32 32, i32 37, i32 16, i32 94, i32 29, i32 0, i32 0, i32 0, i32 0, i32 0], [15 x i32] [i32 53, i32 71, i32 44, i32 65, i32 25, i32 43, i32 91, i32 52, i32 97, i32 51, i32 14, i32 0, i32 0, i32 0, i32 0], [15 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, i32 0, i32 0, i32 0], [15 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, i32 0, i32 0], [15 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, i32 0], [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] }>
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [15 x [15 x i32]]
%4 = bitcast [15 x [15 x i32]]* %3 to i8*
br label %5
5: ; preds = %24, %2
%6 = phi i64 [ 1, %2 ], [ %25, %24 ]
%7 = phi i64 [ 14, %2 ], [ %26, %24 ]
%8 = sub nuw nsw i64 15, %6
%9 = sub nuw nsw i64 14, %6
%10 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %3, i64 0, i64 %8, i64 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %5, %12
%13 = phi i32 [ %11, %5 ], [ %17, %12 ]
%14 = phi i64 [ 0, %5 ], [ %15, %12 ]
%15 = add nuw nsw i64 %14, 1
%16 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %3, i64 0, i64 %8, i64 %15
%17 = load i32, i32* %16
%18 = tail call i64 @MAX(i32 %13, i32 %17)
%19 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %3, i64 0, i64 %9, i64 %14
%20 = load i32, i32* %19
%21 = trunc i64 %18 to i32
%22 = add i32 %20, %21
store i32 %22, i32* %19
%23 = icmp eq i64 %15, %7
br i1 %23, label %24, label %12
24: ; preds = %12
%25 = add nuw nsw i64 %6, 1
%26 = add nsw i64 %7, -1
%27 = icmp eq i64 %25, 15
br i1 %27, label %28, label %5
28: ; preds = %24
%29 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %3, i64 0, i64 0, i64 0
%30 = load i32, i32* %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
ret i32 0
}