#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  if (argc != 4) {
    fprintf(stdout, "Invalid arguments\nvig <plain/ciphertext> <key> -d/-e\n");
    fprintf(stdout, "Arguments are expected to be all capital letters with no "
                    "whitespace\n-d indicates decryption, -e encryption\n");
    exit(EXIT_FAILURE);
  }
  if (strcmp(argv[3], "-e") == 0) {
    fprintf(stdout, "Plaintext: %s\nKey: %s\nCiphertext numerical: ", argv[1],
            argv[2]);
    char buf[256];
    char out[256];
    memset(out, 0, 256);
    for (int i = 0; i < strlen(argv[1]); ++i) {
      char c = argv[1][i];
      char d = argv[2][i % strlen(argv[2])];
      int a = c - 65;
      int b = d - 65;
      int o = ((c + d) % 26) + 65;
      sprintf(buf, "%c", o);
      fprintf(stdout, "%d ", o - 65);
      strcat(out, buf);
    }
    fprintf(stdout, "\nCiphertext: %s\n", out);
    exit(EXIT_SUCCESS);
  } else if (strcmp(argv[3], "-d") == 0) {
    fprintf(stdout, "Ciphertext: %s\nKey: %s\nPlaintext numerical: ", argv[1],
            argv[2]);
    char buf[256];
    char out[256];
    memset(out, 0, 256);
    for (int i = 0; i < strlen(argv[1]); ++i) {
      char c = argv[1][i];
      char d = argv[2][i % strlen(argv[2])];
      int a = c - 65;
      int b = d - 65;
      int o = ((c - d) % 26) + 65;
      sprintf(buf, "%c", o);
      fprintf(stdout, "%d ", o - 65);
      strcat(out, buf);
    }
    fprintf(stdout, "\nPlaintext: %s\n", out);
    exit(EXIT_SUCCESS);
  } else {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11cf <main+0x5f>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xec4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1385 <main+0x215>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x214(%rbp)
mov    -0x214(%rbp),%eax
mov    %eax,-0x448(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x448(%rbp),%eax
cmp    %ecx,%eax
jge    1359 <main+0x1e9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x214(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x215(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x450(%rbp)
mov    -0x214(%rbp),%eax
mov    %eax,-0x454(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x454(%rbp),%eax
cltd
idiv   %ecx
mov    -0x450(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x216(%rbp)
movsbl -0x215(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x21c(%rbp)
movsbl -0x216(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x220(%rbp)
movsbl -0x215(%rbp),%eax
movsbl -0x216(%rbp),%ecx
add    %ecx,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %edx,-0x224(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x224(%rbp),%edx
lea    0xdc5(%rip),%rsi
call   1080 <sprintf@plt>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
mov    -0x224(%rbp),%edx
sub    $0x41,%edx
lea    0xdaa(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    1231 <main+0xc1>
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
lea    -0x210(%rbp),%rdx
lea    0xd69(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd56(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    153b <main+0x3cb>
mov    0x2c2e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xd2a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x434(%rbp)
mov    -0x434(%rbp),%eax
mov    %eax,-0x458(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x458(%rbp),%eax
cmp    %ecx,%eax
jge    150f <main+0x39f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x434(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x435(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x460(%rbp)
mov    -0x434(%rbp),%eax
mov    %eax,-0x464(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x464(%rbp),%eax
cltd
idiv   %ecx
mov    -0x460(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x436(%rbp)
movsbl -0x435(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x43c(%rbp)
movsbl -0x436(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x440(%rbp)
movsbl -0x435(%rbp),%eax
movsbl -0x436(%rbp),%ecx
sub    %ecx,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %edx,-0x444(%rbp)
lea    -0x330(%rbp),%rdi
mov    -0x444(%rbp),%edx
lea    0xc0f(%rip),%rsi
call   1080 <sprintf@plt>
mov    0x2b09(%rip),%rax
mov    (%rax),%edi
mov    -0x444(%rbp),%edx
sub    $0x41,%edx
lea    0xbf4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x430(%rbp),%rdi
lea    -0x330(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x434(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x434(%rbp)
jmp    13e7 <main+0x277>
mov    0x2ac2(%rip),%rax
mov    (%rax),%edi
lea    -0x430(%rbp),%rdx
lea    0xbf4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2a9c(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    0x2a9e(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
cmp    $0x4,%edi
jne    1275 <main+0x115>
mov    %rsi,%r13
mov    0x18(%rsi),%rdi
lea    0xf1a(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    12aa <main+0x14a>
mov    0x2e3b(%rip),%r15
mov    (%r15),%edi
mov    0x8(%r13),%rdx
mov    0x10(%r13),%rcx
lea    0xef6(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    0x8(%r13),%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1266 <main+0x106>
lea    0x100(%rsp),%r12
xor    %ebx,%ebx
mov    0x8(%r13),%rax
mov    0x10(%r13),%rbp
movsbl (%rax,%rbx,1),%r14d
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
movsbl 0x0(%rbp,%rdx,1),%eax
add    %r14d,%eax
imul   $0x4ec5,%eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x13,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
movswl %ax,%edx
add    $0x41,%al
mov    %al,0x100(%rsp)
movb   $0x0,0x101(%rsp)
mov    (%r15),%edi
lea    0xe96(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rsp,%rdi
mov    %r12,%rsi
call   1070 <strcat@plt>
add    $0x1,%rbx
mov    0x8(%r13),%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     11e0 <main+0x80>
mov    (%r15),%edi
lea    0xe66(%rip),%rsi
jmp    13a6 <main+0x246>
mov    0x2d5c(%rip),%rbx
mov    (%rbx),%edi
lea    0xd7b(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xda1(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    0x18(%r13),%rdi
lea    0xe32(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    129c <main+0x13c>
mov    0x2d12(%rip),%r15
mov    (%r15),%edi
mov    0x8(%r13),%rdx
mov    0x10(%r13),%rcx
lea    0xe12(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    0x8(%r13),%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    139c <main+0x23c>
lea    0x100(%rsp),%r12
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x8(%r13),%rax
mov    0x10(%r13),%rbp
movsbl (%rax,%rbx,1),%r14d
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
movsbl 0x0(%rbp,%rdx,1),%eax
sub    %eax,%r14d
imul   $0x4ec5,%r14d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x13,%eax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%r14d
movswl %r14w,%edx
add    $0x41,%r14b
mov    %r14b,0x100(%rsp)
movb   $0x0,0x101(%rsp)
mov    (%r15),%edi
lea    0xd60(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rsp,%rdi
mov    %r12,%rsi
call   1070 <strcat@plt>
add    $0x1,%rbx
mov    0x8(%r13),%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1310 <main+0x1b0>
mov    (%r15),%edi
lea    0xd71(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [54 x i8] c"Invalid arguments\0Avig <plain/ciphertext> <key> -d/-e\0A\00"
@.str.1 = [108 x i8] c"Arguments are expected to be all capital letters with no whitespace\0A-d indicates decryption, -e encryption\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [45 x i8] c"Plaintext: %s\0AKey: %s\0ACiphertext numerical: \00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [4 x i8] c"%d \00"
@.str.6 = [17 x i8] c"\0ACiphertext: %s\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.7 = [3 x i8] c"-d\00"
@.str.8 = [45 x i8] c"Ciphertext: %s\0AKey: %s\0APlaintext numerical: \00"
@.str.9 = [16 x i8] c"\0APlaintext: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca [256 x i8]
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [256 x i8]
%15 = alloca [256 x i8]
%16 = alloca i32
%17 = alloca i8
%18 = alloca i8
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 4
br i1 %23, label %24, label %31
24: ; preds = %2
%25 = load i32, i32* @stdout
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* @EXIT_FAILURE
%30 = call i32 @exit(i32 %29)
unreachable
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %107
37: ; preds = %31
%38 = load i32, i32* @stdout
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %41, i8* %44)
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%47 = call i32 @memset(i8* %46, i32 0, i32 256)
store i32 0, i32* %8
br label %48
48: ; preds = %98, %37
%49 = load i32, i32* %8
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = call i32 @strlen(i8* %52)
%54 = icmp slt i32 %49, %53
br i1 %54, label %55, label %101
55: ; preds = %48
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 1
%58 = load i8*, i8** %57
%59 = load i32, i32* %8
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %58, i64 %60
%62 = load i8, i8* %61
store i8 %62, i8* %9
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = load i32, i32* %8
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 2
%69 = load i8*, i8** %68
%70 = call i32 @strlen(i8* %69)
%71 = srem i32 %66, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %65, i64 %72
%74 = load i8, i8* %73
store i8 %74, i8* %10
%75 = load i8, i8* %9
%76 = sext i8 %75 to i32
%77 = sub nsw i32 %76, 65
store i32 %77, i32* %11
%78 = load i8, i8* %10
%79 = sext i8 %78 to i32
%80 = sub nsw i32 %79, 65
store i32 %80, i32* %12
%81 = load i8, i8* %9
%82 = sext i8 %81 to i32
%83 = load i8, i8* %10
%84 = sext i8 %83 to i32
%85 = add nsw i32 %82, %84
%86 = srem i32 %85, 26
%87 = add nsw i32 %86, 65
store i32 %87, i32* %13
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%89 = load i32, i32* %13
%90 = call i32 @sprintf(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %89)
%91 = load i32, i32* @stdout
%92 = load i32, i32* %13
%93 = sub nsw i32 %92, 65
%94 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%97 = call i32 @strcat(i8* %95, i8* %96)
br label %98
98: ; preds = %55
%99 = load i32, i32* %8
%100 = add nsw i32 %99, 1
store i32 %100, i32* %8
br label %48
101: ; preds = %48
%102 = load i32, i32* @stdout
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %103)
%105 = load i32, i32* @EXIT_SUCCESS
%106 = call i32 @exit(i32 %105)
unreachable
107: ; preds = %31
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 3
%110 = load i8*, i8** %109
%111 = call i64 @strcmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %183
113: ; preds = %107
%114 = load i32, i32* @stdout
%115 = load i8**, i8*** %5
%116 = getelementptr inbounds i8*, i8** %115, i64 1
%117 = load i8*, i8** %116
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 2
%120 = load i8*, i8** %119
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0), i8* %117, i8* %120)
%122 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%123 = call i32 @memset(i8* %122, i32 0, i32 256)
store i32 0, i32* %16
br label %124
124: ; preds = %174, %113
%125 = load i32, i32* %16
%126 = load i8**, i8*** %5
%127 = getelementptr inbounds i8*, i8** %126, i64 1
%128 = load i8*, i8** %127
%129 = call i32 @strlen(i8* %128)
%130 = icmp slt i32 %125, %129
br i1 %130, label %131, label %177
131: ; preds = %124
%132 = load i8**, i8*** %5
%133 = getelementptr inbounds i8*, i8** %132, i64 1
%134 = load i8*, i8** %133
%135 = load i32, i32* %16
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8, i8* %134, i64 %136
%138 = load i8, i8* %137
store i8 %138, i8* %17
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 2
%141 = load i8*, i8** %140
%142 = load i32, i32* %16
%143 = load i8**, i8*** %5
%144 = getelementptr inbounds i8*, i8** %143, i64 2
%145 = load i8*, i8** %144
%146 = call i32 @strlen(i8* %145)
%147 = srem i32 %142, %146
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i8, i8* %141, i64 %148
%150 = load i8, i8* %149
store i8 %150, i8* %18
%151 = load i8, i8* %17
%152 = sext i8 %151 to i32
%153 = sub nsw i32 %152, 65
store i32 %153, i32* %19
%154 = load i8, i8* %18
%155 = sext i8 %154 to i32
%156 = sub nsw i32 %155, 65
store i32 %156, i32* %20
%157 = load i8, i8* %17
%158 = sext i8 %157 to i32
%159 = load i8, i8* %18
%160 = sext i8 %159 to i32
%161 = sub nsw i32 %158, %160
%162 = srem i32 %161, 26
%163 = add nsw i32 %162, 65
store i32 %163, i32* %21
%164 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%165 = load i32, i32* %21
%166 = call i32 @sprintf(i8* %164, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %165)
%167 = load i32, i32* @stdout
%168 = load i32, i32* %21
%169 = sub nsw i32 %168, 65
%170 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %169)
%171 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%172 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%173 = call i32 @strcat(i8* %171, i8* %172)
br label %174
174: ; preds = %131
%175 = load i32, i32* %16
%176 = add nsw i32 %175, 1
store i32 %176, i32* %16
br label %124
177: ; preds = %124
%178 = load i32, i32* @stdout
%179 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%180 = call i32 (i32, i8*, ...) @fprintf(i32 %178, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %179)
%181 = load i32, i32* @EXIT_SUCCESS
%182 = call i32 @exit(i32 %181)
unreachable
183: ; preds = %107
%184 = load i32, i32* @EXIT_FAILURE
%185 = call i32 @exit(i32 %184)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [54 x i8] c"Invalid arguments\0Avig <plain/ciphertext> <key> -d/-e\0A\00"
@.str.1 = [108 x i8] c"Arguments are expected to be all capital letters with no whitespace\0A-d indicates decryption, -e encryption\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [45 x i8] c"Plaintext: %s\0AKey: %s\0ACiphertext numerical: \00"
@.str.5 = [4 x i8] c"%d \00"
@.str.6 = [17 x i8] c"\0ACiphertext: %s\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.7 = [3 x i8] c"-d\00"
@.str.8 = [45 x i8] c"Ciphertext: %s\0AKey: %s\0APlaintext numerical: \00"
@.str.9 = [16 x i8] c"\0APlaintext: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = icmp eq i32 %0, 4
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %67
20: ; preds = %15
%21 = load i32, i32* @stdout
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %23, i8* %25)
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%29 = call i32 @memset(i8* %28, i32 0, i32 256)
%30 = load i8*, i8** %22
%31 = call i32 @strlen(i8* %30)
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %20
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 1
br label %40
35: ; preds = %40, %20
%36 = load i32, i32* @stdout
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %28)
%38 = load i32, i32* @EXIT_SUCCESS
%39 = call i32 @exit(i32 %38)
unreachable
40: ; preds = %33, %40
%41 = phi i64 [ 0, %33 ], [ %62, %40 ]
%42 = load i8*, i8** %22
%43 = getelementptr inbounds i8, i8* %42, i64 %41
%44 = load i8, i8* %43
%45 = load i8*, i8** %24
%46 = call i32 @strlen(i8* %45)
%47 = trunc i64 %41 to i32
%48 = srem i32 %47, %46
%49 = zext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %45, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %44 to i16
%53 = sext i8 %51 to i16
%54 = add nsw i16 %53, %52
%55 = srem i16 %54, 26
%56 = sext i16 %55 to i32
%57 = trunc i16 %55 to i8
%58 = add nsw i8 %57, 65
store i8 %58, i8* %27
store i8 0, i8* %34
%59 = load i32, i32* @stdout
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %56)
%61 = call i32 @strcat(i8* %28, i8* %27)
%62 = add nuw nsw i64 %41, 1
%63 = load i8*, i8** %22
%64 = call i32 @strlen(i8* %63)
%65 = sext i32 %64 to i64
%66 = icmp slt i64 %62, %65
br i1 %66, label %40, label %35
67: ; preds = %15
%68 = load i8*, i8** %16
%69 = tail call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %118
71: ; preds = %67
%72 = load i32, i32* @stdout
%73 = getelementptr inbounds i8*, i8** %1, i64 1
%74 = load i8*, i8** %73
%75 = getelementptr inbounds i8*, i8** %1, i64 2
%76 = load i8*, i8** %75
%77 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0), i8* %74, i8* %76)
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%80 = call i32 @memset(i8* %79, i32 0, i32 256)
%81 = load i8*, i8** %73
%82 = call i32 @strlen(i8* %81)
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %71
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 1
br label %91
86: ; preds = %91, %71
%87 = load i32, i32* @stdout
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %79)
%89 = load i32, i32* @EXIT_SUCCESS
%90 = call i32 @exit(i32 %89)
unreachable
91: ; preds = %84, %91
%92 = phi i64 [ 0, %84 ], [ %113, %91 ]
%93 = load i8*, i8** %73
%94 = getelementptr inbounds i8, i8* %93, i64 %92
%95 = load i8, i8* %94
%96 = load i8*, i8** %75
%97 = call i32 @strlen(i8* %96)
%98 = trunc i64 %92 to i32
%99 = srem i32 %98, %97
%100 = zext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %96, i64 %100
%102 = load i8, i8* %101
%103 = sext i8 %95 to i16
%104 = sext i8 %102 to i16
%105 = sub nsw i16 %103, %104
%106 = srem i16 %105, 26
%107 = sext i16 %106 to i32
%108 = trunc i16 %106 to i8
%109 = add nsw i8 %108, 65
store i8 %109, i8* %78
store i8 0, i8* %85
%110 = load i32, i32* @stdout
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %107)
%112 = call i32 @strcat(i8* %79, i8* %78)
%113 = add nuw nsw i64 %92, 1
%114 = load i8*, i8** %73
%115 = call i32 @strlen(i8* %114)
%116 = sext i32 %115 to i64
%117 = icmp slt i64 %113, %116
br i1 %117, label %91, label %86
118: ; preds = %67
%119 = load i32, i32* @EXIT_FAILURE
%120 = tail call i32 @exit(i32 %119)
unreachable
}