#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 = 1; i <= n; ++i) {
    for (int j = n - i; j > 0; --j)
      printf(" ");
    for (int k = i; k > 0; --k)
      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   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11c3 <main+0xa3>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    117f <main+0x5f>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <main+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11a9 <main+0x89>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1185 <main+0x65>
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    $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),%ebx
test   %ebx,%ebx
jle    11c4 <main+0xa4>
mov    $0x1,%r14d
xor    %r15d,%r15d
mov    $0x2,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12d,%ebp
cmp    %r14d,%ebx
jle    1190 <main+0x70>
add    %r15d,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1170 <main+0x50>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1190 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
mov    0xc(%rsp),%ebx
add    $0xffffffff,%r15d
add    $0x1,%r12d
cmp    %r14d,%ebx
mov    %eax,%r14d
jg     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
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 1, i32* %3
br label %7
7: ; preds = %35, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %38
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %4
br label %15
15: ; preds = %20, %11
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
br label %15
23: ; preds = %15
%24 = load i32, i32* %3
store i32 %24, i32* %5
br label %25
25: ; preds = %30, %23
%26 = load i32, i32* %5
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load i32, i32* %5
%32 = add nsw i32 %31, -1
store i32 %32, i32* %5
br label %25
33: ; preds = %25
%34 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %35
35: ; preds = %33
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %7
38: ; 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 slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %18, %0
ret i32 0
7: ; preds = %0, %18
%8 = phi i32 [ %21, %18 ], [ %4, %0 ]
%9 = phi i32 [ %20, %18 ], [ 1, %0 ]
%10 = sub nsw i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %13, %7
br label %23
13: ; preds = %7, %13
%14 = phi i32 [ %16, %13 ], [ %10, %7 ]
%15 = call i32 @putchar(i32 32)
%16 = add nsw i32 %14, -1
%17 = icmp ugt i32 %14, 1
br i1 %17, label %13, label %12
18: ; preds = %23
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %9, 1
%21 = load i32, i32* %1
%22 = icmp sgt i32 %21, %9
br i1 %22, label %7, label %6
23: ; preds = %12, %23
%24 = phi i32 [ %26, %23 ], [ %9, %12 ]
%25 = call i32 @putchar(i32 35)
%26 = add nsw i32 %24, -1
%27 = icmp sgt i32 %24, 1
br i1 %27, label %23, label %18
}