#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(void) {
  int i, j;
  int move = 0;
  char start = 'A';
  for (i = 0; i < 6; i++) {
    for (j = 0; j <= i; j++, move++)
      printf("%c", start + move);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movb   $0x41,-0x11(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1196 <main+0x86>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117a <main+0x6a>
movsbl -0x11(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <main+0x32>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x44,%edi
call   1030 <putchar@plt>
mov    $0x45,%edi
call   1030 <putchar@plt>
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x47,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x49,%edi
call   1030 <putchar@plt>
mov    $0x4a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4b,%edi
call   1030 <putchar@plt>
mov    $0x4c,%edi
call   1030 <putchar@plt>
mov    $0x4d,%edi
call   1030 <putchar@plt>
mov    $0x4e,%edi
call   1030 <putchar@plt>
mov    $0x4f,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x50,%edi
call   1030 <putchar@plt>
mov    $0x51,%edi
call   1030 <putchar@plt>
mov    $0x52,%edi
call   1030 <putchar@plt>
mov    $0x53,%edi
call   1030 <putchar@plt>
mov    $0x54,%edi
call   1030 <putchar@plt>
mov    $0x55,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 65)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @putchar(i32 66)
%4 = tail call i32 @putchar(i32 67)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @putchar(i32 68)
%7 = tail call i32 @putchar(i32 69)
%8 = tail call i32 @putchar(i32 70)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @putchar(i32 71)
%11 = tail call i32 @putchar(i32 72)
%12 = tail call i32 @putchar(i32 73)
%13 = tail call i32 @putchar(i32 74)
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @putchar(i32 75)
%16 = tail call i32 @putchar(i32 76)
%17 = tail call i32 @putchar(i32 77)
%18 = tail call i32 @putchar(i32 78)
%19 = tail call i32 @putchar(i32 79)
%20 = tail call i32 @putchar(i32 10)
%21 = tail call i32 @putchar(i32 80)
%22 = tail call i32 @putchar(i32 81)
%23 = tail call i32 @putchar(i32 82)
%24 = tail call i32 @putchar(i32 83)
%25 = tail call i32 @putchar(i32 84)
%26 = tail call i32 @putchar(i32 85)
%27 = tail call i32 @putchar(i32 10)
ret i32 0
}