// File: /workspace/github_cpp_makefile_star2_O3/Kingsford-Group[P]ghost2/src/alignmentExtender.hpp
// Function: extendAlignment(D_alpha, Graph&, Graph&, 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>*, std::vector<D_alpha, std::allocator<D_alpha>>&, 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)
void extendAlignment(D_alpha seed, Graph& g1, Graph& g2, bmap *alignment, vector<D_alpha>& dalphas, distmap& d, int k)
{
  vector<D_alpha> maxP;
  maxP.push_back(seed);

  while(!maxP.empty()){
    D_alpha best = maxP.front();
    pop_heap(maxP.begin(), maxP.end(), CompareD_alphaL());
    maxP.pop_back();
    insertIfBetter(alignment, best, d);
    
    vlist *neighbors1 = g1.neighbors2(best.get_n1());
    vlist *neighbors2 = g2.neighbors2(best.get_n2());

    vector<D_alpha> matches = computePairwiseScores(neighbors1, neighbors2, *alignment, d, k);
    if(matches.size() == 0) continue;

    //Do the alignment problem
    matches = performMatching(matches);
    //Filter out matches that are already aligned or have D_seq>beta
    auto end = remove_if(matches.begin(), matches.end(), checkSeq);

    for(auto it = matches.begin(); it != end; ++it){
      alignment->insert(bmap::value_type(it->get_n1(), it->get_n2()));
      maxP.push_back(*it);
      push_heap(maxP.begin(), maxP.end(), CompareD_alphaL());
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %r9, 0x68(%rsp)
movq %rcx, %r14
movq %rdx, 0x120(%rsp)
movq %rsi, 0x128(%rsp)
movq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x1dbaa
movq (%rsp), %rbx
cmpq 0x8(%rsp), %rbx
je 0x17ced
leaq 0x180(%rsp), %rbp
leaq 0xc0(%rsp), %r13
leaq 0x40(%rsp), %r15
leaq 0x100(%rsp), %r12
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0x27846
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x27846
movups 0x40(%rbx), %xmm0
leaq 0x80(%rsp), %rax
movups %xmm0, 0x30(%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x51, %rax
jl 0x17915
addq $-0x50, %rsi
movq %rsi, %rdx
movq %rbp, %rcx
callq 0x440e2
leaq 0xe0(%rsp), %rbx
movq 0x8(%rsp), %rsi
jmp 0x1791d
leaq 0xe0(%rsp), %rbx
addq $-0x50, %rsi
movq %rsi, 0x8(%rsp)
movq %rsp, %rdi
callq 0x3ffca
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %rdi
callq 0x27846
leaq 0x160(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %rdi
callq 0x27846
leaq 0x80(%rsp), %rax
movups 0x30(%rax), %xmm0
leaq 0x140(%rsp), %rax
movups %xmm0, 0x30(%rax)
movq %r14, %rdi
leaq 0x130(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x1686d
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x179da
movq 0x160(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x179ff
movq 0x140(%rsp), %rsi
incq %rsi
callq 0xc550
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x27846
movq 0x128(%rsp), %rdi
movq %rbx, %rsi
callq 0x20002
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x17a5c
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0xc550
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x27846
movq 0x120(%rsp), %rdi
movq %r13, %rsi
callq 0x20002
movq %rax, %r13
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x17abf
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0xc550
addq $0x30, %rbx
addq $0x30, %r13
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq 0x68(%rsp), %r8
movl 0x200(%rsp), %r9d
callq 0x16cac
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x17c85
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1709b
movq 0x30(%rsp), %rax
movaps 0x40(%rsp), %xmm0
movq 0x50(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movaps 0x20(%rsp), %xmm1
movaps %xmm0, 0x20(%rsp)
movaps %xmm1, 0x180(%rsp)
movq %rax, 0x190(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %rbp, %rdi
callq 0x1dc0a
movq %r15, %rdi
callq 0x1dc0a
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq -0x35a(%rip), %rdx      # 0x1780a
callq 0x44fdb
movq %rax, %rbx
movq 0x20(%rsp), %r13
cmpq %rbx, %r13
je 0x17c85
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x27846
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x27846
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x433c0
movq 0x8(%r14), %rdi
addq $-0x10, %rdi
movq %rbp, %rsi
callq 0x43424
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x17bfd
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x17c22
movq 0x190(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x17c47
movq 0x110(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x17c63
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xc550
movq %rsp, %rdi
movq %r13, %rsi
callq 0x1dbaa
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1e076
addq $0x50, %r13
jmp 0x17b71
leaq 0x20(%rsp), %rdi
callq 0x1dc0a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x17cb4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
leaq 0xc0(%rsp), %r13
je 0x17cde
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xc550
movq (%rsp), %rbx
cmpq 0x8(%rsp), %rbx
jne 0x17889
movq %rsp, %rdi
callq 0x1dc0a
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17d13
jmp 0x17e42
jmp 0x17e42
movq %rax, %rbx
jmp 0x17e59
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x17e59
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xc550
jmp 0x17e59
movq %rax, %rbx
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x17e4f
movq 0x140(%rsp), %rsi
jmp 0x17dd2
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x1dbd4
jmp 0x17e4f
jmp 0x17dde
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x17e4f
movq 0xf0(%rsp), %rsi
jmp 0x17dd2
jmp 0x17dde
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x17e4f
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0xc550
jmp 0x17e4f
jmp 0x17dde
movq %rax, %rbx
jmp 0x17e4f
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x1e040
jmp 0x17dfd
movq %rax, %rbx
jmp 0x17e22
movq %rax, %rbx
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x17e22
movq 0x110(%rsp), %rsi
incq %rsi
callq 0xc550
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x17e45
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xc550
jmp 0x17e45
jmp 0x17e42
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1dc0a
leaq 0x70(%rsp), %rdi
callq 0x1dbd4
movq %rsp, %rdi
callq 0x1dc0a
movq %rbx, %rdi
callq 0xc9c0