// File: /workspace/github_cpp_makefile_star2_O2/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), %rax
subq (%rdi), %rax
pushq $0x18
popq %r12
cqto
idivq %r12
leaq 0x28(%rsp), %rdx
orl $-0x1, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rcx
movq %rax, %rsi
callq 0x2d1c
leaq 0x30(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
cqto
idivq %r12
xorl %edx, %edx
pushq $0x1
popq %rsi
movl %edx, %edx
cmpq %rdx, %rax
jbe 0x267b
imulq $0x18, %rdx, %r8
movq (%rcx,%r8), %rdi
movq 0x8(%rcx,%r8), %r8
subq %rdi, %r8
sarq $0x3, %r8
xorl %r10d, %r10d
movq 0x10(%rsp), %r9
movl %r10d, %r10d
cmpq %r10, %r8
jbe 0x2677
movl %esi, (%r9,%rdx,4)
movslq (%rdi,%r10,8), %r11
movl %esi, (%r9,%r11,4)
incl %r10d
jmp 0x265e
incl %edx
jmp 0x263b
leaq 0x18(%rbx), %r14
xorl %ebp, %ebp
leaq 0x28(%rsp), %r15
movl %ebp, %eax
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
jbe 0x26ae
leaq (%rcx,%rax,4), %rsi
movq %r15, %rdi
callq 0x2d72
movl %ebp, (%rax)
incl %ebp
jmp 0x2686
movq %r14, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x28(%rsp), %r15
movl %ebp, %ecx
movq (%rbx), %r13
movq 0x8(%rbx), %rax
subq %r13, %rax
cqto
idivq %r12
cmpq %rcx, %rax
jbe 0x274b
movq 0x10(%rsp), %rax
cmpl $0x1, (%rax,%rcx,4)
jne 0x2744
imulq $0x18, %rcx, %r12
movq (%r13,%r12), %rax
xorl %ecx, %ecx
movl %ecx, %r14d
movq 0x8(%r13,%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x271a
leaq (%rax,%r14,8), %rsi
movq %r15, %rdi
callq 0x2d72
movl (%rax), %ecx
movq (%rbx), %r13
movq (%r13,%r12), %rax
movl %ecx, (%rax,%r14,8)
leal 0x1(%r14), %ecx
jmp 0x26e6
movl %ebp, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2dc0
addq %r12, %r13
movslq (%rax), %rax
imulq $0x18, %rax, %rdi
addq (%rbx), %rdi
movq %r13, %rsi
callq 0x2e0e
pushq $0x18
popq %r12
incl %ebp
jmp 0x26ba
movq 0x8(%rsp), %r13
movq (%r13), %rax
xorl %ecx, %ecx
leaq 0x28(%rsp), %r15
movl %ecx, %r14d
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
jbe 0x278a
leaq (%rax,%r14,4), %rsi
movq %r15, %rdi
callq 0x2d72
movl (%rax), %ecx
movq (%r13), %rax
movl %ecx, (%rax,%r14,4)
leal 0x1(%r14), %ecx
jmp 0x275b
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
idivq %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2cc4
movq 0x20(%rbx), %rsi
subq 0x18(%rbx), %rsi
sarq $0x2, %rsi
movq %r13, %rdi
callq 0x2ece
leaq 0x28(%rsp), %rdi
callq 0x2f62
leaq 0x10(%rsp), %rdi
callq 0x3074
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27e0
jmp 0x27e0
jmp 0x27e0
jmp 0x27e0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2f62
leaq 0x10(%rsp), %rdi
callq 0x3074
movq %rbx, %rdi
callq 0x2240
nop