#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 Christmas_Tree(int frows) {
  int count1, count2;
  for (count1 = 1; count1 <= frows; count1++) {
    for (count2 = frows; count2 >= count1; count2--) {
      printf(" ");
    }
    for (count2 = 1; count2 <= count1; count2++) {
      printf("*");
    }
    for (count2 = 1; count2 < count1; count2++) {
      printf("*");
    }
    printf("\n");
  }
  return;
}


x86 assembly (clang, -O0):
<Christmas_Tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11ce <Christmas_Tree+0xbe>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     115a <Christmas_Tree+0x4a>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <Christmas_Tree+0x24>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1187 <Christmas_Tree+0x77>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <Christmas_Tree+0x51>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b4 <Christmas_Tree+0xa4>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118e <Christmas_Tree+0x7e>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <Christmas_Tree+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Christmas_Tree>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    11b1 <Christmas_Tree+0xa1>
mov    %edi,%r14d
add    $0x1,%r14d
mov    $0x1,%ebp
mov    $0x2,%r15d
xor    %r12d,%r12d
jmp    115d <Christmas_Tree+0x4d>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
lea    0x1(%r15),%eax
add    $0x1,%r12d
cmp    %r14d,%r15d
mov    %eax,%r15d
je     11b1 <Christmas_Tree+0xa1>
mov    %r14d,%ebx
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    %ebp,%ebx
jg     1160 <Christmas_Tree+0x50>
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1180 <Christmas_Tree+0x70>
mov    %r12d,%ebx
cmp    $0x2,%ebp
jb     1140 <Christmas_Tree+0x30>
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11a0 <Christmas_Tree+0x90>
jmp    1140 <Christmas_Tree+0x30>
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 @Christmas_Tree(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %42, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %45
9: ; preds = %5
%10 = load i32, i32* %2
store i32 %10, i32* %4
br label %11
11: ; preds = %17, %9
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %11
20: ; preds = %11
store i32 1, i32* %4
br label %21
21: ; preds = %27, %20
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %21
30: ; preds = %21
store i32 1, i32* %4
br label %31
31: ; preds = %37, %30
%32 = load i32, i32* %4
%33 = load i32, i32* %3
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %40
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %31
40: ; preds = %31
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %5
45: ; preds = %5
ret void
}

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