#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 rows = 0;
  int index = 0;
  int counter = 0;
  int spaces = 0;
  int b = 0;
  scanf("%d", &rows);
  for (index = rows; index > 0; index--) {
    printf(" ");
  }
  printf("*\n");
  for (index = 0; index < 2 * rows - 2; index = index + 2) {
    spaces++;
    for (counter = 0; counter < rows - spaces; counter++) {
      printf(" ");
    }
    for (b = 0; b < index + 3; b++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    118c <main+0x6c>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <main+0x48>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    123a <main+0x11a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    11ee <main+0xce>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c3 <main+0xa3>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
cmp    %ecx,%eax
jge    1220 <main+0x100>
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f5 <main+0xd5>
lea    0xddf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    119f <main+0x7f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeba(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jle    1172 <main+0x42>
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1160 <main+0x30>
lea    0xe8a(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jl     1200 <main+0xd0>
xor    %ebx,%ebx
mov    $0x3,%r14d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    %ebx,%eax
jle    11c7 <main+0x97>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
sub    %ebx,%eax
cmp    %eax,%ebp
jl     11b0 <main+0x80>
mov    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11d0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x2,%r15d
mov    0x4(%rsp),%eax
lea    (%rax,%rax,1),%ecx
add    $0xfffffffe,%ecx
add    $0x2,%r14d
cmp    %ecx,%r15d
jl     11a0 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 = [3 x i8] c"*\0A\00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [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
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%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* %3
br label %9
9: ; preds = %14, %0
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %9
17: ; preds = %9
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %19
19: ; preds = %52, %17
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = mul nsw i32 2, %21
%23 = sub nsw i32 %22, 2
%24 = icmp slt i32 %20, %23
br i1 %24, label %25, label %55
25: ; preds = %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
store i32 0, i32* %4
br label %28
28: ; preds = %36, %25
%29 = load i32, i32* %4
%30 = load i32, i32* %2
%31 = load i32, i32* %5
%32 = sub nsw i32 %30, %31
%33 = icmp slt i32 %29, %32
br i1 %33, label %34, label %39
34: ; preds = %28
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %28
39: ; preds = %28
store i32 0, i32* %6
br label %40
40: ; preds = %47, %39
%41 = load i32, i32* %6
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 3
%44 = icmp slt i32 %41, %43
br i1 %44, label %45, label %50
45: ; preds = %40
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
br label %40
50: ; preds = %40
%51 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 2
store i32 %54, i32* %3
br label %19
55: ; preds = %19
ret i32 0
}

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