#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 m, n, i, j, k, l;
  scanf("%d", &n);
  m = n;
  l = n - m + 1;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m - 1; j++) {
      printf(" ");
    }
    m--;
    for (k = 0; k < l; k++) {
      printf("#");
    }
    l++;
    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    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ef <main+0xcf>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1196 <main+0x76>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <main+0x4b>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11cc <main+0xac>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a6 <main+0x86>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x38>
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),%r14d
test   %r14d,%r14d
jle    11b7 <main+0x97>
xor    %r12d,%r12d
mov    $0x1,%ebx
mov    %r14d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2,%r15d
jl     1181 <main+0x61>
mov    %r14d,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    1170 <main+0x50>
add    $0xffffffff,%r15d
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x70>
add    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    0xc(%rsp),%r12d
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
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %7
store i32 0, i32* %4
br label %14
14: ; preds = %45, %0
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %48
18: ; preds = %14
store i32 0, i32* %5
br label %19
19: ; preds = %26, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 1
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %19
29: ; preds = %19
%30 = load i32, i32* %2
%31 = add nsw i32 %30, -1
store i32 %31, i32* %2
store i32 0, i32* %6
br label %32
32: ; preds = %38, %29
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %32
41: ; preds = %32
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %41
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %14
48: ; preds = %14
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, %25
%7 = phi i32 [ %11, %25 ], [ %4, %0 ]
%8 = phi i32 [ %26, %25 ], [ 1, %0 ]
%9 = phi i32 [ %28, %25 ], [ 0, %0 ]
%10 = phi i32 [ %12, %25 ], [ %4, %0 ]
%11 = add i32 %7, -1
%12 = add nsw i32 %10, -1
%13 = icmp sgt i32 %10, 1
br i1 %13, label %14, label %19
14: ; preds = %6, %14
%15 = phi i32 [ %17, %14 ], [ 0, %6 ]
%16 = call i32 @putchar(i32 32)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %11
br i1 %18, label %19, label %14
19: ; preds = %14, %6
br label %20
20: ; preds = %19, %20
%21 = phi i32 [ %23, %20 ], [ 0, %19 ]
%22 = call i32 @putchar(i32 35)
%23 = add nuw nsw i32 %21, 1
%24 = icmp eq i32 %23, %8
br i1 %24, label %25, label %20
25: ; preds = %20
%26 = add nuw nsw i32 %8, 1
%27 = call i32 @putchar(i32 10)
%28 = add nuw nsw i32 %9, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %28, %29
br i1 %30, label %6, label %31
31: ; preds = %25, %0
ret i32 0
}