#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 == 6)
        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     11d3 <main+0xb3>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11b7 <main+0x97>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x6,%eax
jne    1187 <main+0x67>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a4 <main+0x84>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x39>
lea    0xe47(%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   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11d1 <main+0xa1>
mov    $0x1,%r15d
lea    0xea1(%rip),%r14
jmp    118a <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
mov    0xc(%rsp),%esi
cmp    %esi,%r15d
mov    %eax,%r15d
jge    11d1 <main+0xa1>
test   %esi,%esi
jle    1170 <main+0x40>
mov    $0x1,%ebx
jmp    11bc <main+0x8c>
cs nopw 0x0(%rax,%rax,1)
nop
sub    %ebx,%esi
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%eax
mov    0xc(%rsp),%esi
cmp    %esi,%ebx
mov    %eax,%ebx
jge    1170 <main+0x40>
lea    (%rbx,%r15,1),%eax
cmp    $0x6,%eax
jne    11a0 <main+0x70>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11af <main+0x7f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 = %37, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %40
12: ; preds = %8
store i32 1, i32* %5
br label %13
13: ; preds = %32, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %35
17: ; preds = %13
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
%21 = icmp eq i32 %20, 6
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
24: ; preds = %17
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %5
%28 = sub nsw i32 %26, %27
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %24, %22
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %13
35: ; preds = %13
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %8
40: ; 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 = icmp eq i32 %13, 6
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @putchar(i32 42)
br label %21
17: ; preds = %10
%18 = sub nsw i32 1, %12
%19 = add i32 %18, %11
%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 = %15, %17
%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
}