#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*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c, i, j, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n - i; j++)
      putchar(' ');
    for (j = 1; j <= 2 * i - 1; j++)
      printf("%d", j);
    printf("\n");
  }
  for (i = i - 2; i >= 0; i--) {
    for (j = 1; j <= n - i; j++)
      putchar(' ');
    for (j = 1; j <= 2 * i - 1; j++)
      printf("%d", j);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11e8 <main+0xb8>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jg     1192 <main+0x62>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <main+0x39>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11cc <main+0x9c>
mov    -0x18(%rbp),%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <main+0x69>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <main+0x26>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1281 <main+0x151>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jg     122b <main+0xfb>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1202 <main+0xd2>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1265 <main+0x135>
mov    -0x18(%rbp),%esi
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1232 <main+0x102>
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11f1 <main+0xc1>
xor    %eax,%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
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    127a <main+0x14a>
mov    $0x1,%ecx
lea    0xe9c(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%r15d
cmp    %ecx,%eax
jle    1198 <main+0x68>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
sub    %r15d,%eax
add    $0x1,%ebx
cmp    %eax,%ebx
jl     1180 <main+0x50>
mov    $0x1,%ebx
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
jne    11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%ecx
mov    0x4(%rsp),%eax
add    $0xfffffffe,%ebp
cmp    %eax,%r15d
jl     1170 <main+0x40>
lea    (%rcx,%rcx,1),%r14d
add    $0xfffffffc,%r14d
lea    0xe19(%rip),%r12
nopw   0x0(%rax,%rax,1)
cmp    $0x3,%r14d
mov    $0x2,%ebx
cmovge %r14d,%ebx
lea    -0x1(%r15),%r13d
cmp    %r15d,%eax
jl     1228 <main+0xf8>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
sub    %r13d,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1210 <main+0xe0>
cmp    $0x2,%r15d
jl     1270 <main+0x140>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1240 <main+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%r15d
jl     127a <main+0x14a>
add    $0xfffffffe,%r14d
mov    0x4(%rsp),%eax
mov    %r13d,%r15d
jmp    11f0 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [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 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 1, i32* %5
br label %9
9: ; preds = %40, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %43
13: ; preds = %9
store i32 1, i32* %6
br label %14
14: ; preds = %22, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = sub nsw i32 %16, %17
%19 = icmp sle i32 %15, %18
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = call i32 @putchar(i8 signext 32)
br label %22
22: ; preds = %20
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %14
25: ; preds = %14
store i32 1, i32* %6
br label %26
26: ; preds = %35, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %5
%29 = mul nsw i32 2, %28
%30 = sub nsw i32 %29, 1
%31 = icmp sle i32 %27, %30
br i1 %31, label %32, label %38
32: ; preds = %26
%33 = load i32, i32* %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %26
38: ; preds = %26
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %9
43: ; preds = %9
%44 = load i32, i32* %5
%45 = sub nsw i32 %44, 2
store i32 %45, i32* %5
br label %46
46: ; preds = %76, %43
%47 = load i32, i32* %5
%48 = icmp sge i32 %47, 0
br i1 %48, label %49, label %79
49: ; preds = %46
store i32 1, i32* %6
br label %50
50: ; preds = %58, %49
%51 = load i32, i32* %6
%52 = load i32, i32* %7
%53 = load i32, i32* %5
%54 = sub nsw i32 %52, %53
%55 = icmp sle i32 %51, %54
br i1 %55, label %56, label %61
56: ; preds = %50
%57 = call i32 @putchar(i8 signext 32)
br label %58
58: ; preds = %56
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %50
61: ; preds = %50
store i32 1, i32* %6
br label %62
62: ; preds = %71, %61
%63 = load i32, i32* %6
%64 = load i32, i32* %5
%65 = mul nsw i32 2, %64
%66 = sub nsw i32 %65, 1
%67 = icmp sle i32 %63, %66
br i1 %67, label %68, label %74
68: ; preds = %62
%69 = load i32, i32* %6
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %68
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
br label %62
74: ; preds = %62
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %76
76: ; preds = %74
%77 = load i32, i32* %5
%78 = add nsw i32 %77, -1
store i32 %78, i32* %5
br label %46
79: ; preds = %46
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 %61, 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(i8 signext 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
%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 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%26 = add nuw nsw i32 %9, 1
%27 = load i32, i32* %1
%28 = icmp slt i32 %9, %27
%29 = add i32 %8, 2
br i1 %28, label %6, label %30
30: ; preds = %24
%31 = shl nuw i32 %26, 1
%32 = add i32 %31, -4
br label %33
33: ; preds = %58, %30
%34 = phi i32 [ %27, %30 ], [ %60, %58 ]
%35 = phi i32 [ %32, %30 ], [ %59, %58 ]
%36 = phi i32 [ %9, %30 ], [ %37, %58 ]
%37 = add nsw i32 %36, -1
%38 = call i32 @llvm.smax.i32(i32 %35, i32 2)
%39 = icmp slt i32 %34, %36
br i1 %39, label %40, label %44
40: ; preds = %44, %33
%41 = icmp sgt i32 %36, 1
br i1 %41, label %51, label %42
42: ; preds = %40
%43 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
br label %61
44: ; preds = %33, %44
%45 = phi i32 [ %47, %44 ], [ 1, %33 ]
%46 = call i32 @putchar(i8 signext 32)
%47 = add nuw nsw i32 %45, 1
%48 = load i32, i32* %1
%49 = sub nsw i32 %48, %37
%50 = icmp slt i32 %45, %49
br i1 %50, label %44, label %40
51: ; preds = %40, %51
%52 = phi i32 [ %54, %51 ], [ 1, %40 ]
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = add nuw nsw i32 %52, 1
%55 = icmp eq i32 %54, %38
br i1 %55, label %56, label %51
56: ; preds = %51
%57 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
br i1 %41, label %58, label %61
58: ; preds = %56
%59 = add i32 %35, -2
%60 = load i32, i32* %1
br label %33
61: ; preds = %56, %42, %0
ret i32 0
}