#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 */
int /*<<< orphan*/ allcaps(char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ parseinput(char *, int, int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
void main() {
  FILE *inFile;
  FILE *outFile;
  inFile = fopen("caesarCipher.in", "r");
  outFile = fopen("caesarCipher.out", "w");
  int inSize = 256;
  char input[256] = "";
  int outSize = 310;
  char code[310] = "";
  char mode;
  int block = 5;
  int key;
  printf("Please type a 'D' to decrypt or leave blank for encrypt: ");
  scanf("%c", &mode);
  printf("Please enter the Caesar cipher key: ");
  scanf("%d", &key);
  if (mode == 'd' || mode == 'D')
    key = 26 - key;
  while (fgets(input, inSize, inFile) != NULL) {
    parseinput(input, inSize, block, code);
    allcaps(code, inSize);
    int i;
    for (i = 0; i < outSize; i++) {
      if (code[i] >= 'A' && code[i] <= 'Z')
        code[i] = ((code[i] - 'A') + key) % 26 + 'A';
    }
    fprintf(outFile, "%s\n", code);
    memset(&input[0], 0, inSize);
    memset(&code[0], 0, outSize);
  }
  fclose(inFile);
  fclose(outFile);
  if (mode == 'd' || mode == 'D')
    printf("Your input is decoded in 'caesarCipher.out utilizing key %d.\n",
           26 - key);
  else
    printf("Your input is encoded in 'caesarCipher.out'utilizing key %d.\n",
           key);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
lea    0xe5e(%rip),%rdi
lea    0xe67(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    0xe59(%rip),%rdi
lea    0xe63(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x100,-0x14(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
movl   $0x136,-0x124(%rbp)
lea    -0x260(%rbp),%rdi
xor    %esi,%esi
mov    $0x136,%edx
call   1060 <memset@plt>
movl   $0x5,-0x268(%rbp)
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe40(%rip),%rdi
lea    -0x261(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe45(%rip),%rdi
lea    -0x26c(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
movsbl -0x261(%rbp),%eax
cmp    $0x64,%eax
je     1270 <main+0xe0>
movsbl -0x261(%rbp),%eax
cmp    $0x44,%eax
jne    1281 <main+0xf1>
mov    $0x1a,%eax
sub    -0x26c(%rbp),%eax
mov    %eax,-0x26c(%rbp)
jmp    1286 <main+0xf6>
lea    -0x120(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     13a7 <main+0x217>
lea    -0x120(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x268(%rbp),%edx
lea    -0x260(%rbp),%rcx
call   1090 <parseinput@plt>
lea    -0x260(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <allcaps@plt>
movl   $0x0,-0x270(%rbp)
mov    -0x270(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    1366 <main+0x1d6>
movslq -0x270(%rbp),%rax
movsbl -0x260(%rbp,%rax,1),%eax
ff
cmp    $0x41,%eax
jl     134d <main+0x1bd>
movslq -0x270(%rbp),%rax
movsbl -0x260(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jg     134d <main+0x1bd>
movslq -0x270(%rbp),%rax
movsbl -0x260(%rbp,%rax,1),%eax
ff
sub    $0x41,%eax
add    -0x26c(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%cl
movslq -0x270(%rbp),%rax
mov    %cl,-0x260(%rbp,%rax,1)
jmp    1352 <main+0x1c2>
mov    -0x270(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x270(%rbp)
jmp    12d8 <main+0x148>
mov    -0x10(%rbp),%rdi
lea    -0x260(%rbp),%rdx
lea    0xd12(%rip),%rsi
call   1080 <fprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    -0x260(%rbp),%rdi
mov    -0x124(%rbp),%edx
xor    %esi,%esi
call   1060 <memset@plt>
jmp    1286 <main+0xf6>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
movsbl -0x261(%rbp),%eax
cmp    $0x64,%eax
je     13d9 <main+0x249>
movsbl -0x261(%rbp),%eax
cmp    $0x44,%eax
jne    13f7 <main+0x267>
mov    $0x1a,%esi
sub    -0x26c(%rbp),%esi
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    140b <main+0x27b>
mov    -0x26c(%rbp),%esi
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x250,%rsp
lea    0xe79(%rip),%rdi
lea    0xe82(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r15
lea    0xe75(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r14
pxor   %xmm0,%xmm0
movdqa %xmm0,0x240(%rsp)
movdqa %xmm0,0x230(%rsp)
movdqa %xmm0,0x220(%rsp)
movdqa %xmm0,0x210(%rsp)
movdqa %xmm0,0x200(%rsp)
movdqa %xmm0,0x1f0(%rsp)
movdqa %xmm0,0x1e0(%rsp)
movdqa %xmm0,0x1d0(%rsp)
movdqa %xmm0,0x1c0(%rsp)
movdqa %xmm0,0x1b0(%rsp)
movdqa %xmm0,0x1a0(%rsp)
movdqa %xmm0,0x190(%rsp)
movdqa %xmm0,0x180(%rsp)
movdqa %xmm0,0x170(%rsp)
movdqa %xmm0,0x160(%rsp)
movdqa %xmm0,0x150(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x136,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdf9(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe00(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0xb(%rsp),%al
and    $0xdf,%al
cmp    $0x44,%al
jne    12ca <main+0x13a>
mov    $0x1a,%eax
sub    0xc(%rsp),%eax
mov    %eax,0xc(%rsp)
lea    0x150(%rsp),%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1787 <main+0x5f7>
lea    0x150(%rsp),%r12
lea    0x10(%rsp),%rbx
lea    0xdae(%rip),%r13
jmp    1345 <main+0x1b5>
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1080 <fprintf@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x136,%edx
call   1060 <memset@plt>
mov    %r12,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1787 <main+0x5f7>
mov    %r12,%rdi
mov    $0x100,%esi
mov    $0x5,%edx
mov    %rbx,%rcx
call   1090 <parseinput@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <allcaps@plt>
mov    0xc(%rsp),%eax
xor    %ecx,%ecx
movdqa 0xc8b(%rip),%xmm4
movdqa 0xc93(%rip),%xmm5
pcmpeqd %xmm6,%xmm6
jmp    13a1 <main+0x211>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x8,%rcx
cmp    $0x130,%rcx
je     1600 <main+0x470>
movq   0x10(%rsp,%rcx,1),%xmm0
movdqa %xmm0,%xmm1
paddb  %xmm4,%xmm1
movdqa %xmm1,%xmm2
pmaxub %xmm5,%xmm2
pcmpeqb %xmm1,%xmm2
movd   %xmm2,%edx
not    %dl
test   $0x1,%dl
je     13fa <main+0x26a>
movd   %xmm0,%edx
movzbl %dl,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x10(%rsp,%rcx,1)
movdqa %xmm2,%xmm1
pxor   %xmm6,%xmm1
movdqa %xmm1,%xmm3
pslld  $0x8,%xmm3
movd   %xmm3,%edx
shr    $0x10,%edx
test   $0x1,%dl
je     144b <main+0x2bb>
movd   %xmm0,%edx
movzbl %dh,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x11(%rsp,%rcx,1)
pshuflw $0x55,%xmm2,%xmm3
pxor   %xmm6,%xmm3
pextrw $0x2,%xmm3,%edx
test   $0x1,%dl
je     1495 <main+0x305>
movd   %xmm0,%edx
shr    $0x10,%edx
movzbl %dl,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x12(%rsp,%rcx,1)
movdqa %xmm1,%xmm3
psllq  $0x18,%xmm3
pextrw $0x3,%xmm3,%edx
test   $0x1,%dl
je     14dc <main+0x34c>
movd   %xmm0,%edx
shr    $0x18,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x13(%rsp,%rcx,1)
pshufd $0x55,%xmm2,%xmm2
pxor   %xmm6,%xmm2
pextrw $0x4,%xmm2,%edx
test   $0x1,%dl
je     1524 <main+0x394>
pextrw $0x2,%xmm0,%edx
movzbl %dl,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x14(%rsp,%rcx,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%edx
test   $0x1,%dl
je     156c <main+0x3dc>
pextrw $0x2,%xmm0,%edx
shr    $0x8,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x15(%rsp,%rcx,1)
pextrw $0x3,%xmm1,%edx
test   $0x1,%dl
je     15ab <main+0x41b>
pextrw $0x3,%xmm0,%edx
movzbl %dl,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x16(%rsp,%rcx,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%edx
test   $0x1,%dl
je     1390 <main+0x200>
pextrw $0x3,%xmm0,%edx
shr    $0x8,%edx
add    %eax,%edx
add    $0xffffffbf,%edx
movslq %edx,%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%edx
add    $0x41,%dl
mov    %dl,0x17(%rsp,%rcx,1)
jmp    1390 <main+0x200>
nopl   0x0(%rax,%rax,1)
movzbl 0x140(%rsp),%ecx
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1640 <main+0x4b0>
add    %eax,%ecx
add    $0xffffffbf,%ecx
movslq %ecx,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    $0x41,%cl
mov    %cl,0x140(%rsp)
movzbl 0x141(%rsp),%ecx
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1680 <main+0x4f0>
add    %eax,%ecx
add    $0xffffffbf,%ecx
movslq %ecx,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    $0x41,%cl
mov    %cl,0x141(%rsp)
movzbl 0x142(%rsp),%ecx
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     16c0 <main+0x530>
add    %eax,%ecx
add    $0xffffffbf,%ecx
movslq %ecx,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    $0x41,%cl
mov    %cl,0x142(%rsp)
movzbl 0x143(%rsp),%ecx
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1700 <main+0x570>
add    %eax,%ecx
add    $0xffffffbf,%ecx
movslq %ecx,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    $0x41,%cl
mov    %cl,0x143(%rsp)
movzbl 0x144(%rsp),%ecx
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1740 <main+0x5b0>
add    %eax,%ecx
add    $0xffffffbf,%ecx
movslq %ecx,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    $0x41,%cl
mov    %cl,0x144(%rsp)
movzbl 0x145(%rsp),%ecx
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1300 <main+0x170>
add    %ecx,%eax
add    $0xffffffbf,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x41,%al
mov    %al,0x145(%rsp)
jmp    1300 <main+0x170>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0xb(%rsp),%al
and    $0xdf,%al
mov    0xc(%rsp),%esi
cmp    $0x44,%al
jne    17b7 <main+0x627>
mov    $0x1a,%eax
sub    %esi,%eax
lea    0x8fb(%rip),%rdi
mov    %eax,%esi
jmp    17be <main+0x62e>
lea    0x92e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x250,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"caesarCipher.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [17 x i8] c"caesarCipher.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [58 x i8] c"Please type a 'D' to decrypt or leave blank for encrypt: \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [37 x i8] c"Please enter the Caesar cipher key: \00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@.str.9 = [62 x i8] c"Your input is decoded in 'caesarCipher.out utilizing key %d.\0A\00"
@.str.10 = [62 x i8] c"Your input is encoded in 'caesarCipher.out'utilizing key %d.\0A\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca [310 x i8]
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %1
%12 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %12, i32** %2
store i32 256, i32* %3
%13 = bitcast [256 x i8]* %4 to i8*
store i32 310, i32* %5
%14 = bitcast [310 x i8]* %6 to i8*
store i32 5, i32* %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %9)
%19 = load i8, i8* %7
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 100
br i1 %21, label %26, label %22
22: ; preds = %0
%23 = load i8, i8* %7
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 68
br i1 %25, label %26, label %29
26: ; preds = %22, %0
%27 = load i32, i32* %9
%28 = sub nsw i32 26, %27
store i32 %28, i32* %9
br label %29
29: ; preds = %26, %22
br label %30
30: ; preds = %82, %29
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%32 = load i32, i32* %3
%33 = load i32*, i32** %1
%34 = call i32* @fgets(i8* %31, i32 %32, i32* %33)
%35 = icmp ne i32* %34, null
br i1 %35, label %36, label %92
36: ; preds = %30
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%38 = load i32, i32* %3
%39 = load i32, i32* %8
%40 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 0
%41 = call i32 @parseinput(i8* %37, i32 %38, i32 %39, i8* %40)
%42 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 0
%43 = load i32, i32* %3
%44 = call i32 @allcaps(i8* %42, i32 %43)
store i32 0, i32* %10
br label %45
45: ; preds = %79, %36
%46 = load i32, i32* %10
%47 = load i32, i32* %5
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %82
49: ; preds = %45
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp sge i32 %54, 65
br i1 %55, label %56, label %78
56: ; preds = %49
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp sle i32 %61, 90
br i1 %62, label %63, label %78
63: ; preds = %56
%64 = load i32, i32* %10
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = sub nsw i32 %68, 65
%70 = load i32, i32* %9
%71 = add nsw i32 %69, %70
%72 = srem i32 %71, 26
%73 = add nsw i32 %72, 65
%74 = trunc i32 %73 to i8
%75 = load i32, i32* %10
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 %76
store i8 %74, i8* %77
br label %78
78: ; preds = %63, %56, %49
br label %79
79: ; preds = %78
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
store i32 %81, i32* %10
br label %45
82: ; preds = %45
%83 = load i32*, i32** %2
%84 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 0
%85 = call i32 @fprintf(i32* %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %84)
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%87 = load i32, i32* %3
%88 = call i32 @memset(i8* %86, i32 0, i32 %87)
%89 = getelementptr inbounds [310 x i8], [310 x i8]* %6, i64 0, i64 0
%90 = load i32, i32* %5
%91 = call i32 @memset(i8* %89, i32 0, i32 %90)
br label %30
92: ; preds = %30
%93 = load i32*, i32** %1
%94 = call i32 @fclose(i32* %93)
%95 = load i32*, i32** %2
%96 = call i32 @fclose(i32* %95)
%97 = load i8, i8* %7
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 100
br i1 %99, label %104, label %100
100: ; preds = %92
%101 = load i8, i8* %7
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 68
br i1 %103, label %104, label %108
104: ; preds = %100, %92
%105 = load i32, i32* %9
%106 = sub nsw i32 26, %105
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i32 %106)
br label %111
108: ; preds = %100
%109 = load i32, i32* %9
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0), i32 %109)
br label %111
111: ; preds = %108, %104
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"caesarCipher.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [17 x i8] c"caesarCipher.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [58 x i8] c"Please type a 'D' to decrypt or leave blank for encrypt: \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [37 x i8] c"Please enter the Caesar cipher key: \00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@.str.9 = [62 x i8] c"Your input is decoded in 'caesarCipher.out utilizing key %d.\0A\00"
@.str.10 = [62 x i8] c"Your input is encoded in 'caesarCipher.out'utilizing key %d.\0A\00"
define void @main() {
%1 = alloca [256 x i8]
%2 = alloca [310 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 0
%9 = bitcast i32* %4 to i8*
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %4)
%14 = load i8, i8* %3
%15 = and i8 %14, -33
%16 = icmp eq i8 %15, 68
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = load i32, i32* %4
%19 = sub nsw i32 26, %18
store i32 %19, i32* %4
br label %20
20: ; preds = %0, %17
%21 = call i32* @fgets(i8* %7, i32 256, i32* %5)
%22 = icmp eq i32* %21, null
br i1 %22, label %210, label %23
23: ; preds = %20
%24 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 304
%25 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 305
%26 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 306
%27 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 307
%28 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 308
%29 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 309
br label %30
30: ; preds = %23, %204
%31 = call i32 @parseinput(i8* %7, i32 256, i32 5, i8* %8)
%32 = call i32 @allcaps(i8* %8, i32 256)
%33 = load i32, i32* %4
br label %34
34: ; preds = %135, %30
%35 = phi i64 [ 0, %30 ], [ %136, %135 ]
%36 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %35
%37 = bitcast i8* %36 to <8 x i8>*
%38 = load <8 x i8>, <8 x i8>* %37
%39 = add <8 x i8> %38, <i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65>
%40 = icmp ult <8 x i8> %39, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26>
%41 = extractelement <8 x i1> %40, i64 0
br i1 %41, label %42, label %51
42: ; preds = %34
%43 = extractelement <8 x i8> %38, i64 0
%44 = zext i8 %43 to i32
%45 = add nsw i32 %44, -65
%46 = add nsw i32 %45, %33
%47 = srem i32 %46, 26
%48 = trunc i32 %47 to i8
%49 = add nsw i8 %48, 65
%50 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %35
store i8 %49, i8* %50
br label %51
51: ; preds = %42, %34
%52 = extractelement <8 x i1> %40, i64 1
br i1 %52, label %53, label %63
53: ; preds = %51
%54 = or i64 %35, 1
%55 = extractelement <8 x i8> %38, i64 1
%56 = zext i8 %55 to i32
%57 = add nsw i32 %56, -65
%58 = add nsw i32 %57, %33
%59 = srem i32 %58, 26
%60 = trunc i32 %59 to i8
%61 = add nsw i8 %60, 65
%62 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %54
store i8 %61, i8* %62
br label %63
63: ; preds = %53, %51
%64 = extractelement <8 x i1> %40, i64 2
br i1 %64, label %65, label %75
65: ; preds = %63
%66 = or i64 %35, 2
%67 = extractelement <8 x i8> %38, i64 2
%68 = zext i8 %67 to i32
%69 = add nsw i32 %68, -65
%70 = add nsw i32 %69, %33
%71 = srem i32 %70, 26
%72 = trunc i32 %71 to i8
%73 = add nsw i8 %72, 65
%74 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %66
store i8 %73, i8* %74
br label %75
75: ; preds = %65, %63
%76 = extractelement <8 x i1> %40, i64 3
br i1 %76, label %77, label %87
77: ; preds = %75
%78 = or i64 %35, 3
%79 = extractelement <8 x i8> %38, i64 3
%80 = zext i8 %79 to i32
%81 = add nsw i32 %80, -65
%82 = add nsw i32 %81, %33
%83 = srem i32 %82, 26
%84 = trunc i32 %83 to i8
%85 = add nsw i8 %84, 65
%86 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %78
store i8 %85, i8* %86
br label %87
87: ; preds = %77, %75
%88 = extractelement <8 x i1> %40, i64 4
br i1 %88, label %89, label %99
89: ; preds = %87
%90 = or i64 %35, 4
%91 = extractelement <8 x i8> %38, i64 4
%92 = zext i8 %91 to i32
%93 = add nsw i32 %92, -65
%94 = add nsw i32 %93, %33
%95 = srem i32 %94, 26
%96 = trunc i32 %95 to i8
%97 = add nsw i8 %96, 65
%98 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %90
store i8 %97, i8* %98
br label %99
99: ; preds = %89, %87
%100 = extractelement <8 x i1> %40, i64 5
br i1 %100, label %101, label %111
101: ; preds = %99
%102 = or i64 %35, 5
%103 = extractelement <8 x i8> %38, i64 5
%104 = zext i8 %103 to i32
%105 = add nsw i32 %104, -65
%106 = add nsw i32 %105, %33
%107 = srem i32 %106, 26
%108 = trunc i32 %107 to i8
%109 = add nsw i8 %108, 65
%110 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %102
store i8 %109, i8* %110
br label %111
111: ; preds = %101, %99
%112 = extractelement <8 x i1> %40, i64 6
br i1 %112, label %113, label %123
113: ; preds = %111
%114 = or i64 %35, 6
%115 = extractelement <8 x i8> %38, i64 6
%116 = zext i8 %115 to i32
%117 = add nsw i32 %116, -65
%118 = add nsw i32 %117, %33
%119 = srem i32 %118, 26
%120 = trunc i32 %119 to i8
%121 = add nsw i8 %120, 65
%122 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %114
store i8 %121, i8* %122
br label %123
123: ; preds = %113, %111
%124 = extractelement <8 x i1> %40, i64 7
br i1 %124, label %125, label %135
125: ; preds = %123
%126 = or i64 %35, 7
%127 = extractelement <8 x i8> %38, i64 7
%128 = zext i8 %127 to i32
%129 = add nsw i32 %128, -65
%130 = add nsw i32 %129, %33
%131 = srem i32 %130, 26
%132 = trunc i32 %131 to i8
%133 = add nsw i8 %132, 65
%134 = getelementptr inbounds [310 x i8], [310 x i8]* %2, i64 0, i64 %126
store i8 %133, i8* %134
br label %135
135: ; preds = %125, %123
%136 = add nuw i64 %35, 8
%137 = icmp eq i64 %136, 304
br i1 %137, label %138, label %34
138: ; preds = %135
%139 = load i8, i8* %24
%140 = add i8 %139, -65
%141 = icmp ult i8 %140, 26
br i1 %141, label %142, label %149
142: ; preds = %138
%143 = zext i8 %139 to i32
%144 = add nsw i32 %143, -65
%145 = add nsw i32 %144, %33
%146 = srem i32 %145, 26
%147 = trunc i32 %146 to i8
%148 = add nsw i8 %147, 65
store i8 %148, i8* %24
br label %149
149: ; preds = %138, %142
%150 = load i8, i8* %25
%151 = add i8 %150, -65
%152 = icmp ult i8 %151, 26
br i1 %152, label %153, label %160
153: ; preds = %149
%154 = zext i8 %150 to i32
%155 = add nsw i32 %154, -65
%156 = add nsw i32 %155, %33
%157 = srem i32 %156, 26
%158 = trunc i32 %157 to i8
%159 = add nsw i8 %158, 65
store i8 %159, i8* %25
br label %160
160: ; preds = %153, %149
%161 = load i8, i8* %26
%162 = add i8 %161, -65
%163 = icmp ult i8 %162, 26
br i1 %163, label %164, label %171
164: ; preds = %160
%165 = zext i8 %161 to i32
%166 = add nsw i32 %165, -65
%167 = add nsw i32 %166, %33
%168 = srem i32 %167, 26
%169 = trunc i32 %168 to i8
%170 = add nsw i8 %169, 65
store i8 %170, i8* %26
br label %171
171: ; preds = %164, %160
%172 = load i8, i8* %27
%173 = add i8 %172, -65
%174 = icmp ult i8 %173, 26
br i1 %174, label %175, label %182
175: ; preds = %171
%176 = zext i8 %172 to i32
%177 = add nsw i32 %176, -65
%178 = add nsw i32 %177, %33
%179 = srem i32 %178, 26
%180 = trunc i32 %179 to i8
%181 = add nsw i8 %180, 65
store i8 %181, i8* %27
br label %182
182: ; preds = %175, %171
%183 = load i8, i8* %28
%184 = add i8 %183, -65
%185 = icmp ult i8 %184, 26
br i1 %185, label %186, label %193
186: ; preds = %182
%187 = zext i8 %183 to i32
%188 = add nsw i32 %187, -65
%189 = add nsw i32 %188, %33
%190 = srem i32 %189, 26
%191 = trunc i32 %190 to i8
%192 = add nsw i8 %191, 65
store i8 %192, i8* %28
br label %193
193: ; preds = %186, %182
%194 = load i8, i8* %29
%195 = add i8 %194, -65
%196 = icmp ult i8 %195, 26
br i1 %196, label %197, label %204
197: ; preds = %193
%198 = zext i8 %194 to i32
%199 = add nsw i32 %198, -65
%200 = add nsw i32 %199, %33
%201 = srem i32 %200, 26
%202 = trunc i32 %201 to i8
%203 = add nsw i8 %202, 65
store i8 %203, i8* %29
br label %204
204: ; preds = %197, %193
%205 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %8)
%206 = call i32 @memset(i8* %7, i32 0, i32 256)
%207 = call i32 @memset(i8* %8, i32 0, i32 310)
%208 = call i32* @fgets(i8* %7, i32 256, i32* %5)
%209 = icmp eq i32* %208, null
br i1 %209, label %210, label %30
210: ; preds = %204, %20
%211 = call i32 @fclose(i32* %5)
%212 = call i32 @fclose(i32* %6)
%213 = load i8, i8* %3
%214 = and i8 %213, -33
%215 = icmp eq i8 %214, 68
%216 = load i32, i32* %4
br i1 %215, label %217, label %220
217: ; preds = %210
%218 = sub nsw i32 26, %216
%219 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i32 %218)
br label %222
220: ; preds = %210
%221 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0), i32 %216)
br label %222
222: ; preds = %220, %217
ret void
}