// File: /workspace/github_cpp_makefile_star2_O2/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, %ebx
movq %r8, 0x50(%rsp)
movq %rcx, %r15
movq %rdx, 0x38(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq %rdi, 0x20(%rsp)
andq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x1873a
movq %rax, %r14
leaq 0x98(%r15), %rbp
addq $0xa0, %r15
movl %ebx, 0x2c(%rsp)
movslq %ebx, %rax
movq %rax, 0x48(%rsp)
leaq 0xa8(%rsp), %rbx
leaq 0x58(%rsp), %r12
movq %rbp, 0x30(%rsp)
testq %r14, %r14
je 0x15795
leaq 0x10(%r14), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x19f1e
movq (%rbp), %rcx
cmpq -0x8(%rcx), %rax
jne 0x1578d
movq %r14, 0x40(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movq 0x38(%rsp), %rdi
callq 0x1873a
movq %rax, %r14
testq %r14, %r14
je 0x15736
leaq 0x10(%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x19fde
movq (%r15), %rcx
cmpq -0x8(%rcx), %rax
jne 0x1572e
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x219ca
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x1a02e
movq %r12, %rdi
movq %rax, %rsi
callq 0x19f6e
movq %rbx, %rdi
callq 0x19672
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cqto
pushq $0x50
popq %rcx
idivq %rcx
cmpl $-0x1, 0x2c(%rsp)
je 0x1570d
cmpq 0x48(%rsp), %rax
jb 0x1570d
movsd 0x40(%rdi), %xmm0
ucomisd 0x98(%rsp), %xmm0
jbe 0x15726
callq 0x1a1d0
movq 0x8(%rsp), %rdi
addq $-0x50, %rdi
movq %rdi, 0x8(%rsp)
callq 0x19ce8
movq %rsp, %rdi
movq %r12, %rsi
callq 0x19cbc
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1a132
movq %r12, %rdi
callq 0x19ce8
movq (%r14), %r14
jmp 0x1566d
movq 0x20(%rsp), %r14
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
pushq $0x50
popq %rcx
idivq %rcx
movq %rax, %rsi
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
idivq %rcx
addq %rax, %rsi
movq %r14, %rdi
callq 0x1a208
movq 0x8(%r14), %rsi
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %r14, %rdi
callq 0x1a2aa
movq %rsp, %rdi
callq 0x19cfe
movq 0x40(%rsp), %r14
movq 0x30(%rsp), %rbp
movq (%r14), %r14
jmp 0x15626
movq 0x20(%rsp), %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x157d8
jmp 0x157d8
movq %rax, %rbx
jmp 0x157e3
jmp 0x157d8
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x19ce8
jmp 0x157db
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x19672
jmp 0x157db
movq %rax, %rbx
movq %rsp, %rdi
callq 0x19cfe
movq 0x20(%rsp), %rdi
callq 0x19cfe
movq %rbx, %rdi
callq 0xe9f0