#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() {
  char c;
  c = '*';
  int n, i, k, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    for (j = n - i; j > 0; j--)
      printf(" ");
    for (k = n - i; k < n; k++) {
      if (k == n - 1)
        printf("%c", c);
      else
        printf("%c%c", c, c);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2a,-0x5(%rbp)
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1207 <main+0xe7>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1185 <main+0x65>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    115f <main+0x3f>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11eb <main+0xcb>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11c2 <main+0xa2>
movsbl -0x5(%rbp),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <main+0x6e>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x2a>
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    11f2 <main+0xc2>
mov    $0x1,%r14d
lea    0xe9d(%rip),%r12
xor    %r15d,%r15d
jmp    118e <main+0x5e>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
mov    0xc(%rsp),%ebp
add    $0xffffffff,%r15d
cmp    %r14d,%ebp
mov    %eax,%r14d
jle    11f2 <main+0xc2>
mov    %ebp,%ebx
sub    %r14d,%ebx
jle    11df <main+0xaf>
add    %r15d,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11a0 <main+0x70>
mov    0xc(%rsp),%ebp
mov    %ebp,%ebx
sub    %r14d,%ebx
jmp    11df <main+0xaf>
nopl   (%rax)
mov    %r12,%rdi
mov    $0x2a,%esi
mov    $0x2a,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%ebp
cmp    %ebp,%ebx
jge    1170 <main+0x40>
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    11c0 <main+0x90>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11d4 <main+0xa4>
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 = [3 x i8] c"%c\00"
@.str.3 = [5 x i8] c"%c%c\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i8 42, i8* %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 1, i32* %4
br label %8
8: ; preds = %53, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %56
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %6
br label %16
16: ; preds = %21, %12
%17 = load i32, i32* %6
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19
%22 = load i32, i32* %6
%23 = add nsw i32 %22, -1
store i32 %23, i32* %6
br label %16
24: ; preds = %16
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = sub nsw i32 %25, %26
store i32 %27, i32* %5
br label %28
28: ; preds = %48, %24
%29 = load i32, i32* %5
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %51
32: ; preds = %28
%33 = load i32, i32* %5
%34 = load i32, i32* %3
%35 = sub nsw i32 %34, 1
%36 = icmp eq i32 %33, %35
br i1 %36, label %37, label %41
37: ; preds = %32
%38 = load i8, i8* %2
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %39)
br label %47
41: ; preds = %32
%42 = load i8, i8* %2
%43 = sext i8 %42 to i32
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %43, i32 %45)
br label %47
47: ; preds = %41, %37
br label %48
48: ; preds = %47
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %28
51: ; preds = %28
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %53
53: ; preds = %51
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
br label %8
56: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.3 = [5 x i8] c"%c%c\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 %40, label %6
6: ; preds = %0, %35
%7 = phi i32 [ %38, %35 ], [ %4, %0 ]
%8 = phi i32 [ %37, %35 ], [ 1, %0 ]
%9 = sub nsw i32 %7, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ %9, %6 ]
%13 = call i32 @putchar(i32 32)
%14 = add nsw i32 %12, -1
%15 = icmp ugt i32 %12, 1
br i1 %15, label %11, label %16
16: ; preds = %11
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, %8
br label %19
19: ; preds = %6, %16
%20 = phi i32 [ %7, %6 ], [ %17, %16 ]
%21 = phi i32 [ %9, %6 ], [ %18, %16 ]
br label %22
22: ; preds = %19, %31
%23 = phi i32 [ %33, %31 ], [ %20, %19 ]
%24 = phi i32 [ %32, %31 ], [ %21, %19 ]
%25 = add nsw i32 %23, -1
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @putchar(i32 42)
br label %31
29: ; preds = %22
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 42, i32 42)
br label %31
31: ; preds = %27, %29
%32 = add nsw i32 %24, 1
%33 = load i32, i32* %1
%34 = icmp slt i32 %32, %33
br i1 %34, label %22, label %35
35: ; preds = %31
%36 = call i32 @putchar(i32 10)
%37 = add nuw nsw i32 %8, 1
%38 = load i32, i32* %1
%39 = icmp sgt i32 %38, %8
br i1 %39, label %6, label %40
40: ; preds = %35, %0
ret i32 0
}