#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*/ lastrow(int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ total(int);
int main() {
  int n;
  scanf("%d", &n);
  total(n);
  int j = 2 * n - 1;
  int i = 0, a = 0, k = 2, c = 0;
  char hash = '#', zvezd = '*';
  for (; i < j; i++, j--)
    printf(" ");
  printf("%c\n", zvezd);
  i = 2;
  for (; i < n; i++, k += 2, j--) {
    for (c = 0; c < j; c++)
      printf(" ");
    for (a = 0; a <= k; a++) {
      if (a == 0)
        printf("%c", zvezd);
      else if (a == k)
        printf("%c", zvezd);
      else
        printf("%c", hash);
    }
    printf("\n");
  }
  printf(" ");
  lastrow(j, i, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <total@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movb   $0x23,-0x1d(%rbp)
movb   $0x2a,-0x1e(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c8 <main+0x88>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1197 <main+0x57>
movsbl -0x1e(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12cb <main+0x18b>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121c <main+0xdc>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f4 <main+0xb4>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     129d <main+0x15d>
cmpl   $0x0,-0x14(%rbp)
jne    1250 <main+0x110>
movsbl -0x1e(%rbp),%esi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128a <main+0x14a>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1273 <main+0x133>
movsbl -0x1e(%rbp),%esi
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1285 <main+0x145>
movsbl -0x1d(%rbp),%esi
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128a <main+0x14a>
jmp    128f <main+0x14f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1223 <main+0xe3>
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11e1 <main+0xa1>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1060 <lastrow@plt>
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    0xe9d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <total@plt>
mov    0xc(%rsp),%eax
lea    (%rax,%rax,1),%r12d
add    $0xffffffff,%r12d
test   %eax,%eax
jle    11a8 <main+0x58>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r12d
lea    0x1(%rbp),%eax
cmp    %r12d,%ebp
mov    %eax,%ebp
jl     1190 <main+0x40>
lea    0xe54(%rip),%rdi
mov    $0x2a,%ebp
mov    $0x2a,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%r14d
cmpl   $0x3,0xc(%rsp)
jl     1242 <main+0xf2>
mov    $0x2,%r15d
mov    $0x2,%r14d
nopl   0x0(%rax)
mov    %r12d,%ebx
test   %r12d,%r12d
jle    11ff <main+0xaf>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11f0 <main+0xa0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %r15d,%ebx
nopl   0x0(%rax)
cmp    $0x1,%ebx
mov    $0x23,%edi
cmove  %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1210 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
add    $0x2,%r15d
add    $0xffffffff,%r12d
cmp    0xc(%rsp),%r14d
jl     11e0 <main+0x90>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%edx
mov    %r12d,%edi
mov    %r14d,%esi
call   1070 <lastrow@plt>
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 = [4 x i8] c"%c\0A\00"
@.str.3 = [3 x i8] c"%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
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
store i32 0, i32* %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = call i32 @total(i32 %11)
%13 = load i32, i32* %2
%14 = mul nsw i32 2, %13
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 2, i32* %6
store i32 0, i32* %7
store i8 35, i8* %8
store i8 42, i8* %9
br label %16
16: ; preds = %22, %0
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = add nsw i32 %25, -1
store i32 %26, i32* %3
br label %16
27: ; preds = %16
%28 = load i8, i8* %9
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
store i32 2, i32* %4
br label %31
31: ; preds = %76, %27
%32 = load i32, i32* %4
%33 = load i32, i32* %2
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %83
35: ; preds = %31
store i32 0, i32* %7
br label %36
36: ; preds = %42, %35
%37 = load i32, i32* %7
%38 = load i32, i32* %3
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %45
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %36
45: ; preds = %36
store i32 0, i32* %5
br label %46
46: ; preds = %71, %45
%47 = load i32, i32* %5
%48 = load i32, i32* %6
%49 = icmp sle i32 %47, %48
br i1 %49, label %50, label %74
50: ; preds = %46
%51 = load i32, i32* %5
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = load i8, i8* %9
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %55)
br label %70
57: ; preds = %50
%58 = load i32, i32* %5
%59 = load i32, i32* %6
%60 = icmp eq i32 %58, %59
br i1 %60, label %61, label %65
61: ; preds = %57
%62 = load i8, i8* %9
%63 = sext i8 %62 to i32
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %63)
br label %69
65: ; preds = %57
%66 = load i8, i8* %8
%67 = sext i8 %66 to i32
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %65, %61
br label %70
70: ; preds = %69, %53
br label %71
71: ; preds = %70
%72 = load i32, i32* %5
%73 = add nsw i32 %72, 1
store i32 %73, i32* %5
br label %46
74: ; preds = %46
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %76
76: ; preds = %74
%77 = load i32, i32* %4
%78 = add nsw i32 %77, 1
store i32 %78, i32* %4
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 2
store i32 %80, i32* %6
%81 = load i32, i32* %3
%82 = add nsw i32 %81, -1
store i32 %82, i32* %3
br label %31
83: ; preds = %31
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%85 = load i32, i32* %3
%86 = load i32, i32* %4
%87 = load i32, i32* %2
%88 = call i32 @lastrow(i32 %85, i32 %86, i32 %87)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%c\0A\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 = call i32 @total(i32 %4)
%6 = load i32, i32* %1
%7 = shl nsw i32 %6, 1
%8 = add nsw i32 %7, -1
%9 = icmp sgt i32 %6, 0
br i1 %9, label %10, label %17
10: ; preds = %0, %10
%11 = phi i32 [ %15, %10 ], [ %8, %0 ]
%12 = phi i32 [ %14, %10 ], [ 0, %0 ]
%13 = call i32 @putchar(i32 32)
%14 = add nuw nsw i32 %12, 1
%15 = add nsw i32 %11, -1
%16 = icmp slt i32 %14, %15
br i1 %16, label %10, label %17
17: ; preds = %10, %0
%18 = phi i32 [ %8, %0 ], [ %15, %10 ]
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 42)
%20 = load i32, i32* %1
%21 = icmp sgt i32 %20, 2
br i1 %21, label %22, label %50
22: ; preds = %17, %42
%23 = phi i32 [ %49, %42 ], [ 3, %17 ]
%24 = phi i32 [ %46, %42 ], [ %18, %17 ]
%25 = phi i32 [ %45, %42 ], [ 2, %17 ]
%26 = phi i32 [ %44, %42 ], [ 2, %17 ]
%27 = icmp sgt i32 %24, 0
br i1 %27, label %30, label %28
28: ; preds = %30, %22
%29 = call i32 @putchar(i32 42)
br label %35
30: ; preds = %22, %30
%31 = phi i32 [ %33, %30 ], [ 0, %22 ]
%32 = call i32 @putchar(i32 32)
%33 = add nuw nsw i32 %31, 1
%34 = icmp eq i32 %33, %24
br i1 %34, label %28, label %30
35: ; preds = %35, %28
%36 = phi i32 [ 1, %28 ], [ %40, %35 ]
%37 = icmp eq i32 %36, %25
%38 = select i1 %37, i32 42, i32 35
%39 = call i32 @putchar(i32 %38)
%40 = add nuw i32 %36, 1
%41 = icmp eq i32 %40, %23
br i1 %41, label %42, label %35
42: ; preds = %35
%43 = call i32 @putchar(i32 10)
%44 = add nuw nsw i32 %26, 1
%45 = add nuw nsw i32 %25, 2
%46 = add nsw i32 %24, -1
%47 = load i32, i32* %1
%48 = icmp slt i32 %44, %47
%49 = add nuw i32 %23, 2
br i1 %48, label %22, label %50
50: ; preds = %42, %17
%51 = phi i32 [ 2, %17 ], [ %44, %42 ]
%52 = phi i32 [ %18, %17 ], [ %46, %42 ]
%53 = call i32 @putchar(i32 32)
%54 = load i32, i32* %1
%55 = call i32 @lastrow(i32 %52, i32 %51, i32 %54)
ret i32 0
}