#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, p;
  char c;
  p = 0;
  for (i = 4; i >= 1; i--) {
    p = i;
    printf("\n");
    while (p >= 2) {
      printf(" ");
      p--;
    }
    printf("*");
    p = i;
    while (p <= 3) {
      printf("**");
      p++;
    }
  }
  printf("\n");
  for (i = 7; i >= 1; i--) {
    p = i;
    printf("\n");
    while (p >= 2) {
      printf(" ");
      p--;
    }
    printf("*");
    p = i;
    while (p <= 6) {
      printf("**");
      p++;
    }
  }
  printf("\n");
  for (i = 11; i >= 1; i--) {
    p = i;
    printf("\n");
    while (p >= 2) {
      printf(" ");
      p--;
    }
    printf("*");
    p = i;
    while (p <= 10) {
      printf("**");
      p++;
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     11b6 <main+0xa6>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0xc(%rbp)
jl     116d <main+0x5d>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <main+0x39>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     11a3 <main+0x93>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <main+0x6f>
jmp    11a8 <main+0x98>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1252 <main+0x142>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0xc(%rbp)
jl     1209 <main+0xf9>
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11e5 <main+0xd5>
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jg     123f <main+0x12f>
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    121b <main+0x10b>
jmp    1244 <main+0x134>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11c9 <main+0xb9>
lea    0xda7(%rip),%rdi
call   1030 <printf@plt>
movl   $0xb,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     12ee <main+0x1de>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xd84(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0xc(%rbp)
jl     12a5 <main+0x195>
lea    0xd70(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1281 <main+0x171>
lea    0xd59(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     12db <main+0x1cb>
lea    0xd3c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12b7 <main+0x1a7>
jmp    12e0 <main+0x1d0>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1265 <main+0x155>
lea    0xd0b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
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    $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>
lea    0xe77(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7,%r15d
mov    $0x8,%r12d
xor    %r14d,%r14d
jmp    1225 <main+0x105>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%r15),%eax
add    $0xffffffff,%r12d
add    $0x1,%r14d
cmp    $0x1,%r15d
mov    %eax,%r15d
jbe    128f <main+0x16f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12d,%ebp
cmp    $0x2,%r15d
jb     1270 <main+0x150>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
jg     1240 <main+0x120>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    $0x6,%r15d
ja     1210 <main+0xf0>
jmp    127a <main+0x15a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %r14d,%ebp
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1280 <main+0x160>
jmp    1210 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xb,%r15d
mov    $0xc,%r12d
xor    %r14d,%r14d
lea    0xd51(%rip),%rbx
jmp    12d5 <main+0x1b5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r15),%eax
add    $0xffffffff,%r12d
add    $0x1,%r14d
cmp    $0x1,%r15d
mov    %eax,%r15d
jbe    133f <main+0x21f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12d,%ebp
cmp    $0x2,%r15d
jb     1320 <main+0x200>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
jg     12f0 <main+0x1d0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    $0xa,%r15d
ja     12c0 <main+0x1a0>
jmp    132a <main+0x20a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %r14d,%ebp
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1330 <main+0x210>
jmp    12c0 <main+0x1a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [3 x i8] c"**\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %3
store i32 4, i32* %2
br label %5
5: ; preds = %29, %0
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %32
8: ; preds = %5
%9 = load i32, i32* %2
store i32 %9, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %14, %8
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 2
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
br label %11
18: ; preds = %11
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %2
store i32 %20, i32* %3
br label %21
21: ; preds = %24, %18
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, 3
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %21
28: ; preds = %21
br label %29
29: ; preds = %28
%30 = load i32, i32* %2
%31 = add nsw i32 %30, -1
store i32 %31, i32* %2
br label %5
32: ; preds = %5
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 7, i32* %2
br label %34
34: ; preds = %58, %32
%35 = load i32, i32* %2
%36 = icmp sge i32 %35, 1
br i1 %36, label %37, label %61
37: ; preds = %34
%38 = load i32, i32* %2
store i32 %38, i32* %3
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %40
40: ; preds = %43, %37
%41 = load i32, i32* %3
%42 = icmp sge i32 %41, 2
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%45 = load i32, i32* %3
%46 = add nsw i32 %45, -1
store i32 %46, i32* %3
br label %40
47: ; preds = %40
%48 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%49 = load i32, i32* %2
store i32 %49, i32* %3
br label %50
50: ; preds = %53, %47
%51 = load i32, i32* %3
%52 = icmp sle i32 %51, 6
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 1
store i32 %56, i32* %3
br label %50
57: ; preds = %50
br label %58
58: ; preds = %57
%59 = load i32, i32* %2
%60 = add nsw i32 %59, -1
store i32 %60, i32* %2
br label %34
61: ; preds = %34
%62 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 11, i32* %2
br label %63
63: ; preds = %87, %61
%64 = load i32, i32* %2
%65 = icmp sge i32 %64, 1
br i1 %65, label %66, label %90
66: ; preds = %63
%67 = load i32, i32* %2
store i32 %67, i32* %3
%68 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %69
69: ; preds = %72, %66
%70 = load i32, i32* %3
%71 = icmp sge i32 %70, 2
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%74 = load i32, i32* %3
%75 = add nsw i32 %74, -1
store i32 %75, i32* %3
br label %69
76: ; preds = %69
%77 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%78 = load i32, i32* %2
store i32 %78, i32* %3
br label %79
79: ; preds = %82, %76
%80 = load i32, i32* %3
%81 = icmp sle i32 %80, 10
br i1 %81, label %82, label %86
82: ; preds = %79
%83 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%84 = load i32, i32* %3
%85 = add nsw i32 %84, 1
store i32 %85, i32* %3
br label %79
86: ; preds = %79
br label %87
87: ; preds = %86
%88 = load i32, i32* %2
%89 = add nsw i32 %88, -1
store i32 %89, i32* %2
br label %63
90: ; preds = %63
%91 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"**\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @putchar(i32 32)
%3 = tail call i32 @putchar(i32 32)
%4 = tail call i32 @putchar(i32 32)
%5 = tail call i32 @putchar(i32 42)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @putchar(i32 32)
%8 = tail call i32 @putchar(i32 32)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @putchar(i32 32)
%13 = tail call i32 @putchar(i32 42)
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 @putchar(i32 42)
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%21 = tail call i32 @putchar(i32 10)
br label %22
22: ; preds = %0, %42
%23 = phi i32 [ 7, %0 ], [ %43, %42 ]
%24 = tail call i32 @putchar(i32 10)
%25 = icmp ugt i32 %23, 1
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = tail call i32 @putchar(i32 42)
br label %36
28: ; preds = %22, %28
%29 = phi i32 [ %31, %28 ], [ %23, %22 ]
%30 = tail call i32 @putchar(i32 32)
%31 = add nsw i32 %29, -1
%32 = icmp sgt i32 %29, 2
br i1 %32, label %28, label %33
33: ; preds = %28
%34 = tail call i32 @putchar(i32 42)
%35 = icmp ult i32 %23, 7
br i1 %35, label %36, label %42
36: ; preds = %26, %33
br label %37
37: ; preds = %36, %37
%38 = phi i32 [ %40, %37 ], [ %23, %36 ]
%39 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%40 = add nuw nsw i32 %38, 1
%41 = icmp eq i32 %40, 7
br i1 %41, label %42, label %37
42: ; preds = %37, %33
%43 = add nsw i32 %23, -1
br i1 %25, label %22, label %44
44: ; preds = %42
%45 = tail call i32 @putchar(i32 10)
br label %46
46: ; preds = %44, %66
%47 = phi i32 [ 11, %44 ], [ %67, %66 ]
%48 = tail call i32 @putchar(i32 10)
%49 = icmp ugt i32 %47, 1
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = tail call i32 @putchar(i32 42)
br label %60
52: ; preds = %46, %52
%53 = phi i32 [ %55, %52 ], [ %47, %46 ]
%54 = tail call i32 @putchar(i32 32)
%55 = add nsw i32 %53, -1
%56 = icmp sgt i32 %53, 2
br i1 %56, label %52, label %57
57: ; preds = %52
%58 = tail call i32 @putchar(i32 42)
%59 = icmp ult i32 %47, 11
br i1 %59, label %60, label %66
60: ; preds = %50, %57
br label %61
61: ; preds = %60, %61
%62 = phi i32 [ %64, %61 ], [ %47, %60 ]
%63 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%64 = add nuw nsw i32 %62, 1
%65 = icmp eq i32 %64, 11
br i1 %65, label %66, label %61
66: ; preds = %61, %57
%67 = add nsw i32 %47, -1
br i1 %49, label %46, label %68
68: ; preds = %66
%69 = tail call i32 @putchar(i32 10)
ret i32 0
}