#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, i, j;
  printf("Input : ");
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    for (j = 0; j < n - i; j++) {
      printf(" ");
    }
    for (j = 0; j < (i * 2) - 1; 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
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11df <main+0xbf>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1190 <main+0x70>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <main+0x45>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11c5 <main+0xa5>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1197 <main+0x77>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11dd <main+0xad>
mov    $0x1,%r14d
mov    $0x1,%r15d
nopl   0x0(%rax)
cmp    $0x2,%r14d
mov    $0x1,%ebp
cmovge %r14d,%ebp
cmp    %r15d,%eax
jle    11b0 <main+0x80>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
sub    %r15d,%eax
cmp    %eax,%ebx
jl     1190 <main+0x60>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%ecx
mov    0x4(%rsp),%eax
add    $0x2,%r14d
cmp    %eax,%r15d
mov    %ecx,%r15d
jl     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Input : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %32, label %7
7: ; preds = %0, %26
%8 = phi i32 [ %29, %26 ], [ %5, %0 ]
%9 = phi i32 [ %31, %26 ], [ 1, %0 ]
%10 = phi i32 [ %28, %26 ], [ 1, %0 ]
%11 = call i32 @llvm.smax.i32(i32 %9, i32 1)
%12 = icmp sgt i32 %8, %10
br i1 %12, label %13, label %20
13: ; preds = %7, %13
%14 = phi i32 [ %16, %13 ], [ 0, %7 ]
%15 = call i32 @putchar(i32 32)
%16 = add nuw nsw i32 %14, 1
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, %10
%19 = icmp slt i32 %16, %18
br i1 %19, label %13, label %20
20: ; preds = %13, %7
br label %21
21: ; preds = %20, %21
%22 = phi i32 [ %24, %21 ], [ 0, %20 ]
%23 = call i32 @putchar(i32 42)
%24 = add nuw nsw i32 %22, 1
%25 = icmp eq i32 %24, %11
br i1 %25, label %26, label %21
26: ; preds = %21
%27 = call i32 @putchar(i32 10)
%28 = add nuw nsw i32 %10, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %10, %29
%31 = add nuw i32 %9, 2
br i1 %30, label %7, label %32
32: ; preds = %26, %0
ret i32 0
}