#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int rows;
  printf("Enter number: ");
  scanf("%d", &rows);
  int i = 0;
  while (i < rows) {
    int j = rows;
    while (j > 0) {
      if (j <= i + 1) {
        printf("*");
      } else {
        printf(" ");
      }
      j--;
    }
    i++;
    printf("\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11cb <main+0xab>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    11b1 <main+0x91>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1197 <main+0x77>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x83>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    116b <main+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x39>
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
jle    11ac <main+0x7c>
xor    %ebx,%ebx
mov    $0x20,%r14d
jmp    1182 <main+0x52>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ebp
cmp    %ebp,%ebx
jge    11ac <main+0x7c>
add    $0x1,%ebx
test   %ebp,%ebp
jle    1170 <main+0x40>
nopl   0x0(%rax)
cmp    %ebx,%ebp
mov    $0x2a,%edi
cmovg  %r14d,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbp),%eax
cmp    $0x1,%ebp
mov    %eax,%ebp
jg     1190 <main+0x60>
jmp    1170 <main+0x40>
mov    0x2e2d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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