// File: 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
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rsi, -0x220(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x218(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x27920
movq -0x218(%rbp), %rdi
movq -0x210(%rbp), %rsi
callq 0x287f0
movq %rax, -0x208(%rbp)
jmp 0x1cc3b
movq -0x208(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x28a50
jmp 0x1cc55
leaq -0x48(%rbp), %rdi
callq 0x10460
movq -0x220(%rbp), %rsi
movq -0x8(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x238(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x27950
movq -0x238(%rbp), %rdi
movq -0x230(%rbp), %rsi
callq 0x28a90
movq %rax, -0x228(%rbp)
jmp 0x1cca5
movq -0x228(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x28b50
jmp 0x1ccbf
leaq -0x88(%rbp), %rdi
callq 0x10460
movq -0x220(%rbp), %rdi
callq 0x27660
movsd %xmm0, -0x90(%rbp)
movq -0x8(%rbp), %rdi
addq $0x98, %rdi
callq 0x288f0
movq %rax, -0x98(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x28b90
movb $0x0, -0xd9(%rbp)
movb $0x0, -0x129(%rbp)
testb $0x1, %al
jne 0x1cdd6
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x268(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x28ca0
movq -0x260(%rbp), %rdi
movq %rax, -0x258(%rbp)
callq 0x28ca0
movq -0x258(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %rdx
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x28c60
movq -0x250(%rbp), %rdi
movq -0x248(%rbp), %rsi
movb $0x1, -0xd9(%rbp)
callq 0x28bd0
movq %rax, -0x240(%rbp)
jmp 0x1cd9e
movq -0x240(%rbp), %rdi
callq 0x27660
movsd %xmm0, -0x270(%rbp)
jmp 0x1cdb4
movsd -0x270(%rbp), %xmm0
movsd -0x268(%rbp), %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x271(%rbp)
jbe 0x1cefd
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
callq 0x28d10
movq %rax, -0x280(%rbp)
jmp 0x1cdef
movq -0x280(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x28cd0
movb %al, -0x281(%rbp)
jmp 0x1ce15
movb -0x281(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x282(%rbp)
jne 0x1cef1
jmp 0x1ce2e
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x2a0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x28d40
movq %rax, -0x290(%rbp)
jmp 0x1ce5b
movq -0x290(%rbp), %rax
movq %rax, -0x2b0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x28d40
movq %rax, -0x2a8(%rbp)
jmp 0x1ce7b
movq -0x2b0(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
addq $0x20, %rdx
leaq -0x128(%rbp), %rdi
callq 0x28c60
jmp 0x1ce9b
movq -0x298(%rbp), %rdi
movb $0x1, -0x129(%rbp)
leaq -0x128(%rbp), %rsi
callq 0x28bd0
movq %rax, -0x2b8(%rbp)
jmp 0x1cebe
movq -0x2b8(%rbp), %rdi
callq 0x27660
movsd %xmm0, -0x2c0(%rbp)
jmp 0x1ced4
movsd -0x2c0(%rbp), %xmm0
movsd -0x2a0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x282(%rbp)
movb -0x282(%rbp), %al
movb %al, -0x271(%rbp)
movb -0x271(%rbp), %al
movb %al, -0x2c1(%rbp)
testb $0x1, -0x129(%rbp)
jne 0x1cf14
jmp 0x1cf20
leaq -0x128(%rbp), %rdi
callq 0x267e0
testb $0x1, -0xd9(%rbp)
jne 0x1cf2b
jmp 0x1cf37
leaq -0xd8(%rbp), %rdi
callq 0x267e0
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x1cf46
jmp 0x1d17a
movq -0x220(%rbp), %rsi
movq -0x8(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x2d8(%rbp)
leaq -0x150(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x27920
movq -0x2d8(%rbp), %rdi
movq -0x2d0(%rbp), %rsi
callq 0x28d70
jmp 0x1cf86
leaq -0x150(%rbp), %rdi
callq 0x10460
movq -0x220(%rbp), %rsi
movq -0x8(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x2e8(%rbp)
leaq -0x170(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x27950
movq -0x2e8(%rbp), %rdi
movq -0x2e0(%rbp), %rsi
callq 0x28e00
jmp 0x1cfd2
leaq -0x170(%rbp), %rdi
callq 0x10460
movq -0x220(%rbp), %rsi
movq -0x8(%rbp), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x27920
movq -0x220(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x27950
jmp 0x1d011
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
callq 0x28f40
jmp 0x1d02d
movq -0x2f0(%rbp), %rsi
leaq -0x200(%rbp), %rdi
leaq -0x1b0(%rbp), %rdx
callq 0x28e90
jmp 0x1d049
leaq -0x1b0(%rbp), %rdi
callq 0x28f70
leaq -0x1f0(%rbp), %rdi
callq 0x10460
leaq -0x1d0(%rbp), %rdi
callq 0x10460
jmp 0x1d17a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x10460
jmp 0x1d183
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x10460
jmp 0x1d183
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1d0dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
testb $0x1, -0x129(%rbp)
jne 0x1d0ce
jmp 0x1d0da
leaq -0x128(%rbp), %rdi
callq 0x267e0
jmp 0x1d0dc
testb $0x1, -0xd9(%rbp)
jne 0x1d0e7
jmp 0x1d0f3
leaq -0xd8(%rbp), %rdi
callq 0x267e0
jmp 0x1d183
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x10460
jmp 0x1d183
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x10460
jmp 0x1d183
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1d16c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1d160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x28f70
leaq -0x1f0(%rbp), %rdi
callq 0x10460
leaq -0x1d0(%rbp), %rdi
callq 0x10460
jmp 0x1d183
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x10cc0
nopl (%rax)