// File: riyadparvez[P]louvain-method/graph.cpp
// Function: Graph::renumber(int)
void
Graph::renumber(int type) {
  vector<int> linked(links.size(),-1);
  map<int, int> renum;
  
  for (unsigned int i=0 ; i<links.size() ; i++) {
    for (unsigned int j=0 ; j<links[i].size() ; j++) {
      linked[i]=1;
      linked[links[i][j].first]=1;
    }
  }
  
  //TODO new rename
  for (unsigned int i=0 ; i<nodes.size() ; i++) {
      renum[nodes[i]]=i;
  }

  for (unsigned int i=0 ; i<links.size() ; i++) {
    if (linked[i]==1) {
      for (unsigned int j=0 ; j<links[i].size() ; j++) {
        links[i][j].first = renum[links[i][j].first];
      }
      links[renum[i]]=links[i];
    }
  }
  
  for (unsigned int i=0 ; i<nodes.size() ; i++) {
    nodes[i] = renum[nodes[i]];
  }
  links.resize(links.size());
  nodes.resize(nodes.size());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x36b0
movq %rax, -0xa0(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x3b30
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rcx
leaq -0x28(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x3b50
jmp 0x29ad
leaq -0x2d(%rbp), %rdi
callq 0x3bd0
leaq -0x70(%rbp), %rdi
callq 0x3bf0
movl $0x0, -0x74(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x74(%rbp), %eax
movq %rax, -0xb0(%rbp)
callq 0x36b0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2aa4
movl $0x0, -0x78(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x78(%rbp), %eax
movq %rax, -0xb8(%rbp)
movl -0x74(%rbp), %eax
movl %eax, %esi
callq 0x37b0
movq %rax, %rdi
callq 0x3c10
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2a94
movl -0x74(%rbp), %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x3c30
movq -0xa8(%rbp), %rdi
movl $0x1, (%rax)
movl -0x74(%rbp), %eax
movl %eax, %esi
callq 0x37b0
movq %rax, %rdi
movl -0x78(%rbp), %eax
movl %eax, %esi
callq 0x3c50
movslq (%rax), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3c30
movl $0x1, (%rax)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x29f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2d(%rbp), %rdi
callq 0x3bd0
jmp 0x2dd7
jmp 0x2a96
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x29c6
movl $0x0, -0x7c(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x7c(%rbp), %eax
movq %rax, -0xc0(%rbp)
addq $0x18, %rdi
callq 0x3c70
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2b41
movq -0xa8(%rbp), %rdi
movl -0x7c(%rbp), %eax
movl %eax, -0xcc(%rbp)
addq $0x18, %rdi
movl %eax, %esi
callq 0x3c30
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3c90
movq %rax, -0xc8(%rbp)
jmp 0x2b04
movq -0xc8(%rbp), %rax
movl -0xcc(%rbp), %ecx
movl %ecx, (%rax)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x2aab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4130
leaq -0x28(%rbp), %rdi
callq 0x3a70
jmp 0x2dd7
movl $0x0, -0x80(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x80(%rbp), %eax
movq %rax, -0xd8(%rbp)
callq 0x36b0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2cd1
movl -0x80(%rbp), %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x3c30
cmpl $0x1, (%rax)
jne 0x2cc1
movl $0x0, -0x84(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x84(%rbp), %eax
movq %rax, -0xe0(%rbp)
movl -0x80(%rbp), %eax
movl %eax, %esi
callq 0x37b0
movq %rax, %rdi
callq 0x3c10
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2c4d
movq -0xa8(%rbp), %rdi
movl -0x80(%rbp), %eax
movl %eax, %esi
callq 0x37b0
movq %rax, %rdi
movl -0x84(%rbp), %eax
movl %eax, %esi
callq 0x3c50
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3c90
movq %rax, -0xe8(%rbp)
jmp 0x2c01
movq -0xa8(%rbp), %rdi
movq -0xe8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xec(%rbp)
movl -0x80(%rbp), %eax
movl %eax, %esi
callq 0x37b0
movq %rax, %rdi
movl -0x84(%rbp), %eax
movl %eax, %esi
callq 0x3c50
movl -0xec(%rbp), %ecx
movl %ecx, (%rax)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x2b92
movq -0xa8(%rbp), %rdi
movl -0x80(%rbp), %eax
movl %eax, %esi
callq 0x37b0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movq %rcx, -0x108(%rbp)
movq %rax, -0x100(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3d70
movq %rax, -0xf8(%rbp)
jmp 0x2c98
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rax
movslq (%rax), %rsi
callq 0x37b0
movq -0x108(%rbp), %rsi
movq %rax, %rdi
callq 0x3e50
jmp 0x2cbf
jmp 0x2cc1
jmp 0x2cc3
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x2b48
movl $0x0, -0x8c(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x8c(%rbp), %eax
movq %rax, -0x110(%rbp)
addq $0x18, %rdi
callq 0x3c70
movq %rax, %rcx
movq -0x110(%rbp), %rax
cmpq %rcx, %rax
jae 0x2d77
movq -0xa8(%rbp), %rdi
addq $0x18, %rdi
movl -0x8c(%rbp), %eax
movl %eax, %esi
callq 0x3c30
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3c90
movq %rax, -0x118(%rbp)
jmp 0x2d34
movq -0xa8(%rbp), %rdi
movq -0x118(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x11c(%rbp)
addq $0x18, %rdi
movl -0x8c(%rbp), %eax
movl %eax, %esi
callq 0x3c30
movl -0x11c(%rbp), %ecx
movl %ecx, (%rax)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x2cdb
movq -0xa8(%rbp), %rdi
callq 0x36b0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x3720
jmp 0x2d94
movq -0xa8(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x128(%rbp)
callq 0x3c70
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x40a0
jmp 0x2dbc
leaq -0x70(%rbp), %rdi
callq 0x4130
leaq -0x28(%rbp), %rdi
callq 0x3a70
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2260