#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 current_row;
  int max_rows = 4;
  for (current_row = 0; current_row < max_rows; current_row++) {
    int i;
    for (i = 0; i < max_rows - current_row - 1; i++) {
      printf(" ");
    }
    for (i = 0; i < 1 + 2 * current_row; i++) {
      printf("*");
    }
    printf("\n");
  }
  printf("\n");
  max_rows = 7;
  for (current_row = 0; current_row < max_rows; current_row++) {
    int i;
    for (i = 0; i < max_rows - current_row - 1; i++) {
      printf(" ");
    }
    for (i = 0; i < 1 + 2 * current_row; i++) {
      printf("*");
    }
    printf("\n");
  }
  printf("\n");
  max_rows = 11;
  for (current_row = 0; current_row < max_rows; current_row++) {
    int i;
    for (i = 0; i < max_rows - current_row - 1; i++) {
      printf(" ");
    }
    for (i = 0; i < 1 + 2 * current_row; i++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bd <main+0xad>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116e <main+0x5e>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%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    11a3 <main+0x93>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <main+0x65>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1267 <main+0x157>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1218 <main+0x108>
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ea <main+0xda>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    124d <main+0x13d>
lea    0xdc8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121f <main+0x10f>
lea    0xdb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d7 <main+0xc7>
lea    0xd96(%rip),%rdi
call   1030 <printf@plt>
movl   $0xb,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1311 <main+0x201>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12c2 <main+0x1b2>
lea    0xd51(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1294 <main+0x184>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    12f7 <main+0x1e7>
lea    0xd1e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12c9 <main+0x1b9>
lea    0xd06(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1281 <main+0x171>
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    $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>
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    $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    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %r15d,%r15d
mov    $0x6,%ebp
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x2,%ebp
mov    $0x1,%ebx
cmovge %ebp,%ebx
cmp    $0x5,%r15d
ja     126f <main+0x15f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1260 <main+0x150>
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1280 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
add    $0xffffffff,%ebp
add    $0x2,%r14d
cmp    $0x7,%r15d
jne    1240 <main+0x130>
mov    $0xa,%r15d
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2,%r15d
mov    $0x1,%ebx
cmovge %r15d,%ebx
cmp    $0x9,%ebp
ja     12ff <main+0x1ef>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12f0 <main+0x1e0>
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1310 <main+0x200>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    $0xffffffff,%r15d
add    $0x2,%r14d
cmp    $0xb,%ebp
jne    12d0 <main+0x1c0>
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
%6 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
store i32 0, i32* %2
br label %7
7: ; preds = %38, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %41
11: ; preds = %7
store i32 0, i32* %4
br label %12
12: ; preds = %21, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = sub nsw i32 %14, %15
%17 = sub nsw i32 %16, 1
%18 = icmp slt i32 %13, %17
br i1 %18, label %19, label %24
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %12
24: ; preds = %12
store i32 0, i32* %4
br label %25
25: ; preds = %33, %24
%26 = load i32, i32* %4
%27 = load i32, i32* %2
%28 = mul nsw i32 2, %27
%29 = add nsw i32 1, %28
%30 = icmp slt i32 %26, %29
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %25
36: ; preds = %25
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %7
41: ; preds = %7
%42 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 7, i32* %3
store i32 0, i32* %2
br label %43
43: ; preds = %74, %41
%44 = load i32, i32* %2
%45 = load i32, i32* %3
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %77
47: ; preds = %43
store i32 0, i32* %5
br label %48
48: ; preds = %57, %47
%49 = load i32, i32* %5
%50 = load i32, i32* %3
%51 = load i32, i32* %2
%52 = sub nsw i32 %50, %51
%53 = sub nsw i32 %52, 1
%54 = icmp slt i32 %49, %53
br i1 %54, label %55, label %60
55: ; preds = %48
%56 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %57
57: ; preds = %55
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
store i32 %59, i32* %5
br label %48
60: ; preds = %48
store i32 0, i32* %5
br label %61
61: ; preds = %69, %60
%62 = load i32, i32* %5
%63 = load i32, i32* %2
%64 = mul nsw i32 2, %63
%65 = add nsw i32 1, %64
%66 = icmp slt i32 %62, %65
br i1 %66, label %67, label %72
67: ; preds = %61
%68 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %69
69: ; preds = %67
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %5
br label %61
72: ; preds = %61
%73 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %74
74: ; preds = %72
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %43
77: ; preds = %43
%78 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 11, i32* %3
store i32 0, i32* %2
br label %79
79: ; preds = %110, %77
%80 = load i32, i32* %2
%81 = load i32, i32* %3
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %113
83: ; preds = %79
store i32 0, i32* %6
br label %84
84: ; preds = %93, %83
%85 = load i32, i32* %6
%86 = load i32, i32* %3
%87 = load i32, i32* %2
%88 = sub nsw i32 %86, %87
%89 = sub nsw i32 %88, 1
%90 = icmp slt i32 %85, %89
br i1 %90, label %91, label %96
91: ; preds = %84
%92 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %93
93: ; preds = %91
%94 = load i32, i32* %6
%95 = add nsw i32 %94, 1
store i32 %95, i32* %6
br label %84
96: ; preds = %84
store i32 0, i32* %6
br label %97
97: ; preds = %105, %96
%98 = load i32, i32* %6
%99 = load i32, i32* %2
%100 = mul nsw i32 2, %99
%101 = add nsw i32 1, %100
%102 = icmp slt i32 %98, %101
br i1 %102, label %103, label %108
103: ; preds = %97
%104 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %105
105: ; preds = %103
%106 = load i32, i32* %6
%107 = add nsw i32 %106, 1
store i32 %107, i32* %6
br label %97
108: ; preds = %97
%109 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %110
110: ; preds = %108
%111 = load i32, i32* %2
%112 = add nsw i32 %111, 1
store i32 %112, i32* %2
br label %79
113: ; preds = %79
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 32)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @putchar(i32 32)
%7 = tail call i32 @putchar(i32 32)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @putchar(i32 42)
%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 @putchar(i32 42)
%15 = tail call i32 @putchar(i32 42)
%16 = tail call i32 @putchar(i32 42)
%17 = tail call i32 @putchar(i32 42)
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @putchar(i32 42)
%20 = tail call i32 @putchar(i32 42)
%21 = tail call i32 @putchar(i32 42)
%22 = tail call i32 @putchar(i32 42)
%23 = tail call i32 @putchar(i32 42)
%24 = tail call i32 @putchar(i32 42)
%25 = tail call i32 @putchar(i32 42)
%26 = tail call i32 @putchar(i32 10)
%27 = tail call i32 @putchar(i32 10)
br label %28
28: ; preds = %0, %45
%29 = phi i32 [ 1, %0 ], [ %49, %45 ]
%30 = phi i32 [ 6, %0 ], [ %48, %45 ]
%31 = phi i32 [ 0, %0 ], [ %47, %45 ]
%32 = call i32 @llvm.smax.i32(i32 %30, i32 1)
%33 = icmp ult i32 %31, 6
br i1 %33, label %34, label %39
34: ; preds = %28, %34
%35 = phi i32 [ %37, %34 ], [ 0, %28 ]
%36 = tail call i32 @putchar(i32 32)
%37 = add nuw nsw i32 %35, 1
%38 = icmp eq i32 %37, %32
br i1 %38, label %39, label %34
39: ; preds = %34, %28
br label %40
40: ; preds = %39, %40
%41 = phi i32 [ %43, %40 ], [ 0, %39 ]
%42 = tail call i32 @putchar(i32 42)
%43 = add nuw nsw i32 %41, 1
%44 = icmp eq i32 %43, %29
br i1 %44, label %45, label %40
45: ; preds = %40
%46 = tail call i32 @putchar(i32 10)
%47 = add nuw nsw i32 %31, 1
%48 = add nsw i32 %30, -1
%49 = add nuw nsw i32 %29, 2
%50 = icmp eq i32 %47, 7
br i1 %50, label %51, label %28
51: ; preds = %45
%52 = tail call i32 @putchar(i32 10)
br label %53
53: ; preds = %51, %70
%54 = phi i32 [ 1, %51 ], [ %74, %70 ]
%55 = phi i32 [ 10, %51 ], [ %73, %70 ]
%56 = phi i32 [ 0, %51 ], [ %72, %70 ]
%57 = call i32 @llvm.smax.i32(i32 %55, i32 1)
%58 = icmp ult i32 %56, 10
br i1 %58, label %59, label %64
59: ; preds = %53, %59
%60 = phi i32 [ %62, %59 ], [ 0, %53 ]
%61 = tail call i32 @putchar(i32 32)
%62 = add nuw nsw i32 %60, 1
%63 = icmp eq i32 %62, %57
br i1 %63, label %64, label %59
64: ; preds = %59, %53
br label %65
65: ; preds = %64, %65
%66 = phi i32 [ %68, %65 ], [ 0, %64 ]
%67 = tail call i32 @putchar(i32 42)
%68 = add nuw nsw i32 %66, 1
%69 = icmp eq i32 %68, %54
br i1 %69, label %70, label %65
70: ; preds = %65
%71 = tail call i32 @putchar(i32 10)
%72 = add nuw nsw i32 %56, 1
%73 = add nsw i32 %55, -1
%74 = add nuw nsw i32 %54, 2
%75 = icmp eq i32 %72, 11
br i1 %75, label %76, label %53
76: ; preds = %70
ret i32 0
}