#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 EXIT_SUCCESS;
scalar_t__ cdel_verify_base16_string(char *);
scalar_t__ cdel_verify_base2_string(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *read_string(int /*<<< orphan*/ *);
int sscanf(char *, char *, char *, char *, char *, char *, char *, char *,
           char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int cline = 0;
  char base2[300];
  char base2spc[300];
  char base16upc[128];
  char base16lwr[128];
  char base32[128];
  char base58[128];
  char base64[128];
  char base85[128];
  char base91[128];
  char *line = NULL;
  FILE *fp = fopen("./EncodingTestFile.txt", "r");
  if (fp == NULL) {
    fprintf(stderr, "ERROR: Failed to open the test file (%s)\n",
            strerror(errno));
    return 1;
  }
  line = read_string(fp);
  if ((line == NULL) || (line[0] == '\0')) {
    fprintf(stderr, "ERROR: Failed to read from test file (%s)\n",
            strerror(errno));
    return 1;
  }
  if (strcmp(line, "#Base2<TAB>Base2Spaced<TAB>Base85<TAB>Base16<TAB>Base32<"
                   "TAB>Base58<TAB>Base64<TAB>Base91") != 0) {
    fprintf(stderr, "ERROR: The token line in the test file is missing, not "
                    "valid or this test utility to too old.\n");
    return 1;
  }
  free(line);
  fprintf(
      stdout,
      "C Data Encoding Library (libcdel) Test Utility\nStarting tests ...\n\n");
  while ((line = read_string(fp)) != NULL) {
    if (line[0] == '\0')
      continue;
    memset(base2, 0, 300);
    memset(base2spc, 0, 300);
    memset(base16upc, 0, 128);
    memset(base16lwr, 0, 128);
    memset(base32, 0, 128);
    memset(base58, 0, 128);
    memset(base64, 0, 128);
    memset(base85, 0, 128);
    memset(base91, 0, 128);
    if (sscanf(line, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", base2, base2spc, base85,
               base16upc, base32, base58, base64, base91) != 8) {
      fprintf(
          stderr,
          "ERROR: A corrupt, damaged or badly formed line was encountered.\n");
      free(line);
      return 1;
    }
    ++cline;
    fprintf(
        stdout,
        "Test of base2 verification function, string %02d  (sans spaces)... ",
        cline);
    if (cdel_verify_base2_string(base2) == 0) {
      fprintf(stdout, "\aFAILED\nVerify failed with input %s\n", base2);
      exit(1);
    } else {
      fprintf(stdout, "PASSED\n");
    }
    fprintf(
        stdout,
        "Test of base2 verification function, string %02d (spaced)...       ",
        cline);
    if (cdel_verify_base2_string(base2spc) == 0) {
      fprintf(stderr, "\aFAILED\nVerify failed with input %s", base2spc);
      exit(1);
    } else {
      fprintf(stdout, "PASSED\n");
    }
    fprintf(
        stdout,
        "Test of base16 verification function, string %02d  (uppercase)...  ",
        cline);
    if (cdel_verify_base16_string(base16upc) == 0) {
      fprintf(stdout, "\aFAILED\nVerify failed with input %s\n", base2);
      exit(1);
    } else {
      fprintf(stdout, "PASSED\n");
    }
    free(line);
  }
  fclose(fp);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x638,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x608(%rbp)
lea    0xe0d(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x610(%rbp)
cmpq   $0x0,-0x610(%rbp)
jne    1254 <main+0x94>
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x614(%rbp)
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x614(%rbp),%edi
mov    %rax,%rdx
lea    0xdd8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1620 <main+0x460>
mov    -0x610(%rbp),%rdi
call   10d0 <read_string@plt>
mov    %rax,-0x608(%rbp)
cmpq   $0x0,-0x608(%rbp)
je     1288 <main+0xc8>
mov    -0x608(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12c8 <main+0x108>
mov    0x2d51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x618(%rbp)
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x618(%rbp),%edi
mov    %rax,%rdx
lea    0xd8e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1620 <main+0x460>
mov    -0x608(%rbp),%rdi
lea    0xd98(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1308 <main+0x148>
mov    0x2cf4(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1620 <main+0x460>
mov    -0x608(%rbp),%rdi
call   1030 <free@plt>
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x610(%rbp),%rdi
call   10d0 <read_string@plt>
mov    %rax,-0x608(%rbp)
cmp    $0x0,%rax
je     1608 <main+0x448>
mov    -0x608(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1360 <main+0x1a0>
jmp    132b <main+0x16b>
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x12c,%edx
call   1050 <memset@plt>
lea    -0x280(%rbp),%rdi
xor    %esi,%esi
mov    $0x12c,%edx
call   1050 <memset@plt>
lea    -0x300(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x380(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x480(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x500(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x580(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x600(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    -0x608(%rbp),%rdi
lea    -0x150(%rbp),%rdx
lea    -0x280(%rbp),%rcx
lea    -0x580(%rbp),%r8
lea    -0x300(%rbp),%r9
lea    -0x400(%rbp),%rbx
lea    -0x480(%rbp),%r11
lea    -0x500(%rbp),%r10
lea    -0x600(%rbp),%rax
lea    0xd19(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1080 <sscanf@plt>
cmp    $0x8,%eax
je     14a1 <main+0x2e1>
mov    0x2b67(%rip),%rax
mov    (%rax),%edi
lea    0xd00(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x608(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0xc(%rbp)
jmp    1620 <main+0x460>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    0x2b1f(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xd06(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x150(%rbp),%rdi
call   1090 <cdel_verify_base2_string@plt>
cmp    $0x0,%rax
jne    1502 <main+0x342>
mov    0x2aef(%rip),%rax
mov    (%rax),%edi
lea    -0x150(%rbp),%rdx
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2ac7(%rip),%rax
mov    (%rax),%edi
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2ab0(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xd08(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x280(%rbp),%rdi
call   1090 <cdel_verify_base2_string@plt>
cmp    $0x0,%rax
jne    1571 <main+0x3b1>
mov    0x2a90(%rip),%rax
mov    (%rax),%edi
lea    -0x280(%rbp),%rdx
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2a58(%rip),%rax
mov    (%rax),%edi
lea    0xcab(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2a41(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x300(%rbp),%rdi
call   10e0 <cdel_verify_base16_string@plt>
cmp    $0x0,%rax
jne    15e0 <main+0x420>
mov    0x2a11(%rip),%rax
mov    (%rax),%edi
lea    -0x150(%rbp),%rdx
lea    0xc38(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x29e9(%rip),%rax
mov    (%rax),%edi
lea    0xc3c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x608(%rbp),%rdi
call   1030 <free@plt>
jmp    132b <main+0x16b>
mov    -0x610(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x29ad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x638,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5e8,%rsp
lea    0xe28(%rip),%rdi
lea    0xe38(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     124e <main+0x8e>
mov    %rax,%rbx
mov    %rax,%rdi
call   10d0 <read_string@plt>
test   %rax,%rax
je     122e <main+0x6e>
mov    %rax,%rbp
cmpb   $0x0,(%rax)
je     122e <main+0x6e>
lea    0xe66(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     128f <main+0xcf>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1278 <main+0xb8>
mov    0x2dab(%rip),%rax
mov    (%rax),%ebx
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xdf7(%rip),%rsi
jmp    126c <main+0xac>
mov    0x2d8b(%rip),%rax
mov    (%rax),%ebx
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xdad(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%eax
add    $0x5e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x560(%rsp),%r13
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %rbx,%rdi
call   10d0 <read_string@plt>
test   %rax,%rax
je     148f <main+0x2cf>
mov    %rax,%rbp
cmpb   $0x0,(%rax)
je     12c0 <main+0x100>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x12c,%edx
call   1050 <memset@plt>
mov    %r13,%r15
lea    0x330(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x12c,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0x4e0(%rsp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0x2b0(%rsp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0x230(%rsp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0x1b0(%rsp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0x130(%rsp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0x460(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    %rbp,%rdi
lea    0xdd4(%rip),%rsi
mov    %rsp,%rdx
mov    %r13,%rcx
mov    %r15,%r13
lea    0x130(%rsp),%r8
mov    %r15,%r9
push   %r12
lea    0x1b8(%rsp),%rax
push   %rax
lea    0x240(%rsp),%rax
push   %rax
lea    0x2c8(%rsp),%rax
push   %rax
call   1080 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x8,%eax
jne    14a5 <main+0x2e5>
add    $0x1,%r14d
mov    0x2bec(%rip),%r15
mov    (%r15),%edi
lea    0xdd5(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rsp,%rdi
call   1090 <cdel_verify_base2_string@plt>
mov    (%r15),%edi
test   %rax,%rax
je     14c9 <main+0x309>
lea    0xe19(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r15),%edi
lea    0xe0d(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x330(%rsp),%rdi
call   1090 <cdel_verify_base2_string@plt>
test   %rax,%rax
je     14d5 <main+0x315>
mov    (%r15),%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r15),%edi
lea    0xe3e(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13,%rdi
call   10e0 <cdel_verify_base16_string@plt>
mov    (%r15),%edi
test   %rax,%rax
je     14c9 <main+0x309>
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
jmp    12c0 <main+0x100>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2b2a(%rip),%rax
mov    (%rax),%eax
jmp    127d <main+0xbd>
mov    0x2b34(%rip),%rax
mov    (%rax),%edi
lea    0xccd(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
jmp    1278 <main+0xb8>
lea    0xd37(%rip),%rsi
mov    %rsp,%rdx
jmp    14ed <main+0x32d>
mov    0x2b04(%rip),%rax
mov    (%rax),%edi
lea    0xd93(%rip),%rsi
lea    0x330(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"./EncodingTestFile.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [42 x i8] c"ERROR: Failed to open the test file (%s)\0A\00"
@errno = global i32 0
@.str.3 = [43 x i8] c"ERROR: Failed to read from test file (%s)\0A\00"
@.str.4 = [89 x i8] c"#Base2<TAB>Base2Spaced<TAB>Base85<TAB>Base16<TAB>Base32<TAB>Base58<TAB>Base64<TAB>Base91\00"
@.str.5 = [95 x i8] c"ERROR: The token line in the test file is missing, not valid or this test utility to too old.\0A\00"
@stdout = global i32 0
@.str.6 = [68 x i8] c"C Data Encoding Library (libcdel) Test Utility\0AStarting tests ...\0A\0A\00"
@.str.7 = [24 x i8] c"%s\09%s\09%s\09%s\09%s\09%s\09%s\09%s\00"
@.str.8 = [65 x i8] c"ERROR: A corrupt, damaged or badly formed line was encountered.\0A\00"
@.str.9 = [68 x i8] c"Test of base2 verification function, string %02d (sans spaces)... \00"
@.str.10 = [37 x i8] c"\07FAILED\0AVerify failed with input %s\0A\00"
@.str.11 = [8 x i8] c"PASSED\0A\00"
@.str.12 = [68 x i8] c"Test of base2 verification function, string %02d (spaced)... \00"
@.str.13 = [36 x i8] c"\07FAILED\0AVerify failed with input %s\00"
@.str.14 = [68 x i8] c"Test of base16 verification function, string %02d (uppercase)... \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [300 x i8]
%8 = alloca [300 x i8]
%9 = alloca [128 x i8]
%10 = alloca [128 x i8]
%11 = alloca [128 x i8]
%12 = alloca [128 x i8]
%13 = alloca [128 x i8]
%14 = alloca [128 x i8]
%15 = alloca [128 x i8]
%16 = alloca i8*
%17 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %16
%18 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %18, i32** %17
%19 = load i32*, i32** %17
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = load i32, i32* @errno
%24 = call i8* @strerror(i32 %23)
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %24)
store i32 1, i32* %3
br label %154
26: ; preds = %2
%27 = load i32*, i32** %17
%28 = call i8* @read_string(i32* %27)
store i8* %28, i8** %16
%29 = load i8*, i8** %16
%30 = icmp eq i8* %29, null
br i1 %30, label %37, label %31
31: ; preds = %26
%32 = load i8*, i8** %16
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %42
37: ; preds = %31, %26
%38 = load i32, i32* @stderr
%39 = load i32, i32* @errno
%40 = call i8* @strerror(i32 %39)
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* %40)
store i32 1, i32* %3
br label %154
42: ; preds = %31
%43 = load i8*, i8** %16
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %154
49: ; preds = %42
%50 = load i8*, i8** %16
%51 = call i32 @free(i8* %50)
%52 = load i32, i32* @stdout
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0))
br label %54
54: ; preds = %147, %64, %49
%55 = load i32*, i32** %17
%56 = call i8* @read_string(i32* %55)
store i8* %56, i8** %16
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %150
58: ; preds = %54
%59 = load i8*, i8** %16
%60 = getelementptr inbounds i8, i8* %59, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %58
br label %54
65: ; preds = %58
%66 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%67 = call i32 @memset(i8* %66, i32 0, i32 300)
%68 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%69 = call i32 @memset(i8* %68, i32 0, i32 300)
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%71 = call i32 @memset(i8* %70, i32 0, i32 128)
%72 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%73 = call i32 @memset(i8* %72, i32 0, i32 128)
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%75 = call i32 @memset(i8* %74, i32 0, i32 128)
%76 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%77 = call i32 @memset(i8* %76, i32 0, i32 128)
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%79 = call i32 @memset(i8* %78, i32 0, i32 128)
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%81 = call i32 @memset(i8* %80, i32 0, i32 128)
%82 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%83 = call i32 @memset(i8* %82, i32 0, i32 128)
%84 = load i8*, i8** %16
%85 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%86 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%87 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%91 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%93 = call i32 @sscanf(i8* %84, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %85, i8* %86, i8* %87, i8* %88, i8* %89, i8* %90, i8* %91, i8* %92)
%94 = icmp ne i32 %93, 8
br i1 %94, label %95, label %100
95: ; preds = %65
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.8, i64 0, i64 0))
%98 = load i8*, i8** %16
%99 = call i32 @free(i8* %98)
store i32 1, i32* %3
br label %154
100: ; preds = %65
%101 = load i32, i32* %6
%102 = add nsw i32 %101, 1
store i32 %102, i32* %6
%103 = load i32, i32* @stdout
%104 = load i32, i32* %6
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.9, i64 0, i64 0), i32 %104)
%106 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%107 = call i64 @cdel_verify_base2_string(i8* %106)
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %114
109: ; preds = %100
%110 = load i32, i32* @stdout
%111 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %111)
%113 = call i32 @exit(i32 1)
unreachable
114: ; preds = %100
%115 = load i32, i32* @stdout
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %117
117: ; preds = %114
%118 = load i32, i32* @stdout
%119 = load i32, i32* %6
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i32 %119)
%121 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%122 = call i64 @cdel_verify_base2_string(i8* %121)
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %129
124: ; preds = %117
%125 = load i32, i32* @stderr
%126 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i8* %126)
%128 = call i32 @exit(i32 1)
unreachable
129: ; preds = %117
%130 = load i32, i32* @stdout
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %132
132: ; preds = %129
%133 = load i32, i32* @stdout
%134 = load i32, i32* %6
%135 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.14, i64 0, i64 0), i32 %134)
%136 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%137 = call i64 @cdel_verify_base16_string(i8* %136)
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %144
139: ; preds = %132
%140 = load i32, i32* @stdout
%141 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %141)
%143 = call i32 @exit(i32 1)
unreachable
144: ; preds = %132
%145 = load i32, i32* @stdout
%146 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %147
147: ; preds = %144
%148 = load i8*, i8** %16
%149 = call i32 @free(i8* %148)
br label %54
150: ; preds = %54
%151 = load i32*, i32** %17
%152 = call i32 @fclose(i32* %151)
%153 = load i32, i32* @EXIT_SUCCESS
store i32 %153, i32* %3
br label %154
154: ; preds = %150, %95, %46, %37, %21
%155 = load i32, i32* %3
ret i32 %155
}

LLVM IR (-O2):
@.str = [23 x i8] c"./EncodingTestFile.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [42 x i8] c"ERROR: Failed to open the test file (%s)\0A\00"
@errno = global i32 0
@.str.3 = [43 x i8] c"ERROR: Failed to read from test file (%s)\0A\00"
@.str.4 = [89 x i8] c"#Base2<TAB>Base2Spaced<TAB>Base85<TAB>Base16<TAB>Base32<TAB>Base58<TAB>Base64<TAB>Base91\00"
@.str.5 = [95 x i8] c"ERROR: The token line in the test file is missing, not valid or this test utility to too old.\0A\00"
@stdout = global i32 0
@.str.6 = [68 x i8] c"C Data Encoding Library (libcdel) Test Utility\0AStarting tests ...\0A\0A\00"
@.str.7 = [24 x i8] c"%s\09%s\09%s\09%s\09%s\09%s\09%s\09%s\00"
@.str.8 = [65 x i8] c"ERROR: A corrupt, damaged or badly formed line was encountered.\0A\00"
@.str.9 = [68 x i8] c"Test of base2 verification function, string %02d (sans spaces)... \00"
@.str.10 = [37 x i8] c"\07FAILED\0AVerify failed with input %s\0A\00"
@.str.11 = [8 x i8] c"PASSED\0A\00"
@.str.12 = [68 x i8] c"Test of base2 verification function, string %02d (spaced)... \00"
@.str.13 = [36 x i8] c"\07FAILED\0AVerify failed with input %s\00"
@.str.14 = [68 x i8] c"Test of base16 verification function, string %02d (uppercase)... \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [300 x i8]
%4 = alloca [300 x i8]
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
%7 = alloca [128 x i8]
%8 = alloca [128 x i8]
%9 = alloca [128 x i8]
%10 = alloca [128 x i8]
%11 = alloca [128 x i8]
%12 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [300 x i8], [300 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%21 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %28
23: ; preds = %2
%24 = load i32, i32* @stderr
%25 = load i32, i32* @errno
%26 = tail call i8* @strerror(i32 %25)
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %26)
br label %110
28: ; preds = %2
%29 = tail call i8* @read_string(i32* %21)
%30 = icmp eq i8* %29, null
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = load i8, i8* %29
%33 = icmp eq i8 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %31, %28
%35 = load i32, i32* @stderr
%36 = load i32, i32* @errno
%37 = tail call i8* @strerror(i32 %36)
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* %37)
br label %110
39: ; preds = %31
%40 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = load i32, i32* @stderr
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.5, i64 0, i64 0))
br label %110
45: ; preds = %39
%46 = tail call i32 @free(i8* %29)
%47 = load i32, i32* @stdout
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0))
br label %49
49: ; preds = %104, %45
%50 = phi i32 [ %74, %104 ], [ 0, %45 ]
br label %51
51: ; preds = %49, %54
%52 = call i8* @read_string(i32* %21)
%53 = icmp eq i8* %52, null
br i1 %53, label %107, label %54
54: ; preds = %51
%55 = load i8, i8* %52
%56 = icmp eq i8 %55, 0
br i1 %56, label %51, label %57
57: ; preds = %54
%58 = call i32 @memset(i8* %12, i32 0, i32 300)
%59 = call i32 @memset(i8* %13, i32 0, i32 300)
%60 = call i32 @memset(i8* %14, i32 0, i32 128)
%61 = call i32 @memset(i8* %15, i32 0, i32 128)
%62 = call i32 @memset(i8* %16, i32 0, i32 128)
%63 = call i32 @memset(i8* %17, i32 0, i32 128)
%64 = call i32 @memset(i8* %18, i32 0, i32 128)
%65 = call i32 @memset(i8* %19, i32 0, i32 128)
%66 = call i32 @memset(i8* %20, i32 0, i32 128)
%67 = call i32 @sscanf(i8* %52, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %12, i8* %13, i8* %19, i8* %14, i8* %16, i8* %17, i8* %18, i8* %20)
%68 = icmp eq i32 %67, 8
br i1 %68, label %73, label %69
69: ; preds = %57
%70 = load i32, i32* @stderr
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.8, i64 0, i64 0))
%72 = call i32 @free(i8* %52)
br label %110
73: ; preds = %57
%74 = add nuw nsw i32 %50, 1
%75 = load i32, i32* @stdout
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.9, i64 0, i64 0), i32 %74)
%77 = call i64 @cdel_verify_base2_string(i8* %12)
%78 = icmp eq i64 %77, 0
%79 = load i32, i32* @stdout
br i1 %78, label %80, label %83
80: ; preds = %73
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %12)
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %73
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%85 = load i32, i32* @stdout
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i32 %74)
%87 = call i64 @cdel_verify_base2_string(i8* %13)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %83
%90 = load i32, i32* @stderr
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i8* %13)
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %83
%94 = load i32, i32* @stdout
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%96 = load i32, i32* @stdout
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.14, i64 0, i64 0), i32 %74)
%98 = call i64 @cdel_verify_base16_string(i8* %14)
%99 = icmp eq i64 %98, 0
%100 = load i32, i32* @stdout
br i1 %99, label %101, label %104
101: ; preds = %93
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %12)
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %93
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%106 = call i32 @free(i8* %52)
br label %49
107: ; preds = %51
%108 = call i32 @fclose(i32* %21)
%109 = load i32, i32* @EXIT_SUCCESS
br label %110
110: ; preds = %107, %69, %42, %34, %23
%111 = phi i32 [ 1, %23 ], [ 1, %34 ], [ 1, %42 ], [ 1, %69 ], [ %109, %107 ]
ret i32 %111
}