// File: Kingsford-Group[P]ghost2/src/alignmentExtender.hpp
// Function: adjustWeights(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>>*)
void adjustWeights(Graph &g1, Graph &g2, bmap *align, vector<D_alpha> *matches){
  for(int i = 0; i < matches->size(); i++){
    int count = 0;
    vlist *adj1 = g1.neighbors2((*matches)[i].get_n1());
    vlist *adj2 = g2.neighbors2((*matches)[i].get_n2());
    for(auto it = adj1->begin(); it != adj1->end(); it++){
      auto mapped = align->left.find(*it);
      if(mapped != align->left.end() && adj2->find(mapped->second) != adj2->end()) count++;
    }
    D_alpha d = (*matches)[i];
    d.set_da(d.get_da() / (count/2.0 + 1));
    (*matches)[i] = d;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x20(%rbp), %rdi
callq 0x27750
movq %rax, %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
jae 0x1cbcc
movl $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x287d0
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x27920
movq -0x130(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x120(%rbp)
jmp 0x1c927
leaq -0x50(%rbp), %rdi
callq 0x10460
movq -0x120(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x287d0
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x27950
movq -0x148(%rbp), %rdi
movq -0x140(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x138(%rbp)
jmp 0x1c985
leaq -0x88(%rbp), %rdi
callq 0x10460
movq -0x138(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rdi
callq 0x23730
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rdi
callq 0x23770
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x1c9d8
jmp 0x1cb0a
movq -0x18(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x158(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x23830
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0x287f0
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x288f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x288b0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x149(%rbp)
jne 0x1ca46
jmp 0x1caa0
movq -0x68(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x28920
movq -0x160(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x24db0
movq %rax, -0xb0(%rbp)
movq -0x68(%rbp), %rdi
callq 0x23770
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x23800
movb %al, -0x149(%rbp)
movb -0x149(%rbp), %al
testb $0x1, %al
jne 0x1caac
jmp 0x1caee
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1caee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10460
jmp 0x1cbd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x10460
jmp 0x1cbd5
jmp 0x1caf0
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
callq 0x237c0
movq %rax, -0xc0(%rbp)
jmp 0x1c9ac
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x287d0
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x28950
movq -0x170(%rbp), %rdi
callq 0x27660
movsd %xmm0, -0x168(%rbp)
jmp 0x1cb43
movsd -0x168(%rbp), %xmm0
cvtsi2sdl -0x28(%rbp), %xmm1
movsd 0x9f570(%rip), %xmm2    # 0xbc0c8
mulsd %xmm2, %xmm1
movsd 0x9f50c(%rip), %xmm2    # 0xbc070
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq -0x110(%rbp), %rdi
callq 0x289d0
jmp 0x1cb7a
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x287d0
movq %rax, %rdi
leaq -0x110(%rbp), %rsi
callq 0x289f0
jmp 0x1cb98
leaq -0x110(%rbp), %rdi
callq 0x27fc0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1c8b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x27fc0
jmp 0x1cbd5
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x10cc0
nop