#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 */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addtoNode(struct node *, struct node *, struct node *);
struct node *createNode(int);
struct node *createTree() {
  struct node *top, *aux[15], *temp;
  int i, j;
  int row[15][15] = {{4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23},
                     {63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31},
                     {91, 71, 53, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48},
                     {70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57},
                     {53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14},
                     {41, 48, 72, 33, 47, 32, 37, 16, 94, 29},
                     {41, 41, 26, 56, 83, 40, 80, 70, 33},
                     {99, 65, 04, 28, 06, 16, 70, 92},
                     {88, 02, 77, 73, 07, 63, 67},
                     {19, 01, 23, 75, 03, 34},
                     {20, 04, 82, 47, 65},
                     {18, 35, 87, 10},
                     {17, 47, 82},
                     {95, 64},
                     {75}};
  for (i = 0; i < 15; i++) {
    for (j = 0; j < (15 - i); j++) {
      if (i == 0) {
        aux[j] = createNode(row[i][j]);
      } else {
        temp = createNode(row[i][j]);
        addtoNode(temp, aux[j], aux[j + 1]);
        aux[j] = temp;
      }
    }
  }
  top = temp;
  return top;
}


x86 assembly (clang, -O0):
<createTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
lea    -0x420(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x384,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x8c(%rbp)
cmpl   $0xf,-0x8c(%rbp)
jge    126a <createTree+0x13a>
movl   $0x0,-0x90(%rbp)
mov    -0x90(%rbp),%eax
mov    $0xf,%ecx
sub    -0x8c(%rbp),%ecx
cmp    %ecx,%eax
jge    1251 <createTree+0x121>
cmpl   $0x0,-0x8c(%rbp)
jne    11d2 <createTree+0xa2>
movslq -0x8c(%rbp),%rcx
lea    -0x420(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movslq -0x90(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <createNode@plt>
mov    %rax,%rcx
movslq -0x90(%rbp),%rax
mov    %rcx,-0x80(%rbp,%rax,8)
jmp    1238 <createTree+0x108>
movslq -0x8c(%rbp),%rcx
lea    -0x420(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movslq -0x90(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <createNode@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
movslq -0x90(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rsi
mov    -0x90(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,8),%rdx
call   1030 <addtoNode@plt>
mov    -0x88(%rbp),%rcx
movslq -0x90(%rbp),%rax
mov    %rcx,-0x80(%rbp,%rax,8)
jmp    123d <createTree+0x10d>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1174 <createTree+0x44>
jmp    1256 <createTree+0x126>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    115d <createTree+0x2d>
mov    -0x88(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createTree>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    $0xf,%r14d
xor    %r15d,%r15d
lea    0xec2(%rip),%r12
jmp    114e <createTree+0x2e>
add    $0x1,%r15
add    $0xffffffffffffffff,%r14
cmp    $0xf,%r15
je     11b0 <createTree+0x90>
xor    %ebx,%ebx
jmp    1193 <createTree+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
imul   $0x3c,%r15,%rax
add    %r12,%rax
mov    (%rax,%rbx,4),%edi
call   1040 <createNode@plt>
mov    %rax,%r13
lea    0x1(%rbx),%rbp
mov    (%rsp,%rbx,8),%rsi
mov    0x8(%rsp,%rbx,8),%rdx
mov    %rax,%rdi
call   1030 <addtoNode@plt>
mov    %r13,(%rsp,%rbx,8)
mov    %rbp,%rbx
cmp    %r14,%rbx
je     1140 <createTree+0x20>
test   %r15,%r15
jne    1160 <createTree+0x40>
mov    (%r12,%rbx,4),%edi
call   1040 <createNode@plt>
mov    %rax,(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    %r14,%rbx
jne    1193 <createTree+0x73>
jmp    1140 <createTree+0x20>
mov    %r13,%rax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@__const.createTree.row = <{ [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, i32, i32, i32, i32, i32, i32, [8 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, [14 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], [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 91, i32 71, i32 53, 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 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 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 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 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 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], <{ 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 }>, <{ 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, [10 x i32] }> <{ i32 20, i32 4, i32 82, i32 47, i32 65, [10 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, [12 x i32] }> <{ i32 17, i32 47, i32 82, [12 x i32] zeroinitializer }>, <{ i32, i32, [13 x i32] }> <{ i32 95, i32 64, [13 x i32] zeroinitializer }>, <{ i32, [14 x i32] }> <{ i32 75, [14 x i32] zeroinitializer }> }>
define %struct.node* @createTree() {
%1 = alloca %struct.node*
%2 = alloca [15 x %struct.node*]
%3 = alloca %struct.node*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [15 x [15 x i32]]
%7 = bitcast [15 x [15 x i32]]* %6 to i8*
store i32 0, i32* %4
br label %8
8: ; preds = %61, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 15
br i1 %10, label %11, label %64
11: ; preds = %8
store i32 0, i32* %5
br label %12
12: ; preds = %57, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = sub nsw i32 15, %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %60
17: ; preds = %12
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %32
20: ; preds = %17
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %6, i64 0, i64 %22
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [15 x i32], [15 x i32]* %23, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call %struct.node* @createNode(i32 %27)
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %2, i64 0, i64 %30
store %struct.node* %28, %struct.node** %31
br label %56
32: ; preds = %17
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* %6, i64 0, i64 %34
%36 = load i32, i32* %5
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [15 x i32], [15 x i32]* %35, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call %struct.node* @createNode(i32 %39)
store %struct.node* %40, %struct.node** %3
%41 = load %struct.node*, %struct.node** %3
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %2, i64 0, i64 %43
%45 = load %struct.node*, %struct.node** %44
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %2, i64 0, i64 %48
%50 = load %struct.node*, %struct.node** %49
%51 = call i32 @addtoNode(%struct.node* %41, %struct.node* %45, %struct.node* %50)
%52 = load %struct.node*, %struct.node** %3
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %2, i64 0, i64 %54
store %struct.node* %52, %struct.node** %55
br label %56
56: ; preds = %32, %20
br label %57
57: ; preds = %56
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
store i32 %59, i32* %5
br label %12
60: ; preds = %12
br label %61
61: ; preds = %60
%62 = load i32, i32* %4
%63 = add nsw i32 %62, 1
store i32 %63, i32* %4
br label %8
64: ; preds = %8
%65 = load %struct.node*, %struct.node** %3
store %struct.node* %65, %struct.node** %1
%66 = load %struct.node*, %struct.node** %1
ret %struct.node* %66
}

LLVM IR (-O2):
%struct.node = type { i32 }
@__const.createTree.row = <{ [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, i32, i32, i32, i32, i32, i32, [8 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, [14 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], [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 91, i32 71, i32 53, 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 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 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 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 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 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], <{ 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 }>, <{ 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, [10 x i32] }> <{ i32 20, i32 4, i32 82, i32 47, i32 65, [10 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, [12 x i32] }> <{ i32 17, i32 47, i32 82, [12 x i32] zeroinitializer }>, <{ i32, i32, [13 x i32] }> <{ i32 95, i32 64, [13 x i32] zeroinitializer }>, <{ i32, [14 x i32] }> <{ i32 75, [14 x i32] zeroinitializer }> }>
define %struct.node* @createTree() {
%1 = alloca [15 x %struct.node*]
%2 = bitcast [15 x %struct.node*]* %1 to i8*
br label %3
3: ; preds = %31, %0
%4 = phi i64 [ 0, %0 ], [ %32, %31 ]
%5 = phi i64 [ 15, %0 ], [ %33, %31 ]
%6 = phi %struct.node* [ undef, %0 ], [ %29, %31 ]
%7 = icmp eq i64 %4, 0
br label %8
8: ; preds = %3, %27
%9 = phi i64 [ 0, %3 ], [ %28, %27 ]
%10 = phi %struct.node* [ %6, %3 ], [ %29, %27 ]
br i1 %7, label %11, label %17
11: ; preds = %8
%12 = getelementptr inbounds <{ [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, i32, i32, i32, i32, i32, i32, [8 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, [14 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, i32, i32, i32, i32, i32, i32, [8 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, [14 x i32] }> }>* @__const.createTree.row, i64 0, i32 0, i64 %9
%13 = load i32, i32* %12
%14 = tail call %struct.node* @createNode(i32 %13)
%15 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %1, i64 0, i64 %9
store %struct.node* %14, %struct.node** %15
%16 = add nuw nsw i64 %9, 1
br label %27
17: ; preds = %8
%18 = getelementptr inbounds [15 x [15 x i32]], [15 x [15 x i32]]* bitcast (<{ [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, i32, i32, i32, i32, i32, i32, [8 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [9 x i32] }>, <{ i32, i32, i32, i32, i32, [10 x i32] }>, <{ i32, i32, i32, i32, [11 x i32] }>, <{ i32, i32, i32, [12 x i32] }>, <{ i32, i32, [13 x i32] }>, <{ i32, [14 x i32] }> }>* @__const.createTree.row to [15 x [15 x i32]]*), i64 0, i64 %4, i64 %9
%19 = load i32, i32* %18
%20 = tail call %struct.node* @createNode(i32 %19)
%21 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %1, i64 0, i64 %9
%22 = load %struct.node*, %struct.node** %21
%23 = add nuw nsw i64 %9, 1
%24 = getelementptr inbounds [15 x %struct.node*], [15 x %struct.node*]* %1, i64 0, i64 %23
%25 = load %struct.node*, %struct.node** %24
%26 = tail call i32 @addtoNode(%struct.node* %20, %struct.node* %22, %struct.node* %25)
store %struct.node* %20, %struct.node** %21
br label %27
27: ; preds = %11, %17
%28 = phi i64 [ %16, %11 ], [ %23, %17 ]
%29 = phi %struct.node* [ %10, %11 ], [ %20, %17 ]
%30 = icmp eq i64 %28, %5
br i1 %30, label %31, label %8
31: ; preds = %27
%32 = add nuw nsw i64 %4, 1
%33 = add nsw i64 %5, -1
%34 = icmp eq i64 %32, 15
br i1 %34, label %35, label %3
35: ; preds = %31
ret %struct.node* %29
}