#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*/ SEEK_SET;
double atof(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
float sqrt(double);
int /*<<< orphan*/ strcpy(char *, char *);
char *strtok(char *, char *);
int main(int argc, const char *argv[]) {
  FILE *f1;
  FILE *f2;
  char line[100];
  char line2[100];
  f1 = fopen("../3dData/PDBs/averagedAA2YPI.txt", "r");
  f2 = fopen("../3dData/PDBs/averagedAA2YPI.txt", "r");
  if (f1 == NULL) {
    printf("file is null");
    return 1;
  }
  while (fgets(line, 100, f1)) {
    if ((line[0] == 'A') && (line[1] == 'T') && (line[2] == 'O') &&
        (line[3] == 'M')) {
      if ((line[7] == 'C') && (line[8] == 'A')) {
        char *splitLine[13];
        char *result = NULL;
        int counter = 0;
        result = strtok(line, " ");
        while (result != NULL) {
          splitLine[counter] = malloc(7);
          strcpy(splitLine[counter++], result);
          result = strtok(NULL, " ");
        }
        printf("{\"OriginAminoAcid\":%s, \"DestinationAminoAcids\":[",
               splitLine[5]);
        while (fgets(line2, 100, f2)) {
          if ((line2[0] == 'A') && (line2[1] == 'T') && (line2[2] == 'O') &&
              (line2[3] == 'M')) {
            if ((line2[7] == 'C') && (line2[8] == 'A')) {
              char *result2 = NULL;
              int counter2 = 0;
              char aaNumber2[5];
              char x[18];
              char y[18];
              char z[18];
              result2 = strtok(line2, " ");
              while (result2 != NULL) {
                if (counter2 == 5)
                  strcpy(aaNumber2, result2);
                if (counter2 == 6)
                  strcpy(x, result2);
                if (counter2 == 7)
                  strcpy(y, result2);
                if (counter2 == 8)
                  strcpy(z, result2);
                result2 = strtok(NULL, " ");
                counter2++;
              }
              double difX = atof(splitLine[6]) - atof(x);
              double difY = atof(splitLine[7]) - atof(y);
              double difZ = atof(splitLine[8]) - atof(z);
              float diff = sqrt((difX * difX) + (difY * difY) + (difZ * difZ));
              printf("\"%s\": %.3f,", aaNumber2, diff);
            }
          }
        }
        printf("z]},\n");
        fseek(f2, 0, SEEK_SET);
        for (int i = 0; i < counter; i++) {
          free(splitLine[i]);
        }
      }
    }
  }
  fclose(f1);
  fclose(f2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe30(%rip),%rdi
lea    0xe4b(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe19(%rip),%rdi
lea    0xe34(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    121c <main+0x6c>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1663 <main+0x4b3>
jmp    1221 <main+0x71>
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x64,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     164a <main+0x49a>
movsbl -0x90(%rbp),%eax
cmp    $0x41,%eax
jne    1645 <main+0x495>
movsbl -0x8f(%rbp),%eax
cmp    $0x54,%eax
jne    1645 <main+0x495>
movsbl -0x8e(%rbp),%eax
cmp    $0x4f,%eax
jne    1645 <main+0x495>
movsbl -0x8d(%rbp),%eax
cmp    $0x4d,%eax
jne    1645 <main+0x495>
movsbl -0x89(%rbp),%eax
cmp    $0x43,%eax
jne    1640 <main+0x490>
movsbl -0x88(%rbp),%eax
cmp    $0x41,%eax
jne    1640 <main+0x490>
movq   $0x0,-0x178(%rbp)
movl   $0x0,-0x17c(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
je     133c <main+0x18c>
mov    $0x7,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
movslq -0x17c(%rbp),%rax
mov    %rcx,-0x170(%rbp,%rax,8)
ff
mov    -0x17c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x17c(%rbp)
cltq
mov    -0x170(%rbp,%rax,8),%rdi
ff
mov    -0x178(%rbp),%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd06(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x178(%rbp)
jmp    12cf <main+0x11f>
mov    -0x148(%rbp),%rsi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x100(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x64,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     15d5 <main+0x425>
movsbl -0x100(%rbp),%eax
cmp    $0x41,%eax
jne    15d0 <main+0x420>
movsbl -0xff(%rbp),%eax
cmp    $0x54,%eax
jne    15d0 <main+0x420>
movsbl -0xfe(%rbp),%eax
cmp    $0x4f,%eax
jne    15d0 <main+0x420>
movsbl -0xfd(%rbp),%eax
cmp    $0x4d,%eax
jne    15d0 <main+0x420>
movsbl -0xf9(%rbp),%eax
cmp    $0x43,%eax
jne    15cb <main+0x41b>
movsbl -0xf8(%rbp),%eax
cmp    $0x41,%eax
jne    15cb <main+0x41b>
movq   $0x0,-0x188(%rbp)
movl   $0x0,-0x18c(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xc3e(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x188(%rbp)
cmpq   $0x0,-0x188(%rbp)
je     14b8 <main+0x308>
cmpl   $0x5,-0x18c(%rbp)
jne    142d <main+0x27d>
lea    -0x191(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x6,-0x18c(%rbp)
jne    144d <main+0x29d>
lea    -0x1b0(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x7,-0x18c(%rbp)
jne    146d <main+0x2bd>
lea    -0x1d0(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x8,-0x18c(%rbp)
jne    148d <main+0x2dd>
lea    -0x1f0(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xb99(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x188(%rbp)
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    13ff <main+0x24f>
mov    -0x140(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x228(%rbp)
ff
lea    -0x1b0(%rbp),%rdi
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x228(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
mov    -0x138(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x220(%rbp)
ff
lea    -0x1d0(%rbp),%rdi
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x220(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
mov    -0x130(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x218(%rbp)
ff
lea    -0x1f0(%rbp),%rdi
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x218(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
movsd  -0x1f8(%rbp),%xmm1
ff
movsd  -0x1f8(%rbp),%xmm2
ff
movsd  -0x200(%rbp),%xmm0
ff
mulsd  -0x200(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x208(%rbp),%xmm0
ff
movsd  -0x208(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
movss  %xmm0,-0x20c(%rbp)
ff
lea    -0x191(%rbp),%rsi
movss  -0x20c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xaa0(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
jmp    15d0 <main+0x420>
jmp    1351 <main+0x1a1>
lea    0xa94(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    0x29f2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
movl   $0x0,-0x210(%rbp)
mov    -0x210(%rbp),%eax
cmp    -0x17c(%rbp),%eax
jge    163b <main+0x48b>
movslq -0x210(%rbp),%rax
mov    -0x170(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x210(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x210(%rbp)
jmp    1601 <main+0x451>
jmp    1640 <main+0x490>
jmp    1645 <main+0x495>
jmp    1221 <main+0x71>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
lea    0xe38(%rip),%rbx
lea    0xe53(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10c0 <fopen@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10c0 <fopen@plt>
test   %r12,%r12
je     154f <main+0x38f>
mov    %rax,%rbx
lea    0x110(%rsp),%rdi
mov    $0x64,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     153b <main+0x37b>
lea    0xe18(%rip),%r15
lea    0x110(%rsp),%rbp
lea    0x3b(%rsp),%r13
lea    0xdc3(%rip),%r14
mov    %rbx,(%rsp)
jmp    1275 <main+0xb5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsp),%rbx
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x64,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     153b <main+0x37b>
movdqa 0x110(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x4d4f5441,%eax
jne    125c <main+0x9c>
cmpb   $0x43,0x117(%rsp)
43
jne    125c <main+0x9c>
cmpb   $0x41,0x118(%rsp)
41
jne    125c <main+0x9c>
mov    %r12,%rbx
mov    %rbp,%rdi
mov    %r15,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
je     12f5 <main+0x135>
mov    %rax,%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x7,%edi
call   10a0 <malloc@plt>
mov    %rax,0x180(%rsp,%rbp,8)
add    $0x1,%rbp
mov    %rax,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   10d0 <strtok@plt>
mov    %rax,%r12
test   %rax,%rax
jne    12c0 <main+0x100>
jmp    12f7 <main+0x137>
xor    %ebp,%ebp
mov    %rbx,%r12
mov    (%rsp),%rbx
mov    0x1a8(%rsp),%rsi
lea    0xd36(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xa0(%rsp),%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     14f0 <main+0x330>
mov    0x1b0(%rsp),%rax
mov    %rax,0x28(%rsp)
mov    0x1b8(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x1c0(%rsp),%rax
mov    %rax,0x18(%rsp)
jmp    143f <main+0x27f>
xchg   %ax,%ax
mov    0x28(%rsp),%rdi
call   1060 <atof@plt>
movq   %xmm0,0x10(%rsp)
lea    0x80(%rsp),%rdi
call   1060 <atof@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    0x20(%rsp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x60(%rsp),%rdi
call   1060 <atof@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    0x18(%rsp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x30(%rsp)
lea    0x40(%rsp),%rdi
call   1060 <atof@plt>
movsd  0x30(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   10e0 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
lea    0xc61(%rip),%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   1080 <printf@plt>
mov    (%rsp),%rbx
lea    0xa0(%rsp),%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     14f0 <main+0x330>
movdqa 0xa0(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x4d4f5441,%eax
jne    1421 <main+0x261>
cmpb   $0x43,0xa7(%rsp)
43
jne    1421 <main+0x261>
cmpb   $0x41,0xa8(%rsp)
41
jne    1421 <main+0x261>
lea    0xa0(%rsp),%rdi
mov    %r15,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
je     1360 <main+0x1a0>
xor    %ebx,%ebx
jmp    14b3 <main+0x2f3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x40(%rsp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   10d0 <strtok@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1360 <main+0x1a0>
lea    -0x5(%rbx),%ecx
cmp    $0x3,%ecx
ja     149d <main+0x2dd>
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
mov    %r13,%rdi
jmp    *%rcx
lea    0x80(%rsp),%rdi
jmp    1495 <main+0x2d5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x60(%rsp),%rdi
jmp    1495 <main+0x2d5>
nopw   0x0(%rax,%rax,1)
lea    0xb89(%rip),%rdi
call   1050 <puts@plt>
mov    0x2add(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
test   %ebp,%ebp
je     1250 <main+0x90>
mov    %ebp,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x180(%rsp,%rbp,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1520 <main+0x360>
jmp    1250 <main+0x90>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
jmp    1562 <main+0x3a2>
lea    0xade(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%eax
add    $0x1e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"../3dData/PDBs/averagedAA2YPI.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"file is null\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [49 x i8] c"{\22OriginAminoAcid\22:%s, \22DestinationAminoAcids\22:[\00"
@.str.5 = [12 x i8] c"\22%s\22: %.3f,\00"
@.str.6 = [6 x i8] c"z]},\0A\00"
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca [13 x i8*]
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca [5 x i8]
%16 = alloca [18 x i8]
%17 = alloca [18 x i8]
%18 = alloca [18 x i8]
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca float
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = call i32* @fopen(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %6
%25 = call i32* @fopen(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %25, i32** %7
%26 = load i32*, i32** %6
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %30
28: ; preds = %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %223
30: ; preds = %2
br label %31
31: ; preds = %217, %30
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%33 = load i32*, i32** %6
%34 = call i64 @fgets(i8* %32, i32 100, i32* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %218
36: ; preds = %31
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 65
br i1 %40, label %41, label %217
41: ; preds = %36
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 84
br i1 %45, label %46, label %217
46: ; preds = %41
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 2
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 79
br i1 %50, label %51, label %217
51: ; preds = %46
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 3
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 77
br i1 %55, label %56, label %217
56: ; preds = %51
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 7
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 67
br i1 %60, label %61, label %216
61: ; preds = %56
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 8
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 65
br i1 %65, label %66, label %216
66: ; preds = %61
store i8* null, i8** %11
store i32 0, i32* %12
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%68 = call i8* @strtok(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %68, i8** %11
br label %69
69: ; preds = %72, %66
%70 = load i8*, i8** %11
%71 = icmp ne i8* %70, null
br i1 %71, label %72, label %85
72: ; preds = %69
%73 = call i8* @malloc(i32 7)
%74 = load i32, i32* %12
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 %75
store i8* %73, i8** %76
%77 = load i32, i32* %12
%78 = add nsw i32 %77, 1
store i32 %78, i32* %12
%79 = sext i32 %77 to i64
%80 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 %79
%81 = load i8*, i8** %80
%82 = load i8*, i8** %11
%83 = call i32 @strcpy(i8* %81, i8* %82)
%84 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %84, i8** %11
br label %69
85: ; preds = %69
%86 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 5
%87 = load i8*, i8** %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %87)
br label %89
89: ; preds = %196, %85
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%91 = load i32*, i32** %7
%92 = call i64 @fgets(i8* %90, i32 100, i32* %91)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %197
94: ; preds = %89
%95 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 65
br i1 %98, label %99, label %196
99: ; preds = %94
%100 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 1
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 84
br i1 %103, label %104, label %196
104: ; preds = %99
%105 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 2
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 79
br i1 %108, label %109, label %196
109: ; preds = %104
%110 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 3
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 77
br i1 %113, label %114, label %196
114: ; preds = %109
%115 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 7
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp eq i32 %117, 67
br i1 %118, label %119, label %195
119: ; preds = %114
%120 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 8
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 65
br i1 %123, label %124, label %195
124: ; preds = %119
store i8* null, i8** %13
store i32 0, i32* %14
%125 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%126 = call i8* @strtok(i8* %125, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %126, i8** %13
br label %127
127: ; preds = %158, %124
%128 = load i8*, i8** %13
%129 = icmp ne i8* %128, null
br i1 %129, label %130, label %162
130: ; preds = %127
%131 = load i32, i32* %14
%132 = icmp eq i32 %131, 5
br i1 %132, label %133, label %137
133: ; preds = %130
%134 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%135 = load i8*, i8** %13
%136 = call i32 @strcpy(i8* %134, i8* %135)
br label %137
137: ; preds = %133, %130
%138 = load i32, i32* %14
%139 = icmp eq i32 %138, 6
br i1 %139, label %140, label %144
140: ; preds = %137
%141 = getelementptr inbounds [18 x i8], [18 x i8]* %16, i64 0, i64 0
%142 = load i8*, i8** %13
%143 = call i32 @strcpy(i8* %141, i8* %142)
br label %144
144: ; preds = %140, %137
%145 = load i32, i32* %14
%146 = icmp eq i32 %145, 7
br i1 %146, label %147, label %151
147: ; preds = %144
%148 = getelementptr inbounds [18 x i8], [18 x i8]* %17, i64 0, i64 0
%149 = load i8*, i8** %13
%150 = call i32 @strcpy(i8* %148, i8* %149)
br label %151
151: ; preds = %147, %144
%152 = load i32, i32* %14
%153 = icmp eq i32 %152, 8
br i1 %153, label %154, label %158
154: ; preds = %151
%155 = getelementptr inbounds [18 x i8], [18 x i8]* %18, i64 0, i64 0
%156 = load i8*, i8** %13
%157 = call i32 @strcpy(i8* %155, i8* %156)
br label %158
158: ; preds = %154, %151
%159 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %159, i8** %13
%160 = load i32, i32* %14
%161 = add nsw i32 %160, 1
store i32 %161, i32* %14
br label %127
162: ; preds = %127
%163 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 6
%164 = load i8*, i8** %163
%165 = call double @atof(i8* %164)
%166 = getelementptr inbounds [18 x i8], [18 x i8]* %16, i64 0, i64 0
%167 = call double @atof(i8* %166)
%168 = fsub double %165, %167
store double %168, double* %19
%169 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 7
%170 = load i8*, i8** %169
%171 = call double @atof(i8* %170)
%172 = getelementptr inbounds [18 x i8], [18 x i8]* %17, i64 0, i64 0
%173 = call double @atof(i8* %172)
%174 = fsub double %171, %173
store double %174, double* %20
%175 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 8
%176 = load i8*, i8** %175
%177 = call double @atof(i8* %176)
%178 = getelementptr inbounds [18 x i8], [18 x i8]* %18, i64 0, i64 0
%179 = call double @atof(i8* %178)
%180 = fsub double %177, %179
store double %180, double* %21
%181 = load double, double* %19
%182 = load double, double* %19
%183 = load double, double* %20
%184 = load double, double* %20
%185 = fmul double %183, %184
%186 = call double @llvm.fmuladd.f64(double %181, double %182, double %185)
%187 = load double, double* %21
%188 = load double, double* %21
%189 = call double @llvm.fmuladd.f64(double %187, double %188, double %186)
%190 = call float @sqrt(double %189)
store float %190, float* %22
%191 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%192 = load float, float* %22
%193 = fpext float %192 to double
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %191, double %193)
br label %195
195: ; preds = %162, %119, %114
br label %196
196: ; preds = %195, %109, %104, %99, %94
br label %89
197: ; preds = %89
%198 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%199 = load i32*, i32** %7
%200 = load i32, i32* @SEEK_SET
%201 = call i32 @fseek(i32* %199, i32 0, i32 %200)
store i32 0, i32* %23
br label %202
202: ; preds = %212, %197
%203 = load i32, i32* %23
%204 = load i32, i32* %12
%205 = icmp slt i32 %203, %204
br i1 %205, label %206, label %215
206: ; preds = %202
%207 = load i32, i32* %23
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [13 x i8*], [13 x i8*]* %10, i64 0, i64 %208
%210 = load i8*, i8** %209
%211 = call i32 @free(i8* %210)
br label %212
212: ; preds = %206
%213 = load i32, i32* %23
%214 = add nsw i32 %213, 1
store i32 %214, i32* %23
br label %202
215: ; preds = %202
br label %216
216: ; preds = %215, %61, %56
br label %217
217: ; preds = %216, %51, %46, %41, %36
br label %31
218: ; preds = %31
%219 = load i32*, i32** %6
%220 = call i32 @fclose(i32* %219)
%221 = load i32*, i32** %7
%222 = call i32 @fclose(i32* %221)
store i32 0, i32* %3
br label %223
223: ; preds = %218, %28
%224 = load i32, i32* %3
ret i32 %224
}

LLVM IR (-O2):
@.str = [34 x i8] c"../3dData/PDBs/averagedAA2YPI.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"file is null\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [49 x i8] c"{\22OriginAminoAcid\22:%s, \22DestinationAminoAcids\22:[\00"
@.str.5 = [12 x i8] c"\22%s\22: %.3f,\00"
@SEEK_SET = global i32 0
@str = [5 x i8] c"z]},\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [13 x i8*]
%6 = alloca [5 x i8]
%7 = alloca [18 x i8]
%8 = alloca [18 x i8]
%9 = alloca [18 x i8]
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%12 = tail call i32* @fopen(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32* @fopen(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32* %12, null
br i1 %14, label %34, label %15
15: ; preds = %2
%16 = call i64 @fgets(i8* %10, i32 100, i32* %12)
%17 = icmp eq i64 %16, 0
br i1 %17, label %135, label %18
18: ; preds = %15
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 7
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 8
%21 = bitcast [13 x i8*]* %5 to i8*
%22 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 5
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 7
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 8
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%26 = getelementptr inbounds [18 x i8], [18 x i8]* %7, i64 0, i64 0
%27 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%28 = getelementptr inbounds [18 x i8], [18 x i8]* %9, i64 0, i64 0
%29 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 6
%30 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 7
%31 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 8
%32 = bitcast [100 x i8]* %3 to <4 x i8>*
%33 = bitcast [100 x i8]* %4 to <4 x i8>*
br label %36
34: ; preds = %2
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %138
36: ; preds = %18, %132
%37 = load <4 x i8>, <4 x i8>* %32
%38 = freeze <4 x i8> %37
%39 = bitcast <4 x i8> %38 to i32
%40 = icmp eq i32 %39, 1297044545
br i1 %40, label %41, label %132
41: ; preds = %36
%42 = load i8, i8* %19
%43 = icmp eq i8 %42, 67
%44 = load i8, i8* %20
%45 = icmp eq i8 %44, 65
%46 = select i1 %43, i1 %45, i1 false
br i1 %46, label %47, label %132
47: ; preds = %41
%48 = call i8* @strtok(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i8* %48, null
br i1 %49, label %61, label %50
50: ; preds = %47, %50
%51 = phi i64 [ %55, %50 ], [ 0, %47 ]
%52 = phi i8* [ %57, %50 ], [ %48, %47 ]
%53 = call dereferenceable_or_null(7) i8* @malloc(i32 7)
%54 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 %51
store i8* %53, i8** %54
%55 = add nuw i64 %51, 1
%56 = call i32 @strcpy(i8* %53, i8* %52)
%57 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %50
59: ; preds = %50
%60 = trunc i64 %55 to i32
br label %61
61: ; preds = %59, %47
%62 = phi i32 [ 0, %47 ], [ %60, %59 ]
%63 = load i8*, i8** %22
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %63)
%65 = call i64 @fgets(i8* %11, i32 100, i32* %13)
%66 = icmp eq i64 %65, 0
br i1 %66, label %117, label %67
67: ; preds = %61
%68 = load i8*, i8** %29
%69 = load i8*, i8** %30
%70 = load i8*, i8** %31
br label %71
71: ; preds = %67, %114
%72 = load <4 x i8>, <4 x i8>* %33
%73 = freeze <4 x i8> %72
%74 = bitcast <4 x i8> %73 to i32
%75 = icmp eq i32 %74, 1297044545
br i1 %75, label %76, label %114
76: ; preds = %71
%77 = load i8, i8* %23
%78 = icmp eq i8 %77, 67
%79 = load i8, i8* %24
%80 = icmp eq i8 %79, 65
%81 = select i1 %78, i1 %80, i1 false
br i1 %81, label %82, label %114
82: ; preds = %76
%83 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%84 = icmp eq i8* %83, null
br i1 %84, label %98, label %85
85: ; preds = %82, %94
%86 = phi i32 [ %96, %94 ], [ 0, %82 ]
%87 = phi i8* [ %95, %94 ], [ %83, %82 ]
switch i32 %86, label %94 [
i32 5, label %91
i32 6, label %88
i32 7, label %89
i32 8, label %90
]
88: ; preds = %85
br label %91
89: ; preds = %85
br label %91
90: ; preds = %85
br label %91
91: ; preds = %85, %90, %88, %89
%92 = phi i8* [ %27, %89 ], [ %26, %88 ], [ %28, %90 ], [ %25, %85 ]
%93 = call i32 @strcpy(i8* %92, i8* %87)
br label %94
94: ; preds = %91, %85
%95 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%96 = add nuw nsw i32 %86, 1
%97 = icmp eq i8* %95, null
br i1 %97, label %98, label %85
98: ; preds = %94, %82
%99 = call double @atof(i8* %68)
%100 = call double @atof(i8* %26)
%101 = fsub double %99, %100
%102 = call double @atof(i8* %69)
%103 = call double @atof(i8* %27)
%104 = fsub double %102, %103
%105 = call double @atof(i8* %70)
%106 = call double @atof(i8* %28)
%107 = fsub double %105, %106
%108 = fmul double %104, %104
%109 = call double @llvm.fmuladd.f64(double %101, double %101, double %108)
%110 = call double @llvm.fmuladd.f64(double %107, double %107, double %109)
%111 = call float @sqrt(double %110)
%112 = fpext float %111 to double
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %25, double %112)
br label %114
114: ; preds = %76, %98, %71
%115 = call i64 @fgets(i8* %11, i32 100, i32* %13)
%116 = icmp eq i64 %115, 0
br i1 %116, label %117, label %71
117: ; preds = %114, %61
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%119 = load i32, i32* @SEEK_SET
%120 = call i32 @fseek(i32* %13, i32 0, i32 %119)
%121 = icmp eq i32 %62, 0
br i1 %121, label %124, label %122
122: ; preds = %117
%123 = zext i32 %62 to i64
br label %125
124: ; preds = %125, %117
br label %132
125: ; preds = %122, %125
%126 = phi i64 [ 0, %122 ], [ %130, %125 ]
%127 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 %126
%128 = load i8*, i8** %127
%129 = call i32 @free(i8* %128)
%130 = add nuw nsw i64 %126, 1
%131 = icmp eq i64 %130, %123
br i1 %131, label %124, label %125
132: ; preds = %41, %124, %36
%133 = call i64 @fgets(i8* %10, i32 100, i32* %12)
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %36
135: ; preds = %132, %15
%136 = call i32 @fclose(i32* %12)
%137 = call i32 @fclose(i32* %13)
br label %138
138: ; preds = %135, %34
%139 = phi i32 [ 1, %34 ], [ 0, %135 ]
ret i32 %139
}