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


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    0xebe(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf_s@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     11f2 <main+0xc2>
jmp    1177 <main+0x47>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     11d8 <main+0xa8>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11d3 <main+0xa3>
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    11a8 <main+0x78>
jmp    1177 <main+0x47>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1168 <main+0x38>
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
lea    0xe19(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf_s@plt>
cmpl   $0x0,0xc(%rsp)
js     11a5 <main+0x65>
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmpl   $0x2,0xc(%rsp)
jl     1170 <main+0x30>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x2,%ebx
cmp    0xc(%rsp),%ebx
jl     1190 <main+0x50>
jmp    1170 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe64(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Enter number of rows: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(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, -1
br i1 %6, label %7, label %18
7: ; preds = %0, %11
%8 = call i32 @putchar(i32 42)
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 1
br i1 %10, label %12, label %11
11: ; preds = %12, %7
br label %7
12: ; preds = %7, %12
%13 = phi i32 [ %15, %12 ], [ 1, %7 ]
%14 = call i32 @putchar(i32 32)
%15 = add nuw nsw i32 %13, 2
%16 = load i32, i32* %1
%17 = icmp slt i32 %15, %16
br i1 %17, label %12, label %11
18: ; preds = %0
%19 = call i32 @putchar(i32 10)
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}