// File: riyadparvez[P]louvain-method/community.cpp
// Function: Community::partition2graph()
void
Community::partition2graph() {
  vector<int> renumber(size, -1);
  for (int node=0 ; node<size ; node++) {
    renumber[n2c[node]]++;
  }

  int final=0;
  for (int i=0 ; i<size ; i++)
    if (renumber[i]!=-1)
      renumber[i]=final++;


  for (int i=0 ; i<size ; i++) {
    pair<vector<unsigned int>::iterator, vector<float>::iterator> p = g.neighbors(i);

    int deg = g.nb_neighbors(i);
    for (int j=0 ; j<deg ; j++) {
      int neigh = *(p.first+j);
      cout << renumber[n2c[i]] << " " << renumber[n2c[neigh]] << endl;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movslq 0xb0(%rax), %rax
movq %rax, -0x80(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
leaq -0x25(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x4130
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rcx
leaq -0x20(%rbp), %rdi
leaq -0x24(%rbp), %rdx
callq 0xa5d0
jmp 0x8af0
leaq -0x25(%rbp), %rdi
callq 0x7290
movl $0x0, -0x38(%rbp)
movq -0x88(%rbp), %rcx
movl -0x38(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jge 0x8b61
movq -0x88(%rbp), %rdi
addq $0xb8, %rdi
movslq -0x38(%rbp), %rsi
callq 0x3ab0
movslq (%rax), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3ab0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x8b00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x25(%rbp), %rdi
callq 0x7290
jmp 0x8d5e
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x88(%rbp), %rcx
movl -0x40(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jge 0x8bc4
movslq -0x40(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3ab0
cmpl $-0x1, (%rax)
je 0x8bb7
movl -0x3c(%rbp), %eax
movl %eax, -0x8c(%rbp)
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movslq -0x40(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3ab0
movl -0x8c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x8bb9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x8b6f
movl $0x0, -0x44(%rbp)
movq -0x88(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jge 0x8d4c
movq -0x88(%rbp), %rdi
addq $0x38, %rdi
movl -0x44(%rbp), %esi
callq 0x3ad0
movq %rdx, -0xa0(%rbp)
movq %rax, -0x98(%rbp)
jmp 0x8c04
movq -0x88(%rbp), %rdi
movq -0xa0(%rbp), %rax
movq -0x98(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0x50(%rbp)
addq $0x38, %rdi
movl -0x44(%rbp), %esi
callq 0x3c80
movl %eax, -0xa4(%rbp)
jmp 0x8c35
movl -0xa4(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x8d3c
movslq -0x60(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x3d40
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3d80
movq -0x88(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x64(%rbp)
addq $0xb8, %rdi
movslq -0x44(%rbp), %rsi
callq 0x3ab0
movslq (%rax), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3ab0
movl (%rax), %esi
movq 0x17334(%rip), %rdi     # 0x1ffd0
callq 0x22f0
movq %rax, -0xb0(%rbp)
jmp 0x8caa
movq -0xb0(%rbp), %rdi
leaq 0xc9ef(%rip), %rsi      # 0x156a7
callq 0x2190
movq %rax, -0xb8(%rbp)
jmp 0x8cc6
movq -0x88(%rbp), %rdi
addq $0xb8, %rdi
movslq -0x64(%rbp), %rsi
callq 0x3ab0
movslq (%rax), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3ab0
movq -0xb8(%rbp), %rdi
movl (%rax), %esi
callq 0x22f0
movq %rax, -0xc0(%rbp)
jmp 0x8d00
movq -0xc0(%rbp), %rdi
movq 0x172b2(%rip), %rsi     # 0x1ffc0
callq 0x21d0
jmp 0x8d15
jmp 0x8d17
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x8c45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3640
jmp 0x8d5e
jmp 0x8d3e
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8bcb
leaq -0x20(%rbp), %rdi
callq 0x3640
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x2300
nopw (%rax,%rax)