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


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>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1235 <main+0x115>
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1191 <main+0x71>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x49>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11cc <main+0xac>
mov    -0x18(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1198 <main+0x78>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1210 <main+0xf0>
mov    -0x18(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11dc <main+0xbc>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <main+0x2f>
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
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rsp)
test   %eax,%eax
jle    1208 <main+0xd8>
mov    $0x1,%ebp
lea    0xe99(%rip),%r14
xor    %r12d,%r12d
mov    (%rsp),%r13d
jmp    1189 <main+0x59>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%eax
add    $0x1,%r12d
cmp    0x4(%rsp),%ebp
mov    %eax,%ebp
jge    1208 <main+0xd8>
cmp    $0x2,%r13d
jl     11b1 <main+0x81>
mov    (%rsp),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jne    11a0 <main+0x70>
add    $0xffffffff,%r13d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jne    11c0 <main+0x90>
cmp    $0x2,%ebp
jb     1170 <main+0x40>
mov    $0xffffffff,%r15d
xchg   %ax,%ax
lea    (%rbx,%r15,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%r15,1),%eax
add    $0xffffffff,%eax
mov    %r15d,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%r15d
cmp    $0xffffffff,%eax
jne    11e0 <main+0xb0>
jmp    1170 <main+0x40>
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" \00"
@.str.2 = [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
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %3
store i32 1, i32* %4
br label %10
10: ; preds = %56, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %59
14: ; preds = %10
store i32 1, i32* %6
store i32 1, i32* %5
br label %15
15: ; preds = %21, %14
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %15
24: ; preds = %15
store i32 1, i32* %5
br label %25
25: ; preds = %34, %24
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %37
29: ; preds = %25
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %34
34: ; preds = %29
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %25
37: ; preds = %25
%38 = load i32, i32* %6
%39 = sub nsw i32 %38, 2
store i32 %39, i32* %6
store i32 1, i32* %5
br label %40
40: ; preds = %49, %37
%41 = load i32, i32* %5
%42 = load i32, i32* %4
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %52
44: ; preds = %40
%45 = load i32, i32* %6
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %6
%48 = add nsw i32 %47, -1
store i32 %48, i32* %6
br label %49
49: ; preds = %44
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %40
52: ; preds = %40
%53 = load i32, i32* %3
%54 = add nsw i32 %53, -1
store i32 %54, i32* %3
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %56
56: ; preds = %52
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %10
59: ; preds = %10
%60 = load i32, i32* %1
ret i32 %60
}

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 %38, label %6
6: ; preds = %0, %32
%7 = phi i32 [ %37, %32 ], [ 2, %0 ]
%8 = phi i32 [ %34, %32 ], [ 1, %0 ]
%9 = phi i32 [ %10, %32 ], [ %4, %0 ]
%10 = add nsw i32 %9, -1
%11 = icmp sgt i32 %9, 1
br i1 %11, label %12, label %17
12: ; preds = %6, %12
%13 = phi i32 [ %15, %12 ], [ 1, %6 ]
%14 = call i32 @putchar(i32 32)
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %9
br i1 %16, label %17, label %12
17: ; preds = %12, %6
br label %18
18: ; preds = %17, %18
%19 = phi i32 [ %21, %18 ], [ 1, %17 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = add nuw i32 %19, 1
%22 = icmp eq i32 %21, %7
br i1 %22, label %23, label %18
23: ; preds = %18
%24 = icmp ugt i32 %8, 1
br i1 %24, label %25, label %32
25: ; preds = %23, %25
%26 = phi i32 [ %28, %25 ], [ %19, %23 ]
%27 = phi i32 [ %30, %25 ], [ 1, %23 ]
%28 = add nsw i32 %26, -1
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i32 %27, 1
%31 = icmp eq i32 %30, %8
br i1 %31, label %32, label %25
32: ; preds = %25, %23
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %8, 1
%35 = load i32, i32* %1
%36 = icmp slt i32 %8, %35
%37 = add nuw i32 %7, 1
br i1 %36, label %6, label %38
38: ; preds = %32, %0
ret i32 0
}