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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e1 <main+0xc1>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1194 <main+0x74>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11be <main+0x9e>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    119a <main+0x7a>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x2d>
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    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
jle    11d7 <main+0xb7>
mov    $0x1,%r12d
mov    $0xfffffffe,%r14d
mov    $0x2,%ebp
mov    $0x1,%r15d
mov    %r12d,%eax
not    %eax
lea    (%rax,%rbx,2),%eax
cmp    $0x2,%eax
jl     1192 <main+0x72>
add    %ebx,%ebx
add    %r14d,%ebx
shr    %ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1180 <main+0x60>
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jg     11a0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
add    $0x2,%r12d
mov    0xc(%rsp),%ebx
add    $0xfffffffe,%r14d
add    $0x2,%ebp
cmp    %ebx,%r15d
mov    %eax,%r15d
jl     1160 <main+0x40>
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"\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* %2)
store i32 1, i32* %3
store i32 1, i32* %4
br label %7
7: ; preds = %36, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %41
11: ; preds = %7
%12 = load i32, i32* %2
%13 = mul nsw i32 2, %12
%14 = sub nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = sdiv i32 %16, 2
store i32 %17, i32* %5
br label %18
18: ; preds = %21, %11
%19 = load i32, i32* %5
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %5
%24 = add nsw i32 %23, -1
store i32 %24, i32* %5
br label %18
25: ; preds = %18
%26 = load i32, i32* %4
store i32 %26, i32* %5
br label %27
27: ; preds = %30, %25
%28 = load i32, i32* %5
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* %5
%33 = add nsw i32 %32, -1
store i32 %33, i32* %5
br label %27
34: ; preds = %27
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 2
store i32 %40, i32* %4
br label %7
41: ; preds = %7
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, 1
br i1 %5, label %33, label %6
6: ; preds = %0, %27
%7 = phi i32 [ %31, %27 ], [ %4, %0 ]
%8 = phi i32 [ %30, %27 ], [ 1, %0 ]
%9 = phi i32 [ %29, %27 ], [ 1, %0 ]
%10 = shl nsw i32 %7, 1
%11 = xor i32 %8, -1
%12 = add i32 %10, %11
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %21
14: ; preds = %6
%15 = lshr i32 %12, 1
br label %16
16: ; preds = %14, %16
%17 = phi i32 [ %19, %16 ], [ %15, %14 ]
%18 = call i32 @putchar(i32 32)
%19 = add nsw i32 %17, -1
%20 = icmp ugt i32 %17, 1
br i1 %20, label %16, label %21
21: ; preds = %16, %6
br label %22
22: ; preds = %21, %22
%23 = phi i32 [ %25, %22 ], [ %8, %21 ]
%24 = call i32 @putchar(i32 35)
%25 = add nsw i32 %23, -1
%26 = icmp sgt i32 %23, 1
br i1 %26, label %22, label %27
27: ; preds = %22
%28 = call i32 @putchar(i32 10)
%29 = add nuw nsw i32 %9, 1
%30 = add nuw nsw i32 %8, 2
%31 = load i32, i32* %1
%32 = icmp slt i32 %9, %31
br i1 %32, label %6, label %33
33: ; preds = %27, %0
ret i32 0
}