#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;
  printf("HOW MANY LINE DO U WANT TO DRAW?\n");
  scanf("%d", &n);
  if (n > 22)
    printf("THE LINE IS DEFAUTL\n");
  else {
    int j, i, k;
    for (i = 0; i <= n; i++) {
      for (k = n - 1; k >= i; k--) {
        printf(" ");
      }
      for (j = 1; j <= (2 * i + 1); j++) {
        printf("*");
      }
      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
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x16,-0x8(%rbp)
jle    1166 <main+0x46>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11f7 <main+0xd7>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11a8 <main+0x88>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <main+0x62>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     11dd <main+0xbd>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11af <main+0x8f>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116d <main+0x4d>
jmp    11fc <main+0xdc>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebp
cmp    $0x16,%ebp
jle    116c <main+0x3c>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
jmp    11ca <main+0x9a>
test   %ebp,%ebp
js     11ca <main+0x9a>
xor    %ebx,%ebx
mov    $0x1,%r14d
jmp    118d <main+0x5d>
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    %ebx,%ebp
jg     1180 <main+0x50>
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
mov    0xc(%rsp),%ebp
add    $0x2,%r14d
cmp    %ebp,%ebx
mov    %eax,%ebx
jl     118d <main+0x5d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"HOW MANY LINE DO U WANT TO DRAW?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"THE LINE IS DEFAUTL\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 22
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %47
12: ; preds = %0
store i32 0, i32* %4
br label %13
13: ; preds = %43, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %46
17: ; preds = %13
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 1
store i32 %19, i32* %5
br label %20
20: ; preds = %26, %17
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp sge i32 %21, %22
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %5
%28 = add nsw i32 %27, -1
store i32 %28, i32* %5
br label %20
29: ; preds = %20
store i32 1, i32* %3
br label %30
30: ; preds = %38, %29
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = mul nsw i32 2, %32
%34 = add nsw i32 %33, 1
%35 = icmp sle i32 %31, %34
br i1 %35, label %36, label %41
36: ; preds = %30
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %30
41: ; preds = %30
%42 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %13
46: ; preds = %13
br label %47
47: ; preds = %46, %10
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [33 x i8] c"HOW MANY LINE DO U WANT TO DRAW?\00"
@str.6 = [20 x i8] c"THE LINE IS DEFAUTL\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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 sgt i32 %5, 22
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = icmp slt i32 %5, 0
br i1 %8, label %33, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
br label %33
11: ; preds = %7, %27
%12 = phi i32 [ %32, %27 ], [ 2, %7 ]
%13 = phi i32 [ %30, %27 ], [ %5, %7 ]
%14 = phi i32 [ %29, %27 ], [ 0, %7 ]
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %11, %16
%17 = phi i32 [ %18, %16 ], [ %13, %11 ]
%18 = add nsw i32 %17, -1
%19 = call i32 @putchar(i32 32)
%20 = icmp sgt i32 %18, %14
br i1 %20, label %16, label %21
21: ; preds = %16, %11
br label %22
22: ; preds = %21, %22
%23 = phi i32 [ %25, %22 ], [ 1, %21 ]
%24 = call i32 @putchar(i32 42)
%25 = add nuw i32 %23, 1
%26 = icmp eq i32 %25, %12
br i1 %26, label %27, label %22
27: ; preds = %22
%28 = call i32 @putchar(i32 10)
%29 = add nuw nsw i32 %14, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %14, %30
%32 = add i32 %12, 2
br i1 %31, label %11, label %33
33: ; preds = %27, %7, %9
ret i32 0
}