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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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    11c3 <main+0xa3>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a9 <main+0x89>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    118a <main+0x6a>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x76>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x7b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
lea    0xe57(%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    $0x10,%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    11a1 <main+0x81>
xor    %r14d,%r14d
jmp    1167 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
mov    0xc(%rsp),%eax
cmp    %eax,%r14d
jge    11a1 <main+0x81>
test   %eax,%eax
jle    1150 <main+0x30>
mov    %r14d,%ebp
not    %ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %ebp,%eax
xor    %ecx,%ecx
cmp    %eax,%ebx
setge  %cl
lea    (%rcx,%rcx,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
jl     1180 <main+0x60>
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
store i32 0, i32* %1
%5 = 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 %6
6: ; preds = %32, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %35
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %27, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %11
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
%20 = sub nsw i32 %19, 1
%21 = icmp slt i32 %16, %20
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %26
24: ; preds = %15
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %11
30: ; preds = %11
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %6
35: ; preds = %6
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 %12
6: ; preds = %0, %13
%7 = phi i32 [ %16, %13 ], [ %4, %0 ]
%8 = phi i32 [ %15, %13 ], [ 0, %0 ]
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = xor i32 %8, -1
br label %18
12: ; preds = %13, %0
ret i32 0
13: ; preds = %18, %6
%14 = call i32 @putchar(i32 10)
%15 = add nuw nsw i32 %8, 1
%16 = load i32, i32* %1
%17 = icmp slt i32 %15, %16
br i1 %17, label %6, label %12
18: ; preds = %10, %18
%19 = phi i32 [ %7, %10 ], [ %26, %18 ]
%20 = phi i32 [ 0, %10 ], [ %25, %18 ]
%21 = add i32 %19, %11
%22 = icmp slt i32 %20, %21
%23 = select i1 %22, i32 32, i32 35
%24 = call i32 @putchar(i32 %23)
%25 = add nuw nsw i32 %20, 1
%26 = load i32, i32* %1
%27 = icmp slt i32 %25, %26
br i1 %27, label %18, label %13
}