#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);
  i = 1;
  j = N;
  while (i <= N) {
    while (j > 0 && j > i) {
      printf("%d", j);
      j = j - 1;
    }
    printf("*");
    j = i - 1;
    while (j > 0) {
      printf("%d", j);
      j = j - 1;
    }
    i = i + 1;
    j = 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    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1209 <main+0xe9>
jmp    115d <main+0x3d>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jle    1178 <main+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1188 <main+0x68>
jmp    11a7 <main+0x87>
mov    -0xc(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x3d>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11e7 <main+0xc7>
mov    -0xc(%rbp),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11be <main+0x9e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <main+0x2c>
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),%ebp
test   %ebp,%ebp
jle    11e7 <main+0xb7>
mov    $0x1,%ebx
mov    $0x2,%r14d
lea    0xe95(%rip),%r15
jmp    118f <main+0x5f>
nopl   (%rax)
lea    0x1(%rbx),%r12d
mov    0xc(%rsp),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    0xc(%rsp),%ebx
mov    %r12d,%ebx
jge    11e7 <main+0xb7>
test   %ebp,%ebp
jle    11b7 <main+0x87>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %ebx,%ebp
jle    11b7 <main+0x87>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    %ebx,%ebp
jg     11a4 <main+0x74>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebx
jb     1170 <main+0x40>
mov    %r14d,%ebp
nopl   0x0(%rax)
lea    -0x2(%rbp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
jg     11d0 <main+0xa0>
jmp    1170 <main+0x40>
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
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)
store i32 1, i32* %2
%6 = load i32, i32* %4
store i32 %6, i32* %3
br label %7
7: ; preds = %38, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %43
11: ; preds = %7
br label %12
12: ; preds = %21, %11
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp sgt i32 %16, %17
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %21, label %26
21: ; preds = %19
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %3
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %3
br label %12
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %33, %26
%31 = load i32, i32* %3
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %3
%37 = sub nsw i32 %36, 1
store i32 %37, i32* %3
br label %30
38: ; preds = %30
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
%41 = load i32, i32* %4
store i32 %41, i32* %3
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %7
43: ; 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 slt i32 %4, 1
br i1 %5, label %31, label %6
6: ; preds = %0, %25
%7 = phi i32 [ %27, %25 ], [ %4, %0 ]
%8 = phi i32 [ %26, %25 ], [ 1, %0 ]
%9 = icmp sgt i32 %7, 0
%10 = icmp sgt i32 %7, %8
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %12, label %17
12: ; preds = %6, %12
%13 = phi i32 [ %15, %12 ], [ %7, %6 ]
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = add nsw i32 %13, -1
%16 = icmp sgt i32 %15, %8
br i1 %16, label %12, label %17
17: ; preds = %12, %6
%18 = call i32 @putchar(i32 42)
%19 = icmp ugt i32 %8, 1
br i1 %19, label %20, label %25
20: ; preds = %17, %20
%21 = phi i32 [ %22, %20 ], [ %8, %17 ]
%22 = add nsw i32 %21, -1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = icmp sgt i32 %21, 2
br i1 %24, label %20, label %25
25: ; preds = %20, %17
%26 = add nuw nsw i32 %8, 1
%27 = load i32, i32* %1
%28 = call i32 @putchar(i32 10)
%29 = load i32, i32* %1
%30 = icmp slt i32 %8, %29
br i1 %30, label %6, label %31
31: ; preds = %25, %0
ret i32 0
}