#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/2YPI.pdb", "r");
  f2 = fopen("../3dData/PDBs/2YPI.pdb", "r");
  if (f1 == NULL) {
    printf("file is null");
    return 1;
  }
  int lineCounter = 0;
  while (fgets(line, 100, f1)) {
    ++lineCounter;
    if ((lineCounter < 639) || (lineCounter > 2522))
      continue;
    if ((line[0] == 'A') && (line[1] == 'T') && (line[2] == 'O') &&
        (line[3] == 'M')) {
      if ((line[13] == 'C') && (line[14] == '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, " ");
        }
        int lineCounter2 = 0;
        printf("{\"OriginAminoAcid\":%s, \"DestinationAminoAcids\":[",
               splitLine[5]);
        while (fgets(line2, 100, f2)) {
          ++lineCounter2;
          if ((lineCounter2 < 639) || (lineCounter2 > 2522))
            continue;
          if ((line2[0] == 'A') && (line2[1] == 'T') && (line2[2] == 'O') &&
              (line2[3] == 'M')) {
            if ((line2[13] == 'C') && (line2[14] == 'A')) {
              char *result2 = NULL;
              int counter2 = 0;
              char aaNumber2[5];
              char x[8];
              char y[8];
              char z[8];
              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    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe30(%rip),%rdi
lea    0xe41(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe19(%rip),%rdi
lea    0xe2a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    121c <main+0x6c>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16da <main+0x52a>
movl   $0x0,-0x104(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x64,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     16c1 <main+0x511>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
cmpl   $0x27f,-0x104(%rbp)
jl     1274 <main+0xc4>
cmpl   $0x9da,-0x104(%rbp)
jle    1279 <main+0xc9>
jmp    1226 <main+0x76>
movsbl -0x90(%rbp),%eax
cmp    $0x41,%eax
jne    16bc <main+0x50c>
movsbl -0x8f(%rbp),%eax
cmp    $0x54,%eax
jne    16bc <main+0x50c>
movsbl -0x8e(%rbp),%eax
cmp    $0x4f,%eax
jne    16bc <main+0x50c>
movsbl -0x8d(%rbp),%eax
cmp    $0x4d,%eax
jne    16bc <main+0x50c>
movsbl -0x83(%rbp),%eax
cmp    $0x43,%eax
jne    16b7 <main+0x507>
movsbl -0x82(%rbp),%eax
cmp    $0x41,%eax
jne    16b7 <main+0x507>
movq   $0x0,-0x178(%rbp)
movl   $0x0,-0x17c(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xd2b(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
je     1375 <main+0x1c5>
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    0xcc3(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x178(%rbp)
jmp    1308 <main+0x158>
movl   $0x0,-0x180(%rbp)
mov    -0x148(%rbp),%rsi
lea    0xc9c(%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     164c <main+0x49c>
mov    -0x180(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x180(%rbp)
cmpl   $0x27f,-0x180(%rbp)
jl     13e2 <main+0x232>
cmpl   $0x9da,-0x180(%rbp)
jle    13e7 <main+0x237>
jmp    1394 <main+0x1e4>
movsbl -0x100(%rbp),%eax
cmp    $0x41,%eax
jne    1647 <main+0x497>
movsbl -0xff(%rbp),%eax
cmp    $0x54,%eax
jne    1647 <main+0x497>
movsbl -0xfe(%rbp),%eax
cmp    $0x4f,%eax
jne    1647 <main+0x497>
movsbl -0xfd(%rbp),%eax
cmp    $0x4d,%eax
jne    1647 <main+0x497>
movsbl -0xf3(%rbp),%eax
cmp    $0x43,%eax
jne    1642 <main+0x492>
movsbl -0xf2(%rbp),%eax
cmp    $0x41,%eax
jne    1642 <main+0x492>
movq   $0x0,-0x188(%rbp)
movl   $0x0,-0x18c(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xbbd(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x188(%rbp)
cmpq   $0x0,-0x188(%rbp)
je     152f <main+0x37f>
cmpl   $0x5,-0x18c(%rbp)
jne    14a4 <main+0x2f4>
lea    -0x191(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x6,-0x18c(%rbp)
jne    14c4 <main+0x314>
lea    -0x199(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x7,-0x18c(%rbp)
jne    14e4 <main+0x334>
lea    -0x1a1(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x8,-0x18c(%rbp)
jne    1504 <main+0x354>
lea    -0x1a9(%rbp),%rdi
mov    -0x188(%rbp),%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xb18(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x188(%rbp)
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    1476 <main+0x2c6>
mov    -0x140(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x1e8(%rbp)
ff
lea    -0x199(%rbp),%rdi
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x1e8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
mov    -0x138(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x1e0(%rbp)
ff
lea    -0x1a1(%rbp),%rdi
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x1e0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
mov    -0x130(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x1d8(%rbp)
ff
lea    -0x1a9(%rbp),%rdi
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x1d8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1c8(%rbp)
ff
movsd  -0x1b8(%rbp),%xmm1
ff
movsd  -0x1b8(%rbp),%xmm2
ff
movsd  -0x1c0(%rbp),%xmm0
ff
mulsd  -0x1c0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x1c8(%rbp),%xmm0
ff
movsd  -0x1c8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
movss  %xmm0,-0x1cc(%rbp)
ff
lea    -0x191(%rbp),%rsi
movss  -0x1cc(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xa1f(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
jmp    1647 <main+0x497>
jmp    1394 <main+0x1e4>
lea    0xa13(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    0x297b(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
movl   $0x0,-0x1d0(%rbp)
mov    -0x1d0(%rbp),%eax
cmp    -0x17c(%rbp),%eax
jge    16b2 <main+0x502>
movslq -0x1d0(%rbp),%rax
mov    -0x170(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x1d0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d0(%rbp)
jmp    1678 <main+0x4c8>
jmp    16b7 <main+0x507>
jmp    16bc <main+0x50c>
jmp    1226 <main+0x76>
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    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
lea    0xe38(%rip),%r14
lea    0xe49(%rip),%rbp
mov    %r14,%rdi
mov    %rbp,%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbp,%rsi
call   10c0 <fopen@plt>
test   %r15,%r15
je     154f <main+0x38f>
mov    %rax,%r12
lea    0xe0(%rsp),%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     153b <main+0x37b>
lea    0xe0e(%rip),%r13
lea    0xe0(%rsp),%rbp
lea    0xdc8(%rip),%r14
xor    %ebx,%ebx
mov    %r15,0x28(%rsp)
mov    %r12,0x20(%rsp)
jmp    127e <main+0xbe>
cs nopw 0x0(%rax,%rax,1)
mov    0x28(%rsp),%r15
lea    0xe0(%rsp),%rbp
mov    0x30(%rsp),%rbx
add    $0x1,%ebx
mov    %rbp,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     153b <main+0x37b>
lea    -0x9da(%rbx),%eax
cmp    $0xfffff8a4,%eax
jb     1262 <main+0xa2>
movdqa 0xe0(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x4d4f5441,%eax
jne    1262 <main+0xa2>
cmpb   $0x43,0xed(%rsp)
43
jne    1262 <main+0xa2>
cmpb   $0x41,0xee(%rsp)
41
jne    1262 <main+0xa2>
mov    %rbp,%rdi
mov    %r13,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
mov    %rbx,0x30(%rsp)
je     1305 <main+0x145>
mov    %rax,%r12
xor    %r15d,%r15d
xchg   %ax,%ax
mov    $0x7,%edi
call   10a0 <malloc@plt>
mov    %rax,0x150(%rsp,%r15,8)
add    $0x1,%r15
mov    %rax,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10d0 <strtok@plt>
mov    %rax,%r12
test   %rax,%rax
jne    12d0 <main+0x110>
jmp    1308 <main+0x148>
xor    %r15d,%r15d
mov    0x20(%rsp),%r12
lea    0x70(%rsp),%rbx
mov    0x178(%rsp),%rsi
lea    0xd18(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     14f0 <main+0x330>
mov    0x180(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0x188(%rsp),%rax
mov    %rax,0x40(%rsp)
xor    %ebp,%ebp
mov    0x190(%rsp),%rax
mov    %rax,0x38(%rsp)
jmp    144d <main+0x28d>
nop
mov    0x48(%rsp),%rdi
call   1060 <atof@plt>
movq   %xmm0,0x10(%rsp)
lea    0x68(%rsp),%rdi
call   1060 <atof@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    0x40(%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    0x38(%rsp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x50(%rsp)
lea    0x58(%rsp),%rdi
call   1060 <atof@plt>
movsd  0x50(%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    0xc4a(%rip),%rdi
lea    0x1b(%rsp),%rsi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0x70(%rsp),%rbx
add    $0x1,%ebp
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     14f0 <main+0x330>
lea    -0x9da(%rbp),%eax
cmp    $0xfffff8a4,%eax
jb     1431 <main+0x271>
movdqa 0x70(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x4d4f5441,%eax
jne    1431 <main+0x271>
cmpb   $0x43,0x7d(%rsp)
jne    1431 <main+0x271>
cmpb   $0x41,0x7e(%rsp)
jne    1431 <main+0x271>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
je     1370 <main+0x1b0>
xor    %ebx,%ebx
jmp    14c3 <main+0x303>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x58(%rsp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10d0 <strtok@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1370 <main+0x1b0>
lea    -0x5(%rbx),%ecx
cmp    $0x3,%ecx
ja     14ad <main+0x2ed>
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
lea    0x1b(%rsp),%rdi
jmp    *%rcx
lea    0x68(%rsp),%rdi
jmp    14a5 <main+0x2e5>
lea    0x60(%rsp),%rdi
jmp    14a5 <main+0x2e5>
nopw   0x0(%rax,%rax,1)
lea    0xb7f(%rip),%rdi
call   1050 <puts@plt>
mov    0x2add(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
test   %r15d,%r15d
je     1250 <main+0x90>
mov    %r15d,%ebx
xor    %ebp,%ebp
nopl   (%rax)
mov    0x150(%rsp,%rbp,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1520 <main+0x360>
jmp    1250 <main+0x90>
mov    %r15,%rdi
call   1070 <fclose@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
jmp    1562 <main+0x3a2>
lea    0xad4(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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