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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11ba <main+0xaa>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    116b <main+0x5b>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <main+0x30>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11a0 <main+0x90>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <main+0x62>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     124e <main+0x13e>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    11ff <main+0xef>
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d4 <main+0xc4>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1234 <main+0x124>
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1206 <main+0xf6>
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11c3 <main+0xb3>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
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>
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    $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    $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    $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
%5 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %5
store i32 0, i32* %2
br label %6
6: ; preds = %36, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %5
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %39
10: ; preds = %6
store i32 0, i32* %3
br label %11
11: ; preds = %19, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = load i32, i32* %2
%15 = sub nsw i32 %13, %14
%16 = icmp slt i32 %12, %15
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %11
22: ; preds = %11
store i32 0, i32* %4
br label %23
23: ; preds = %31, %22
%24 = load i32, i32* %4
%25 = load i32, i32* %2
%26 = mul nsw i32 %25, 2
%27 = add nsw i32 1, %26
%28 = icmp slt i32 %24, %27
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %23
34: ; preds = %23
%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* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %6
39: ; preds = %6
%40 = load i32, i32* %5
%41 = sub nsw i32 %40, 1
store i32 %41, i32* %2
br label %42
42: ; preds = %71, %39
%43 = load i32, i32* %2
%44 = icmp sge i32 %43, 0
br i1 %44, label %45, label %74
45: ; preds = %42
store i32 0, i32* %3
br label %46
46: ; preds = %54, %45
%47 = load i32, i32* %3
%48 = load i32, i32* %5
%49 = load i32, i32* %2
%50 = sub nsw i32 %48, %49
%51 = icmp slt i32 %47, %50
br i1 %51, label %52, label %57
52: ; preds = %46
%53 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %54
54: ; preds = %52
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 1
store i32 %56, i32* %3
br label %46
57: ; preds = %46
store i32 0, i32* %4
br label %58
58: ; preds = %66, %57
%59 = load i32, i32* %4
%60 = load i32, i32* %2
%61 = mul nsw i32 %60, 2
%62 = add nsw i32 1, %61
%63 = icmp slt i32 %59, %62
br i1 %63, label %64, label %69
64: ; preds = %58
%65 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %66
66: ; preds = %64
%67 = load i32, i32* %4
%68 = add nsw i32 %67, 1
store i32 %68, i32* %4
br label %58
69: ; preds = %58
%70 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %71
71: ; preds = %69
%72 = load i32, i32* %2
%73 = add nsw i32 %72, -1
store i32 %73, i32* %2
br label %42
74: ; preds = %42
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @putchar(i32 32)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @putchar(i32 32)
%6 = tail call i32 @putchar(i32 42)
%7 = tail call i32 @putchar(i32 42)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 10)
%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 42)
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 @putchar(i32 32)
%17 = tail call i32 @putchar(i32 42)
%18 = tail call i32 @putchar(i32 42)
%19 = tail call i32 @putchar(i32 42)
%20 = tail call i32 @putchar(i32 10)
%21 = tail call i32 @putchar(i32 32)
%22 = tail call i32 @putchar(i32 32)
%23 = tail call i32 @putchar(i32 42)
%24 = tail call i32 @putchar(i32 10)
ret i32 0
}