#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*/ Delay(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, space, rows, k = 0;
  printf("Enter the number of rows: ");
  scanf("%d", &rows);
  for (i = 1; i <= rows; ++i) {
    for (space = 1; space <= rows - i; ++space) {
      printf(" ");
      Delay(10);
    }
    while (k != 2 * i - 1) {
      printf("*");
      ++k;
      Delay(10);
    }
    k = 0;
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     120f <main+0xdf>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     11b1 <main+0x81>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <Delay@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <main+0x4c>
jmp    11b6 <main+0x86>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11ee <main+0xbe>
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0xa,%edi
call   1030 <Delay@plt>
jmp    11b6 <main+0x86>
movl   $0x0,-0x14(%rbp)
lea    0xe24(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <main+0x39>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11f4 <main+0xb4>
mov    $0x1,%r14d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14d,%ebp
cmp    %ebx,%eax
jle    11c0 <main+0x80>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1040 <Delay@plt>
mov    0xc(%rsp),%eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1190 <main+0x50>
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1040 <Delay@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0xc(%rsp),%eax
add    $0x2,%r14d
cmp    %eax,%ebx
mov    %ecx,%ebx
jl     1180 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"Enter the number of rows: \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 ([27 x i8], [27 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 %33, label %7
7: ; preds = %0, %28
%8 = phi i32 [ %31, %28 ], [ %5, %0 ]
%9 = phi i32 [ %30, %28 ], [ 1, %0 ]
%10 = icmp sgt i32 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %14, %7
%12 = shl nuw nsw i32 %9, 1
%13 = add nsw i32 %12, -1
br label %22
14: ; preds = %7, %14
%15 = phi i32 [ %18, %14 ], [ 1, %7 ]
%16 = call i32 @putchar(i32 32)
%17 = call i32 @Delay(i32 10)
%18 = add nuw nsw i32 %15, 1
%19 = load i32, i32* %1
%20 = sub nsw i32 %19, %9
%21 = icmp slt i32 %15, %20
br i1 %21, label %14, label %11
22: ; preds = %11, %22
%23 = phi i32 [ 0, %11 ], [ %25, %22 ]
%24 = call i32 @putchar(i32 42)
%25 = add nuw nsw i32 %23, 1
%26 = call i32 @Delay(i32 10)
%27 = icmp eq i32 %25, %13
br i1 %27, label %28, label %22
28: ; preds = %22
%29 = call i32 @putchar(i32 10)
%30 = add nuw nsw i32 %9, 1
%31 = load i32, i32* %1
%32 = icmp slt i32 %9, %31
br i1 %32, label %7, label %33
33: ; preds = %28, %0
ret i32 0
}