#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*/ printf(char *);
void printTree(int heightTree) {
  int space;
  int star = 1;
  int i, j;
  space = heightTree - 1;
  for (j = 1; j <= heightTree; j++) {
    for (i = space; i > 0; i--) {
      printf(" ");
    };
    for (i = 1; i <= star; i++) {
      printf("*");
    };
    printf("\n");
    space -= 1;
    star += 2;
  };
}


x86 assembly (clang, -O0):
<printTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11c1 <printTree+0xb1>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1168 <printTree+0x58>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <printTree+0x34>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1195 <printTree+0x85>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116f <printTree+0x5f>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <printTree+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTree>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    1189 <printTree+0x79>
mov    %edi,%r14d
mov    $0x1,%ebp
mov    %edi,%r15d
mov    $0x1,%r12d
nopl   (%rax)
cmp    $0x2,%r15d
jl     1152 <printTree+0x42>
mov    %r15d,%ebx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <printTree+0x30>
add    $0xffffffff,%r15d
mov    %ebp,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <printTree+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
add    $0x2,%ebp
cmp    %r14d,%r12d
mov    %eax,%r12d
jne    1130 <printTree+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printTree(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %25, label %3
3: ; preds = %1, %20
%4 = phi i32 [ %23, %20 ], [ 2, %1 ]
%5 = phi i32 [ %7, %20 ], [ %0, %1 ]
%6 = phi i32 [ %22, %20 ], [ 1, %1 ]
%7 = add nsw i32 %5, -1
%8 = icmp sgt i32 %5, 1
br i1 %8, label %9, label %14
9: ; preds = %3, %9
%10 = phi i32 [ %12, %9 ], [ %7, %3 ]
%11 = tail call i32 @putchar(i32 32)
%12 = add nsw i32 %10, -1
%13 = icmp ugt i32 %10, 1
br i1 %13, label %9, label %14
14: ; preds = %9, %3
br label %15
15: ; preds = %14, %15
%16 = phi i32 [ %18, %15 ], [ 1, %14 ]
%17 = tail call i32 @putchar(i32 42)
%18 = add nuw i32 %16, 1
%19 = icmp eq i32 %18, %4
br i1 %19, label %20, label %15
20: ; preds = %15
%21 = tail call i32 @putchar(i32 10)
%22 = add nuw i32 %6, 1
%23 = add i32 %4, 2
%24 = icmp eq i32 %6, %0
br i1 %24, label %25, label %3
25: ; preds = %20, %1
ret void
}