#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*/ findmax(int **);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int **input = (int **)malloc(15 * sizeof(int *));
  int i, j;
  for (i = 0; i < 15; i++) {
    input[i] = (int *)malloc(i * sizeof(int));
  }
  for (i = 0; i < 15; i++) {
    for (j = 0; j <= i; j++) {
      scanf("%d", &input[i][j]);
    }
    printf("\n");
  }
  findmax(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x78,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jge    119a <main+0x5a>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x24>
movl   $0x0,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jge    1209 <main+0xc9>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11ef <main+0xaf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe24(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b2 <main+0x72>
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a1 <main+0x61>
mov    -0x10(%rbp),%rdi
call   1050 <findmax@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x78,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
xor    %r15d,%r15d
xor    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%r14)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,0x10(%r14)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,0x18(%r14)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,0x20(%r14)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,0x28(%r14)
mov    $0x18,%edi
call   1040 <malloc@plt>
mov    %rax,0x30(%r14)
mov    $0x1c,%edi
call   1040 <malloc@plt>
mov    %rax,0x38(%r14)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,0x40(%r14)
mov    $0x24,%edi
call   1040 <malloc@plt>
mov    %rax,0x48(%r14)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,0x50(%r14)
mov    $0x2c,%edi
call   1040 <malloc@plt>
mov    %rax,0x58(%r14)
mov    $0x30,%edi
call   1040 <malloc@plt>
mov    %rax,0x60(%r14)
mov    $0x34,%edi
call   1040 <malloc@plt>
mov    %rax,0x68(%r14)
mov    $0x38,%edi
call   1040 <malloc@plt>
mov    %rax,0x70(%r14)
mov    $0x4,%r13d
lea    0xdcc(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%r15,8),%rsi
add    %rbx,%rsi
mov    %r12,%rdi
call   1060 <scanf@plt>
add    $0x4,%rbx
cmp    %rbx,%r13
jne    1250 <main+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0x4,%r13
cmp    $0xf,%r15
jne    1240 <main+0x100>
mov    %r14,%rdi
call   1050 <findmax@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i64 @malloc(i32 120)
%6 = inttoptr i64 %5 to i32**
store i32** %6, i32*** %2
store i32 0, i32* %3
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 15
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i32*
%17 = load i32**, i32*** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32*, i32** %17, i64 %19
store i32* %16, i32** %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %7
24: ; preds = %7
store i32 0, i32* %3
br label %25
25: ; preds = %48, %24
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 15
br i1 %27, label %28, label %51
28: ; preds = %25
store i32 0, i32* %4
br label %29
29: ; preds = %43, %28
%30 = load i32, i32* %4
%31 = load i32, i32* %3
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %46
33: ; preds = %29
%34 = load i32**, i32*** %2
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32*, i32** %34, i64 %36
%38 = load i32*, i32** %37
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %38, i64 %40
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %41)
br label %43
43: ; preds = %33
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %29
46: ; preds = %29
%47 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %48
48: ; preds = %46
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %25
51: ; preds = %25
%52 = load i32**, i32*** %2
%53 = call i32 @findmax(i32** %52)
ret i32 0
}

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