#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;
  for (i = 0; i < 20; i++)
    for (j = 0; j <= i; j++) {
      printf("*");
      if (j == i)
        printf("\n");
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    118d <main+0x7d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117a <main+0x6a>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1167 <main+0x57>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <main+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    117f <main+0x6f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
mov    $0x1,%r14d
jmp    112c <main+0x1c>
xchg   %ax,%ax
add    $0x1,%ebx
add    $0x1,%r14d
cmp    $0x14,%ebx
je     1152 <main+0x42>
xor    %ebp,%ebp
jmp    1138 <main+0x28>
add    $0x1,%ebp
cmp    %ebp,%r14d
je     1120 <main+0x10>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    %ebp,%ebx
jne    1130 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %24, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 20
br i1 %6, label %7, label %27
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %20, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %8
23: ; preds = %8
br label %24
24: ; preds = %23
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %4
27: ; preds = %4
ret i32 0
}

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