#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 i = 0, i2 = 1, space, red, posl = 0, hashtag = 1;
  scanf("%d", &red);
  while (i < red - 2) {
    hashtag = hashtag + i2;
    i++;
    i2 = i2 + 2;
  }
  hashtag--;
  printf("%d", hashtag);
  hashtag = 1;
  i = 0;
  while (i < red) {
    posl = posl + 2;
    i++;
  }
  posl--;
  space = posl / 2 - 1;
  printf("\n");
  for (i = -1; i < space; i++) {
    printf(" ");
  }
  printf("*");
  space--;
  while (space != -1) {
    printf("\n");
    for (i = -1; i < space; i++) {
      printf(" ");
    }
    printf("*");
    for (i = 0; i < hashtag; i++) {
      printf("#");
    }
    hashtag = hashtag + 2;
    printf("*");
    space--;
  }
  printf("\n");
  for (i = 0; i < posl; i++) {
    printf("*");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    118c <main+0x6c>
mov    -0x1c(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <main+0x3b>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d7 <main+0xb7>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b4 <main+0x94>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    122e <main+0x10e>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1206 <main+0xe6>
lea    0xdd2(%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     12ee <main+0x1ce>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    128c <main+0x16c>
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1264 <main+0x144>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12c9 <main+0x1a9>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12a1 <main+0x181>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1245 <main+0x125>
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    132b <main+0x20b>
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1303 <main+0x1e3>
mov    -0x4(%rbp),%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 1, i32* %3
store i32 0, 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* %5)
br label %9
9: ; preds = %14, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 2
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %22
14: ; preds = %9
%15 = load i32, i32* %7
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 2
store i32 %21, i32* %3
br label %9
22: ; preds = %9
%23 = load i32, i32* %7
%24 = add nsw i32 %23, -1
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
store i32 1, i32* %7
store i32 0, i32* %2
br label %27
27: ; preds = %31, %22
%28 = load i32, i32* %2
%29 = load i32, i32* %5
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 2
store i32 %33, i32* %6
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %27
36: ; preds = %27
%37 = load i32, i32* %6
%38 = add nsw i32 %37, -1
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = sdiv i32 %39, 2
%41 = sub nsw i32 %40, 1
store i32 %41, i32* %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %43
43: ; preds = %49, %36
%44 = load i32, i32* %2
%45 = load i32, i32* %4
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %47
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %43
52: ; preds = %43
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%54 = load i32, i32* %4
%55 = add nsw i32 %54, -1
store i32 %55, i32* %4
br label %56
56: ; preds = %81, %52
%57 = load i32, i32* %4
%58 = icmp ne i32 %57, -1
br i1 %58, label %59, label %87
59: ; preds = %56
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %61
61: ; preds = %67, %59
%62 = load i32, i32* %2
%63 = load i32, i32* %4
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %70
65: ; preds = %61
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %67
67: ; preds = %65
%68 = load i32, i32* %2
%69 = add nsw i32 %68, 1
store i32 %69, i32* %2
br label %61
70: ; preds = %61
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %72
72: ; preds = %78, %70
%73 = load i32, i32* %2
%74 = load i32, i32* %7
%75 = icmp slt i32 %73, %74
br i1 %75, label %76, label %81
76: ; preds = %72
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %78
78: ; preds = %76
%79 = load i32, i32* %2
%80 = add nsw i32 %79, 1
store i32 %80, i32* %2
br label %72
81: ; preds = %72
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 2
store i32 %83, i32* %7
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%85 = load i32, i32* %4
%86 = add nsw i32 %85, -1
store i32 %86, i32* %4
br label %56
87: ; preds = %56
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %89
89: ; preds = %95, %87
%90 = load i32, i32* %2
%91 = load i32, i32* %6
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %98
93: ; preds = %89
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %95
95: ; preds = %93
%96 = load i32, i32* %2
%97 = add nsw i32 %96, 1
store i32 %97, i32* %2
br label %89
98: ; preds = %89
%99 = load i32, i32* %1
ret i32 %99
}

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
}