#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;
  int i, symbolCount;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) {
    for (symbolCount = 0; symbolCount < N; symbolCount++) {
      if (N - symbolCount > 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>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11be <main+0x9e>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a4 <main+0x84>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1185 <main+0x65>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <main+0x71>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x76>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
lea    0xe5c(%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    11a5 <main+0x85>
mov    $0x1,%r14d
jmp    116a <main+0x4a>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0xc(%rsp),%eax
cmp    %eax,%r14d
mov    %ecx,%r14d
jge    11a5 <main+0x85>
test   %eax,%eax
jle    1150 <main+0x30>
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %ebp,%eax
xor    %ecx,%ecx
cmp    %r14d,%eax
setle  %cl
lea    (%rcx,%rcx,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    $0xffffffff,%ebp
cmp    %ebx,%eax
jg     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 1, i32* %3
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %34
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %26, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %29
15: ; preds = %11
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %15
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %11
29: ; preds = %11
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %6
34: ; 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 slt i32 %4, 1
br i1 %5, label %25, label %6
6: ; preds = %0, %20
%7 = phi i32 [ %23, %20 ], [ %4, %0 ]
%8 = phi i32 [ %22, %20 ], [ 1, %0 ]
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %20
10: ; preds = %6, %10
%11 = phi i32 [ %18, %10 ], [ %7, %6 ]
%12 = phi i32 [ %17, %10 ], [ 0, %6 ]
%13 = sub nsw i32 %11, %12
%14 = icmp sgt i32 %13, %8
%15 = select i1 %14, i32 32, i32 35
%16 = call i32 @putchar(i32 %15)
%17 = add nuw nsw i32 %12, 1
%18 = load i32, i32* %1
%19 = icmp sgt i32 %18, %17
br i1 %19, label %10, label %20
20: ; preds = %10, %6
%21 = call i32 @putchar(i32 10)
%22 = add nuw nsw i32 %8, 1
%23 = load i32, i32* %1
%24 = icmp slt i32 %8, %23
br i1 %24, label %6, label %25
25: ; preds = %20, %0
ret i32 0
}