#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 height;
  scanf("%d", &height);
  int counter1 = 1;
  int counter2 = 1;
  int counter3 = 0;
  while (height > 0) {
    while (counter2 <= height - 1) {
      printf(" ");
      counter2++;
    }
    counter2 = 1;
    while (counter3 != ((2 * counter1) - 1)) {
      printf("*");
      counter3++;
    }
    printf("\n");
    counter1++;
    counter3 = 0;
    height--;
  }
}


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>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11ed <main+0xcd>
jmp    1163 <main+0x43>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     118e <main+0x6e>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <main+0x43>
movl   $0x1,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11c3 <main+0xa3>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1195 <main+0x75>
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x34>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11ac <main+0x8c>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ebp
cmp    $0x2,%eax
jb     1180 <main+0x60>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1160 <main+0x40>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
add    $0x2,%ebx
cmp    $0x1,%ecx
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %31, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %37
10: ; preds = %7
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
%15 = icmp sle i32 %12, %14
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%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* %5
%23 = load i32, i32* %3
%24 = mul nsw i32 2, %23
%25 = sub nsw i32 %24, 1
%26 = icmp ne i32 %22, %25
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %21
31: ; preds = %21
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
store i32 0, i32* %5
%35 = load i32, i32* %2
%36 = add nsw i32 %35, -1
store i32 %36, i32* %2
br label %7
37: ; preds = %7
%38 = load i32, i32* %1
ret i32 %38
}

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 %30
6: ; preds = %0, %24
%7 = phi i32 [ %28, %24 ], [ %4, %0 ]
%8 = phi i32 [ %26, %24 ], [ 1, %0 ]
%9 = icmp ugt i32 %7, 1
br i1 %9, label %13, label %10
10: ; preds = %13, %6
%11 = shl nuw nsw i32 %8, 1
%12 = add nsw i32 %11, -1
br label %19
13: ; preds = %6, %13
%14 = phi i32 [ %16, %13 ], [ 1, %6 ]
%15 = call i32 @putchar(i32 32)
%16 = add nuw nsw i32 %14, 1
%17 = load i32, i32* %1
%18 = icmp slt i32 %16, %17
br i1 %18, label %13, label %10
19: ; preds = %10, %19
%20 = phi i32 [ 0, %10 ], [ %22, %19 ]
%21 = call i32 @putchar(i32 42)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, %12
br i1 %23, label %24, label %19
24: ; preds = %19
%25 = call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %8, 1
%27 = load i32, i32* %1
%28 = add nsw i32 %27, -1
store i32 %28, i32* %1
%29 = icmp sgt i32 %27, 1
br i1 %29, label %6, label %30
30: ; preds = %24, %0
ret i32 0
}