// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r13, %rsi
leaq 0x28(%rsp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rcx
callq 0x3044
leaq 0x30(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
je 0x27cf
sarq $0x3, %rcx
imulq %r13, %rcx
movq 0x10(%rsp), %rdx
xorl %esi, %esi
movl $0x1, %edi
leaq (%rsi,%rsi,2), %r9
movq (%rax,%r9,8), %r8
movq 0x8(%rax,%r9,8), %r9
subq %r8, %r9
je 0x27c4
sarq $0x3, %r9
xorl %r10d, %r10d
movl %edi, (%rdx,%rsi,4)
movslq (%r8,%r10,8), %r11
movl %edi, (%rdx,%r11,4)
incq %r10
movl %r10d, %r11d
cmpq %r11, %r9
ja 0x27ae
incq %rsi
movl %esi, %r8d
cmpq %r8, %rcx
ja 0x2795
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x2807
xorl %r15d, %r15d
leaq 0x28(%rsp), %r14
leaq (%rax,%r15,4), %rsi
movq %r14, %rdi
callq 0x30c2
movl %r15d, (%rax)
incl %r15d
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
ja 0x27e1
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
je 0x28dc
xorl %eax, %eax
xorl %ebp, %ebp
movq 0x10(%rsp), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x28bf
movq (%rbx), %rdx
leaq (%rax,%rax,2), %rsi
movq (%rdx,%rsi,8), %rcx
cmpq %rcx, 0x8(%rdx,%rsi,8)
je 0x2892
movl $0x1, %r13d
shlq $0x3, %rax
leaq (%rax,%rax,2), %r15
xorl %r14d, %r14d
leaq (%rcx,%r14,8), %rsi
leaq 0x28(%rsp), %rdi
callq 0x30c2
movl (%rax), %eax
movq (%rbx), %rcx
movq (%rcx,%r15), %rcx
movl %eax, (%rcx,%r14,8)
movl %r13d, %r14d
movq (%rbx), %r12
movq (%r12,%r15), %rcx
movq 0x8(%r12,%r15), %rax
subq %rcx, %rax
sarq $0x3, %rax
incl %r13d
cmpq %r14, %rax
ja 0x284a
addq %r15, %r12
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
jmp 0x2896
leaq (%rdx,%rsi,8), %r12
movl %ebp, 0xc(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x3126
movslq (%rax), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq (%rbx), %rdi
movq %r12, %rsi
callq 0x318a
incl %ebp
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x3, %rcx
imulq %r13, %rcx
movq %rbp, %rax
cmpq %rbp, %rcx
ja 0x2818
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x291e
movl $0x1, %ebp
xorl %r15d, %r15d
leaq 0x28(%rsp), %r14
leaq (%rax,%r15,4), %rsi
movq %r14, %rdi
callq 0x30c2
movl (%rax), %ecx
movq 0x18(%rbx), %rax
movl %ecx, (%rax,%r15,4)
movl %ebp, %r15d
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %r15, %rcx
ja 0x28f3
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
movq %rbx, %rdi
callq 0x2fba
leaq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rsi
subq 0x18(%rbx), %rsi
sarq $0x2, %rsi
callq 0x32a8
leaq 0x28(%rsp), %rdi
callq 0x3334
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x296b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2982
jmp 0x2982
jmp 0x2982
jmp 0x2982
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3334
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x29a6
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0