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


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>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11de <main+0xbe>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    118d <main+0x6d>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <main+0x3b>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11c2 <main+0xa2>
mov    -0x8(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <main+0x79>
lea    0xe3a(%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    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%ebp
test   %ebp,%ebp
jle    123b <main+0x10b>
mov    $0x2,%r14d
mov    $0x1,%r12d
lea    0xe92(%rip),%r15
xor    %ecx,%ecx
mov    $0x1,%r13d
jmp    11b2 <main+0x82>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r13),%eax
mov    0x8(%rsp),%ebp
mov    0x14(%rsp),%r14d
add    $0x1,%r14d
mov    0xc(%rsp),%ecx
add    $0xffffffff,%ecx
add    $0xffffffff,%r12d
cmp    %ebp,%r13d
mov    %eax,%r13d
jge    123b <main+0x10b>
cmp    $0x2,%r13d
mov    %r14d,0x14(%rsp)
mov    %r12d,0x10(%rsp)
mov    %ecx,0xc(%rsp)
jb     11f1 <main+0xc1>
mov    %ecx,%r12d
nopl   0x0(%rax)
add    %r12d,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%ebp
add    $0xffffffff,%r14d
add    $0x1,%r12d
cmp    $0x2,%r14d
jg     11d0 <main+0xa0>
mov    %ebp,%ebx
sub    %r13d,%ebx
add    $0x1,%ebx
test   %ebx,%ebx
mov    0x10(%rsp),%r12d
jle    1180 <main+0x50>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebx
je     1180 <main+0x50>
add    %r12d,%ebp
xchg   %ax,%ax
mov    0x8(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
jg     1220 <main+0xf0>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%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
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)
store i32 1, i32* %3
br label %8
8: ; preds = %43, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %46
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %4
br label %15
15: ; preds = %24, %12
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
br label %15
27: ; preds = %15
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = sub nsw i32 %28, %29
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %32
32: ; preds = %38, %27
%33 = load i32, i32* %6
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %32
%36 = load i32, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %35
%39 = load i32, i32* %6
%40 = add nsw i32 %39, -1
store i32 %40, i32* %6
br label %32
41: ; preds = %32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %8
46: ; preds = %8
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 %37, label %6
6: ; preds = %0, %32
%7 = phi i32 [ %35, %32 ], [ %4, %0 ]
%8 = phi i32 [ %34, %32 ], [ 1, %0 ]
%9 = icmp ugt i32 %8, 1
br i1 %9, label %10, label %18
10: ; preds = %6, %10
%11 = phi i32 [ %17, %10 ], [ %7, %6 ]
%12 = phi i32 [ %13, %10 ], [ %8, %6 ]
%13 = add nsw i32 %12, -1
%14 = sub nsw i32 %11, %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = icmp sgt i32 %12, 2
%17 = load i32, i32* %1
br i1 %16, label %10, label %18
18: ; preds = %10, %6
%19 = phi i32 [ %7, %6 ], [ %17, %10 ]
%20 = sub nsw i32 1, %8
%21 = add i32 %20, %19
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
%25 = icmp eq i32 %21, 1
br i1 %25, label %32, label %26
26: ; preds = %23, %26
%27 = phi i32 [ %28, %26 ], [ %21, %23 ]
%28 = add nsw i32 %27, -1
%29 = load i32, i32* %1
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = icmp sgt i32 %27, 2
br i1 %31, label %26, label %32
32: ; preds = %26, %23, %18
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %8, 1
%35 = load i32, i32* %1
%36 = icmp slt i32 %8, %35
br i1 %36, label %6, label %37
37: ; preds = %32, %0
ret i32 0
}