#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*/ printf(char *, int);
int main() {
  int i, j;
  int data[5][5] = {{9, 0, 0, 0, 0},
                    {12, 15, 0, 0, 0},
                    {10, 6, 8, 0, 0},
                    {2, 18, 9, 5, 0},
                    {19, 7, 10, 4, 16}};
  for (i = 4; i > 0; i--)
    for (j = 0; j < i; j++)
      data[i - 1][j] +=
          data[i][j] > data[i][j + 1] ? data[i][j] : data[i][j + 1];
  printf("%d", data[0][0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1220 <main+0x100>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120d <main+0xed>
movslq -0x8(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x8(%rbp),%rdx
lea    -0x70(%rbp),%rcx
imul   $0x14,%rdx,%rdx
add    %rdx,%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    11c0 <main+0xa0>
movslq -0x8(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x74(%rbp)
jmp    11de <main+0xbe>
movslq -0x8(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%edx
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115f <main+0x3f>
jmp    1212 <main+0xf2>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x2e>
mov    -0x70(%rbp),%esi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3b,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.data = [5 x [5 x i32]] [[5 x i32] [i32 9, i32 0, i32 0, i32 0, i32 0], [5 x i32] [i32 12, i32 15, i32 0, i32 0, i32 0], [5 x i32] [i32 10, i32 6, i32 8, i32 0, i32 0], [5 x i32] [i32 2, i32 18, i32 9, i32 5, i32 0], [5 x i32] [i32 19, i32 7, i32 10, i32 4, i32 16]]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%5 = bitcast [5 x [5 x i32]]* %4 to i8*
store i32 4, i32* %2
br label %6
6: ; preds = %63, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %66
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %59, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %62
14: ; preds = %10
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 %16
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %24, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp sgt i32 %21, %29
br i1 %30, label %31, label %39
31: ; preds = %14
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 %33
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %34, i64 0, i64 %36
%38 = load i32, i32* %37
br label %48
39: ; preds = %14
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 %45
%47 = load i32, i32* %46
br label %48
48: ; preds = %39, %31
%49 = phi i32 [ %38, %31 ], [ %47, %39 ]
%50 = load i32, i32* %2
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 %52
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [5 x i32], [5 x i32]* %53, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = add nsw i32 %57, %49
store i32 %58, i32* %56
br label %59
59: ; preds = %48
%60 = load i32, i32* %3
%61 = add nsw i32 %60, 1
store i32 %61, i32* %3
br label %10
62: ; preds = %10
br label %63
63: ; preds = %62
%64 = load i32, i32* %2
%65 = add nsw i32 %64, -1
store i32 %65, i32* %2
br label %6
66: ; preds = %6
%67 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 0
%68 = getelementptr inbounds [5 x i32], [5 x i32]* %67, i64 0, i64 0
%69 = load i32, i32* %68
%70 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %69)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 59)
ret i32 0
}