#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 = n; i > 0; i--) {
    for (j = n - i; j > 0; j--)
      printf(" ");
    for (k = 2 * i - 1; k > 0; k--)
      printf("#");
    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>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    117c <main+0x5c>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11ac <main+0x8c>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1188 <main+0x68>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <main+0x25>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jle    11c6 <main+0xa6>
mov    $0x1,%r14d
sub    %ebp,%r14d
lea    0x1(%rbp,%rbp,1),%r15d
mov    %ebp,%ebx
cmp    %ebx,%ebp
jle    1182 <main+0x62>
nopl   0x0(%rax,%rax,1)
add    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1170 <main+0x50>
mov    %r15d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
jg     1190 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebx
jl     11c6 <main+0xa6>
add    $0xffffffff,%ebx
mov    0x4(%rsp),%ebp
add    $0x1,%r14d
add    $0xfffffffe,%r15d
cmp    %ebx,%ebp
jg     1160 <main+0x40>
jmp    1182 <main+0x62>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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)
%7 = load i32, i32* %2
store i32 %7, i32* %3
br label %8
8: ; preds = %37, %0
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %40
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %4
br label %15
15: ; preds = %20, %11
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
br label %15
23: ; preds = %15
%24 = load i32, i32* %3
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %5
br label %27
27: ; preds = %32, %23
%28 = load i32, i32* %5
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30
%33 = load i32, i32* %5
%34 = add nsw i32 %33, -1
store i32 %34, i32* %5
br label %27
35: ; preds = %27
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %3
%39 = add nsw i32 %38, -1
store i32 %39, i32* %3
br label %8
40: ; preds = %8
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 %29
6: ; preds = %0, %26
%7 = phi i32 [ %28, %26 ], [ %4, %0 ]
%8 = phi i32 [ %27, %26 ], [ %4, %0 ]
%9 = sub nsw i32 %7, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ %9, %6 ]
%13 = call i32 @putchar(i32 32)
%14 = add nsw i32 %12, -1
%15 = icmp ugt i32 %12, 1
br i1 %15, label %11, label %16
16: ; preds = %11, %6
%17 = shl nsw i32 %8, 1
br label %18
18: ; preds = %16, %18
%19 = phi i32 [ %20, %18 ], [ %17, %16 ]
%20 = add nsw i32 %19, -1
%21 = call i32 @putchar(i32 35)
%22 = icmp sgt i32 %19, 2
br i1 %22, label %18, label %23
23: ; preds = %18
%24 = call i32 @putchar(i32 10)
%25 = icmp sgt i32 %8, 1
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = add nsw i32 %8, -1
%28 = load i32, i32* %1
br label %6
29: ; preds = %23, %0
ret i32 0
}