#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 Height) {
  int i, q;
  q = 0;
  while (q < Height) {
    i = 0;
    while (i < Height - q) {
      printf(" ");
      i++;
    }
    i = 0;
    do {
      printf("*");
      i++;
    } while (i < q * 2 + 1);
    printf("\n");
    q++;
  }
}


x86 assembly (clang, -O0):
<PrintTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11aa <PrintTree+0x9a>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1160 <PrintTree+0x50>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <PrintTree+0x25>
movl   $0x0,-0x8(%rbp)
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jl     1167 <PrintTree+0x57>
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <PrintTree+0x12>
add    $0x10,%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
xor    %ebp,%ebp
mov    $0x1,%r12d
mov    %edi,%r15d
nopw   0x0(%rax,%rax,1)
cmp    %r14d,%ebp
jge    114f <PrintTree+0x3f>
mov    %r15d,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <PrintTree+0x30>
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <PrintTree+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    $0xffffffff,%r15d
add    $0x2,%r12d
cmp    %r14d,%ebp
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
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %31, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %35
9: ; preds = %5
store i32 0, i32* %3
br label %10
10: ; preds = %16, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = icmp slt i32 %11, %14
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
store i32 0, i32* %3
br label %21
21: ; preds = %25, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %25
25: ; preds = %21
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = mul nsw i32 %27, 2
%29 = add nsw i32 %28, 1
%30 = icmp slt i32 %26, %29
br i1 %30, label %21, label %31
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %5
35: ; preds = %5
ret void
}

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