// File: /workspace/github_cpp_makefile_star2_O2/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 $0x448, %rsp            # imm = 0x448
movq %rdx, %r15
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq 0x694f4(%rip), %rdi     # 0x7cf98
leaq 0x2ce96(%rip), %rsi     # 0x40941
callq 0xe540
movq %rax, %rdi
movq %r14, %rsi
callq 0xe4a0
leaq 0x2cbc1(%rip), %rsi     # 0x40683
movq %rax, %rdi
callq 0xe540
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, 0x10(%rsp)
andq $0x0, 0x10(%rbx)
leaq 0x240(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0xe950
movq 0x240(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x260(%rsp,%rax)
jne 0x13ce0
movq %r15, 0x18(%rsp)
leaq 0x240(%rsp), %rdi
callq 0xe680
xorl %ebx, %ebx
leaq 0x240(%rsp), %r13
leaq 0x70(%rsp), %r12
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x240(%rsp), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x260(%rsp,%rcx)
jne 0x13c60
cmpb $0x9, %al
je 0x13bef
movzbl %al, %edx
cmpl $0xd, %edx
je 0x13c53
movslq %ebp, %rcx
cmpl $0xa, %edx
jne 0x13c1a
movb $0x0, 0xc0(%rsp,%rcx)
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1c0(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0x1866e
leaq 0x30(%rsp), %r14
movq %r14, %rdi
leaq 0x140(%rsp), %rsi
leaq 0xe(%rsp), %rdx
callq 0x1866e
leaq 0xc0(%rsp), %rdi
callq 0xe6e0
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x19ab2
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x39ab8
movq %r12, %rdi
callq 0x19ce8
movq %r14, %rdi
callq 0xe290
movq %rbx, %rdi
callq 0xe290
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %ebp, %ebp
jmp 0x13c31
movl %ebx, %eax
leaq 0x1c0(%rsp), %rcx
testl %r14d, %r14d
je 0x13c0f
cmpl $0x1, %r14d
jne 0x13c15
movl %r15d, %eax
leaq 0x140(%rsp), %rcx
cltq
movb $0x0, (%rcx,%rax)
incl %r14d
jmp 0x13c53
cmpl $0x1, %r14d
je 0x13c36
testl %r14d, %r14d
jne 0x13c49
movslq %ebx, %rcx
incl %ebx
movb %al, 0x1c0(%rsp,%rcx)
xorl %r14d, %r14d
jmp 0x13c53
movslq %r15d, %rcx
incl %r15d
movb %al, 0x140(%rsp,%rcx)
pushq $0x1
popq %r14
jmp 0x13c53
leal 0x1(%rcx), %ebp
movb %al, 0xc0(%rsp,%rcx)
movq %r13, %rdi
callq 0xe680
jmp 0x13b30
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x13001
movq 0x69316(%rip), %rdi     # 0x7cf98
leaq 0x2ccdd(%rip), %rsi     # 0x40966
callq 0xe540
movq %rax, %rdi
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
pushq $0x50
popq %rcx
cqto
idivq %rcx
movq %rax, %rsi
callq 0xe3a0
leaq 0x2ccc4(%rip), %rsi     # 0x40978
movq %rax, %rdi
callq 0xe540
leaq 0x240(%rsp), %rdi
callq 0xe170
movq 0x10(%rsp), %rax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x692b1(%rip), %rdi     # 0x7cf98
leaq 0x2cc6b(%rip), %rsi     # 0x40959
callq 0xe540
movq %rax, %rdi
movq %r14, %rsi
callq 0xe4a0
leaq 0x2cbb7(%rip), %rsi     # 0x408bc
movq %rax, %rdi
callq 0xe540
xorl %edi, %edi
callq 0xe6a0
jmp 0x13d4e
jmp 0x13d4e
movq %rax, %r14
jmp 0x13d5e
jmp 0x13d4e
movq %rax, %r14
jmp 0x13d38
movq %rax, %r14
jmp 0x13d42
jmp 0x13d4e
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x19ce8
leaq 0x30(%rsp), %rdi
callq 0xe290
leaq 0x50(%rsp), %rdi
callq 0xe290
jmp 0x13d51
movq %rax, %r14
leaq 0x240(%rsp), %rdi
callq 0xe170
movq 0x10(%rsp), %rdi
callq 0x19cfe
movq %r14, %rdi
callq 0xe9f0