#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 abs(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N, blank, star;
  scanf("%d", &N);
  for (int i = 1; i < 2 * N; i++) {
    blank = abs(N - i);
    star = N - blank;
    for (int j = 0; j < blank; j++)
      printf(" ");
    for (int k = 0; k < star; k++)
      printf("*");
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11f2 <main+0xc2>
mov    -0x8(%rbp),%edi
sub    -0x14(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ab <main+0x7b>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1185 <main+0x55>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d8 <main+0xa8>
lea    0xe40(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b2 <main+0x82>
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%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),%ebp
test   %ebp,%ebp
jle    11e6 <main+0xc6>
mov    $0x1,%r14d
mov    $0xffffffff,%r15d
mov    $0x1,%r12d
jmp    117f <main+0x5f>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
mov    0xc(%rsp),%ebp
lea    0x0(%rbp,%rbp,1),%eax
add    $0xffffffff,%r15d
cmp    %eax,%r12d
jge    11e6 <main+0xc6>
mov    %ebp,%eax
sub    %r12d,%eax
mov    %eax,%ebx
neg    %ebx
cmovns %eax,%ebx
add    %ebp,%ebx
test   %eax,%eax
je     11bf <main+0x9f>
mov    %r12d,%eax
sub    %ebp,%eax
add    %r15d,%ebp
cmp    %eax,%ebp
cmovle %eax,%ebp
cmp    $0x2,%ebp
cmovb  %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x90>
test   %ebx,%ebx
jle    1160 <main+0x40>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
jl     11d0 <main+0xb0>
jmp    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
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %5
br label %9
9: ; preds = %43, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %2
%12 = mul nsw i32 2, %11
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %46
14: ; preds = %9
%15 = load i32, i32* %2
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = call i32 @abs(i32 %17)
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %4
store i32 0, i32* %6
br label %22
22: ; preds = %28, %14
%23 = load i32, i32* %6
%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.1, i64 0, i64 0))
br label %28
28: ; preds = %26
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %22
31: ; preds = %22
store i32 0, i32* %7
br label %32
32: ; preds = %38, %31
%33 = load i32, i32* %7
%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.2, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %32
41: ; preds = %32
%42 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %9
46: ; preds = %9
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 sgt i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %27, %0
ret i32 0
7: ; preds = %0, %27
%8 = phi i32 [ %33, %27 ], [ -1, %0 ]
%9 = phi i32 [ %30, %27 ], [ %4, %0 ]
%10 = phi i32 [ %29, %27 ], [ 1, %0 ]
%11 = sub nsw i32 %9, %10
%12 = call i32 @llvm.abs.i32(i32 %11, i1 true)
%13 = sub nsw i32 %9, %12
%14 = icmp eq i32 %11, 0
br i1 %14, label %20, label %15
15: ; preds = %7
%16 = add i32 %9, %8
%17 = sub i32 %10, %9
%18 = call i32 @llvm.smax.i32(i32 %16, i32 %17)
%19 = call i32 @llvm.umax.i32(i32 %18, i32 1)
br label %22
20: ; preds = %22, %7
%21 = icmp sgt i32 %13, 0
br i1 %21, label %34, label %27
22: ; preds = %15, %22
%23 = phi i32 [ %25, %22 ], [ 0, %15 ]
%24 = call i32 @putchar(i32 32)
%25 = add nuw i32 %23, 1
%26 = icmp eq i32 %25, %19
br i1 %26, label %20, label %22
27: ; preds = %34, %20
%28 = call i32 @putchar(i32 10)
%29 = add nuw nsw i32 %10, 1
%30 = load i32, i32* %1
%31 = shl nsw i32 %30, 1
%32 = icmp slt i32 %29, %31
%33 = add nsw i32 %8, -1
br i1 %32, label %7, label %6
34: ; preds = %20, %34
%35 = phi i32 [ %37, %34 ], [ 0, %20 ]
%36 = call i32 @putchar(i32 42)
%37 = add nuw nsw i32 %35, 1
%38 = icmp slt i32 %37, %13
br i1 %38, label %34, label %27
}