#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  int i, j;
  scanf("%d", &N);
  for (i = 1; i <= N; i = i + 1) {
    for (j = 1; j <= N; j = j + 1)
      if (i > j) {
        printf("%d", N - i + j);
      } else {
        printf("%d\n", 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   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11c0 <main+0xa0>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ad <main+0x8d>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    118b <main+0x6b>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    119a <main+0x7a>
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x7f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
jmp    11b2 <main+0x92>
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   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11a3 <main+0x83>
mov    $0x1,%ebx
xor    %r12d,%r12d
lea    0xeac(%rip),%r14
lea    0xea8(%rip),%r15
jmp    116d <main+0x4d>
nopl   (%rax)
lea    0x1(%rbx),%eax
add    $0xffffffff,%r12d
cmp    %esi,%ebx
mov    %eax,%ebx
jge    11a3 <main+0x83>
test   %esi,%esi
jle    1160 <main+0x40>
xor    %eax,%eax
jmp    1192 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %ebp,%eax
cmp    %esi,%ebp
jge    1160 <main+0x40>
lea    0x1(%rax),%ebp
cmp    %ebx,%ebp
jae    1180 <main+0x60>
add    %r12d,%esi
add    %eax,%esi
mov    %r14,%rdi
jmp    1183 <main+0x63>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 %28, label %6
6: ; preds = %0, %24
%7 = phi i32 [ %25, %24 ], [ %4, %0 ]
%8 = phi i32 [ %26, %24 ], [ 1, %0 ]
%9 = icmp slt i32 %7, 1
br i1 %9, label %24, label %10
10: ; preds = %6, %20
%11 = phi i32 [ %22, %20 ], [ %7, %6 ]
%12 = phi i32 [ %21, %20 ], [ 1, %6 ]
%13 = icmp ult i32 %12, %8
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = sub nsw i32 %12, %8
%16 = add i32 %15, %11
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %20
18: ; preds = %10
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %20
20: ; preds = %14, %18
%21 = add nuw nsw i32 %12, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %12, %22
br i1 %23, label %10, label %24
24: ; preds = %20, %6
%25 = phi i32 [ %7, %6 ], [ %22, %20 ]
%26 = add nuw nsw i32 %8, 1
%27 = icmp slt i32 %8, %25
br i1 %27, label %6, label %28
28: ; preds = %24, %0
ret i32 0
}