#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;
  scanf("%d", &n);
  for (i = n; i >= 1; i--) {
    for (j = 1; j <= n; j++) {
      if (j < i) {
        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>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     11b8 <main+0x98>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     119e <main+0x7e>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117f <main+0x5f>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <main+0x6b>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x70>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <main+0x36>
lea    0xe62(%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    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1197 <main+0x77>
mov    %eax,%ebx
test   %eax,%eax
jle    117b <main+0x5b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
xor    %eax,%eax
cmp    %ebx,%ebp
setge  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
cmp    0x4(%rsp),%ebp
jl     1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebx
jl     1197 <main+0x77>
add    $0xffffffff,%ebx
mov    0x4(%rsp),%eax
test   %eax,%eax
jg     1150 <main+0x30>
jmp    117b <main+0x5b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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)
%6 = load i32, i32* %2
store i32 %6, i32* %3
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %32
10: ; preds = %7
store i32 1, i32* %4
br label %11
11: ; preds = %24, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %11
27: ; preds = %11
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %27
%30 = load i32, i32* %3
%31 = add nsw i32 %30, -1
store i32 %31, i32* %3
br label %7
32: ; 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 %24
6: ; preds = %0, %21
%7 = phi i32 [ %23, %21 ], [ %4, %0 ]
%8 = phi i32 [ %22, %21 ], [ %4, %0 ]
%9 = icmp slt i32 %7, 1
br i1 %9, label %18, label %10
10: ; preds = %6, %10
%11 = phi i32 [ %15, %10 ], [ 1, %6 ]
%12 = icmp slt i32 %11, %8
%13 = select i1 %12, i32 32, i32 35
%14 = call i32 @putchar(i32 %13)
%15 = add nuw nsw i32 %11, 1
%16 = load i32, i32* %1
%17 = icmp slt i32 %11, %16
br i1 %17, label %10, label %18
18: ; preds = %10, %6
%19 = call i32 @putchar(i32 10)
%20 = icmp sgt i32 %8, 1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = add nsw i32 %8, -1
%23 = load i32, i32* %1
br label %6
24: ; preds = %18, %0
ret i32 0
}