#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*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++)
      putchar(i + j < n - 1 ? '_' : '*');
    puts("");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c0 <main+0x90>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a6 <main+0x76>
mov    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0x2a,%eax
mov    $0x5f,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <main+0x39>
lea    0xe55(%rip),%rdi
call   1040 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1197 <main+0x77>
xor    %r14d,%r14d
jmp    1167 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
mov    0x4(%rsp),%eax
cmp    %eax,%r14d
jge    1197 <main+0x77>
test   %eax,%eax
jle    1150 <main+0x30>
xor    %ebx,%ebx
jmp    1180 <main+0x60>
nop
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
jge    1150 <main+0x30>
lea    (%r14,%rbx,1),%ecx
add    $0xffffffff,%eax
mov    $0x5f,%edi
cmp    %eax,%ecx
jl     1170 <main+0x50>
mov    $0x2a,%edi
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [1 x i8] zeroinitializer
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 0, i32* %3
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %34
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %26, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %29
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 1
%21 = icmp slt i32 %18, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 95, i32 42
%24 = trunc i32 %23 to i8
%25 = call i32 @putchar(i8 signext %24)
br label %26
26: ; preds = %15
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %11
29: ; preds = %11
%30 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %6
34: ; 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 sgt i32 %4, 0
br i1 %5, label %6, label %26
6: ; preds = %0, %21
%7 = phi i32 [ %24, %21 ], [ %4, %0 ]
%8 = phi i32 [ %23, %21 ], [ 0, %0 ]
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %21
10: ; preds = %6, %10
%11 = phi i32 [ %19, %10 ], [ %7, %6 ]
%12 = phi i32 [ %18, %10 ], [ 0, %6 ]
%13 = add nuw nsw i32 %12, %8
%14 = add nsw i32 %11, -1
%15 = icmp slt i32 %13, %14
%16 = select i1 %15, i8 95, i8 42
%17 = call i32 @putchar(i8 signext %16)
%18 = add nuw nsw i32 %12, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %10, label %21
21: ; preds = %10, %6
%22 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%23 = add nuw nsw i32 %8, 1
%24 = load i32, i32* %1
%25 = icmp slt i32 %23, %24
br i1 %25, label %6, label %26
26: ; preds = %21, %0
ret i32 0
}