// File: /workspace/github_cpp_makefile_star2_O1/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, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1130
movq 0x2c08(%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 0x15bb
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
leaq 0x40(%rsp), %rbx
leaq 0x28(%rsp), %r14
leaq 0x24(%rsp), %r15
movq %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 0x15ab
cmpl $0x0, 0x28(%rsp)
jne 0x157a
leal 0x2(%r13), %eax
movslq %eax, %rsi
movq %r12, %rdi
callq 0x1924
incl %r13d
movslq %r13d, %rax
movq (%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x15a3
movl 0x24(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x15ab
movq %r15, %rdx
callq 0x1c3c
movq 0x40(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x60(%rsp,%rax)
je 0x153b
movl 0x2b27(%rip), %eax      # 0x40e8
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x1766
testl %eax, %eax
js 0x1749
movq (%rsp), %rcx
movq 0x8(%rsp), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rsi
cmpq %rax, %rsi
jbe 0x1749
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
sarq $0x2, %rsi
leaq 0x28(%rsp), %rdi
leaq 0x24(%rsp), %rdx
callq 0x1960
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
cmpq %rcx, %rdx
je 0x1649
movq 0x28(%rsp), %rdi
xorl %r8d, %r8d
movl %r8d, (%rdi,%r8,4)
incq %r8
movl %r8d, %r9d
cmpq %r9, %rsi
ja 0x163a
cmpl $0x0, 0x2a98(%rip)      # 0x40e8
jle 0x1690
movq 0x28(%rsp), %rdi
xorl %r8d, %r8d
cmpq %rcx, %rdx
je 0x1681
leaq (%r8,%r8,2), %r9
movq (%rax,%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 0x166a
incq %r8
movslq 0x2a5d(%rip), %r9       # 0x40e8
cmpq %r9, %r8
jl 0x165a
movq (%rsp), %rax
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x1729
movl $0x1, %ebp
xorl %r15d, %r15d
movq 0x2920(%rip), %rbx      # 0x3fd0
leaq 0x953(%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 (%rsp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movl %ebp, %r15d
sarq $0x2, %rcx
incl %ebp
cmpq %r15, %rcx
ja 0x16b7
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18b7
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1120
jmp 0x18b7
movq 0x28a0(%rip), %rdi      # 0x3ff0
leaq 0xa8a(%rip), %rsi       # 0x21e1
movl $0x10, %edx
callq 0x1140
jmp 0x18b7
movq 0x2863(%rip), %rdi      # 0x3fd0
leaq 0xa4c(%rip), %rsi       # 0x21c0
movl $0x12, %edx
callq 0x1140
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq 0x2830(%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 0x8(%rsp), %rax
cmpq (%rsp), %rax
je 0x18b7
movl $0x1, %r14d
xorl %r13d, %r13d
movq 0x27e2(%rip), %rbx      # 0x3fd0
leaq 0x814(%rip), %r15       # 0x2009
leaq 0x9de(%rip), %r12       # 0x21da
movl $0x6, %edx
movq %rbx, %rdi
leaq 0x9c8(%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 (%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 0x8(%rsp), %rax
subq (%rsp), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
incl %r14d
cmpq %r13, %rax
ja 0x17fc
leaq 0x40(%rsp), %rdi
callq 0x1040
movq %rsp, %rdi
callq 0x19ea
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1906
jmp 0x1906
movq %rax, %rbx
jmp 0x1913
jmp 0x1906
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1909
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1120
jmp 0x1909
jmp 0x1906
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x1040
movq %rsp, %rdi
callq 0x19ea
movq %rbx, %rdi
callq 0x11a0
nop