#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  char c[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  scanf("%d", &n);
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < i; j++) {
      printf("%c", c[j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0x18(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x16(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11db <main+0xbb>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11bf <main+0x9f>
movslq -0x38(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    118e <main+0x6e>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    117b <main+0x5b>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeeb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     1195 <main+0x75>
xor    %r15d,%r15d
lea    0xeb5(%rip),%r14
jmp    116b <main+0x4b>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%rax
movslq 0xc(%rsp),%rcx
cmp    %rcx,%r15
mov    %rax,%r15
jge    1195 <main+0x75>
test   %r15,%r15
je     1150 <main+0x30>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rbx,%r14,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1180 <main+0x60>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.c = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0, %10
%7 = phi i64 [ %12, %10 ], [ 0, %0 ]
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %16
9: ; preds = %10, %0
ret i32 0
10: ; preds = %16, %6
%11 = call i32 @putchar(i32 10)
%12 = add nuw nsw i64 %7, 1
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %7, %14
br i1 %15, label %6, label %9
16: ; preds = %6, %16
%17 = phi i64 [ %22, %16 ], [ 0, %6 ]
%18 = getelementptr inbounds [27 x i8], [27 x i8]* @__const.main.c, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 @putchar(i32 %20)
%22 = add nuw nsw i64 %17, 1
%23 = icmp eq i64 %22, %7
br i1 %23, label %10, label %16
}