// File: /workspace/github_cpp_makefile_star2_O1/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 0x63a5f(%rip), %r14     # 0x78f98
leaq 0x343ed(%rip), %rsi     # 0x4992d
movl $0x17, %edx
movq %r14, %rdi
callq 0xd620
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0xd620
leaq 0x3410c(%rip), %rsi     # 0x4966f
movl $0x1, %edx
movq %rax, %rdi
callq 0xd620
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %r15, (%rsp)
movq $0x0, 0x10(%r15)
leaq 0x230(%rsp), %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0xd920
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x250(%rsp,%rax)
jne 0x15832
movq %r12, 0x48(%rsp)
leaq 0x230(%rsp), %rdi
callq 0xd670
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 0x157a0
cmpb $0x9, %al
je 0x15730
movzbl %al, %ecx
cmpl $0xd, %ecx
je 0x15793
cmpl $0xa, %ecx
jne 0x15756
movslq %ebx, %rax
movb $0x0, 0x130(%rsp,%rax)
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r15, %rdi
callq 0xd250
leaq (%rsp,%rax), %rdx
addq $0x1b0, %rdx            # imm = 0x1B0
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x28dfa
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xd250
leaq (%rsp,%rax), %rdx
addq $0xb0, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x28dfa
leaq 0x130(%rsp), %rdi
callq 0xd6d0
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1ebe8
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x4112e
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x156d3
movq 0x90(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x156ef
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1570b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15727
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xd550
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x1576d
movl %ebp, %eax
movq %r15, %rcx
testl %r12d, %r12d
je 0x1574b
cmpl $0x1, %r12d
jne 0x15751
movl %r14d, %eax
leaq 0xb0(%rsp), %rcx
cltq
movb $0x0, (%rcx,%rax)
incl %r12d
jmp 0x15793
cmpl $0x1, %r12d
je 0x15772
testl %r12d, %r12d
jne 0x15787
movslq %ebp, %rcx
incl %ebp
movb %al, 0x1b0(%rsp,%rcx)
xorl %r12d, %r12d
jmp 0x15793
movslq %r14d, %rcx
incl %r14d
movb %al, 0xb0(%rsp,%rcx)
movl $0x1, %r12d
jmp 0x15793
movslq %ebx, %rcx
incl %ebx
movb %al, 0x130(%rsp,%rcx)
movq %r13, %rdi
callq 0xd670
jmp 0x155de
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movq (%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x14436
movq 0x637d7(%rip), %rdi     # 0x78f98
leaq 0x3418a(%rip), %rsi     # 0x49952
movl $0x11, %edx
callq 0xd620
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x4, %rax
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rsi
movq 0x637a2(%rip), %rdi     # 0x78f98
callq 0xd360
leaq 0x34162(%rip), %rsi     # 0x49964
movl $0xb, %edx
movq %rax, %rdi
callq 0xd620
leaq 0x230(%rsp), %rdi
callq 0xd160
movq (%rsp), %rax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6375f(%rip), %rdi     # 0x78f98
leaq 0x34105(%rip), %rsi     # 0x49945
movl $0xc, %edx
callq 0xd620
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x63740(%rip), %rdi     # 0x78f98
callq 0xd620
leaq 0x34044(%rip), %rsi     # 0x498a8
movq %rax, %rdi
callq 0xd500
xorl %edi, %edi
callq 0xd690
jmp 0x158d1
jmp 0x158d1
movq %rax, %rbx
jmp 0x158e1
jmp 0x158d1
movq %rax, %rbx
jmp 0x15897
movq %rax, %rbx
jmp 0x158b3
jmp 0x158d1
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x1eef6
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x158b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x158d4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xd550
jmp 0x158d4
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0xd160
movq (%rsp), %rdi
callq 0x1ef2c
movq %rbx, %rdi
callq 0xd9c0