#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*/ prettyprint(double);
int /*<<< orphan*/ printPoints();
int /*<<< orphan*/ printf(char *);
void printBigTriangleUp(double **data, int baseSize) {
  int i, j;
  int roundSize = 4;
  for (i = baseSize - 1; i >= baseSize - roundSize; i--) {
    for (j = 0; j < baseSize - i; j++) {
      prettyprint(data[i][j]);
    }
    printf("\n");
  }
  prettyprint(data[baseSize - (roundSize + 1)][0]);
  for (i = 0; i < roundSize - 1; i++) {
    printPoints();
  }
  prettyprint(data[baseSize - (roundSize + 1)][roundSize]);
  printf("\n");
  for (i = 0; i <= roundSize + 1; i++) {
    printPoints();
  }
  printf("\n");
  prettyprint(data[0][0]);
  prettyprint(data[0][1]);
  for (i = 0; i < roundSize - 1; i++) {
    printPoints();
  }
  prettyprint(data[0][baseSize - 2]);
  prettyprint(data[0][baseSize - 1]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printBigTriangleUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jl     11ba <printBigTriangleUp+0x8a>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    11a0 <printBigTriangleUp+0x70>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <prettyprint@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <printBigTriangleUp+0x37>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <printBigTriangleUp+0x1f>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm0
call   1040 <prettyprint@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1206 <printBigTriangleUp+0xd6>
mov    $0x0,%al
call   1050 <printPoints@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e0 <printBigTriangleUp+0xb0>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <prettyprint@plt>
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1263 <printBigTriangleUp+0x133>
mov    $0x0,%al
call   1050 <printPoints@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    123d <printBigTriangleUp+0x10d>
lea    0xd96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
call   1040 <prettyprint@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
call   1040 <prettyprint@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12bd <printBigTriangleUp+0x18d>
mov    $0x0,%al
call   1050 <printPoints@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1297 <printBigTriangleUp+0x167>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <prettyprint@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <prettyprint@plt>
lea    0xd08(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBigTriangleUp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
lea    -0x1(%rsi),%eax
movslq %eax,%rbp
movslq %esi,%r15
add    $0xfffffffc,%esi
movslq %esi,%r12
mov    $0x1,%ebx
mov    %rbp,%rax
mov    %rbp,(%rsp)
jmp    1179 <printBigTriangleUp+0x49>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbp),%rax
add    $0x1,%ebx
cmp    %r12,%rbp
mov    %rax,%rbp
jle    11ab <printBigTriangleUp+0x7b>
mov    %ebx,%ebx
cmp    %r15,%rbp
jge    1160 <printBigTriangleUp+0x30>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13,%rbp,8),%rax
movsd  (%rax,%r14,8),%xmm0
call   1040 <prettyprint@plt>
add    $0x1,%r14
cmp    %r14,%rbx
jne    1190 <printBigTriangleUp+0x60>
jmp    1160 <printBigTriangleUp+0x30>
mov    -0x28(%r13,%r15,8),%rax
movsd  (%rax),%xmm0
call   1040 <prettyprint@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
mov    -0x28(%r13,%r15,8),%rax
movsd  0x20(%rax),%xmm0
call   1040 <prettyprint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x0(%r13),%rax
movsd  (%rax),%xmm0
call   1040 <prettyprint@plt>
mov    0x0(%r13),%rax
movsd  0x8(%rax),%xmm0
call   1040 <prettyprint@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
xor    %eax,%eax
call   1050 <printPoints@plt>
mov    0x0(%r13),%rax
movsd  -0x10(%rax,%r15,8),%xmm0
call   1040 <prettyprint@plt>
mov    0x0(%r13),%rax
mov    (%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <prettyprint@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @printBigTriangleUp(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
store i32 4, i32* %7
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
br label %10
10: ; preds = %39, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = icmp sge i32 %11, %14
br i1 %15, label %16, label %42
16: ; preds = %10
store i32 0, i32* %6
br label %17
17: ; preds = %34, %16
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = icmp slt i32 %18, %21
br i1 %22, label %23, label %37
23: ; preds = %17
%24 = load double**, double*** %3
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double*, double** %24, i64 %26
%28 = load double*, double** %27
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = call i32 @prettyprint(double %32)
br label %34
34: ; preds = %23
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %17
37: ; preds = %17
%38 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %5
%41 = add nsw i32 %40, -1
store i32 %41, i32* %5
br label %10
42: ; preds = %10
%43 = load double**, double*** %3
%44 = load i32, i32* %4
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
%47 = sub nsw i32 %44, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double*, double** %43, i64 %48
%50 = load double*, double** %49
%51 = getelementptr inbounds double, double* %50, i64 0
%52 = load double, double* %51
%53 = call i32 @prettyprint(double %52)
store i32 0, i32* %5
br label %54
54: ; preds = %61, %42
%55 = load i32, i32* %5
%56 = load i32, i32* %7
%57 = sub nsw i32 %56, 1
%58 = icmp slt i32 %55, %57
br i1 %58, label %59, label %64
59: ; preds = %54
%60 = call i32 (...) @printPoints()
br label %61
61: ; preds = %59
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %54
64: ; preds = %54
%65 = load double**, double*** %3
%66 = load i32, i32* %4
%67 = load i32, i32* %7
%68 = add nsw i32 %67, 1
%69 = sub nsw i32 %66, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double*, double** %65, i64 %70
%72 = load double*, double** %71
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
%76 = load double, double* %75
%77 = call i32 @prettyprint(double %76)
%78 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %79
79: ; preds = %86, %64
%80 = load i32, i32* %5
%81 = load i32, i32* %7
%82 = add nsw i32 %81, 1
%83 = icmp sle i32 %80, %82
br i1 %83, label %84, label %89
84: ; preds = %79
%85 = call i32 (...) @printPoints()
br label %86
86: ; preds = %84
%87 = load i32, i32* %5
%88 = add nsw i32 %87, 1
store i32 %88, i32* %5
br label %79
89: ; preds = %79
%90 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%91 = load double**, double*** %3
%92 = getelementptr inbounds double*, double** %91, i64 0
%93 = load double*, double** %92
%94 = getelementptr inbounds double, double* %93, i64 0
%95 = load double, double* %94
%96 = call i32 @prettyprint(double %95)
%97 = load double**, double*** %3
%98 = getelementptr inbounds double*, double** %97, i64 0
%99 = load double*, double** %98
%100 = getelementptr inbounds double, double* %99, i64 1
%101 = load double, double* %100
%102 = call i32 @prettyprint(double %101)
store i32 0, i32* %5
br label %103
103: ; preds = %110, %89
%104 = load i32, i32* %5
%105 = load i32, i32* %7
%106 = sub nsw i32 %105, 1
%107 = icmp slt i32 %104, %106
br i1 %107, label %108, label %113
108: ; preds = %103
%109 = call i32 (...) @printPoints()
br label %110
110: ; preds = %108
%111 = load i32, i32* %5
%112 = add nsw i32 %111, 1
store i32 %112, i32* %5
br label %103
113: ; preds = %103
%114 = load double**, double*** %3
%115 = getelementptr inbounds double*, double** %114, i64 0
%116 = load double*, double** %115
%117 = load i32, i32* %4
%118 = sub nsw i32 %117, 2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %116, i64 %119
%121 = load double, double* %120
%122 = call i32 @prettyprint(double %121)
%123 = load double**, double*** %3
%124 = getelementptr inbounds double*, double** %123, i64 0
%125 = load double*, double** %124
%126 = load i32, i32* %4
%127 = sub nsw i32 %126, 1
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds double, double* %125, i64 %128
%130 = load double, double* %129
%131 = call i32 @prettyprint(double %130)
%132 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printBigTriangleUp(double** nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = add nsw i32 %1, -4
%5 = sext i32 %3 to i64
%6 = sext i32 %1 to i64
%7 = sext i32 %4 to i64
br label %8
8: ; preds = %2, %23
%9 = phi i64 [ %5, %2 ], [ %25, %23 ]
%10 = phi i32 [ 1, %2 ], [ %27, %23 ]
%11 = icmp slt i64 %9, %6
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = getelementptr inbounds double*, double** %0, i64 %9
%14 = zext i32 %10 to i64
br label %15
15: ; preds = %12, %15
%16 = phi i64 [ 0, %12 ], [ %21, %15 ]
%17 = load double*, double** %13
%18 = getelementptr inbounds double, double* %17, i64 %16
%19 = load double, double* %18
%20 = tail call i32 @prettyprint(double %19)
%21 = add nuw nsw i64 %16, 1
%22 = icmp eq i64 %21, %14
br i1 %22, label %23, label %15
23: ; preds = %15, %8
%24 = tail call i32 @putchar(i32 10)
%25 = add nsw i64 %9, -1
%26 = icmp sgt i64 %9, %7
%27 = add i32 %10, 1
br i1 %26, label %8, label %28
28: ; preds = %23
%29 = add nsw i32 %1, -5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double*, double** %0, i64 %30
%32 = load double*, double** %31
%33 = load double, double* %32
%34 = tail call i32 @prettyprint(double %33)
%35 = tail call i32 (...) @printPoints()
%36 = tail call i32 (...) @printPoints()
%37 = tail call i32 (...) @printPoints()
%38 = load double*, double** %31
%39 = getelementptr inbounds double, double* %38, i64 4
%40 = load double, double* %39
%41 = tail call i32 @prettyprint(double %40)
%42 = tail call i32 @putchar(i32 10)
%43 = tail call i32 (...) @printPoints()
%44 = tail call i32 (...) @printPoints()
%45 = tail call i32 (...) @printPoints()
%46 = tail call i32 (...) @printPoints()
%47 = tail call i32 (...) @printPoints()
%48 = tail call i32 (...) @printPoints()
%49 = tail call i32 @putchar(i32 10)
%50 = load double*, double** %0
%51 = load double, double* %50
%52 = tail call i32 @prettyprint(double %51)
%53 = load double*, double** %0
%54 = getelementptr inbounds double, double* %53, i64 1
%55 = load double, double* %54
%56 = tail call i32 @prettyprint(double %55)
%57 = tail call i32 (...) @printPoints()
%58 = tail call i32 (...) @printPoints()
%59 = tail call i32 (...) @printPoints()
%60 = load double*, double** %0
%61 = add nsw i32 %1, -2
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = tail call i32 @prettyprint(double %64)
%66 = load double*, double** %0
%67 = getelementptr inbounds double, double* %66, i64 %5
%68 = load double, double* %67
%69 = tail call i32 @prettyprint(double %68)
%70 = tail call i32 @putchar(i32 10)
ret void
}