#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 *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int size, spaces, stars = 1;
  int i;
  printf("\nEnter the size of tree\n");
  scanf("%d", &size);
  spaces = size - 1;
  if (size == 0 || size == 1) {
    printf("cannot build a three");
  } else {
    while (spaces != -1) {
      for (i = 0; i < spaces; i++) {
        printf(" ");
      }
      for (i = 0; i < stars; i++) {
        printf("*");
      }
      printf("\n");
      stars = stars + 2;
      spaces = spaces - 1;
    }
    if (spaces == -1) {
      for (i = 0; i < size - 1; i++) {
        printf(" ");
      }
      printf("*");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116f <main+0x4f>
cmpl   $0x1,-0x8(%rbp)
jne    1180 <main+0x60>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1259 <main+0x139>
jmp    1185 <main+0x65>
cmpl   $0xffffffff,-0xc(%rbp)
je     120c <main+0xec>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bc <main+0x9c>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <main+0x76>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e9 <main+0xc9>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c3 <main+0xa3>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1185 <main+0x65>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1254 <main+0x134>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1248 <main+0x128>
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121d <main+0xfd>
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
jmp    1259 <main+0x139>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
lea    0xea5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%ebx
cmp    $0x2,%ebx
jae    117f <main+0x3f>
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
jmp    1212 <main+0xd2>
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x2,%ebx
jl     11b1 <main+0x71>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11a0 <main+0x60>
add    $0xffffffff,%ebx
mov    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x2,%r14d
test   %ebx,%ebx
jne    1190 <main+0x50>
cmpl   $0x2,0xc(%rsp)
jl     1208 <main+0xc8>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%ebx
jl     11f0 <main+0xb0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0AEnter the size of tree\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"cannot build a three\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12, %0
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %64
17: ; preds = %12
br label %18
18: ; preds = %41, %17
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %47
21: ; preds = %18
store i32 0, i32* %5
br label %22
22: ; preds = %28, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %22
31: ; preds = %22
store i32 0, i32* %5
br label %32
32: ; preds = %38, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %32
41: ; preds = %32
%42 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 2
store i32 %44, i32* %4
%45 = load i32, i32* %3
%46 = sub nsw i32 %45, 1
store i32 %46, i32* %3
br label %18
47: ; preds = %18
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %63
50: ; preds = %47
store i32 0, i32* %5
br label %51
51: ; preds = %58, %50
%52 = load i32, i32* %5
%53 = load i32, i32* %2
%54 = sub nsw i32 %53, 1
%55 = icmp slt i32 %52, %54
br i1 %55, label %56, label %61
56: ; preds = %51
%57 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %51
61: ; preds = %51
%62 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %63
63: ; preds = %61, %47
br label %64
64: ; preds = %63, %15
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"cannot build a three\00"
@str = [24 x i8] c"\0AEnter the size of tree\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %43
9: ; preds = %0, %30
%10 = phi i32 [ %13, %30 ], [ %5, %0 ]
%11 = phi i32 [ %14, %30 ], [ %5, %0 ]
%12 = phi i32 [ %32, %30 ], [ 1, %0 ]
%13 = add i32 %10, -1
%14 = add nsw i32 %11, -1
%15 = icmp sgt i32 %11, 1
br i1 %15, label %19, label %24
16: ; preds = %30
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 1
br i1 %18, label %34, label %41
19: ; preds = %9, %19
%20 = phi i32 [ %22, %19 ], [ 0, %9 ]
%21 = call i32 @putchar(i32 32)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, %13
br i1 %23, label %24, label %19
24: ; preds = %19, %9
br label %25
25: ; preds = %24, %25
%26 = phi i32 [ %28, %25 ], [ 0, %24 ]
%27 = call i32 @putchar(i32 42)
%28 = add nuw nsw i32 %26, 1
%29 = icmp eq i32 %28, %12
br i1 %29, label %30, label %25
30: ; preds = %25
%31 = call i32 @putchar(i32 10)
%32 = add nuw nsw i32 %12, 2
%33 = icmp eq i32 %14, 0
br i1 %33, label %16, label %9
34: ; preds = %16, %34
%35 = phi i32 [ %37, %34 ], [ 0, %16 ]
%36 = call i32 @putchar(i32 32)
%37 = add nuw nsw i32 %35, 1
%38 = load i32, i32* %1
%39 = add nsw i32 %38, -1
%40 = icmp slt i32 %37, %39
br i1 %40, label %34, label %41
41: ; preds = %34, %16
%42 = call i32 @putchar(i32 42)
br label %43
43: ; preds = %41, %7
ret i32 0
}