#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 *);
int main() {
  int h, i, k, z, j;
  scanf("%d", &h);
  z = h;
  for (i = 1, j = 1; h > 0; i++, j = j + 2, h--) {
    for (k = z - i; k > 0; k--) {
      printf(" ");
    }
    for (k = 0; k < j; k++) {
      printf("*");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11e3 <main+0xc3>
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    118a <main+0x6a>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <main+0x46>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11b7 <main+0x97>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1191 <main+0x71>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r14d
test   %r14d,%r14d
jle    11c4 <main+0xa4>
mov    $0x1,%r12d
mov    %r14d,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %ebx,%r14d
jle    1182 <main+0x62>
mov    %r15d,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1170 <main+0x50>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
add    $0x2,%r12d
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
add    $0xffffffff,%r15d
cmp    $0x1,%eax
jg     1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %29
6: ; preds = %0, %22
%7 = phi i32 [ %25, %22 ], [ 1, %0 ]
%8 = phi i32 [ %24, %22 ], [ 1, %0 ]
%9 = sub nsw i32 %4, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ %9, %6 ]
%13 = call i32 @putchar(i32 32)
%14 = add nsw i32 %12, -1
%15 = icmp ugt i32 %12, 1
br i1 %15, label %11, label %16
16: ; preds = %11, %6
br label %17
17: ; preds = %16, %17
%18 = phi i32 [ %20, %17 ], [ 0, %16 ]
%19 = call i32 @putchar(i32 42)
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, %7
br i1 %21, label %22, label %17
22: ; preds = %17
%23 = call i32 @putchar(i32 10)
%24 = add nuw nsw i32 %8, 1
%25 = add nuw nsw i32 %7, 2
%26 = load i32, i32* %1
%27 = add nsw i32 %26, -1
store i32 %27, i32* %1
%28 = icmp sgt i32 %26, 1
br i1 %28, label %6, label %29
29: ; preds = %22, %0
ret i32 0
}