// File: Kingsford-Group[P]ghost2/src/localImprove.hpp
// Function: move::calcScores(Graph*, Graph*, 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>>>, double, 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, double>>>*, 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>*)
void calcScores(Graph *G, Graph *H, blastmap *dists, bmap *f)
  {
    s0 = s1 = s2 = 0;
    if(u != up){
      vlist *neighborsu = G->neighbors2(u);
      vlist *neighborsw = H->neighbors2(w);
      vlist *neighborsv = H->neighbors2(v);
      vlist *neighborsup = up == "" ? NULL : G->neighbors2(up);
      //Go thru all the edges that u is a part of, to see what changes
      for(auto it = neighborsu->begin(); it != neighborsu->end(); it++){
        auto mapped = f->left.find(*it);
        if(mapped != f->left.end()){
          string s = mapped->second;
          //There is a matching edge to w that we are losing
          if(neighborsw->find(s) != neighborsw->end()) s0--;
          if(s == v) s = w;
          else if(s == w) s = v;
          //There is a matching edge to v that we are adding
          if(neighborsv->find(s) != neighborsv->end()) s0++;
        }
      }
      if(neighborsup){
        //Go thru all the edges that up is a part of, to see what changes
        for(auto it = neighborsup->begin(); it != neighborsup->end(); it++){
          auto mapped = f->left.find(*it);
          if(mapped != f->left.end()){
            string s = mapped->second;
            //There is a matching edge to v that we are losing
            if(neighborsv->find(s) != neighborsv->end()) s0--;
            if(s == v) s = w;
            else if(s == w) s = v;
            //There is a matching edge to w that we are adding
            if(neighborsw->find(s) != neighborsw->end()) s0++;
          }
        }
      }
    }

    if(dists){
      auto uw = dists->find(make_pair(u,w));
      auto uv = dists->find(make_pair(u,v));
      s1 = (uw != dists->end() ? uw->second : 1) - (uv != dists->end() ? uv->second : 1);

      if(up != ""){
        uw = dists->find(make_pair(up,w));
        uv = dists->find(make_pair(up,v));
        s2 = (uv != dists->end() ? uv->second : 1) - (uw != dists->end() ? uw->second : 1);
      }
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x90(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x88(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x80(%rdi)
movq %rdi, %rsi
addq $0x60, %rsi
callq 0x2b290
testb $0x1, %al
jne 0x29ff0
jmp 0x2a71f
movq -0x2f8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x310(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x10300
movq -0x310(%rbp), %rdi
movq -0x308(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x300(%rbp)
jmp 0x2a02e
leaq -0x50(%rbp), %rdi
callq 0x10460
movq -0x300(%rbp), %rax
movq -0x2f8(%rbp), %rsi
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x328(%rbp)
addq $0x20, %rsi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x10300
movq -0x328(%rbp), %rdi
movq -0x320(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x318(%rbp)
jmp 0x2a087
leaq -0x88(%rbp), %rdi
callq 0x10460
movq -0x318(%rbp), %rax
movq -0x2f8(%rbp), %rsi
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x340(%rbp)
addq $0x40, %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x10300
movq -0x340(%rbp), %rdi
movq -0x338(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x330(%rbp)
jmp 0x2a0e3
leaq -0xb0(%rbp), %rdi
callq 0x10460
movq -0x330(%rbp), %rax
movq -0x2f8(%rbp), %rdi
movq %rax, -0x90(%rbp)
addq $0x60, %rdi
leaq 0x9277d(%rip), %rsi     # 0xbc88c
callq 0x233d0
movb $0x0, -0xd9(%rbp)
testb $0x1, %al
jne 0x2a121
jmp 0x2a12c
xorl %eax, %eax
movq %rax, -0x348(%rbp)
jmp 0x2a188
movq -0x2f8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x360(%rbp)
addq $0x60, %rsi
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0x10300
movq -0x360(%rbp), %rdi
movq -0x358(%rbp), %rsi
movb $0x1, -0xd9(%rbp)
callq 0x24cb0
movq %rax, -0x350(%rbp)
jmp 0x2a178
movq -0x350(%rbp), %rax
movq %rax, -0x348(%rbp)
jmp 0x2a188
movq -0x348(%rbp), %rax
movq %rax, -0x368(%rbp)
testb $0x1, -0xd9(%rbp)
jne 0x2a1a1
jmp 0x2a1ad
leaq -0xd8(%rbp), %rdi
callq 0x10460
movq -0x368(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x30(%rbp), %rdi
callq 0x23730
movq %rax, -0xe8(%rbp)
movq -0x30(%rbp), %rdi
callq 0x23770
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x2a1f7
jmp 0x2a4a2
movq -0x28(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x370(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x23830
movq -0x370(%rbp), %rdi
movq %rax, %rsi
callq 0x287f0
movq %rax, -0xf8(%rbp)
movq -0x28(%rbp), %rdi
addq $0x98, %rdi
callq 0x288f0
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x288b0
testb $0x1, %al
jne 0x2a25d
jmp 0x2a486
leaq -0xf8(%rbp), %rdi
callq 0x28920
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x120(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x10300
movq -0x380(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x24db0
movq %rax, -0x378(%rbp)
jmp 0x2a29c
movq -0x378(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x68(%rbp), %rdi
callq 0x23770
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x2a2d6
jmp 0x2a393
movq -0x2f8(%rbp), %rax
movsd 0x91d93(%rip), %xmm0    # 0xbc078
addsd 0x80(%rax), %xmm0
movsd %xmm0, 0x80(%rax)
jmp 0x2a393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10460
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x10460
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x10460
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
testb $0x1, -0xd9(%rbp)
jne 0x2a365
jmp 0x2a371
leaq -0xd8(%rbp), %rdi
callq 0x10460
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x10460
jmp 0x2ab22
movq -0x2f8(%rbp), %rsi
addq $0x40, %rsi
leaq -0x120(%rbp), %rdi
callq 0x234b0
testb $0x1, %al
jne 0x2a3b0
jmp 0x2a3cb
movq -0x2f8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x120(%rbp), %rdi
callq 0x10070
jmp 0x2a3c9
jmp 0x2a405
movq -0x2f8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x120(%rbp), %rdi
callq 0x234b0
testb $0x1, %al
jne 0x2a3e8
jmp 0x2a403
movq -0x2f8(%rbp), %rsi
addq $0x40, %rsi
leaq -0x120(%rbp), %rdi
callq 0x10070
jmp 0x2a401
jmp 0x2a403
jmp 0x2a405
movq -0x90(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x24db0
movq %rax, -0x388(%rbp)
jmp 0x2a421
movq -0x388(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x90(%rbp), %rdi
callq 0x23770
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x2a45b
jmp 0x2a47a
movq -0x2f8(%rbp), %rax
movsd 0x91c06(%rip), %xmm0    # 0xbc070
addsd 0x80(%rax), %xmm0
movsd %xmm0, 0x80(%rax)
leaq -0x120(%rbp), %rdi
callq 0x10460
jmp 0x2a488
leaq -0xe8(%rbp), %rdi
xorl %esi, %esi
callq 0x237c0
movq %rax, -0x148(%rbp)
jmp 0x2a1cb
cmpq $0x0, -0xb8(%rbp)
je 0x2a71d
movq -0xb8(%rbp), %rdi
callq 0x23730
movq %rax, -0x150(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x23770
movq %rax, -0x158(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x2a4f2
jmp 0x2a71b
movq -0x28(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x390(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x23830
movq -0x390(%rbp), %rdi
movq %rax, %rsi
callq 0x287f0
movq %rax, -0x160(%rbp)
movq -0x28(%rbp), %rdi
addq $0x98, %rdi
callq 0x288f0
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x288b0
testb $0x1, %al
jne 0x2a558
jmp 0x2a6ff
leaq -0x160(%rbp), %rdi
callq 0x28920
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x188(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x10300
movq -0x3a0(%rbp), %rsi
movq -0x90(%rbp), %rdi
callq 0x24db0
movq %rax, -0x398(%rbp)
jmp 0x2a59a
movq -0x398(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x90(%rbp), %rdi
callq 0x23770
movq %rax, -0x198(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x2a5d4
jmp 0x2a612
movq -0x2f8(%rbp), %rax
movsd 0x91a95(%rip), %xmm0    # 0xbc078
addsd 0x80(%rax), %xmm0
movsd %xmm0, 0x80(%rax)
jmp 0x2a612
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x10460
jmp 0x2ab22
movq -0x2f8(%rbp), %rsi
addq $0x40, %rsi
leaq -0x188(%rbp), %rdi
callq 0x234b0
testb $0x1, %al
jne 0x2a62f
jmp 0x2a64a
movq -0x2f8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x188(%rbp), %rdi
callq 0x10070
jmp 0x2a648
jmp 0x2a684
movq -0x2f8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x188(%rbp), %rdi
callq 0x234b0
testb $0x1, %al
jne 0x2a667
jmp 0x2a682
movq -0x2f8(%rbp), %rsi
addq $0x40, %rsi
leaq -0x188(%rbp), %rdi
callq 0x10070
jmp 0x2a680
jmp 0x2a682
jmp 0x2a684
movq -0x68(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x24db0
movq %rax, -0x3a8(%rbp)
jmp 0x2a69d
movq -0x3a8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x68(%rbp), %rdi
callq 0x23770
movq %rax, -0x1a8(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x2a6d4
jmp 0x2a6f3
movq -0x2f8(%rbp), %rax
movsd 0x9198d(%rip), %xmm0    # 0xbc070
addsd 0x80(%rax), %xmm0
movsd %xmm0, 0x80(%rax)
leaq -0x188(%rbp), %rdi
callq 0x10460
jmp 0x2a701
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
callq 0x237c0
movq %rax, -0x1b0(%rbp)
jmp 0x2a4c3
jmp 0x2a71d
jmp 0x2a71f
cmpq $0x0, -0x20(%rbp)
je 0x2ab19
movq -0x2f8(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x3c0(%rbp)
movq %rsi, %rdx
addq $0x20, %rdx
leaq -0x1f8(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x267a0
movq -0x3c0(%rbp), %rdi
movq -0x3b8(%rbp), %rsi
callq 0x278a0
movq %rax, -0x3b0(%rbp)
jmp 0x2a772
movq -0x3b0(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x267e0
movq -0x2f8(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x3d8(%rbp)
movq %rsi, %rdx
addq $0x40, %rdx
leaq -0x240(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x267a0
movq -0x3d8(%rbp), %rdi
movq -0x3d0(%rbp), %rsi
callq 0x278a0
movq %rax, -0x3c8(%rbp)
jmp 0x2a7d4
movq -0x3c8(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x267e0
movq -0x20(%rbp), %rdi
callq 0x279b0
movq %rax, -0x248(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x27a10
testb $0x1, %al
jne 0x2a817
jmp 0x2a832
leaq -0x1b8(%rbp), %rdi
callq 0x279d0
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x3e0(%rbp)
jmp 0x2a844
movsd 0x91836(%rip), %xmm0    # 0xbc070
movsd %xmm0, -0x3e0(%rbp)
jmp 0x2a844
movsd -0x3e0(%rbp), %xmm0
movsd %xmm0, -0x3e8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x279b0
movq %rax, -0x250(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x27a10
testb $0x1, %al
jne 0x2a87d
jmp 0x2a898
leaq -0x200(%rbp), %rdi
callq 0x279d0
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x3f0(%rbp)
jmp 0x2a8aa
movsd 0x917d0(%rip), %xmm0    # 0xbc070
movsd %xmm0, -0x3f0(%rbp)
jmp 0x2a8aa
movq -0x2f8(%rbp), %rdi
movsd -0x3e8(%rbp), %xmm0
movsd -0x3f0(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rdi)
addq $0x60, %rdi
leaq 0x91fb4(%rip), %rsi     # 0xbc88c
callq 0x23540
testb $0x1, %al
jne 0x2a8e6
jmp 0x2ab17
movq -0x2f8(%rbp), %rdx
movq -0x20(%rbp), %rax
movq %rax, -0x408(%rbp)
movq %rdx, %rsi
addq $0x60, %rsi
addq $0x20, %rdx
leaq -0x298(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x267a0
movq -0x408(%rbp), %rdi
movq -0x400(%rbp), %rsi
callq 0x278a0
movq %rax, -0x3f8(%rbp)
jmp 0x2a932
movq -0x3f8(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x267e0
movq -0x2f8(%rbp), %rdx
movq -0x20(%rbp), %rax
movq %rax, -0x420(%rbp)
movq %rdx, %rsi
addq $0x60, %rsi
addq $0x40, %rdx
leaq -0x2e0(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x267a0
movq -0x420(%rbp), %rdi
movq -0x418(%rbp), %rsi
callq 0x278a0
movq %rax, -0x410(%rbp)
jmp 0x2a9a6
movq -0x410(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x267e0
movq -0x20(%rbp), %rdi
callq 0x279b0
movq %rax, -0x2e8(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x27a10
testb $0x1, %al
jne 0x2a9f7
jmp 0x2aa12
leaq -0x200(%rbp), %rdi
callq 0x279d0
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x428(%rbp)
jmp 0x2aa24
movsd 0x91656(%rip), %xmm0    # 0xbc070
movsd %xmm0, -0x428(%rbp)
jmp 0x2aa24
movsd -0x428(%rbp), %xmm0
movsd %xmm0, -0x430(%rbp)
movq -0x20(%rbp), %rdi
callq 0x279b0
movq %rax, -0x2f0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x27a10
testb $0x1, %al
jne 0x2aa5d
jmp 0x2aa78
leaq -0x1b8(%rbp), %rdi
callq 0x279d0
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x438(%rbp)
jmp 0x2aa8a
movsd 0x915f0(%rip), %xmm0    # 0xbc070
movsd %xmm0, -0x438(%rbp)
jmp 0x2aa8a
movq -0x2f8(%rbp), %rax
movsd -0x430(%rbp), %xmm0
movsd -0x438(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x90(%rax)
jmp 0x2ab17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x267e0
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x267e0
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x267e0
jmp 0x2ab22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x267e0
jmp 0x2ab22
jmp 0x2ab19
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x10cc0
nopl (%rax,%rax)