#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 getPositiveInt();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int n = getPositiveInt();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int m = n - i;
      if (j <= m) {
        printf(" ");
      } else {
        printf("#");
      }
    }
    printf("  ");
    for (int j = n; j > 0; j--) {
      int m = n - i;
      if (j > m) {
        printf("#");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getPositiveInt@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     120e <main+0xee>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a4 <main+0x84>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1185 <main+0x65>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <main+0x71>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x76>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <main+0x33>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11f4 <main+0xd4>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11e1 <main+0xc1>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <main+0xc6>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11b6 <main+0x96>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getPositiveInt@plt>
test   %eax,%eax
jle    11fa <main+0xca>
mov    %eax,%r15d
mov    %eax,%r13d
neg    %r13d
mov    $0x1,%r12d
lea    0xea0(%rip),%r14
jmp    1187 <main+0x57>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
cmp    %r12d,%r15d
mov    %eax,%r12d
je     11fa <main+0xca>
mov    %r15d,%ebp
sub    %r12d,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
cmp    %ebp,%ebx
setg   %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
lea    (%rbx,%r13,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    11a0 <main+0x70>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15d,%ebx
jmp    11ea <main+0xba>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jle    1170 <main+0x40>
cmp    %ebp,%ebx
jle    11e0 <main+0xb0>
mov    $0x23,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0xb0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [3 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
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (...) @getPositiveInt()
store i32 %8, i32* %2
store i32 1, i32* %3
br label %9
9: ; preds = %54, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %57
13: ; preds = %9
store i32 1, i32* %4
br label %14
14: ; preds = %30, %13
%15 = load i32, i32* %4
%16 = load i32, i32* %2
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %29
27: ; preds = %18
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %14
33: ; preds = %14
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%35 = load i32, i32* %2
store i32 %35, i32* %6
br label %36
36: ; preds = %49, %33
%37 = load i32, i32* %6
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %52
39: ; preds = %36
%40 = load i32, i32* %2
%41 = load i32, i32* %3
%42 = sub nsw i32 %40, %41
store i32 %42, i32* %7
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = icmp sgt i32 %43, %44
br i1 %45, label %46, label %48
46: ; preds = %39
%47 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %48
48: ; preds = %46, %39
br label %49
49: ; preds = %48
%50 = load i32, i32* %6
%51 = add nsw i32 %50, -1
store i32 %51, i32* %6
br label %36
52: ; preds = %36
%53 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %54
54: ; preds = %52
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 1
store i32 %56, i32* %3
br label %9
57: ; preds = %9
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c" \00"
define i32 @main() {
%1 = tail call i32 (...) @getPositiveInt()
%2 = icmp slt i32 %1, 1
br i1 %2, label %6, label %3
3: ; preds = %0, %17
%4 = phi i32 [ %19, %17 ], [ 1, %0 ]
%5 = sub nsw i32 %1, %4
br label %10
6: ; preds = %17, %0
ret i32 0
7: ; preds = %10
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = sub nsw i32 %1, %4
br label %21
10: ; preds = %3, %10
%11 = phi i32 [ 1, %3 ], [ %15, %10 ]
%12 = icmp sgt i32 %11, %5
%13 = select i1 %12, i32 35, i32 32
%14 = tail call i32 @putchar(i32 %13)
%15 = add nuw i32 %11, 1
%16 = icmp eq i32 %11, %1
br i1 %16, label %7, label %10
17: ; preds = %26
%18 = tail call i32 @putchar(i32 10)
%19 = add nuw i32 %4, 1
%20 = icmp eq i32 %1, %4
br i1 %20, label %6, label %3
21: ; preds = %7, %26
%22 = phi i32 [ %1, %7 ], [ %27, %26 ]
%23 = icmp sgt i32 %22, %9
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @putchar(i32 35)
br label %26
26: ; preds = %24, %21
%27 = add nsw i32 %22, -1
%28 = icmp sgt i32 %22, 1
br i1 %28, label %21, label %17
}