#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(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++)
      printf(" ");
    for (int j = 2 * (n - i) - 1; j > 0; j--)
      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>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cc <main+0xac>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117f <main+0x5f>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11b2 <main+0x92>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <main+0x6e>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
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    11a4 <main+0x84>
xor    %r14d,%r14d
xor    %ebp,%ebp
jmp    1169 <main+0x49>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
add    $0xffffffff,%r14d
cmp    %eax,%ebp
jge    11a4 <main+0x84>
mov    %ebp,%ebx
test   %ebp,%ebp
je     1183 <main+0x63>
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1170 <main+0x50>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
jle    1150 <main+0x30>
add    %r14d,%eax
lea    (%rax,%rax,1),%ebx
add    $0x1,%ebx
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jg     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* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %37, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %40
11: ; preds = %7
store i32 0, i32* %4
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %12
21: ; preds = %12
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %5
br label %27
27: ; preds = %32, %21
%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 %7
40: ; 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 sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0, %24
%7 = phi i32 [ %27, %24 ], [ %4, %0 ]
%8 = phi i32 [ %26, %24 ], [ 0, %0 ]
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %19
10: ; preds = %24, %0
ret i32 0
11: ; preds = %19
%12 = load i32, i32* %1
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %12, %11 ], [ %7, %6 ]
%15 = sub nsw i32 %14, %8
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = shl nuw nsw i32 %15, 1
br label %29
19: ; preds = %6, %19
%20 = phi i32 [ %22, %19 ], [ 0, %6 ]
%21 = call i32 @putchar(i32 32)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, %8
br i1 %23, label %11, label %19
24: ; preds = %29, %13
%25 = call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %8, 1
%27 = load i32, i32* %1
%28 = icmp slt i32 %26, %27
br i1 %28, label %6, label %10
29: ; preds = %17, %29
%30 = phi i32 [ %31, %29 ], [ %18, %17 ]
%31 = add nsw i32 %30, -1
%32 = call i32 @putchar(i32 35)
%33 = icmp sgt i32 %30, 2
br i1 %33, label %29, label %24
}