#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 N, range;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    range = i - 1;
    for (int j = 1; j <= (2 * N) - 1; j++) {
      if (j >= N - range && j <= N + range)
        printf("*");
      else if (j < N - range)
        printf(" ");
    }
    printf("\n");
  }
  return 0;
}


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,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11f8 <main+0xd8>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11de <main+0xbe>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jl     11a9 <main+0x89>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     11a9 <main+0x89>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <main+0xab>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    11c6 <main+0xa6>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <main+0xab>
jmp    11d0 <main+0xb0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x42>
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11bb <main+0x9b>
mov    $0x1,%r14d
jmp    116a <main+0x4a>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0xc(%rsp),%eax
cmp    %eax,%r14d
mov    %ecx,%r14d
jge    11bb <main+0x9b>
test   %eax,%eax
jle    1150 <main+0x30>
lea    -0x1(%r14),%ebp
mov    $0x1,%ebx
jmp    1193 <main+0x73>
nopl   0x0(%rax)
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
lea    (%rax,%rax,1),%ecx
cmp    %ecx,%ebx
jge    1150 <main+0x30>
mov    %eax,%ecx
sub    %ebp,%ecx
cmp    %ecx,%ebx
setge  %dl
add    %ebp,%eax
cmp    %eax,%ebx
setle  %al
and    %dl,%al
jne    11ab <main+0x8b>
cmp    %ecx,%ebx
jge    1185 <main+0x65>
mov    $0x2a,%edi
test   %al,%al
jne    1180 <main+0x60>
mov    $0x20,%edi
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
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* %4
br label %7
7: ; preds = %49, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %52
11: ; preds = %7
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %3
store i32 1, i32* %5
br label %14
14: ; preds = %44, %11
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = mul nsw i32 2, %16
%18 = sub nsw i32 %17, 1
%19 = icmp sle i32 %15, %18
br i1 %19, label %20, label %47
20: ; preds = %14
%21 = load i32, i32* %5
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
%25 = icmp sge i32 %21, %24
br i1 %25, label %26, label %34
26: ; preds = %20
%27 = load i32, i32* %5
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = add nsw i32 %28, %29
%31 = icmp sle i32 %27, %30
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
34: ; preds = %26, %20
%35 = load i32, i32* %5
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = sub nsw i32 %36, %37
%39 = icmp slt i32 %35, %38
br i1 %39, label %40, label %42
40: ; preds = %34
%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, %34
br label %43
43: ; preds = %42, %32
br label %44
44: ; preds = %43
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %14
47: ; preds = %14
%48 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %7
52: ; preds = %7
ret i32 0
}

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