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


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

x86 assembly (clang, -O2):
<printTriangleDown>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1179 <printTriangleDown+0x59>
mov    %esi,%r15d
mov    %rdi,%r12
mov    %esi,%r14d
xor    %r13d,%r13d
mov    %esi,%ebx
jmp    1156 <printTriangleDown+0x36>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
add    $0xffffffff,%ebx
cmp    %r14,%r13
je     1179 <printTriangleDown+0x59>
mov    %ebx,%ebx
cmp    %r15d,%r13d
jge    1140 <printTriangleDown+0x20>
xor    %ebp,%ebp
nop
mov    (%r12,%r13,8),%rax
movsd  (%rax,%rbp,8),%xmm0
call   1040 <prettyprint@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1160 <printTriangleDown+0x40>
jmp    1140 <printTriangleDown+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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