// File: /workspace/github_cpp_makefile_star2_O1/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 $0x1b8, %rsp            # imm = 0x1B8
movq %r9, 0x58(%rsp)
movq %rcx, %r14
movq %rdx, 0x110(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x1eecc
movq (%rsp), %rbx
cmpq 0x8(%rsp), %rbx
je 0x18f98
leaq 0x170(%rsp), %rbp
leaq 0xb0(%rsp), %r13
leaq 0x38(%rsp), %r15
leaq 0xd0(%rsp), %r12
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x28d6a
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0x28d6a
movups 0x40(%rbx), %xmm0
leaq 0x70(%rsp), %rax
movups %xmm0, 0x30(%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %rdx, %rax
subq %rdi, %rax
cmpq $0x51, %rax
leaq 0xf0(%rsp), %rbx
jl 0x18bbc
addq $-0x50, %rdx
movq %rdx, %rsi
movq %rbp, %rcx
callq 0x452e7
movq 0x8(%rsp), %rsi
addq $-0x50, %rsi
movq %rsi, 0x8(%rsp)
movq %rsp, %rdi
callq 0x410f8
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x120(%rsp), %rdi
callq 0x28d6a
leaq 0x150(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %rdi
callq 0x28d6a
leaq 0x70(%rsp), %rax
movups 0x30(%rax), %xmm0
leaq 0x130(%rsp), %rax
movups %xmm0, 0x30(%rax)
movq %r14, %rdi
leaq 0x120(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x17b4a
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x18c7b
movq 0x150(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x18ca0
movq 0x130(%rsp), %rsi
incq %rsi
callq 0xd550
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x28d6a
movq 0x118(%rsp), %rdi
movq %rbx, %rsi
callq 0x213e8
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x18cfd
movq 0x100(%rsp), %rsi
incq %rsi
callq 0xd550
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x28d6a
movq 0x110(%rsp), %rdi
movq %r13, %rsi
callq 0x213e8
movq %rax, %r13
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x18d60
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0xd550
addq $0x30, %rbx
addq $0x30, %r13
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq 0x58(%rsp), %r8
movl 0x1f0(%rsp), %r9d
callq 0x17f79
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x18f36
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x18378
xorps %xmm0, %xmm0
movaps %xmm0, 0x170(%rsp)
movups 0x20(%rsp), %xmm0
movq 0x30(%rsp), %rax
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x20(%rsp)
movq 0x48(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movaps 0x170(%rsp), %xmm1
movaps %xmm0, 0x170(%rsp)
movq %rax, 0x180(%rsp)
movups %xmm1, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
movq %rbp, %rdi
callq 0x1ef2c
movq %r15, %rdi
callq 0x1ef2c
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq -0x357(%rip), %rdx      # 0x18abe
callq 0x45f9c
movq %rax, %rbx
movq 0x20(%rsp), %r13
cmpq %rbx, %r13
je 0x18f36
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x28d6a
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x28d6a
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x44570
movq 0x8(%r14), %rdi
addq $-0x10, %rdi
movq %rbp, %rsi
callq 0x445d4
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x18eae
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x18ed3
movq 0x180(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x18ef8
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x18f14
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xd550
movq %rsp, %rdi
movq %r13, %rsi
callq 0x1eecc
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1f3c2
addq $0x50, %r13
jmp 0x18e22
leaq 0x20(%rsp), %rdi
callq 0x1ef2c
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x18f65
movq 0x90(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
leaq 0xb0(%rsp), %r13
je 0x18f89
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd550
movq (%rsp), %rbx
cmpq 0x8(%rsp), %rbx
jne 0x18b3d
movq %rsp, %rdi
callq 0x1ef2c
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18fbe
jmp 0x190e7
jmp 0x190e7
movq %rax, %rbx
jmp 0x190fe
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x190fe
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd550
jmp 0x190fe
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x190f4
movq 0x130(%rsp), %rsi
jmp 0x19077
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x1eef6
jmp 0x190f4
jmp 0x19083
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x190f4
movq 0x100(%rsp), %rsi
jmp 0x19077
jmp 0x19083
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x190f4
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0xd550
jmp 0x190f4
jmp 0x19083
movq %rax, %rbx
jmp 0x190f4
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x1f38c
jmp 0x190a2
movq %rax, %rbx
jmp 0x190c7
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x190c7
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x190ea
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xd550
jmp 0x190ea
jmp 0x190e7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1ef2c
leaq 0x60(%rsp), %rdi
callq 0x1eef6
movq %rsp, %rdi
callq 0x1ef2c
movq %rbx, %rdi
callq 0xd9c0