#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 *, char);
void converse_10_to_26(int a) {
  char temp[100001];
  int i = 100000;
  if (a <= 26) {
    printf("%c", (char)('A' + a - 1));
    return;
  }
  while (a > 26) {
    if (a % 26 == 0) {
      temp[i] = 'Z';
      i--;
      a /= 26;
      a--;
    } else {
      temp[i] = (char)('A' + a % 26 - 1);
      i--;
      a /= 26;
    }
  }
  if (a == 26)
    temp[i] = 'Z';
  else
    temp[i] = (char)('A' + a - 1);
  for (; i <= 100000; i++)
    printf("%c", temp[i]);
  return;
}


x86 assembly (clang, -O0):
<converse_10_to_26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186c0,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x186a0,-0x186b4(%rbp)
cmpl   $0x1a,-0x4(%rbp)
jg     114f <converse_10_to_26+0x3f>
mov    -0x4(%rbp),%eax
add    $0x41,%eax
sub    $0x1,%eax
lea    0xebe(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1271 <converse_10_to_26+0x161>
jmp    1154 <converse_10_to_26+0x44>
cmpl   $0x1a,-0x4(%rbp)
jle    11f1 <converse_10_to_26+0xe1>
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ac <converse_10_to_26+0x9c>
movslq -0x186b4(%rbp),%rax
movb   $0x5a,-0x186b0(%rbp,%rax,1)
5a
mov    -0x186b4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x186b4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    11ec <converse_10_to_26+0xdc>
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,%cl
movslq -0x186b4(%rbp),%rax
mov    %cl,-0x186b0(%rbp,%rax,1)
mov    -0x186b4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x186b4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1154 <converse_10_to_26+0x44>
cmpl   $0x1a,-0x4(%rbp)
jne    120f <converse_10_to_26+0xff>
movslq -0x186b4(%rbp),%rax
movb   $0x5a,-0x186b0(%rbp,%rax,1)
5a
jmp    1228 <converse_10_to_26+0x118>
mov    -0x4(%rbp),%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,%cl
movslq -0x186b4(%rbp),%rax
mov    %cl,-0x186b0(%rbp,%rax,1)
jmp    122d <converse_10_to_26+0x11d>
cmpl   $0x186a0,-0x186b4(%rbp)
jg     126c <converse_10_to_26+0x15c>
movslq -0x186b4(%rbp),%rax
lea    0xdb5(%rip),%rdi
movsbl -0x186b0(%rbp,%rax,1),%esi
ff
call   1030 <printf@plt>
mov    -0x186b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x186b4(%rbp)
jmp    122d <converse_10_to_26+0x11d>
jmp    1271 <converse_10_to_26+0x161>
add    $0x186c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<converse_10_to_26>:
cmp    $0x1b,%edi
jge    1129 <converse_10_to_26+0x19>
add    $0x40,%dil
movsbl %dil,%esi
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x186a8,%rsp
mov    $0x186a0,%ecx
mov    $0xfffe7961,%r9d
movabs $0x186a000000000,%rdx
movabs $0xffffffff00000000,%r8
ff ff ff
jmp    1176 <converse_10_to_26+0x66>
nopl   0x0(%rax,%rax,1)
or     $0x40,%bl
mov    %bl,(%rsp,%rcx,1)
add    $0xffffffffffffffff,%rcx
add    $0x1,%r9d
add    %r8,%rdx
cmp    $0x1a,%edi
jle    11a3 <converse_10_to_26+0x93>
mov    %edi,%ebx
mov    %edi,%esi
imul   $0x4ec4ec4f,%rsi,%rdi
shr    $0x23,%rdi
lea    (%rdi,%rdi,4),%eax
lea    (%rax,%rax,4),%eax
add    %edi,%eax
sub    %eax,%ebx
jne    1160 <converse_10_to_26+0x50>
imul   $0x4ec4ec4f,%rsi,%rdi
shr    $0x23,%rdi
add    $0xffffffff,%edi
mov    $0x5a,%bl
jmp    1163 <converse_10_to_26+0x53>
lea    0x40(%rdi),%eax
cmp    $0x1a,%edi
movzbl %al,%eax
mov    $0x5a,%esi
cmovne %eax,%esi
lea    0x1(%rcx),%eax
sar    $0x20,%rdx
mov    %sil,(%rsp,%rdx,1)
cmp    $0x186a1,%eax
jg     1206 <converse_10_to_26+0xf6>
movslq %ecx,%rax
cmp    $0x186a1,%eax
mov    $0x186a0,%r12d
cmovge %eax,%r12d
lea    (%rsp,%rax,1),%r15
add    %r9d,%r12d
xor    %ebx,%ebx
lea    0xe18(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    11f0 <converse_10_to_26+0xe0>
add    $0x186a8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @converse_10_to_26(i32 %0) {
%2 = alloca i32
%3 = alloca [100001 x i8]
%4 = alloca i32
store i32 %0, i32* %2
store i32 100000, i32* %4
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 26
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 65, %8
%10 = sub nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
br label %74
13: ; preds = %1
br label %14
14: ; preds = %44, %13
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 26
br i1 %16, label %17, label %45
17: ; preds = %14
%18 = load i32, i32* %2
%19 = srem i32 %18, 26
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100001 x i8], [100001 x i8]* %3, i64 0, i64 %23
store i8 90, i8* %24
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
%27 = load i32, i32* %2
%28 = sdiv i32 %27, 26
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = add nsw i32 %29, -1
store i32 %30, i32* %2
br label %44
31: ; preds = %17
%32 = load i32, i32* %2
%33 = srem i32 %32, 26
%34 = add nsw i32 65, %33
%35 = sub nsw i32 %34, 1
%36 = trunc i32 %35 to i8
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100001 x i8], [100001 x i8]* %3, i64 0, i64 %38
store i8 %36, i8* %39
%40 = load i32, i32* %4
%41 = add nsw i32 %40, -1
store i32 %41, i32* %4
%42 = load i32, i32* %2
%43 = sdiv i32 %42, 26
store i32 %43, i32* %2
br label %44
44: ; preds = %31, %21
br label %14
45: ; preds = %14
%46 = load i32, i32* %2
%47 = icmp eq i32 %46, 26
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100001 x i8], [100001 x i8]* %3, i64 0, i64 %50
store i8 90, i8* %51
br label %60
52: ; preds = %45
%53 = load i32, i32* %2
%54 = add nsw i32 65, %53
%55 = sub nsw i32 %54, 1
%56 = trunc i32 %55 to i8
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [100001 x i8], [100001 x i8]* %3, i64 0, i64 %58
store i8 %56, i8* %59
br label %60
60: ; preds = %52, %48
br label %61
61: ; preds = %70, %60
%62 = load i32, i32* %4
%63 = icmp sle i32 %62, 100000
br i1 %63, label %64, label %73
64: ; preds = %61
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100001 x i8], [100001 x i8]* %3, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %68)
br label %70
70: ; preds = %64
%71 = load i32, i32* %4
%72 = add nsw i32 %71, 1
store i32 %72, i32* %4
br label %61
73: ; preds = %61
br label %74
74: ; preds = %73, %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @converse_10_to_26(i32 %0) {
%2 = alloca [100001 x i8]
%3 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%4 = icmp slt i32 %0, 27
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = trunc i32 %0 to i8
%7 = add i8 %6, 64
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %51
9: ; preds = %1, %21
%10 = phi i64 [ %25, %21 ], [ 100000, %1 ]
%11 = phi i32 [ %23, %21 ], [ %0, %1 ]
%12 = urem i32 %11, 26
%13 = udiv i32 %11, 26
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = udiv i32 %11, 26
%17 = add nsw i32 %16, -1
br label %21
18: ; preds = %9
%19 = trunc i32 %12 to i8
%20 = or i8 %19, 64
br label %21
21: ; preds = %18, %15
%22 = phi i8 [ 90, %15 ], [ %20, %18 ]
%23 = phi i32 [ %17, %15 ], [ %13, %18 ]
%24 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %10
store i8 %22, i8* %24
%25 = add i64 %10, -1
%26 = icmp sgt i32 %23, 26
br i1 %26, label %9, label %27
27: ; preds = %21
%28 = trunc i64 %10 to i32
%29 = icmp eq i32 %23, 26
%30 = trunc i32 %23 to i8
%31 = add i8 %30, 64
%32 = select i1 %29, i8 90, i8 %31
%33 = shl i64 %25, 32
%34 = ashr exact i64 %33, 32
%35 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %34
store i8 %32, i8* %35
%36 = icmp slt i32 %28, 100002
br i1 %36, label %37, label %51
37: ; preds = %27
%38 = trunc i64 %25 to i32
%39 = shl i64 %25, 32
%40 = ashr exact i64 %39, 32
%41 = call i32 @llvm.smax.i32(i32 %38, i32 100000)
%42 = add nuw i32 %41, 1
br label %43
43: ; preds = %37, %43
%44 = phi i64 [ %40, %37 ], [ %48, %43 ]
%45 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %46)
%48 = add nsw i64 %44, 1
%49 = trunc i64 %48 to i32
%50 = icmp eq i32 %42, %49
br i1 %50, label %51, label %43
51: ; preds = %43, %27, %5
ret void
}