// File: /workspace/github_cpp_makefile_star2_O1/Kingsford-Group[P]ghost2/src/alignmentExtender.hpp
// Function: insertIfBetter(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>*, 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>>>&)
void insertIfBetter(bmap* alignment, D_alpha best, distmap& dalphas)
{ 
  bmap::left_const_iterator left = alignment->left.find(best.get_n1());
  bmap::right_const_iterator right = alignment->right.find(best.get_n2());
  double d = best.get_da();
  if((left == alignment->left.end() || 
      d < dalphas.at(make_pair(left->first,left->second)).get_da())
      && (right == alignment->right.end() || 
      d < dalphas.at(make_pair(right->second,right->first)).get_da())){
    //Remove any existing alignments, add this one
    alignment->left.erase(best.get_n1());
    alignment->right.erase(best.get_n2());
    alignment->insert(bmap::value_type(best.get_n1(), best.get_n2()));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, 0xa0(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x98(%rdi), %r12
leaq 0x28(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x28d6a
movq %r12, 0x10(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1f12e
movq %rax, %rbp
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x17bba
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd550
leaq 0xa0(%r15), %r12
leaq 0x18(%rsp), %rbx
leaq 0x28(%rsp), %r13
movq %r13, (%rbx)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x28d6a
movq %r12, 0x8(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1f1b6
movq %rax, %rbx
movq %r15, 0x98(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x17c13
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd550
movsd 0x40(%r14), %xmm0
movsd %xmm0, (%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
cmpq -0x8(%rax), %rbp
setne %r15b
movq 0xa0(%rsp), %r13
je 0x17c66
movq %rbp, %rdx
addq $0x20, %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x289ae
movq %r13, %rdi
movq %r12, %rsi
callq 0x1f23e
movsd 0x40(%rax), %xmm0
ucomisd (%rsp), %xmm0
jbe 0x17cac
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq -0x8(%rax), %rbx
je 0x17cb5
movq %rbx, %rdx
addq $0x20, %rdx
leaq 0xe8(%rsp), %rdi
movq %rbx, %rsi
callq 0x289ae
leaq 0xe8(%rsp), %rsi
movq %r13, %rdi
callq 0x1f23e
movsd 0x40(%rax), %xmm0
ucomisd (%rsp), %xmm0
seta %bl
movb $0x1, %al
jmp 0x17cb9
movb $0x1, %r15b
xorl %eax, %eax
xorl %ebx, %ebx
jmp 0x17cb9
movb $0x1, %bl
xorl %eax, %eax
testb %al, %al
je 0x17cff
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17cde
movq 0x118(%rsp), %rsi
incq %rsi
callq 0xd550
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17cff
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xd550
testb %r15b, %r15b
je 0x17d3b
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17d1f
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x17d3b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd550
testb %bl, %bl
je 0x17eb4
leaq 0x68(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x28d6a
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x1f28c
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x17d88
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xd550
leaq 0x58(%rsp), %rbx
movq %r12, (%rbx)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x28d6a
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1f30c
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x17dc7
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xd550
leaq 0xd8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x28d6a
leaq 0xb8(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x28d6a
leaq 0x58(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x44570
movq 0x98(%rsp), %rax
movq 0x8(%rax), %rdi
addq $-0x10, %rdi
leaq 0x58(%rsp), %rsi
callq 0x445d4
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17e63
movq 0x88(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x17e7a
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17e97
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xd550
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x17eb4
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xd550
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x1e644
jmp 0x17f44
movq %rax, %rbx
jmp 0x17f44
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1f38c
jmp 0x17eef
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17f11
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xd550
jmp 0x17f11
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x17f71
movq 0xd8(%rsp), %rsi
jmp 0x17f69
jmp 0x17f2a
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x17f71
movq 0x68(%rsp), %rsi
jmp 0x17f69
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x17f71
leaq 0x18(%rsp), %rdi
callq 0x1e644
jmp 0x17f71
jmp 0x17f57
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x17f71
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd550
movq %rbx, %rdi
callq 0xd9c0