#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 main() {
  int i = 0, j = 0, k = 0;
  for (i = 5; i >= 1; i--) {
    for (j = 0; j <= 5 - i; j++) {
      printf(" ");
    }
    for (k = i; k >= 1; k--) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     11bd <main+0xad>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     1179 <main+0x69>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     11a3 <main+0x93>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    117f <main+0x6f>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 42)
%6 = tail call i32 @putchar(i32 42)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @putchar(i32 32)
%9 = tail call i32 @putchar(i32 32)
%10 = tail call i32 @putchar(i32 42)
%11 = tail call i32 @putchar(i32 42)
%12 = tail call i32 @putchar(i32 42)
%13 = tail call i32 @putchar(i32 42)
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @putchar(i32 32)
%16 = tail call i32 @putchar(i32 32)
%17 = tail call i32 @putchar(i32 32)
%18 = tail call i32 @putchar(i32 42)
%19 = tail call i32 @putchar(i32 42)
%20 = tail call i32 @putchar(i32 42)
%21 = tail call i32 @putchar(i32 10)
%22 = tail call i32 @putchar(i32 32)
%23 = tail call i32 @putchar(i32 32)
%24 = tail call i32 @putchar(i32 32)
%25 = tail call i32 @putchar(i32 32)
%26 = tail call i32 @putchar(i32 42)
%27 = tail call i32 @putchar(i32 42)
%28 = tail call i32 @putchar(i32 10)
%29 = tail call i32 @putchar(i32 32)
%30 = tail call i32 @putchar(i32 32)
%31 = tail call i32 @putchar(i32 32)
%32 = tail call i32 @putchar(i32 32)
%33 = tail call i32 @putchar(i32 32)
%34 = tail call i32 @putchar(i32 42)
%35 = tail call i32 @putchar(i32 10)
ret i32 0
}