// File: /workspace/github_cpp_makefile_star2_O2/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 0x13c3
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1110
movq 0x2c4c(%rip), %rsi      # 0x4100
leaq 0x40(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x10a0
pushq $-0x1
popq %r13
leaq 0x40(%rsp), %rbx
leaq 0x28(%rsp), %r14
leaq 0x24(%rsp), %r15
movq %rsp, %r12
movq 0x40(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x60(%rsp,%rax)
jne 0x153b
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 0x14d7
cmpl $0x0, 0x28(%rsp)
jne 0x1526
leal 0x2(%r13), %eax
movslq %eax, %rsi
movq %r12, %rdi
callq 0x1790
incl %r13d
movslq %r13d, %rax
imulq $0x18, %rax, %rdi
addq (%rsp), %rdi
movq %r15, %rsi
callq 0x17c6
jmp 0x14d7
movl 0x2b9f(%rip), %ecx      # 0x40e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rcx
je 0x15ca
testl %ecx, %ecx
js 0x15b2
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
pushq $0x18
popq %rsi
cqto
idivq %rsi
cmpq %rcx, %rax
jbe 0x15b2
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x2, %rsi
leaq 0x28(%rsp), %rdi
leaq 0x24(%rsp), %rdx
callq 0x17e4
movq (%rsp), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rax
movq %rax, %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
xorl %edi, %edi
movq 0x28(%rsp), %r8
movl %edi, %r9d
cmpq %r9, %rsi
jbe 0x168d
movl %edi, (%r8,%r9,4)
incl %edi
jmp 0x159e
movq 0x2a37(%rip), %rdi      # 0x3ff0
leaq 0xc21(%rip), %rsi       # 0x21e1
callq 0x10e0
jmp 0x1730
movq 0x29ff(%rip), %rdi      # 0x3fd0
leaq 0xbe8(%rip), %rsi       # 0x21c0
callq 0x10e0
movq %rax, %rdi
movq 0x8(%rsp), %rax
subq (%rsp), %rax
pushq $0x18
popq %rbp
cqto
idivq %rbp
movq %rax, %rsi
callq 0x10b0
movq %rax, %rdi
callq 0x1070
xorl %ebx, %ebx
movq 0x29c6(%rip), %r14      # 0x3fd0
leaq 0xbc2(%rip), %r15       # 0x21d3
leaq 0x9f1(%rip), %r12       # 0x2009
leaq 0xbbb(%rip), %r13       # 0x21da
movl %ebx, %ebx
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
idivq %rbp
cmpq %rbx, %rax
jbe 0x1730
movq %r14, %rdi
movq %r15, %rsi
callq 0x10e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x10e0
movq (%rsp), %rcx
imulq $0x18, %rbx, %rdx
movq 0x8(%rcx,%rdx), %rsi
subq (%rcx,%rdx), %rsi
sarq $0x2, %rsi
movq %rax, %rdi
callq 0x10b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
incl %ebx
jmp 0x161f
xorl %edi, %edi
movslq 0x2a4a(%rip), %r8       # 0x40e0
cmpq %r8, %rdi
jge 0x16cb
imulq $0x18, %rdi, %r8
addq %rdx, %r8
xorl %r10d, %r10d
movq 0x28(%rsp), %r9
movl %r10d, %r10d
cmpq %r10, %rsi
jbe 0x16c6
movslq (%r9,%r10,4), %r11
movq (%r8), %rbx
movl (%rbx,%r11,4), %r11d
movl %r11d, (%r9,%r10,4)
incl %r10d
jmp 0x16aa
incq %rdi
jmp 0x168f
xorl %ebx, %ebx
movq 0x28fc(%rip), %r14      # 0x3fd0
leaq 0x92f(%rip), %r15       # 0x200a
subq %rcx, %rax
movl %ebx, %ebx
sarq $0x2, %rax
cmpq %rbx, %rax
jbe 0x1726
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
movq 0x28(%rsp), %rcx
movl (%rcx,%rbx,4), %esi
movq %rax, %rdi
callq 0x1180
movq %rax, %rdi
callq 0x1070
incl %ebx
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
jmp 0x16db
leaq 0x28(%rsp), %rdi
callq 0x1c88
leaq 0x40(%rsp), %rdi
callq 0x1030
movq %rsp, %rdi
callq 0x1836
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1772
jmp 0x1772
movq %rax, %rbx
jmp 0x177f
jmp 0x1772
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1c88
jmp 0x1775
jmp 0x1772
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x1030
movq %rsp, %rdi
callq 0x1836
movq %rbx, %rdi
callq 0x1190
nop