#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 = 0; i <= n; i++) {
    for (j = 1; j <= (2 * i - 1); j++) {
      printf("%c", '#');
    }
    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
jg     11aa <main+0x8a>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     118e <main+0x6e>
lea    0xe8f(%rip),%rdi
mov    $0x23,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
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>
cmpl   $0x0,0xc(%rsp)
js     1191 <main+0x71>
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    116b <main+0x4b>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
add    $0x2,%ebx
cmp    0xc(%rsp),%r14d
mov    %eax,%r14d
jge    1191 <main+0x71>
cmp    $0x3,%ebx
mov    $0x2,%ebp
cmovae %ebx,%ebp
test   %r14d,%r14d
je     1150 <main+0x30>
add    $0xffffffff,%ebp
xchg   %ax,%ax
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    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 = [3 x i8] c"%c\00"
@.str.2 = [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 = %24, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %27
10: ; preds = %6
store i32 1, i32* %4
br label %11
11: ; preds = %19, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = mul nsw i32 2, %13
%15 = sub nsw i32 %14, 1
%16 = icmp sle i32 %12, %15
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 35)
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
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %6
27: ; 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, 0
br i1 %5, label %22, label %6
6: ; preds = %0, %16
%7 = phi i32 [ %21, %16 ], [ 0, %0 ]
%8 = phi i32 [ %18, %16 ], [ 0, %0 ]
%9 = call i32 @llvm.umax.i32(i32 %7, i32 2)
%10 = icmp eq i32 %8, 0
br i1 %10, label %16, label %11
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ 1, %6 ]
%13 = call i32 @putchar(i32 35)
%14 = add nuw i32 %12, 1
%15 = icmp eq i32 %14, %9
br i1 %15, label %16, label %11
16: ; preds = %11, %6
%17 = call i32 @putchar(i32 10)
%18 = add nuw nsw i32 %8, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %8, %19
%21 = add i32 %7, 2
br i1 %20, label %6, label %22
22: ; preds = %16, %0
ret i32 0
}