// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r8, %r12
movq %rcx, 0x30(%rsp)
movq %rdx, %r15
movq %rsi, %r14
leaq 0x60(%rdi), %rsi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rdi)
andq $0x0, 0x90(%rdi)
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
callq 0x1ad96
testb %al, %al
je 0x1a839
leaq 0xd8(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0xe7a0
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b558
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xe290
leaq 0x20(%rbp), %r13
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xe7a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b558
movq %rax, 0x28(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xe290
leaq 0x40(%rbp), %r14
leaq 0x98(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0xe7a0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1b558
movq %rax, 0x20(%rsp)
leaq 0x98(%rsp), %rdi
callq 0xe290
leaq 0x26295(%rip), %rsi     # 0x408c8
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x18661
testb %al, %al
je 0x1a64f
movq $0x0, 0x8(%rsp)
jmp 0x1a67f
leaq 0x78(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0xe7a0
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x1b558
addq $0x30, %rax
movq %rax, 0x8(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xe290
movq 0x10(%rsp), %rax
leaq 0x80(%rax), %r15
addq $0x30, %rbx
addq $0x30, 0x28(%rsp)
addq $0x30, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1873a
movq %rax, %rbx
addq $0x98, %r12
leaq 0x38(%rsp), %rbp
testq %rbx, %rbx
je 0x1a768
leaq 0x10(%rbx), %rsi
movq %r12, %rdi
callq 0x19f1e
movq (%r12), %rcx
cmpq -0x8(%rcx), %rax
je 0x1a760
addq $0x20, %rax
movq %rbp, %rdi
movq %rax, %rsi
callq 0xe7a0
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x2910c
testq %rax, %rax
je 0x1a708
movsd (%r15), %xmm0
addsd 0x25975(%rip), %xmm0    # 0x40078
movsd %xmm0, (%r15)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x186a9
movq %r13, %rsi
testb %al, %al
jne 0x1a72c
movq %rbp, %rdi
movq %r13, %rsi
callq 0x186a9
movq %r14, %rsi
testb %al, %al
je 0x1a734
movq %rbp, %rdi
callq 0xe300
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x2910c
testq %rax, %rax
je 0x1a758
movsd (%r15), %xmm0
addsd 0x2591d(%rip), %xmm0    # 0x40070
movsd %xmm0, (%r15)
movq %rbp, %rdi
callq 0xe290
movq (%rbx), %rbx
jmp 0x1a6b2
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a839
callq 0x1873a
movq %rax, %rbx
leaq 0x38(%rsp), %rbp
testq %rbx, %rbx
je 0x1a839
leaq 0x10(%rbx), %rsi
movq %r12, %rdi
callq 0x19f1e
movq (%r12), %rcx
cmpq -0x8(%rcx), %rax
je 0x1a831
addq $0x20, %rax
movq %rbp, %rdi
movq %rax, %rsi
callq 0xe7a0
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x2910c
testq %rax, %rax
je 0x1a7d9
movsd (%r15), %xmm0
addsd 0x258a4(%rip), %xmm0    # 0x40078
movsd %xmm0, (%r15)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x186a9
movq %r13, %rsi
testb %al, %al
jne 0x1a7fd
movq %rbp, %rdi
movq %r13, %rsi
callq 0x186a9
movq %r14, %rsi
testb %al, %al
je 0x1a805
movq %rbp, %rdi
callq 0xe300
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x2910c
testq %rax, %rax
je 0x1a829
movsd (%r15), %xmm0
addsd 0x2584c(%rip), %xmm0    # 0x40070
movsd %xmm0, (%r15)
movq %rbp, %rdi
callq 0xe290
movq (%rbx), %rbx
jmp 0x1a783
movq 0x30(%rsp), %rbp
testq %rbp, %rbp
movq 0x10(%rsp), %r13
je 0x1a97c
leaq 0x20(%r13), %rbx
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x21726
movq %rbp, %rdi
movq %r14, %rsi
callq 0x38f6c
movq %rax, %r15
leaq 0x38(%rsp), %rdi
callq 0x19672
leaq 0x40(%r13), %r14
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x21726
movq %rbp, %rdi
movq %r12, %rsi
callq 0x38f6c
movq %rax, %r12
leaq 0x38(%rsp), %rdi
callq 0x19672
movsd 0x257be(%rip), %xmm0    # 0x40070
movapd %xmm0, %xmm1
testq %r15, %r15
je 0x1a8c1
movsd 0x50(%r15), %xmm1
testq %r12, %r12
je 0x1a8cd
movsd 0x50(%r12), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, 0x88(%r13)
leaq 0x25fe7(%rip), %rsi     # 0x408c8
movq 0x18(%rsp), %rdi
callq 0x186d2
testb %al, %al
je 0x1a97c
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq 0x18(%rsp), %r12
movq %r12, %rsi
movq %rbx, %rdx
callq 0x21726
movq %rbp, %rdi
movq %r15, %rsi
callq 0x38f6c
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x19672
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x21726
movq %rbp, %rdi
movq %r15, %rsi
callq 0x38f6c
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x19672
movsd 0x2571a(%rip), %xmm0    # 0x40070
movapd %xmm0, %xmm1
testq %r14, %r14
je 0x1a965
movsd 0x50(%r14), %xmm1
testq %rbx, %rbx
je 0x1a96f
movsd 0x50(%rbx), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, 0x90(%r13)
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x1a9e6
jmp 0x1a9c5
jmp 0x1a9c5
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x1a9e6
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x1a9e6
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x1a9e6
jmp 0x1a9c5
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x19672
jmp 0x1a9eb
jmp 0x1a9de
jmp 0x1a9de
jmp 0x1a9de
jmp 0x1a9de
jmp 0x1a9de
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xe290
movq %rbx, %rdi
callq 0xe9f0
nop