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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11db <main+0xbb>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118b <main+0x6b>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x45>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b8 <main+0x98>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1192 <main+0x72>
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11a3 <main+0x83>
lea    (%rax,%rax,1),%ebx
add    $0xffffffff,%ebx
xor    %r14d,%r14d
jmp    1168 <main+0x48>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xfffffffe,%ebx
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
jge    11a3 <main+0x83>
mov    %r14d,%ebp
test   %r14d,%r14d
je     117f <main+0x5f>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1170 <main+0x50>
test   %ebx,%ebx
jle    1150 <main+0x30>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1190 <main+0x70>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
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"\0A\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* %5)
%7 = load i32, i32* %5
%8 = mul nsw i32 %7, 2
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %4
store i32 0, i32* %2
br label %10
10: ; preds = %38, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %41
14: ; preds = %10
store i32 0, i32* %3
br label %15
15: ; preds = %21, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %15
24: ; preds = %15
store i32 0, i32* %3
br label %25
25: ; preds = %31, %24
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %25
34: ; preds = %25
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = load i32, i32* %4
%37 = sub nsw i32 %36, 2
store i32 %37, i32* %4
br label %38
38: ; preds = %34
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %10
41: ; preds = %10
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, 0
br i1 %5, label %6, label %31
6: ; preds = %0
%7 = shl nuw nsw i32 %4, 1
%8 = add nsw i32 %7, -1
br label %9
9: ; preds = %6, %25
%10 = phi i32 [ %27, %25 ], [ %8, %6 ]
%11 = phi i32 [ %28, %25 ], [ 0, %6 ]
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %15, %9
%14 = icmp sgt i32 %10, 0
br i1 %14, label %20, label %25
15: ; preds = %9, %15
%16 = phi i32 [ %18, %15 ], [ 0, %9 ]
%17 = call i32 @putchar(i32 32)
%18 = add nuw nsw i32 %16, 1
%19 = icmp eq i32 %18, %11
br i1 %19, label %13, label %15
20: ; preds = %13, %20
%21 = phi i32 [ %23, %20 ], [ 0, %13 ]
%22 = call i32 @putchar(i32 35)
%23 = add nuw nsw i32 %21, 1
%24 = icmp eq i32 %23, %10
br i1 %24, label %25, label %20
25: ; preds = %20, %13
%26 = call i32 @putchar(i32 10)
%27 = add nsw i32 %10, -2
%28 = add nuw nsw i32 %11, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %28, %29
br i1 %30, label %9, label %31
31: ; preds = %25, %0
ret i32 0
}