#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 a, n, N, i, j;
  scanf("%d", &N);
  for (j = 1; j <= N; j = j + 1) {
    for (i = 1; i <= N; i = i + 1) {
      if (i + j == N + 1)
        printf("*");
      else {
        a = N + 1 - i;
        printf("%d", a);
      }
    }
    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    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d8 <main+0xb8>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11bc <main+0x9c>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    118c <main+0x6c>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <main+0x8e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x39>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%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   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11d1 <main+0xa1>
mov    $0x1,%r15d
mov    $0x2,%r12d
lea    0xe98(%rip),%r14
jmp    118e <main+0x5e>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
mov    0xc(%rsp),%esi
add    $0x1,%r12d
cmp    %esi,%r15d
mov    %eax,%r15d
jge    11d1 <main+0xa1>
test   %esi,%esi
jle    1170 <main+0x40>
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    11ba <main+0x8a>
nopl   0x0(%rax,%rax,1)
add    %ebp,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
add    $0x1,%ebx
add    $0xffffffff,%ebp
cmp    %esi,%ebx
jge    1170 <main+0x40>
lea    (%r12,%rbx,1),%eax
lea    0x1(%rsi),%ecx
cmp    %ecx,%eax
jne    11a0 <main+0x70>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11ac <main+0x7c>
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 = [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* %4)
store i32 1, i32* %6
br label %8
8: ; preds = %39, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %42
12: ; preds = %8
store i32 1, i32* %5
br label %13
13: ; preds = %34, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %37
17: ; preds = %13
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
%23 = icmp eq i32 %20, %22
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %33
26: ; preds = %17
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %5
%30 = sub nsw i32 %28, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %26, %24
br label %34
34: ; preds = %33
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %13
37: ; preds = %13
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %8
42: ; 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 %30, label %6
6: ; preds = %0, %25
%7 = phi i32 [ %28, %25 ], [ %4, %0 ]
%8 = phi i32 [ %27, %25 ], [ 1, %0 ]
%9 = icmp slt i32 %7, 1
br i1 %9, label %25, label %10
10: ; preds = %6, %21
%11 = phi i32 [ %23, %21 ], [ %7, %6 ]
%12 = phi i32 [ %22, %21 ], [ 1, %6 ]
%13 = add nuw nsw i32 %12, %8
%14 = add nsw i32 %11, 1
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @putchar(i32 42)
br label %21
18: ; preds = %10
%19 = sub nsw i32 %14, %12
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %16, %18
%22 = add nuw nsw i32 %12, 1
%23 = load i32, i32* %1
%24 = icmp slt i32 %12, %23
br i1 %24, label %10, label %25
25: ; preds = %21, %6
%26 = call i32 @putchar(i32 10)
%27 = add nuw nsw i32 %8, 1
%28 = load i32, i32* %1
%29 = icmp slt i32 %8, %28
br i1 %29, label %6, label %30
30: ; preds = %25, %0
ret i32 0
}