#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 r = 11, sp, i, k = 0;
  for (i = 1; i <= r; i++) {
    for (sp = 1; sp <= r + 1 - i; sp++) {
      printf(" ");
    }
    while (k != 2 * i - 1) {
      printf("*");
      k++;
    }
    k = 0;
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11c9 <main+0xb9>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jg     1175 <main+0x65>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x37>
jmp    117a <main+0x6a>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11a8 <main+0x98>
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117a <main+0x6a>
movl   $0x0,-0x14(%rbp)
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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