#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  int a;
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%d", &a) != EOF) {
    int b, c, d = --a % 26;
    if (a >= 26) {
      a /= 26;
      c = --a % 26;
      if (a >= 26) {
        a /= 26;
        b = --a % 26;
        printf("%c%c%c\n", 'A' + b, 'A' + c, 'A' + d);
      } else {
        printf("%c%c\n", 'A' + c, 'A' + d);
      }
    } else {
      printf("%c\n", 'A' + d);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1288 <main+0x158>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe87(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe75(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
mov    0x2e39(%rip),%rcx
cmp    (%rcx),%rax
je     1281 <main+0x151>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
cmpl   $0x1a,-0x1c(%rbp)
jl     1268 <main+0x138>
mov    -0x1c(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
cmpl   $0x1a,-0x1c(%rbp)
jl     1249 <main+0x119>
mov    -0x1c(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%esi
add    $0x41,%esi
mov    -0x24(%rbp),%edx
add    $0x41,%edx
mov    -0x28(%rbp),%ecx
add    $0x41,%ecx
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1263 <main+0x133>
mov    -0x24(%rbp),%esi
add    $0x41,%esi
mov    -0x28(%rbp),%edx
add    $0x41,%edx
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <main+0x14c>
mov    -0x28(%rbp),%esi
add    $0x41,%esi
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1194 <main+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1299 <main+0x169>
mov    0x8(%rsi),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rax,%rcx
mov    0x2e73(%rip),%r14
xor    %eax,%eax
cmp    (%r14),%rcx
je     12b3 <main+0x183>
lea    0xe92(%rip),%r15
lea    0xe86(%rip),%r12
lea    0x4(%rsp),%r13
lea    0xe81(%rip),%rbp
jmp    11c6 <main+0x96>
nopl   0x0(%rax)
add    $0x41,%ecx
mov    %rbp,%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <fscanf@plt>
cmp    (%r14),%rax
je     12b1 <main+0x181>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%edx
mov    %edx,0x4(%rsp)
movslq %edx,%rcx
imul   $0x4ec4ec4f,%rcx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rcx
add    %esi,%ecx
lea    (%rcx,%rcx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %ecx,%esi
neg    %esi
lea    (%rax,%rsi,1),%ecx
add    $0xffffffff,%ecx
cmp    $0x1b,%eax
jl     11a0 <main+0x70>
mov    %edx,%edx
imul   $0x4ec4ec4f,%rdx,%rdx
shr    $0x23,%rdx
add    $0xffffffff,%edx
mov    %edx,0x4(%rsp)
imul   $0x4ec4ec4f,%rdx,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
cmp    $0x2bf,%eax
jb     1280 <main+0x150>
add    $0xffffffff,%esi
mov    %esi,0x4(%rsp)
movslq %esi,%rsi
imul   $0x4ec4ec4f,%rsi,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rax
add    %edi,%eax
lea    (%rax,%rax,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %eax,%edi
sub    %edi,%esi
add    $0x41,%esi
add    $0x41,%edx
add    $0x41,%ecx
lea    0xdb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11af <main+0x7f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x41,%edx
add    $0x41,%ecx
mov    %r15,%rdi
mov    %edx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11af <main+0x7f>
mov    (%rsi),%rsi
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
jmp    12b3 <main+0x183>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.3 = [8 x i8] c"%c%c%c\0A\00"
@.str.4 = [6 x i8] c"%c%c\0A\00"
@.str.5 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 1, i32* %3
br label %68
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %6
br label %23
23: ; preds = %66, %18
%24 = load i32*, i32** %6
%25 = call i64 @fscanf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%26 = load i64, i64* @EOF
%27 = icmp ne i64 %25, %26
br i1 %27, label %28, label %67
28: ; preds = %23
%29 = load i32, i32* %7
%30 = add nsw i32 %29, -1
store i32 %30, i32* %7
%31 = srem i32 %30, 26
store i32 %31, i32* %10
%32 = load i32, i32* %7
%33 = icmp sge i32 %32, 26
br i1 %33, label %34, label %62
34: ; preds = %28
%35 = load i32, i32* %7
%36 = sdiv i32 %35, 26
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = add nsw i32 %37, -1
store i32 %38, i32* %7
%39 = srem i32 %38, 26
store i32 %39, i32* %9
%40 = load i32, i32* %7
%41 = icmp sge i32 %40, 26
br i1 %41, label %42, label %55
42: ; preds = %34
%43 = load i32, i32* %7
%44 = sdiv i32 %43, 26
store i32 %44, i32* %7
%45 = load i32, i32* %7
%46 = add nsw i32 %45, -1
store i32 %46, i32* %7
%47 = srem i32 %46, 26
store i32 %47, i32* %8
%48 = load i32, i32* %8
%49 = add nsw i32 65, %48
%50 = load i32, i32* %9
%51 = add nsw i32 65, %50
%52 = load i32, i32* %10
%53 = add nsw i32 65, %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %49, i32 %51, i32 %53)
br label %61
55: ; preds = %34
%56 = load i32, i32* %9
%57 = add nsw i32 65, %56
%58 = load i32, i32* %10
%59 = add nsw i32 65, %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %57, i32 %59)
br label %61
61: ; preds = %55, %42
br label %66
62: ; preds = %28
%63 = load i32, i32* %10
%64 = add nsw i32 65, %63
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %64)
br label %66
66: ; preds = %62, %61
br label %23
67: ; preds = %23
store i32 0, i32* %3
br label %68
68: ; preds = %67, %13
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.3 = [8 x i8] c"%c%c%c\0A\00"
@.str.4 = [6 x i8] c"%c%c\0A\00"
@.str.5 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %45
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i64 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %45, label %16
16: ; preds = %9, %41
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
%19 = srem i32 %18, 26
%20 = icmp sgt i32 %17, 26
br i1 %20, label %21, label %38
21: ; preds = %16
%22 = udiv i32 %18, 26
%23 = add nsw i32 %22, -1
store i32 %23, i32* %3
%24 = urem i32 %23, 26
%25 = udiv i32 %23, 26
%26 = icmp ugt i32 %17, 702
br i1 %26, label %27, label %34
27: ; preds = %21
%28 = add nsw i32 %25, -1
store i32 %28, i32* %3
%29 = srem i32 %28, 26
%30 = add nsw i32 %29, 65
%31 = add nuw nsw i32 %24, 65
%32 = add nsw i32 %19, 65
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %31, i32 %32)
br label %41
34: ; preds = %21
%35 = add nuw nsw i32 %24, 65
%36 = add nsw i32 %19, 65
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %35, i32 %36)
br label %41
38: ; preds = %16
%39 = add nsw i32 %19, 65
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %27, %34, %38
%42 = call i64 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%43 = load i64, i64* @EOF
%44 = icmp eq i64 %42, %43
br i1 %44, label %45, label %16
45: ; preds = %41, %9, %6
%46 = phi i32 [ 1, %6 ], [ 0, %9 ], [ 0, %41 ]
ret i32 %46
}