// File: /workspace/github_cpp_makefile_star2_O3/Kingsford-Group[P]ghost2/src/alignmentExtender.hpp
// Function: computePairwiseScores(boost::unordered::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*, boost::unordered::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*, boost::bimaps::bimap<boost::bimaps::unordered_set_of<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, boost::bimaps::unordered_set_of<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, boost::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, mpl_::na, mpl_::na, mpl_::na>&, 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>>>, D_alpha, 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, D_alpha>>>&, int)
vector<D_alpha> computePairwiseScores(vlist *n1, vlist *n2, bmap& alignment, distmap& dalphas, int k)
{
  vector<D_alpha> ans;
  for(auto it1 = n1->begin(); it1 != n1->end(); ++it1){
    if(alignment.left.find(*it1) != alignment.left.end()) continue; //Skip if already aligned
    vector<D_alpha> maxheap;
    for(auto it2 = n2->begin(); it2 != n2->end(); ++it2){
      if(alignment.right.find(*it2) != alignment.right.end()) continue; //Skip if already aligned

      D_alpha d = dalphas.at(make_pair(*it1,*it2));
      //If we don't have k yet, add it
      if(maxheap.size() < k || k==-1){
        maxheap.push_back(d);
        push_heap(maxheap.begin(), maxheap.end(), CompareD_alphaL());
      //Otherwise add and trim back down to k
      } else if(d.get_da() < maxheap.front().get_da()){
        pop_heap(maxheap.begin(), maxheap.end(), CompareD_alphaL());
        maxheap.pop_back();
        maxheap.push_back(d);
        push_heap(maxheap.begin(), maxheap.end(), CompareD_alphaL());
      }
    }
    ans.reserve(ans.size()+maxheap.size());
    ans.insert(ans.end(), maxheap.begin(), maxheap.end());
  }
  return ans;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, 0x50(%rsp)
movq %rcx, %r15
movq %rdx, 0x38(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq %rdi, (%rsp)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x20d60
movq %rax, %rcx
testq %rax, %rax
je 0x16f8d
leaq 0x98(%r15), %r14
addq $0xa0, %r15
movslq 0xc(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0xa8(%rsp), %rax
movq %r14, 0x30(%rsp)
movq %rax, %r13
movq %rcx, 0x40(%rsp)
leaq 0x10(%rcx), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x1dde2
movq (%r14), %rcx
cmpq -0x8(%rcx), %rax
movq %r13, %rax
jne 0x16f7c
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x38(%rsp), %rdi
callq 0x20d60
movq %rax, %r14
testq %r14, %r14
je 0x16f17
leaq 0x10(%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1de6a
movq (%r15), %rcx
cmpq -0x8(%rcx), %rax
jne 0x16f0f
movq %r13, %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x27492
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x1def2
movq %rax, %rbp
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x27846
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x27846
movupd 0x40(%rbp), %xmm0
leaq 0x68(%rsp), %rax
movupd %xmm0, 0x30(%rax)
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x16e1e
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x16e43
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xc550
cmpl $-0x1, 0xc(%rsp)
je 0x16eb3
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
movq %rax, %rcx
sarq $0x4, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
cmpq 0x48(%rsp), %rcx
jb 0x16eb3
movsd 0x40(%rdi), %xmm0
ucomisd 0x98(%rsp), %xmm0
jbe 0x16ed1
cmpq $0x51, %rax
jl 0x16ea0
addq $-0x50, %rsi
movq %rsi, %rdx
movq %r13, %rcx
callq 0x440e2
movq 0x18(%rsp), %rsi
addq $-0x50, %rsi
movq %rsi, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x3ffca
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1dbaa
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1e076
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x16ef3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x16f0f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xc550
movq (%r14), %r14
jmp 0x16d63
movq (%rsp), %r12
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x4, %rax
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
sarq $0x4, %rsi
imulq %rcx, %rsi
addq %rax, %rsi
movq %r12, %rdi
callq 0x1e25e
movq 0x8(%r12), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r12, %rdi
callq 0x44526
movq 0x30(%rsp), %r14
leaq 0x10(%rsp), %rdi
callq 0x1dc0a
movq %r13, %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x16d1c
movq (%rsp), %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16fac
jmp 0x17005
movq %rax, %r14
jmp 0x1700c
movq %rax, %rdi
callq 0x1c340
movq %rax, %r14
movq (%rsp), %r12
jmp 0x17016
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x16ff2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xc550
jmp 0x16ff2
jmp 0x17005
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x1dbd4
jmp 0x17008
movq %rax, %r14
movq (%rsp), %r12
leaq 0xa8(%rsp), %rdi
callq 0x1d33e
jmp 0x1700c
movq %rax, %r14
movq (%rsp), %r12
leaq 0x10(%rsp), %rdi
callq 0x1dc0a
movq %r12, %rdi
callq 0x1dc0a
movq %r14, %rdi
callq 0xc9c0