#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, k;
  int spaces;
  for (i = 0; i < height; i += 1) {
    spaces = (height - 1) - i;
    for (k = 0; k < spaces; k += 1) {
      printf(" ");
    }
    for (k = 0; k < i * 2 + 1; k += 1) {
      printf("*");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<PrintTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b6 <PrintTree+0xa6>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1167 <PrintTree+0x57>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <PrintTree+0x31>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    119c <PrintTree+0x8c>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116e <PrintTree+0x5e>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%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    1196 <PrintTree+0x86>
mov    %edi,%r14d
xor    %r12d,%r12d
mov    $0x1,%r15d
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r12d,%eax
not    %eax
add    %r14d,%eax
test   %eax,%eax
jle    1161 <PrintTree+0x51>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <PrintTree+0x40>
add    $0xffffffff,%ebx
mov    %r15d,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1170 <PrintTree+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0x2,%r15d
cmp    %r14d,%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
store i32 %0, i32* %2
store i32 0, i32* %3
br label %6
6: ; preds = %38, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %41
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %5
store i32 0, i32* %4
br label %15
15: ; preds = %21, %10
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %15
24: ; preds = %15
store i32 0, i32* %4
br label %25
25: ; preds = %33, %24
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = mul nsw i32 %27, 2
%29 = add nsw i32 %28, 1
%30 = icmp slt i32 %26, %29
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %25
36: ; preds = %25
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %6
41: ; preds = %6
ret void
}

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