// File: Kingsford-Group[P]ghost2/src/alignGraphs.hpp
// Function: printICS(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>&)
void printICS(Graph& G, Graph& H, bmap& result)
{
  int matchingEdges = 0;
  int edgesH = 0;
  for(auto it = result.left.begin(); it != result.left.end(); it++)
  {
    vlist *adj1 = G.neighbors2(it->first);
    vlist *adj2 = H.neighbors2(it->second);
    for(auto it2 = adj1->begin(); it2 != adj1->end(); it2++){
      auto f_a = result.left.find(*it2);
      if(f_a != result.left.end() && adj2->find(f_a->second) != adj2->end()){
        matchingEdges++;
        if(*it2 == it->first) matchingEdges++; //Double count self loops
      }
    }
    for(auto it2 = adj2->begin(); it2 != adj2->end(); it2++) 
      if(result.right.find(*it2) != result.right.end()){
        edgesH++;
        if(*it2 == it->second) edgesH++; //Double count self loops
      }
  }
  vector<string> nodesG = G.nodes();
  int edgesG = 0;
  for(auto it = nodesG.begin(); it != nodesG.end(); it++){
    vlist *n = G.neighbors2(*it);
    edgesG += n->size();
    if(n->find(*it) != n->end()) edgesG++; //Double count self loops
  }

  double ec = ((double)matchingEdges / edgesG) * 100.0;
  double ics = ((double)matchingEdges / edgesH) * 100.0;
  cout << "Edge correctness " << matchingEdges/2 << " / " << edgesG/2 << " = " << ec << "\%\n";
  cout << "ICS = " << ics << "\%\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x29d90
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x288f0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x288b0
testb $0x1, %al
jne 0x1f183
jmp 0x1f502
movq -0x8(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x28920
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x10300
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x180(%rbp)
jmp 0x1f1c6
leaq -0x58(%rbp), %rdi
callq 0x10460
movq -0x180(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x28920
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x10300
movq -0x1a8(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x198(%rbp)
jmp 0x1f224
leaq -0x90(%rbp), %rdi
callq 0x10460
movq -0x198(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rdi
callq 0x23730
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rdi
callq 0x23770
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x1f277
jmp 0x1f3e5
movq -0x18(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x1b8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x23830
movq -0x1b8(%rbp), %rdi
movq %rax, %rsi
callq 0x287f0
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x288f0
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x288b0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x1a9(%rbp)
jne 0x1f2e5
jmp 0x1f33f
movq -0x70(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x28920
movq -0x1c0(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x24db0
movq %rax, -0xb8(%rbp)
movq -0x70(%rbp), %rdi
callq 0x23770
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x23800
movb %al, -0x1a9(%rbp)
movb -0x1a9(%rbp), %al
testb $0x1, %al
jne 0x1f34b
jmp 0x1f3c9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x23830
movq %rax, -0x1c8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x28920
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0x234b0
testb $0x1, %al
jne 0x1f385
jmp 0x1f3c7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f3c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10460
jmp 0x1f819
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x10460
jmp 0x1f819
jmp 0x1f3c9
jmp 0x1f3cb
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x237c0
movq %rax, -0xc8(%rbp)
jmp 0x1f24b
movq -0x70(%rbp), %rdi
callq 0x23730
movq %rax, -0xd0(%rbp)
movq -0x70(%rbp), %rdi
callq 0x23770
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x1f421
jmp 0x1f4e9
movq -0x18(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x1d0(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x23830
movq -0x1d0(%rbp), %rdi
movq %rax, %rsi
callq 0x28a90
movq %rax, -0xe0(%rbp)
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
callq 0x28d10
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x28f90
testb $0x1, %al
jne 0x1f484
jmp 0x1f4cd
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x23830
movq %rax, -0x1d8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x28920
movq -0x1d8(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x234b0
testb $0x1, %al
jne 0x1f4c2
jmp 0x1f4cb
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1f4cd
jmp 0x1f4cf
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
callq 0x237c0
movq %rax, -0xf0(%rbp)
jmp 0x1f3f5
jmp 0x1f4eb
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x29e30
movq %rax, -0xf8(%rbp)
jmp 0x1f159
movq -0x8(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x12320
movl $0x0, -0x114(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x29e60
movq %rax, -0x120(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x29ed0
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x29e90
testb $0x1, %al
jne 0x1f55e
jmp 0x1f6a0
movq -0x8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x29f00
movq %rax, %rsi
leaq -0x150(%rbp), %rdi
callq 0x10300
jmp 0x1f586
movq -0x1e0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x24cb0
movq %rax, -0x1e8(%rbp)
jmp 0x1f5a2
leaq -0x150(%rbp), %rdi
callq 0x10460
movq -0x1e8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x25040
movq %rax, %rcx
movl -0x114(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x114(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x29f00
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
callq 0x24db0
movq %rax, -0x1f0(%rbp)
jmp 0x1f60b
movq -0x1f0(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x130(%rbp), %rdi
callq 0x23770
movq %rax, -0x160(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x23800
testb $0x1, %al
jne 0x1f645
jmp 0x1f684
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x1f684
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1f80d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x10460
jmp 0x1f80d
jmp 0x1f686
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
callq 0x29f20
movq %rax, -0x168(%rbp)
jmp 0x1f52f
cvtsi2sdl -0x1c(%rbp), %xmm0
cvtsi2sdl -0x114(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd 0x9c99f(%rip), %xmm1    # 0xbc058
mulsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
cvtsi2sdl -0x1c(%rbp), %xmm0
cvtsi2sdl -0x20(%rbp), %xmm2
divsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x178(%rbp)
movq 0x1118b2(%rip), %rdi    # 0x130f98
leaq 0x9d289(%rip), %rsi     # 0xbc976
callq 0x106c0
movq %rax, -0x200(%rbp)
jmp 0x1f6fb
movq -0x200(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %eax, %esi
sarl %esi
callq 0x10ca0
movq %rax, -0x208(%rbp)
jmp 0x1f71c
movq -0x208(%rbp), %rdi
leaq 0x9d25e(%rip), %rsi     # 0xbc988
callq 0x106c0
movq %rax, -0x210(%rbp)
jmp 0x1f738
movq -0x210(%rbp), %rdi
movl -0x114(%rbp), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %eax, %esi
sarl %esi
callq 0x10ca0
movq %rax, -0x218(%rbp)
jmp 0x1f75c
movq -0x218(%rbp), %rdi
leaq 0x9d228(%rip), %rsi     # 0xbc992
callq 0x106c0
movq %rax, -0x220(%rbp)
jmp 0x1f778
movq -0x220(%rbp), %rdi
movsd -0x170(%rbp), %xmm0
callq 0x10dc0
movq %rax, -0x228(%rbp)
jmp 0x1f795
movq -0x228(%rbp), %rdi
leaq 0x9d1e9(%rip), %rsi     # 0xbc98c
callq 0x106c0
jmp 0x1f7aa
movq 0x1117e7(%rip), %rdi    # 0x130f98
leaq 0x9d1d7(%rip), %rsi     # 0xbc98f
callq 0x106c0
movq %rax, -0x230(%rbp)
jmp 0x1f7c6
movq -0x230(%rbp), %rdi
movsd -0x178(%rbp), %xmm0
callq 0x10dc0
movq %rax, -0x238(%rbp)
jmp 0x1f7e3
movq -0x238(%rbp), %rdi
leaq 0x9d19b(%rip), %rsi     # 0xbc98c
callq 0x106c0
jmp 0x1f7f8
leaq -0x110(%rbp), %rdi
callq 0x236d0
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x110(%rbp), %rdi
callq 0x236d0
movq -0x60(%rbp), %rdi
callq 0x10cc0
nopw %cs:(%rax,%rax)