#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 scanf(char *, int *);
int main() {
  int n, x, y, a = 1, b = 'A';
  for (y = (scanf("%d", &n), n); y > 0; y--, printf("\n")) {
    for (x = y; x >= 1; x--, printf("%d ", a++))
      ;
    for (x = n; x >= y; x--, printf("%c ", b++))
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x41,-0x18(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11f8 <main+0xd8>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1199 <main+0x79>
jmp    1172 <main+0x52>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1163 <main+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11d7 <main+0xb7>
jmp    11b0 <main+0x90>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119f <main+0x7f>
jmp    11dc <main+0xbc>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1153 <main+0x33>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%r12d
test   %r12d,%r12d
jle    1222 <main+0xf2>
mov    $0x1,%r13d
mov    $0x1,%r14d
sub    %r12d,%r14d
mov    $0x41,%ebx
lea    0xe8b(%rip),%r15
jmp    11a3 <main+0x73>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%r12),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
add    %r12d,%r13d
cmp    $0x1,%r12d
mov    %ebp,%r12d
jle    1222 <main+0xf2>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x0(%r13,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r12d
jne    11b0 <main+0x80>
mov    0xc(%rsp),%ebp
cmp    %r12d,%ebp
jl     1180 <main+0x50>
lea    (%rbx,%rbp,1),%eax
mov    %r14d,0x14(%rsp)
add    %r14d,%eax
mov    %eax,0x10(%rsp)
add    $0x1,%ebp
lea    0xe1e(%rip),%r15
nopl   0x0(%rax)
lea    0x1(%rbx),%r14d
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
mov    %r14d,%ebx
cmp    %ebp,%r12d
jne    11f0 <main+0xc0>
mov    0x10(%rsp),%eax
mov    %eax,%ebx
mov    0x14(%rsp),%r14d
lea    0xde6(%rip),%r15
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%c \00"
@.str.3 = [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 1, i32* %5
store i32 65, i32* %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
store i32 %8, i32* %4
br label %9
9: ; preds = %38, %0
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %42
12: ; preds = %9
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %14
14: ; preds = %18, %12
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 1
br i1 %16, label %17, label %24
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %14
24: ; preds = %14
%25 = load i32, i32* %2
store i32 %25, i32* %3
br label %26
26: ; preds = %31, %24
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = icmp sge i32 %27, %28
br i1 %29, label %30, label %37
30: ; preds = %26
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, -1
store i32 %33, i32* %3
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %34)
br label %26
37: ; preds = %26
br label %38
38: ; preds = %37
%39 = load i32, i32* %4
%40 = add nsw i32 %39, -1
store i32 %40, i32* %4
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %9
42: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%c \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 sgt i32 %4, 0
br i1 %5, label %6, label %36
6: ; preds = %0
%7 = sub nsw i32 1, %4
br label %8
8: ; preds = %30, %6
%9 = phi i32 [ %7, %6 ], [ %35, %30 ]
%10 = phi i32 [ 65, %6 ], [ %31, %30 ]
%11 = phi i32 [ 1, %6 ], [ %13, %30 ]
%12 = phi i32 [ %4, %6 ], [ %32, %30 ]
%13 = add i32 %11, %12
br label %14
14: ; preds = %8, %14
%15 = phi i32 [ %16, %14 ], [ %11, %8 ]
%16 = add i32 %15, 1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%18 = icmp eq i32 %16, %13
br i1 %18, label %19, label %14
19: ; preds = %14
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, %12
br i1 %21, label %30, label %22
22: ; preds = %19
%23 = add i32 %10, %20
%24 = add i32 %23, %9
br label %25
25: ; preds = %22, %25
%26 = phi i32 [ %27, %25 ], [ %10, %22 ]
%27 = add i32 %26, 1
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%29 = icmp eq i32 %27, %24
br i1 %29, label %30, label %25
30: ; preds = %25, %19
%31 = phi i32 [ %10, %19 ], [ %24, %25 ]
%32 = add nsw i32 %12, -1
%33 = call i32 @putchar(i32 10)
%34 = icmp sgt i32 %12, 1
%35 = add i32 %9, 1
br i1 %34, label %8, label %36
36: ; preds = %30, %0
ret i32 0
}