#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() {
  for (int x = 9; x > 0; x--) {
    for (int y = 9 - x; y > 0; y--)
      printf(" ");
    for (int y = 1; y <= x * 2 - 1; y++)
      printf("*");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11ae <main+0x9e>
mov    $0x9,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115f <main+0x4f>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x2b>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1194 <main+0x84>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <main+0x56>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x9,%r14d
mov    $0x1,%r15d
mov    $0x11,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ebp
cmp    $0x9,%r14d
jae    1160 <main+0x50>
mov    %r15d,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1140 <main+0x30>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%r14),%eax
add    $0x1,%r15d
add    $0xfffffffe,%ebx
cmp    $0x1,%r14d
mov    %eax,%r14d
ja     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
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 9, i32* %2
br label %5
5: ; preds = %33, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %36
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 9, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %16, %8
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%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 %11
19: ; preds = %11
store i32 1, i32* %4
br label %20
20: ; preds = %28, %19
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, 2
%24 = sub nsw i32 %23, 1
%25 = icmp sle i32 %21, %24
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %20
31: ; preds = %20
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %2
%35 = add nsw i32 %34, -1
store i32 %35, i32* %2
br label %5
36: ; preds = %5
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %14
ret i32 0
2: ; preds = %0, %14
%3 = phi i32 [ 18, %0 ], [ %18, %14 ]
%4 = phi i32 [ 9, %0 ], [ %16, %14 ]
%5 = icmp ult i32 %4, 9
br i1 %5, label %7, label %6
6: ; preds = %9, %2
br label %19
7: ; preds = %2
%8 = sub nuw nsw i32 9, %4
br label %9
9: ; preds = %7, %9
%10 = phi i32 [ %12, %9 ], [ %8, %7 ]
%11 = tail call i32 @putchar(i32 32)
%12 = add nsw i32 %10, -1
%13 = icmp ugt i32 %10, 1
br i1 %13, label %9, label %6
14: ; preds = %19
%15 = tail call i32 @putchar(i32 10)
%16 = add nsw i32 %4, -1
%17 = icmp ugt i32 %4, 1
%18 = add nsw i32 %3, -2
br i1 %17, label %2, label %1
19: ; preds = %6, %19
%20 = phi i32 [ %22, %19 ], [ 1, %6 ]
%21 = tail call i32 @putchar(i32 42)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, %3
br i1 %23, label %14, label %19
}