// File: /workspace/github_cpp_makefile_star2_O1/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 0x2213c
movq %rax, %rcx
testq %rax, %rax
je 0x1826c
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 0x1f12e
movq (%r14), %rcx
cmpq -0x8(%rcx), %rax
movq %r13, %rax
jne 0x1825b
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x38(%rsp), %rdi
callq 0x2213c
movq %rax, %r14
testq %r14, %r14
je 0x181f6
leaq 0x10(%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1f1b6
movq (%r15), %rcx
cmpq -0x8(%rcx), %rax
jne 0x181ee
movq %r13, %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x289ae
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x1f23e
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 0x28d6a
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x28d6a
movupd 0x40(%rbp), %xmm0
leaq 0x68(%rsp), %rax
movupd %xmm0, 0x30(%rax)
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x180eb
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x18110
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xd550
cmpl $-0x1, 0xc(%rsp)
je 0x18192
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq %rdx, %rax
subq %rdi, %rax
movq %rax, %rcx
sarq $0x4, %rcx
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rsi, %rcx
cmpq 0x48(%rsp), %rcx
jb 0x18192
movsd 0x40(%rdi), %xmm0
ucomisd 0x98(%rsp), %xmm0
jbe 0x181b0
cmpq $0x51, %rax
jl 0x18168
addq $-0x50, %rdx
movq %rdx, %rsi
movq %r13, %rcx
callq 0x452e7
movq 0x18(%rsp), %rsi
addq $-0x50, %rsi
movq %rsi, 0x18(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
callq 0x410f8
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1eecc
jmp 0x181a1
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1eecc
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1f3c2
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x181d2
movq 0x88(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x181ee
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xd550
movq (%r14), %r14
jmp 0x18030
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 0x1f5b6
movq 0x8(%r12), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r12, %rdi
callq 0x4572c
movq 0x30(%rsp), %r14
leaq 0x10(%rsp), %rdi
callq 0x1ef2c
movq %r13, %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x17fe9
movq (%rsp), %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1828b
jmp 0x182e4
movq %rax, %r14
jmp 0x182eb
movq %rax, %rdi
callq 0x1d63c
movq %rax, %r14
movq (%rsp), %r12
jmp 0x182f5
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x182d1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xd550
jmp 0x182d1
jmp 0x182e4
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x1eef6
jmp 0x182e7
movq %rax, %r14
movq (%rsp), %r12
leaq 0xa8(%rsp), %rdi
callq 0x1e644
jmp 0x182eb
movq %rax, %r14
movq (%rsp), %r12
leaq 0x10(%rsp), %rdi
callq 0x1ef2c
movq %r12, %rdi
callq 0x1ef2c
movq %r14, %rdi
callq 0xd9c0