// File: riyadparvez[P]louvain-method/graph_binary.cpp
// Function: Graph::check_symmetry()
bool
Graph::check_symmetry() {
  int error=0;
  for (unsigned int node=0 ; node<nb_nodes ; node++) {
    pair<vector<unsigned int>::iterator, vector<float>::iterator > p = neighbors(node);
    for (unsigned int i=0 ; i<nb_neighbors(node) ; i++) {
      unsigned int neigh = *(p.first+i);
      float weight = *(p.second+i);
      
      pair<vector<unsigned int>::iterator, vector<float>::iterator > p_neigh = neighbors(neigh);
      for (unsigned int j=0 ; j<nb_neighbors(neigh) ; j++) {
	unsigned int neigh_neigh = *(p_neigh.first+j);
	float neigh_weight = *(p_neigh.second+j);

	if (node==neigh_neigh && weight!=neigh_weight) {
	  cout << node << " " << neigh << " " << weight << " " << neigh_weight << endl;
	  if (error++==10)
	    exit(0);
	}
      }
    }
  }
  return (error==0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x78(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl (%rcx), %eax
jae 0x317f
movq -0x78(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x3ad0
movq %rax, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x78(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x10(%rbp), %esi
callq 0x3c80
movl %eax, %ecx
movl -0x7c(%rbp), %eax
cmpl %ecx, %eax
jae 0x316f
leaq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x3d40
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3d80
movl (%rax), %eax
movl %eax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
addq $0x8, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x3dc0
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3e00
movq -0x78(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movl -0x28(%rbp), %esi
callq 0x3ad0
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x78(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x28(%rbp), %esi
callq 0x3c80
movl %eax, %ecx
movl -0x80(%rbp), %eax
cmpl %ecx, %eax
jae 0x315f
leaq -0x50(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, %esi
callq 0x3d40
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3d80
movl (%rax), %eax
movl %eax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
addq $0x8, %rdi
movl -0x54(%rbp), %eax
movl %eax, %esi
callq 0x3dc0
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3e00
movss (%rax), %xmm0
movss %xmm0, -0x64(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x58(%rbp), %eax
jne 0x314f
movss -0x34(%rbp), %xmm0
ucomiss -0x64(%rbp), %xmm0
jne 0x30c6
jp 0x30c6
jmp 0x314f
movl -0x10(%rbp), %esi
movq 0x1cf00(%rip), %rdi     # 0x1ffd0
callq 0x2250
movq %rax, %rdi
leaq 0x125c8(%rip), %rsi     # 0x156a7
callq 0x2190
movq %rax, %rdi
movl -0x28(%rbp), %esi
callq 0x2250
movq %rax, %rdi
leaq 0x125ae(%rip), %rsi     # 0x156a7
callq 0x2190
movq %rax, %rdi
movss -0x34(%rbp), %xmm0
callq 0x2130
movq %rax, %rdi
leaq 0x12592(%rip), %rsi     # 0x156a7
callq 0x2190
movq %rax, %rdi
movss -0x64(%rbp), %xmm0
callq 0x2130
movq %rax, %rdi
movq 0x1ce8f(%rip), %rsi     # 0x1ffc0
callq 0x21d0
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0xa, %eax
jne 0x314d
xorl %edi, %edi
callq 0x2200
jmp 0x314f
jmp 0x3151
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3041
jmp 0x3161
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2fbf
jmp 0x3171
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2f95
cmpl $0x0, -0xc(%rbp)
sete %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)