#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 N;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    for (int j = N; j >= i; j--)
      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    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1198 <main+0x78>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     117e <main+0x5e>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x38>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
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   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jle    1183 <main+0x63>
mov    $0x1,%ebx
jmp    1167 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
mov    0x4(%rsp),%ebp
cmp    %ebp,%ebx
mov    %eax,%ebx
jge    1183 <main+0x63>
cmp    %ebx,%ebp
jl     1150 <main+0x30>
add    $0x1,%ebp
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    %ebx,%ebp
jg     1170 <main+0x50>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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* %2)
store i32 1, i32* %3
br label %6
6: ; preds = %23, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i32, i32* %2
store i32 %11, i32* %4
br label %12
12: ; preds = %18, %10
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %4
%20 = add nsw i32 %19, -1
store i32 %20, i32* %4
br label %12
21: ; preds = %12
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %6
26: ; preds = %6
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 %10, label %6
6: ; preds = %0, %11
%7 = phi i32 [ %14, %11 ], [ %4, %0 ]
%8 = phi i32 [ %13, %11 ], [ 1, %0 ]
%9 = icmp slt i32 %7, %8
br i1 %9, label %11, label %16
10: ; preds = %11, %0
ret i32 0
11: ; preds = %16, %6
%12 = call i32 @putchar(i32 10)
%13 = add nuw nsw i32 %8, 1
%14 = load i32, i32* %1
%15 = icmp slt i32 %8, %14
br i1 %15, label %6, label %10
16: ; preds = %6, %16
%17 = phi i32 [ %19, %16 ], [ %7, %6 ]
%18 = call i32 @putchar(i32 42)
%19 = add nsw i32 %17, -1
%20 = icmp sgt i32 %17, %8
br i1 %20, label %16, label %11
}