#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 empty = 0, row, k, i = 0, j = 1, hashes = 1;
  scanf("%d", &row);
  for (i = 0; i < row - 2; i++) {
    hashes = hashes + j;
    j = j + 2;
  }
  hashes--;
  printf("%d", hashes);
  hashes = 1;
  for (i = 0; i < row; i++) {
    empty = empty + 2;
  }
  empty--;
  k = empty / 2 - 1;
  printf("\n");
  for (i = -1; i < k; i++) {
    printf(" ");
  }
  printf("*");
  k--;
  while (k != -1) {
    printf("\n");
    for (i = -1; i < k; i++) {
      printf(" ");
    }
    printf("*");
    for (i = 0; i < hashes; i++) {
      printf("#");
    }
    hashes = hashes + 2;
    printf("*");
    k--;
  }
  printf("\n");
  for (i = 0; i < empty; i++) {
    printf("*");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xeae(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1193 <main+0x73>
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x42>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11de <main+0xbe>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bb <main+0x9b>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1235 <main+0x115>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    120d <main+0xed>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     12f5 <main+0x1d5>
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1293 <main+0x173>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    126b <main+0x14b>
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12d0 <main+0x1b0>
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12a8 <main+0x188>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    124c <main+0x12c>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1332 <main+0x212>
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    130a <main+0x1ea>
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
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ebx,%ebx
mov    $0x0,%esi
cmp    $0x3,%eax
jl     1171 <main+0x41>
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    0xe88(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
lea    (%rax,%rax,1),%r14d
test   %eax,%eax
cmovle %ebx,%r14d
lea    -0x1(%r14),%r15d
mov    %r15d,%eax
shr    $0x1f,%eax
lea    (%r14,%rax,1),%r12d
add    $0xffffffff,%r12d
sar    %r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x3,%r14d
jl     11cf <main+0x9f>
cmp    $0x2,%r12d
mov    $0x1,%ebx
cmovge %r12d,%ebx
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11c0 <main+0x90>
mov    $0x2a,%edi
call   1030 <putchar@plt>
lea    -0x2(%r12),%r13d
cmp    $0xffffffff,%r13d
je     1256 <main+0x126>
add    $0xffffffff,%r12d
mov    $0x1,%ebx
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r13d,%r13d
js     121f <main+0xef>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xe0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %ebx,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1230 <main+0x100>
add    $0x2,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r12d
sub    $0x1,%r13d
jae    11f0 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%r14d
jl     1280 <main+0x150>
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r15d
jne    1270 <main+0x140>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"#\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
store i32 0, i32* %2
store i32 0, i32* %5
store i32 1, i32* %6
store i32 1, i32* %7
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %5
br label %9
9: ; preds = %20, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %23
14: ; preds = %9
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 2
store i32 %19, i32* %6
br label %20
20: ; preds = %14
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
%24 = load i32, i32* %7
%25 = add nsw i32 %24, -1
store i32 %25, i32* %7
%26 = load i32, i32* %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
store i32 1, i32* %7
store i32 0, i32* %5
br label %28
28: ; preds = %35, %23
%29 = load i32, i32* %5
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 2
store i32 %34, i32* %2
br label %35
35: ; preds = %32
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %28
38: ; preds = %28
%39 = load i32, i32* %2
%40 = add nsw i32 %39, -1
store i32 %40, i32* %2
%41 = load i32, i32* %2
%42 = sdiv i32 %41, 2
%43 = sub nsw i32 %42, 1
store i32 %43, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %45
45: ; preds = %51, %38
%46 = load i32, i32* %5
%47 = load i32, i32* %4
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %54
49: ; preds = %45
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %45
54: ; preds = %45
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* %4
%57 = add nsw i32 %56, -1
store i32 %57, i32* %4
br label %58
58: ; preds = %83, %54
%59 = load i32, i32* %4
%60 = icmp ne i32 %59, -1
br i1 %60, label %61, label %89
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %63
63: ; preds = %69, %61
%64 = load i32, i32* %5
%65 = load i32, i32* %4
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %72
67: ; preds = %63
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %69
69: ; preds = %67
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %5
br label %63
72: ; preds = %63
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %74
74: ; preds = %80, %72
%75 = load i32, i32* %5
%76 = load i32, i32* %7
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %83
78: ; preds = %74
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %80
80: ; preds = %78
%81 = load i32, i32* %5
%82 = add nsw i32 %81, 1
store i32 %82, i32* %5
br label %74
83: ; preds = %74
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 2
store i32 %85, i32* %7
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%87 = load i32, i32* %4
%88 = add nsw i32 %87, -1
store i32 %88, i32* %4
br label %58
89: ; preds = %58
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %91
91: ; preds = %97, %89
%92 = load i32, i32* %5
%93 = load i32, i32* %2
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %100
95: ; preds = %91
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %97
97: ; preds = %95
%98 = load i32, i32* %5
%99 = add nsw i32 %98, 1
store i32 %99, i32* %5
br label %91
100: ; preds = %91
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, 2
br i1 %5, label %6, label %14
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 sgt i32 %17, 0
%19 = shl nuw i32 %17, 1
%20 = select i1 %18, i32 %19, i32 0
%21 = add i32 %20, -1
%22 = sdiv i32 %21, 2
%23 = call i32 @putchar(i32 10)
%24 = icmp sgt i32 %20, 2
br i1 %24, label %25, label %33
25: ; preds = %14
%26 = call i32 @llvm.smax.i32(i32 %22, i32 1)
%27 = add nsw i32 %26, -1
br label %28
28: ; preds = %25, %28
%29 = phi i32 [ %31, %28 ], [ -1, %25 ]
%30 = call i32 @putchar(i32 32)
%31 = add nsw i32 %29, 1
%32 = icmp eq i32 %31, %27
br i1 %32, label %33, label %28
33: ; preds = %28, %14
%34 = call i32 @putchar(i32 42)
%35 = add nsw i32 %22, -2
%36 = icmp eq i32 %35, -1
br i1 %36, label %59, label %37
37: ; preds = %33, %54
%38 = phi i32 [ %55, %54 ], [ 1, %33 ]
%39 = phi i32 [ %57, %54 ], [ %35, %33 ]
%40 = call i32 @putchar(i32 10)
%41 = icmp sgt i32 %39, -1
br i1 %41, label %42, label %47
42: ; preds = %37, %42
%43 = phi i32 [ %45, %42 ], [ -1, %37 ]
%44 = call i32 @putchar(i32 32)
%45 = add nsw i32 %43, 1
%46 = icmp eq i32 %45, %39
br i1 %46, label %47, label %42
47: ; preds = %42, %37
%48 = call i32 @putchar(i32 42)
br label %49
49: ; preds = %47, %49
%50 = phi i32 [ 0, %47 ], [ %52, %49 ]
%51 = call i32 @putchar(i32 35)
%52 = add nuw nsw i32 %50, 1
%53 = icmp eq i32 %52, %38
br i1 %53, label %54, label %49
54: ; preds = %49
%55 = add nuw nsw i32 %38, 2
%56 = call i32 @putchar(i32 42)
%57 = add nsw i32 %39, -1
%58 = icmp eq i32 %39, 0
br i1 %58, label %59, label %37
59: ; preds = %54, %33
%60 = call i32 @putchar(i32 10)
%61 = icmp sgt i32 %20, 1
br i1 %61, label %62, label %67
62: ; preds = %59, %62
%63 = phi i32 [ %65, %62 ], [ 0, %59 ]
%64 = call i32 @putchar(i32 42)
%65 = add nuw nsw i32 %63, 1
%66 = icmp eq i32 %65, %21
br i1 %66, label %67, label %62
67: ; preds = %62, %59
ret i32 0
}