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


x86 assembly (clang, -O0):
<printTriangleUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     119c <printTriangleUp+0x7c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    1182 <printTriangleUp+0x62>
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    1149 <printTriangleUp+0x29>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <printTriangleUp+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTriangleUp>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    117a <printTriangleUp+0x5a>
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%r12d
add    $0x1,%r14d
mov    $0x1,%r13d
add    $0xffffffffffffffff,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%r12,8),%rax
movsd  (%rax,%rbx,8),%xmm0
call   1040 <prettyprint@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1150 <printTriangleUp+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    %r14,%r13
jne    1140 <printTriangleUp+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @printTriangleUp(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %35, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %38
12: ; preds = %9
store i32 0, i32* %6
br label %13
13: ; preds = %30, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = icmp slt i32 %14, %17
br i1 %18, label %19, label %33
19: ; preds = %13
%20 = load double**, double*** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
%24 = load double*, double** %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = call i32 @prettyprint(double %28)
br label %30
30: ; preds = %19
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %13
33: ; preds = %13
%34 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %35
35: ; preds = %33
%36 = load i32, i32* %5
%37 = add nsw i32 %36, -1
store i32 %37, i32* %5
br label %9
38: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @printTriangleUp(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %25
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %21, %4
%9 = phi i64 [ %5, %4 ], [ %11, %21 ]
%10 = phi i64 [ 1, %4 ], [ %23, %21 ]
%11 = add nsw i64 %9, -1
%12 = getelementptr inbounds double*, double** %0, i64 %11
br label %13
13: ; preds = %8, %13
%14 = phi i64 [ 0, %8 ], [ %19, %13 ]
%15 = load double*, double** %12
%16 = getelementptr inbounds double, double* %15, i64 %14
%17 = load double, double* %16
%18 = tail call i32 @prettyprint(double %17)
%19 = add nuw nsw i64 %14, 1
%20 = icmp eq i64 %19, %10
br i1 %20, label %21, label %13
21: ; preds = %13
%22 = tail call i32 @putchar(i32 10)
%23 = add nuw nsw i64 %10, 1
%24 = icmp eq i64 %23, %7
br i1 %24, label %25, label %8
25: ; preds = %21, %2
ret void
}