// File: /workspace/github_cpp_makefile_star2_O3/siolag161[P]louvain-original/main_hierarchy.cpp
// Function: main
int
main(int argc, char **argv) {
  parse_args(argc, argv);

  vector<vector<int> >levels;

  ifstream finput;
  finput.open(filename,fstream::in);

  int l=-1;
  while (!finput.eof()) {
    int node, nodecomm;
    finput >> node >> nodecomm;

    if (finput) {
      if (node==0) {
	l++;
	levels.resize(l+1);
      }
      levels[l].push_back(nodecomm);
    }
  }

  if (display_level==-1) {
    cout << "Number of levels: " << levels.size() << endl;
    for (unsigned int i=0 ; i<levels.size();i++)
      cout << "level " << i << ": " << levels[i].size() << " nodes" << endl;
  } else if (display_level<0 || (unsigned)display_level>=levels.size()) {
    cerr << "Incorrect level\n";
  } else {
    vector<int> n2c(levels[0].size());

    for (unsigned int i=0 ; i<levels[0].size() ; i++)
      n2c[i]=i;
    
    for (l=0 ; l<display_level ; l++)
      for (unsigned int node=0 ; node<levels[0].size() ; node++)
	n2c[node] = levels[l][n2c[node]];
    
    for (unsigned int node=0 ; node<levels[0].size() ; node++)
      cout << node << " " << n2c[node] << endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
callq 0x1403
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1130
movq 0x2c0c(%rip), %rsi      # 0x4108
leaq 0x40(%rsp), %rdi
movl $0x8, %edx
callq 0x10a0
movq 0x40(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x60(%rsp,%rax)
jne 0x15be
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
leaq 0x40(%rsp), %rbx
leaq 0x28(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1090
movq %rax, %rdi
movq %r15, %rsi
callq 0x1090
movq 0x40(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x60(%rsp,%rax)
jne 0x15aa
cmpl $0x0, 0x28(%rsp)
jne 0x1578
leal 0x2(%r13), %eax
movslq %eax, %rsi
movq %r12, %rdi
callq 0x1930
incl %r13d
movslq %r13d, %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x15a2
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x15aa
movq %r15, %rdx
callq 0x1c48
movq 0x40(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x60(%rsp,%rax)
je 0x1539
movl 0x2b24(%rip), %eax      # 0x40e8
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x176a
testl %eax, %eax
js 0x174d
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rsi
cmpq %rax, %rsi
jbe 0x174d
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
sarq $0x2, %rsi
leaq 0x28(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x196c
movq 0x10(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
cmpq %rax, %rdx
je 0x164e
movq 0x28(%rsp), %rdi
xorl %r8d, %r8d
movl %r8d, (%rdi,%r8,4)
incq %r8
movl %r8d, %r9d
cmpq %r9, %rsi
ja 0x163f
movl 0x2a93(%rip), %r9d      # 0x40e8
testl %r9d, %r9d
jle 0x169b
movq 0x28(%rsp), %rdi
xorl %r8d, %r8d
cmpq %rax, %rdx
je 0x1690
leaq (%r8,%r8,2), %r9
movq (%rcx,%r9,8), %r9
xorl %r10d, %r10d
movslq (%rdi,%r10,4), %r11
movl (%r9,%r11,4), %r11d
movl %r11d, (%rdi,%r10,4)
incq %r10
movl %r10d, %r11d
cmpq %r11, %rsi
ja 0x1672
movl 0x2a58(%rip), %r9d      # 0x40e8
incq %r8
movslq %r9d, %r10
cmpq %r10, %r8
jl 0x1662
cmpq %rax, %rdx
je 0x172d
movl $0x1, %ebp
xorl %r15d, %r15d
movq 0x291d(%rip), %rbx      # 0x3fd0
leaq 0x950(%rip), %r14       # 0x200a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1140
movq 0x28(%rsp), %rax
movl (%rax,%r15,4), %esi
movq %r12, %rdi
callq 0x1190
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movl %ebp, %r15d
sarq $0x2, %rcx
incl %ebp
cmpq %r15, %rcx
ja 0x16ba
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18bf
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1120
jmp 0x18bf
movq 0x289c(%rip), %rdi      # 0x3ff0
leaq 0xa86(%rip), %rsi       # 0x21e1
movl $0x10, %edx
callq 0x1140
jmp 0x18bf
movq 0x285f(%rip), %rdi      # 0x3fd0
leaq 0xa48(%rip), %rsi       # 0x21c0
movl $0x12, %edx
callq 0x1140
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq 0x282b(%rip), %rdi      # 0x3fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x18bf
movl $0x1, %r14d
xorl %r13d, %r13d
movq 0x27dc(%rip), %rbx      # 0x3fd0
leaq 0x80e(%rip), %r15       # 0x2009
leaq 0x9d8(%rip), %r12       # 0x21da
movl $0x6, %edx
movq %rbx, %rdi
leaq 0x9c2(%rip), %rsi       # 0x21d3
callq 0x1140
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10b0
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1140
movq 0x10(%rsp), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
movq 0x8(%rax,%rcx,8), %rsi
subq (%rax,%rcx,8), %rsi
sarq $0x2, %rsi
movq %rbp, %rdi
callq 0x10b0
movq %rax, %r13
movl $0x6, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1140
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
movl %r14d, %r13d
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
incl %r14d
cmpq %r13, %rax
ja 0x1802
leaq 0x40(%rsp), %rdi
callq 0x1040
leaq 0x10(%rsp), %rdi
callq 0x19f8
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1910
jmp 0x1910
movq %rax, %rbx
jmp 0x191d
jmp 0x1910
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1913
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1120
jmp 0x1913
jmp 0x1910
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x1040
leaq 0x10(%rsp), %rdi
callq 0x19f8
movq %rbx, %rdi
callq 0x11a0
nop