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


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     11cb <main+0xab>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1184 <main+0x64>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11b1 <main+0x91>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118b <main+0x6b>
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
mov    -0x4(%rbp),%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    11a6 <main+0x86>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %ebx,%eax
jle    1177 <main+0x57>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1160 <main+0x40>
mov    %ebx,%ebp
nopl   0x0(%rax)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jl     1150 <main+0x30>
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)
store i32 1, i32* %3
br label %6
6: ; preds = %34, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
store i32 1, i32* %4
br label %11
11: ; preds = %19, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = icmp sle i32 %12, %15
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %11
22: ; preds = %11
store i32 1, i32* %4
br label %23
23: ; preds = %29, %22
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %23
32: ; preds = %23
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %32
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %6
37: ; preds = %6
%38 = load i32, i32* %1
ret i32 %38
}

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 %30, label %6
6: ; preds = %0, %24
%7 = phi i32 [ %27, %24 ], [ %4, %0 ]
%8 = phi i32 [ %29, %24 ], [ 2, %0 ]
%9 = phi i32 [ %26, %24 ], [ 1, %0 ]
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %18
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ 1, %6 ]
%13 = call i32 @putchar(i32 32)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %1
%16 = sub nsw i32 %15, %9
%17 = icmp slt i32 %12, %16
br i1 %17, label %11, label %18
18: ; preds = %11, %6
br label %19
19: ; preds = %18, %19
%20 = phi i32 [ %22, %19 ], [ 1, %18 ]
%21 = call i32 @putchar(i32 35)
%22 = add nuw i32 %20, 1
%23 = icmp eq i32 %22, %8
br i1 %23, label %24, label %19
24: ; preds = %19
%25 = call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %9, 1
%27 = load i32, i32* %1
%28 = icmp slt i32 %9, %27
%29 = add nuw i32 %8, 1
br i1 %28, label %6, label %30
30: ; preds = %24, %0
ret i32 0
}