#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, x, y;
  scanf("%d", &n);
  for (y = n; y >= 1; y--, printf("\n")) {
    for (x = n; x > y; x--, printf(" "))
      ;
    for (x = 1; x < y * 2; x++, printf("*"))
      ;
  }
  for (y = 2; y <= n; y++, printf("\n")) {
    for (x = n; x > y; x--, printf(" "))
      ;
    for (x = 1; x < y * 2; x++, printf("*"))
      ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     11d6 <main+0xb6>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1180 <main+0x60>
jmp    1166 <main+0x46>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <main+0x35>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11b7 <main+0x97>
jmp    119d <main+0x7d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x67>
jmp    11bc <main+0x9c>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    1145 <main+0x25>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1270 <main+0x150>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    121a <main+0xfa>
jmp    1200 <main+0xe0>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
lea    0xdf3(%rip),%rdi
call   1030 <printf@plt>
jmp    11ef <main+0xcf>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1251 <main+0x131>
jmp    1237 <main+0x117>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xdbe(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <main+0x101>
jmp    1256 <main+0x136>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xda1(%rip),%rdi
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jle    122c <main+0x10c>
lea    (%rbx,%rbx,1),%r14d
mov    %ebx,%r15d
nopl   0x0(%rax,%rax,1)
cmp    $0x3,%r14d
mov    $0x2,%ebp
cmovge %r14d,%ebp
cmp    %r15d,%ebx
jle    1182 <main+0x62>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffff,%ebx
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    %r15d,%ebx
jg     1170 <main+0x50>
add    $0xffffffff,%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>
cmp    $0x2,%r15d
jl     11bd <main+0x9d>
add    $0xfffffffe,%r14d
add    $0xffffffff,%r15d
mov    0x4(%rsp),%ebx
jmp    1150 <main+0x30>
mov    0x4(%rsp),%ebx
cmp    $0x2,%ebx
jl     122c <main+0x10c>
mov    $0x2,%ebp
mov    $0x3,%r14d
jmp    11ed <main+0xcd>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffff,%ebx
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    %ebp,%ebx
jg     11e0 <main+0xc0>
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1200 <main+0xe0>
lea    0x1(%rbp),%r15d
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ebx
add    $0x2,%r14d
cmp    %ebx,%ebp
mov    %r15d,%ebp
jl     11ed <main+0xcd>
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 = [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
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %4
br label %7
7: ; preds = %33, %0
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %37
10: ; preds = %7
%11 = load i32, i32* %2
store i32 %11, i32* %3
br label %12
12: ; preds = %17, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %12
21: ; preds = %12
store i32 1, i32* %3
br label %22
22: ; preds = %28, %21
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = mul nsw i32 %24, 2
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %32
27: ; preds = %22
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %22
32: ; preds = %22
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, -1
store i32 %35, i32* %4
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %7
37: ; preds = %7
store i32 2, i32* %4
br label %38
38: ; preds = %65, %37
%39 = load i32, i32* %4
%40 = load i32, i32* %2
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %69
42: ; preds = %38
%43 = load i32, i32* %2
store i32 %43, i32* %3
br label %44
44: ; preds = %49, %42
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = icmp sgt i32 %45, %46
br i1 %47, label %48, label %53
48: ; preds = %44
br label %49
49: ; preds = %48
%50 = load i32, i32* %3
%51 = add nsw i32 %50, -1
store i32 %51, i32* %3
%52 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %44
53: ; preds = %44
store i32 1, i32* %3
br label %54
54: ; preds = %60, %53
%55 = load i32, i32* %3
%56 = load i32, i32* %4
%57 = mul nsw i32 %56, 2
%58 = icmp slt i32 %55, %57
br i1 %58, label %59, label %64
59: ; preds = %54
br label %60
60: ; preds = %59
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
%63 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %54
64: ; preds = %54
br label %65
65: ; preds = %64
%66 = load i32, i32* %4
%67 = add nsw i32 %66, 1
store i32 %67, i32* %4
%68 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %38
69: ; preds = %38
%70 = load i32, i32* %1
ret i32 %70
}

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 %57
6: ; preds = %0
%7 = shl nuw i32 %4, 1
br label %11
8: ; preds = %28
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 2
br i1 %10, label %57, label %35
11: ; preds = %31, %6
%12 = phi i32 [ %4, %6 ], [ %34, %31 ]
%13 = phi i32 [ %7, %6 ], [ %32, %31 ]
%14 = phi i32 [ %4, %6 ], [ %33, %31 ]
%15 = call i32 @llvm.smax.i32(i32 %13, i32 2)
%16 = icmp sgt i32 %12, %14
br i1 %16, label %17, label %22
17: ; preds = %11, %17
%18 = phi i32 [ %19, %17 ], [ %12, %11 ]
%19 = add nsw i32 %18, -1
%20 = call i32 @putchar(i32 32)
%21 = icmp sgt i32 %19, %14
br i1 %21, label %17, label %22
22: ; preds = %17, %11
br label %23
23: ; preds = %22, %23
%24 = phi i32 [ %25, %23 ], [ 1, %22 ]
%25 = add nuw nsw i32 %24, 1
%26 = call i32 @putchar(i32 42)
%27 = icmp eq i32 %25, %15
br i1 %27, label %28, label %23
28: ; preds = %23
%29 = call i32 @putchar(i32 10)
%30 = icmp sgt i32 %14, 1
br i1 %30, label %31, label %8
31: ; preds = %28
%32 = add i32 %13, -2
%33 = add nsw i32 %14, -1
%34 = load i32, i32* %1
br label %11
35: ; preds = %8, %51
%36 = phi i32 [ %56, %51 ], [ 4, %8 ]
%37 = phi i32 [ %54, %51 ], [ %9, %8 ]
%38 = phi i32 [ %52, %51 ], [ 2, %8 ]
%39 = icmp sgt i32 %37, %38
br i1 %39, label %40, label %45
40: ; preds = %35, %40
%41 = phi i32 [ %42, %40 ], [ %37, %35 ]
%42 = add nsw i32 %41, -1
%43 = call i32 @putchar(i32 32)
%44 = icmp sgt i32 %42, %38
br i1 %44, label %40, label %45
45: ; preds = %40, %35
br label %46
46: ; preds = %45, %46
%47 = phi i32 [ %48, %46 ], [ 1, %45 ]
%48 = add nuw i32 %47, 1
%49 = call i32 @putchar(i32 42)
%50 = icmp eq i32 %48, %36
br i1 %50, label %51, label %46
51: ; preds = %46
%52 = add nuw nsw i32 %38, 1
%53 = call i32 @putchar(i32 10)
%54 = load i32, i32* %1
%55 = icmp slt i32 %38, %54
%56 = add i32 %36, 2
br i1 %55, label %35, label %57
57: ; preds = %51, %0, %8
ret i32 0
}