#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 i, j, n;
  scanf("%d", &n);
  for (i = n; i >= 1; i = i - 1) {
    for (j = 1; j <= n; j = j + 1) {
      if (i != j) {
        printf("%d", n + 1 - j);
      } else {
        printf("*");
      }
    }
    printf("\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    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     11c7 <main+0xa7>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11ab <main+0x8b>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     118a <main+0x6a>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
sub    -0xc(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <main+0x78>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119d <main+0x7d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x36>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <main+0x25>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11bc <main+0x8c>
lea    0xea8(%rip),%r14
mov    %esi,%ebp
test   %esi,%esi
jle    11a0 <main+0x70>
xchg   %ax,%ax
mov    $0x1,%ebx
jmp    1187 <main+0x57>
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
mov    0xc(%rsp),%esi
cmp    %esi,%ebx
mov    %eax,%ebx
jge    11a0 <main+0x70>
cmp    %ebp,%ebx
je     1170 <main+0x40>
sub    %ebx,%esi
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    117a <main+0x4a>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebp
jl     11bc <main+0x8c>
add    $0xffffffff,%ebp
mov    0xc(%rsp),%esi
test   %esi,%esi
jg     1160 <main+0x30>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
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
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %4
store i32 %6, i32* %2
br label %7
7: ; preds = %33, %0
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %36
10: ; preds = %7
store i32 1, i32* %3
br label %11
11: ; preds = %28, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %3
%23 = sub nsw i32 %21, %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %27
25: ; preds = %15
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25, %19
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %11
31: ; preds = %11
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %2
%35 = sub nsw i32 %34, 1
store i32 %35, i32* %2
br label %7
36: ; preds = %7
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 sgt i32 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %0, %27
%7 = phi i32 [ %29, %27 ], [ %4, %0 ]
%8 = phi i32 [ %28, %27 ], [ %4, %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 eq i32 %8, %12
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = sub nsw i32 1, %12
%16 = add i32 %15, %11
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %20
18: ; preds = %10
%19 = call i32 @putchar(i32 42)
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 = call i32 @putchar(i32 10)
%26 = icmp sgt i32 %8, 1
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = add nsw i32 %8, -1
%29 = load i32, i32* %1
br label %6
30: ; preds = %24, %0
ret i32 0
}