// File: /workspace/github_cpp_makefile_star2_O3/Kingsford-Group[P]ghost2/src/spectralToDistance.hpp
// Function: getDistancesFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, double, boost::unordered::unordered_map<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, double, boost::hash<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::equal_to<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const, double>>>*)
vector<D_alpha> getDistancesFromFile(string file, double alpha, double beta, blastmap* blastscores)
{
  cout << "reading distances from " << file << "\n";
  vector<D_alpha> allDistances;

  ifstream fin(file);
  if(!fin.good()) {cout << ".sig.gz file" << file << "not found\n"; exit(0);}
  char c = fin.get();
  int alen = 0;
  int blen = 0;
  int dlen = 0;
  char a[128];
  char b[128];
  char d[128];
  int filling = 0;
  while(fin.good()){
    if(c == '\n'){
      d[dlen] = '\0';
      allDistances.push_back(D_alpha(string(a), string(b), atof(d)));
      alen = blen = dlen = 0;
      filling = 0;
    }
    else if(c == '\r'){}
    else if (c == '\t'){
      if(filling == 0) a[alen] = '\0';
      else if(filling == 1) b[blen] = '\0';
      filling++;
    }
    else if(filling == 0) a[alen++] = c;
    else if(filling == 1) b[blen++] = c;
    else d[dlen++] = c;
    c = fin.get();
  }

  applyAlpha(alpha, beta, &allDistances, blastscores);
  cout << "finished reading " << allDistances.size() << " distances\n";

  return allDistances;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rdx, %r12
movsd %xmm1, 0x58(%rsp)
movsd %xmm0, 0x50(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
movq 0x63c91(%rip), %r14     # 0x77f98
leaq 0x3464f(%rip), %rsi     # 0x4895d
movl $0x17, %edx
movq %r14, %rdi
callq 0xc620
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0xc620
leaq 0x3436e(%rip), %rsi     # 0x4869f
movl $0x1, %edx
movq %rax, %rdi
callq 0xc620
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %r15, (%rsp)
movq $0x0, 0x10(%r15)
leaq 0x230(%rsp), %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0xc920
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x250(%rsp,%rax)
jne 0x14600
movq %r12, 0x48(%rsp)
leaq 0x230(%rsp), %rdi
callq 0xc670
xorl %ebp, %ebp
leaq 0x1b0(%rsp), %r15
leaq 0x230(%rsp), %r13
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x230(%rsp), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x250(%rsp,%rcx)
jne 0x1456e
cmpb $0x9, %al
je 0x144fe
movzbl %al, %ecx
cmpl $0xd, %ecx
je 0x14561
cmpl $0xa, %ecx
jne 0x14524
movslq %ebx, %rax
movb $0x0, 0x130(%rsp,%rax)
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r15, %rdi
callq 0xc250
leaq (%rsp,%rax), %rdx
addq $0x1b0, %rdx            # imm = 0x1B0
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x278dc
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xc250
leaq (%rsp,%rax), %rdx
addq $0xb0, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x278dc
leaq 0x130(%rsp), %rdi
callq 0xc6d0
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1d8e2
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x40000
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x144a1
movq 0x90(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x144bd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x144d9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x144f5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xc550
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x1453b
movl %ebp, %eax
movq %r15, %rcx
testl %r12d, %r12d
je 0x14519
cmpl $0x1, %r12d
jne 0x1451f
movl %r14d, %eax
leaq 0xb0(%rsp), %rcx
cltq
movb $0x0, (%rcx,%rax)
incl %r12d
jmp 0x14561
cmpl $0x1, %r12d
je 0x14540
testl %r12d, %r12d
jne 0x14555
movslq %ebp, %rcx
incl %ebp
movb %al, 0x1b0(%rsp,%rcx)
xorl %r12d, %r12d
jmp 0x14561
movslq %r14d, %rcx
incl %r14d
movb %al, 0xb0(%rsp,%rcx)
movl $0x1, %r12d
jmp 0x14561
movslq %ebx, %rcx
incl %ebx
movb %al, 0x130(%rsp,%rcx)
movq %r13, %rdi
callq 0xc670
jmp 0x143ac
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movq (%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x13229
movq 0x63a09(%rip), %rdi     # 0x77f98
leaq 0x343ec(%rip), %rsi     # 0x48982
movl $0x11, %edx
callq 0xc620
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x4, %rax
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rsi
movq 0x639d4(%rip), %rdi     # 0x77f98
callq 0xc360
leaq 0x343c4(%rip), %rsi     # 0x48994
movl $0xb, %edx
movq %rax, %rdi
callq 0xc620
leaq 0x230(%rsp), %rdi
callq 0xc160
movq (%rsp), %rax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x63991(%rip), %rdi     # 0x77f98
leaq 0x34367(%rip), %rsi     # 0x48975
movl $0xc, %edx
callq 0xc620
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x63972(%rip), %rdi     # 0x77f98
callq 0xc620
leaq 0x342a6(%rip), %rsi     # 0x488d8
movq %rax, %rdi
callq 0xc500
xorl %edi, %edi
callq 0xc690
jmp 0x1469f
jmp 0x1469f
movq %rax, %rbx
jmp 0x146af
jmp 0x1469f
movq %rax, %rbx
jmp 0x14665
movq %rax, %rbx
jmp 0x14681
jmp 0x1469f
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x1dbd4
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x14681
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x146a2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xc550
jmp 0x146a2
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0xc160
movq (%rsp), %rdi
callq 0x1dc0a
movq %rbx, %rdi
callq 0xc9c0