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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     1184 <main+0x64>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <main+0x34>
mov    -0x14(%rbp),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1271 <main+0x151>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    11dc <main+0xbc>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11af <main+0x8f>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1255 <main+0x135>
cmpl   $0x0,-0x18(%rbp)
je     1221 <main+0x101>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
je     1221 <main+0x101>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1234 <main+0x114>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1242 <main+0x122>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1247 <main+0x127>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e3 <main+0xc3>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119c <main+0x7c>
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    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
xor    %esi,%esi
cmp    $0x3,%eax
jl     116d <main+0x3d>
lea    (%rax,%rax,2),%ecx
lea    -0x3(%rax),%edx
add    $0xfffffffc,%eax
imul   %edx,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rcx,1),%esi
add    $0xfffffff8,%esi
lea    0xe8c(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     124e <main+0x11e>
mov    $0xffffffff,%r14d
mov    $0xfffffffd,%r15d
jmp    11c3 <main+0x93>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0xc(%rsp),%eax
add    $0x2,%r14d
add    $0x2,%r15d
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    124e <main+0x11e>
cmp    $0x2,%r14d
mov    $0x1,%r12d
cmovge %r14d,%r12d
cmp    %ebx,%eax
jle    11f7 <main+0xc7>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
sub    %ebx,%eax
cmp    %eax,%ebp
jl     11e0 <main+0xb0>
test   %ebx,%ebx
je     11a0 <main+0x70>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    $0x2,%r14d
jl     11a0 <main+0x70>
add    $0xffffffff,%r12d
xor    %ebp,%ebp
jmp    1237 <main+0x107>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %ebp,%r15d
cmove  %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%r12d
je     11a0 <main+0x70>
mov    $0x2a,%eax
mov    $0x2a,%edi
cmp    0xc(%rsp),%ebx
je     1220 <main+0xf0>
mov    $0x23,%edi
jmp    1220 <main+0xf0>
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"#\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* %4
store i32 0, i32* %5
%7 = 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 %8
8: ; preds = %19, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 2
%12 = icmp sle i32 %9, %11
br i1 %12, label %13, label %22
13: ; preds = %8
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = mul nsw i32 2, %15
%17 = add nsw i32 %14, %16
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %5
br label %19
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %8
22: ; preds = %8
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
store i32 0, i32* %4
br label %25
25: ; preds = %71, %22
%26 = load i32, i32* %4
%27 = load i32, i32* %2
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %74
29: ; preds = %25
store i32 0, i32* %3
br label %30
30: ; preds = %38, %29
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = load i32, i32* %4
%34 = sub nsw i32 %32, %33
%35 = icmp slt i32 %31, %34
br i1 %35, label %36, label %41
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %30
41: ; preds = %30
store i32 0, i32* %6
br label %42
42: ; preds = %66, %41
%43 = load i32, i32* %6
%44 = load i32, i32* %4
%45 = mul nsw i32 2, %44
%46 = sub nsw i32 %45, 1
%47 = icmp slt i32 %43, %46
br i1 %47, label %48, label %69
48: ; preds = %42
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, 0
br i1 %50, label %61, label %51
51: ; preds = %48
%52 = load i32, i32* %6
%53 = load i32, i32* %4
%54 = mul nsw i32 2, %53
%55 = sub nsw i32 %54, 2
%56 = icmp eq i32 %52, %55
br i1 %56, label %61, label %57
57: ; preds = %51
%58 = load i32, i32* %4
%59 = load i32, i32* %2
%60 = icmp eq i32 %58, %59
br i1 %60, label %61, label %63
61: ; preds = %57, %51, %48
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %65
63: ; preds = %57
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %63, %61
br label %66
66: ; preds = %65
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
br label %42
69: ; preds = %42
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %71
71: ; preds = %69
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
store i32 %73, i32* %4
br label %25
74: ; preds = %25
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, 3
br i1 %5, label %14, label %6
6: ; preds = %0
%7 = mul i32 %4, 3
%8 = add nsw i32 %4, -3
%9 = add nsw i32 %4, -4
%10 = mul i32 %8, %9
%11 = and i32 %10, -2
%12 = add i32 %7, %11
%13 = add i32 %12, -8
br label %14
14: ; preds = %6, %0
%15 = phi i32 [ 0, %0 ], [ %13, %6 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
%18 = icmp slt i32 %17, 0
br i1 %18, label %55, label %19
19: ; preds = %14, %49
%20 = phi i32 [ %52, %49 ], [ %17, %14 ]
%21 = phi i32 [ %54, %49 ], [ -1, %14 ]
%22 = phi i32 [ %51, %49 ], [ 0, %14 ]
%23 = call i32 @llvm.smax.i32(i32 %21, i32 1)
%24 = icmp sgt i32 %20, %22
br i1 %24, label %32, label %25
25: ; preds = %32, %19
%26 = icmp eq i32 %22, 0
br i1 %26, label %49, label %27
27: ; preds = %25
%28 = shl nuw nsw i32 %22, 1
%29 = add nsw i32 %28, -2
%30 = call i32 @putchar(i32 42)
%31 = icmp slt i32 %21, 2
br i1 %31, label %49, label %39
32: ; preds = %19, %32
%33 = phi i32 [ %35, %32 ], [ 0, %19 ]
%34 = call i32 @putchar(i32 32)
%35 = add nuw nsw i32 %33, 1
%36 = load i32, i32* %1
%37 = sub nsw i32 %36, %22
%38 = icmp slt i32 %35, %37
br i1 %38, label %32, label %25
39: ; preds = %27, %39
%40 = phi i32 [ %47, %39 ], [ 1, %27 ]
%41 = load i32, i32* %1
%42 = icmp eq i32 %40, %29
%43 = icmp eq i32 %22, %41
%44 = select i1 %42, i1 true, i1 %43
%45 = select i1 %44, i32 42, i32 35
%46 = call i32 @putchar(i32 %45)
%47 = add nuw nsw i32 %40, 1
%48 = icmp eq i32 %47, %23
br i1 %48, label %49, label %39
49: ; preds = %39, %27, %25
%50 = call i32 @putchar(i32 10)
%51 = add nuw nsw i32 %22, 1
%52 = load i32, i32* %1
%53 = icmp slt i32 %22, %52
%54 = add i32 %21, 2
br i1 %53, label %19, label %55
55: ; preds = %49, %14
ret i32 0
}