#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*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  k = (n + 1) / 2;
  for (i = 1; i <= k; i++) {
    for (j = 1; j <= k - i; j++)
      putchar(' ');
    for (j = 1; j <= 2 * i - 1; j++)
      putchar('*');
    putchar('\n');
  }
  for (i = k - 1; i >= 1; i--) {
    for (j = 1; j <= k - i; j++)
      putchar(' ');
    for (j = 1; j <= 2 * i - 1; j++)
      putchar('*');
    putchar('\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>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11de <main+0xbe>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1193 <main+0x73>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116a <main+0x4a>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11c6 <main+0xa6>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119a <main+0x7a>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <main+0x37>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     126c <main+0x14c>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1221 <main+0x101>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f8 <main+0xd8>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1254 <main+0x134>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1228 <main+0x108>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11e7 <main+0xc7>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x14(%rsp),%r15d
test   %r15d,%r15d
jle    1291 <main+0x171>
lea    0x1(%r15),%eax
shr    $0x1f,%eax
lea    (%r15,%rax,1),%r14d
add    $0x1,%r14d
sar    %r14d
cmp    $0x2,%r14d
mov    $0x1,%r13d
mov    $0x1,%r12d
cmovge %r14d,%r12d
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14d,%ebx
cmp    %ebp,%r14d
jle    11a1 <main+0x81>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jne    1190 <main+0x70>
mov    %r13d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11b0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%eax
add    $0x2,%r13d
cmp    %r12d,%ebp
mov    %eax,%ebp
jne    1180 <main+0x60>
mov    %r14,0x8(%rsp)
cmp    $0x3,%r15d
jl     1291 <main+0x171>
mov    0x8(%rsp),%rcx
cmp    $0x2,%ecx
mov    $0x2,%r12d
mov    $0x2,%eax
cmovl  %ecx,%eax
neg    %eax
add    %ecx,%eax
add    $0x3,%eax
mov    %eax,0x10(%rsp)
lea    (%rcx,%rcx,1),%ebx
add    $0xfffffffe,%ebx
mov    $0x1,%r14d
jmp    123c <main+0x11c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0x1,%r14d
add    $0xfffffffe,%ebx
cmp    0x10(%rsp),%r12d
je     1291 <main+0x171>
mov    0x8(%rsp),%r15
cmp    $0x3,%ebx
mov    $0x2,%ebp
cmovge %ebx,%ebp
add    $0xffffffff,%ebp
lea    -0x1(%r15),%eax
mov    %rax,0x8(%rsp)
mov    %r14d,%r13d
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r13d
jne    1260 <main+0x140>
cmp    $0x2,%r15d
jl     1220 <main+0x100>
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1280 <main+0x160>
jmp    1220 <main+0x100>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 2
store i32 %9, i32* %5
store i32 1, i32* %3
br label %10
10: ; preds = %40, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %43
14: ; preds = %10
store i32 1, i32* %4
br label %15
15: ; preds = %23, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
%20 = icmp sle i32 %16, %19
br i1 %20, label %21, label %26
21: ; preds = %15
%22 = call i32 @putchar(i8 signext 32)
br label %23
23: ; preds = %21
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %15
26: ; preds = %15
store i32 1, i32* %4
br label %27
27: ; preds = %35, %26
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = mul nsw i32 2, %29
%31 = sub nsw i32 %30, 1
%32 = icmp sle i32 %28, %31
br i1 %32, label %33, label %38
33: ; preds = %27
%34 = call i32 @putchar(i8 signext 42)
br label %35
35: ; preds = %33
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %27
38: ; preds = %27
%39 = call i32 @putchar(i8 signext 10)
br label %40
40: ; preds = %38
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %10
43: ; preds = %10
%44 = load i32, i32* %5
%45 = sub nsw i32 %44, 1
store i32 %45, i32* %3
br label %46
46: ; preds = %75, %43
%47 = load i32, i32* %3
%48 = icmp sge i32 %47, 1
br i1 %48, label %49, label %78
49: ; preds = %46
store i32 1, i32* %4
br label %50
50: ; preds = %58, %49
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = load i32, i32* %3
%54 = sub nsw i32 %52, %53
%55 = icmp sle i32 %51, %54
br i1 %55, label %56, label %61
56: ; preds = %50
%57 = call i32 @putchar(i8 signext 32)
br label %58
58: ; preds = %56
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %50
61: ; preds = %50
store i32 1, i32* %4
br label %62
62: ; preds = %70, %61
%63 = load i32, i32* %4
%64 = load i32, i32* %3
%65 = mul nsw i32 2, %64
%66 = sub nsw i32 %65, 1
%67 = icmp sle i32 %63, %66
br i1 %67, label %68, label %73
68: ; preds = %62
%69 = call i32 @putchar(i8 signext 42)
br label %70
70: ; preds = %68
%71 = load i32, i32* %4
%72 = add nsw i32 %71, 1
store i32 %72, i32* %4
br label %62
73: ; preds = %62
%74 = call i32 @putchar(i8 signext 10)
br label %75
75: ; preds = %73
%76 = load i32, i32* %3
%77 = add nsw i32 %76, -1
store i32 %77, i32* %3
br label %46
78: ; preds = %46
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 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 2
%7 = icmp slt i32 %4, 1
br i1 %7, label %62, label %8
8: ; preds = %0
%9 = call i32 @llvm.smax.i32(i32 %6, i32 1)
br label %10
10: ; preds = %8, %33
%11 = phi i32 [ 2, %8 ], [ %37, %33 ]
%12 = phi i32 [ %6, %8 ], [ %36, %33 ]
%13 = phi i32 [ 1, %8 ], [ %35, %33 ]
%14 = icmp sgt i32 %6, %13
br i1 %14, label %22, label %27
15: ; preds = %33
%16 = icmp sgt i32 %4, 2
br i1 %16, label %17, label %62
17: ; preds = %15
%18 = shl nsw i32 %6, 1
%19 = add nsw i32 %6, 3
%20 = call i32 @llvm.smin.i32(i32 %6, i32 2)
%21 = sub i32 %19, %20
br label %39
22: ; preds = %10, %22
%23 = phi i32 [ %25, %22 ], [ 1, %10 ]
%24 = call i32 @putchar(i8 signext 32)
%25 = add nuw nsw i32 %23, 1
%26 = icmp eq i32 %25, %12
br i1 %26, label %27, label %22
27: ; preds = %22, %10
br label %28
28: ; preds = %27, %28
%29 = phi i32 [ %31, %28 ], [ 1, %27 ]
%30 = call i32 @putchar(i8 signext 42)
%31 = add nuw nsw i32 %29, 1
%32 = icmp eq i32 %31, %11
br i1 %32, label %33, label %28
33: ; preds = %28
%34 = call i32 @putchar(i8 signext 10)
%35 = add nuw nsw i32 %13, 1
%36 = add nsw i32 %12, -1
%37 = add nuw i32 %11, 2
%38 = icmp eq i32 %13, %9
br i1 %38, label %15, label %10
39: ; preds = %58, %17
%40 = phi i32 [ %18, %17 ], [ %43, %58 ]
%41 = phi i32 [ 2, %17 ], [ %60, %58 ]
%42 = phi i32 [ %6, %17 ], [ %45, %58 ]
%43 = add i32 %40, -2
%44 = call i32 @llvm.smax.i32(i32 %43, i32 2)
%45 = add nsw i32 %42, -1
br label %48
46: ; preds = %48
%47 = icmp sgt i32 %42, 1
br i1 %47, label %53, label %58
48: ; preds = %39, %48
%49 = phi i32 [ %51, %48 ], [ 1, %39 ]
%50 = call i32 @putchar(i8 signext 32)
%51 = add nuw nsw i32 %49, 1
%52 = icmp eq i32 %51, %41
br i1 %52, label %46, label %48
53: ; preds = %46, %53
%54 = phi i32 [ %56, %53 ], [ 1, %46 ]
%55 = call i32 @putchar(i8 signext 42)
%56 = add nuw nsw i32 %54, 1
%57 = icmp eq i32 %56, %44
br i1 %57, label %58, label %53
58: ; preds = %53, %46
%59 = call i32 @putchar(i8 signext 10)
%60 = add nuw nsw i32 %41, 1
%61 = icmp eq i32 %60, %21
br i1 %61, label %62, label %39
62: ; preds = %58, %0, %15
ret i32 0
}