// File: /workspace/github_cpp_makefile_star2_O2/Kingsford-Group[P]ghost2/src/computeSpectralSignatures.hpp
// Function: computeSpectralSignatures(Graph*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void computeSpectralSignatures(Graph *input, int numHops, int numP, string mode)
{
  ptime t = bclock::local_time();
  if(numP < 1) numP = boost::thread::hardware_concurrency();
  if(numP < 1) numP = 2;
  pool tpool(numP);
  vector<string> nodes = (*input).nodes();
  int numNodes = nodes.size();
  GzWriter w((*input).getName()+".sig.gz");
  ProgressBar p(numNodes, t);
  cout << "creating: " << (*input).getName() << ".sig.gz\n";
  w.writeInt(numNodes);
  w.writeInt(numHops);
  
  levelMap levelmap;
  vector< vector<LevelData> > data;
  data.resize(numNodes);
  if(mode=="")
    for(int i=0;i<numNodes;i++)
      tpool.schedule(
        boost::bind(&spectrum, input, numHops, nodes[i], &(data[i]), &p)
      );
  else if(mode=="rayleigh")
    for(int i=0;i<numNodes;i++)
      tpool.schedule(
        boost::bind(&spectrumR, input, numHops, nodes[i], &(data[i]), &p)
      );
  else if(mode=="inverseIter")
    for(int i=0;i<numNodes;i++)
      tpool.schedule(
        boost::bind(&spectrumI, input, numHops, nodes[i], &(data[i]), &p)
      );
  else
  {
    cout << "sigApprox should be either rayleigh or inverseIter\n";
    exit(0);
  }
  tpool.wait();
  cout << "\n";

  for(int i=0;i<numNodes;i++)
    levelmap[nodes[i]] = data[i];
  w.writeData(levelmap);
  cout << "created: " << (*input).getName() << ".sig.gz in " <<
    (bclock::local_time() - t).total_milliseconds() << " milliseconds\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rcx, %r13
movl %edx, %ebp
movl %esi, 0xc(%rsp)
movq %rdi, %r15
callq 0x1889e
movq %rax, %rbx
movq %rax, 0x80(%rsp)
testl %ebp, %ebp
jg 0x11ac3
callq 0xe6c0
movl %eax, %ebp
testl %ebp, %ebp
pushq $0x2
popq %rsi
cmovgl %ebp, %esi
leaq 0x88(%rsp), %rdi
callq 0x190dc
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0xf448
movq 0x20(%rsp), %r12
subq 0x18(%rsp), %r12
leaq 0x68(%r15), %r14
leaq 0xe0(%rsp), %rdi
movq %r14, %rsi
callq 0xe7a0
leaq 0x2ed1a(%rip), %rdx     # 0x40824
leaq 0x130(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x1874a
leaq 0x2b8(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x191c8
shrq $0x5, %r12
leaq 0x130(%rsp), %rdi
callq 0xe290
leaq 0xe0(%rsp), %rdi
callq 0xe290
leaq 0xe0(%rsp), %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x19346
movq 0x6b42c(%rip), %rdi     # 0x7cf98
leaq 0x2ecb9(%rip), %rsi     # 0x4082c
callq 0xe540
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
callq 0xe7a0
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0xe4a0
leaq 0x2ec95(%rip), %rsi     # 0x40837
movq %rax, %rdi
callq 0xe540
leaq 0xa8(%rsp), %rdi
callq 0xe290
leaq 0x2b8(%rsp), %rdi
movl %r12d, %esi
callq 0x18f66
leaq 0x2b8(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x18f66
leaq 0xa8(%rsp), %rdi
callq 0x19380
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movslq %r12d, %rsi
callq 0x1939a
leaq 0x2ecc4(%rip), %rsi     # 0x408c8
movq %r13, %rdi
callq 0x18661
testb %al, %al
movq %r14, 0x78(%rsp)
movq %r15, 0x10(%rsp)
movq %r12, 0x70(%rsp)
je 0x11cdc
xorl %r14d, %r14d
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
imulq $0x18, %rax, %r15
leaq 0x1c0(%rsp), %rbx
leaq 0x270(%rsp), %r12
leaq 0x30(%rsp), %r13
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x11e7e
movq 0x18(%rsp), %rsi
addq %r14, %rsi
movq %rbx, %rdi
callq 0xe7a0
movq 0x50(%rsp), %r9
addq %rbp, %r9
leaq 0xe0(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq -0x63d(%rip), %rsi      # 0x11647
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movq %rbx, %r8
callq 0x193e5
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1948a
leaq 0x88(%rsp), %rdi
movq %r13, %rsi
callq 0x193d0
movq %r13, %rdi
callq 0x194d6
leaq 0x288(%rsp), %rdi
callq 0xe290
movq %rbx, %rdi
callq 0xe290
addq $0x18, %rbp
addq $0x20, %r14
jmp 0x11c4d
leaq 0x2eb5d(%rip), %rsi     # 0x40840
movq %r13, %rdi
callq 0x18661
testb %al, %al
je 0x11dad
xorl %r14d, %r14d
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
imulq $0x18, %rax, %rbp
leaq 0x1a0(%rsp), %rbx
leaq 0x228(%rsp), %r13
leaq 0x30(%rsp), %r12
xorl %r15d, %r15d
cmpq %r15, %rbp
je 0x11e7e
movq 0x18(%rsp), %rsi
addq %r14, %rsi
movq %rbx, %rdi
callq 0xe7a0
movq 0x50(%rsp), %r9
addq %r15, %r9
leaq 0xe0(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq -0x5a2(%rip), %rsi      # 0x117b3
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movq %rbx, %r8
callq 0x193e5
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1948a
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x193d0
movq %r12, %rdi
callq 0x194d6
leaq 0x240(%rsp), %rdi
callq 0xe290
movq %rbx, %rdi
callq 0xe290
addq $0x18, %r15
addq $0x20, %r14
jmp 0x11d1e
leaq 0x2ea95(%rip), %rsi     # 0x40849
movq %r13, %rdi
callq 0x18661
testb %al, %al
je 0x1201c
xorl %r14d, %r14d
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
imulq $0x18, %rax, %rbp
leaq 0x180(%rsp), %rbx
leaq 0x1e0(%rsp), %r13
leaq 0x30(%rsp), %r12
xorl %r15d, %r15d
cmpq %r15, %rbp
je 0x11e7e
movq 0x18(%rsp), %rsi
addq %r14, %rsi
movq %rbx, %rdi
callq 0xe7a0
movq 0x50(%rsp), %r9
addq %r15, %r9
leaq 0xe0(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq -0x507(%rip), %rsi      # 0x1191f
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movq %rbx, %r8
callq 0x193e5
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1948a
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x193d0
movq %r12, %rdi
callq 0x194d6
leaq 0x1f8(%rsp), %rdi
callq 0xe290
movq %rbx, %rdi
callq 0xe290
addq $0x18, %r15
addq $0x20, %r14
jmp 0x11def
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
callq 0x194e6
movq 0x78(%rsp), %rbp
movq 0x70(%rsp), %rbx
movq 0x6b0fa(%rip), %rdi     # 0x7cf98
leaq 0x2e7de(%rip), %rsi     # 0x40683
callq 0xe540
xorl %r15d, %r15d
testl %ebx, %ebx
movl $0x0, %r12d
cmovgl %ebx, %r12d
shlq $0x5, %r12
leaq 0xa8(%rsp), %rbx
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x11efe
movq 0x50(%rsp), %r14
movq 0x18(%rsp), %rsi
addq %r13, %rsi
movq %rbx, %rdi
callq 0x33128
addq %r15, %r14
addq $0x30, %rax
movq %rax, %rdi
movq %r14, %rsi
callq 0x194fc
addq $0x20, %r13
addq $0x18, %r15
jmp 0x11ec8
leaq 0x150(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x195da
leaq 0x2b8(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x114d8
leaq 0x150(%rsp), %rdi
callq 0x32620
movq 0x6b05c(%rip), %rdi     # 0x7cf98
leaq 0x2e946(%rip), %rsi     # 0x40889
callq 0xe540
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0xe7a0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0xe4a0
leaq 0x2e927(%rip), %rsi     # 0x40893
movq %rax, %rdi
callq 0xe540
movq %rax, %rbx
callq 0x1889e
leaq 0xd8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x80(%rsp), %rsi
callq 0x1c4fa
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe500
leaq 0x2e831(%rip), %rsi     # 0x407e1
movq %rax, %rdi
callq 0xe540
leaq 0x30(%rsp), %rdi
callq 0xe290
leaq 0x50(%rsp), %rdi
callq 0x1961c
leaq 0xa8(%rsp), %rdi
callq 0x32620
leaq 0x108(%rsp), %rdi
callq 0x216f2
leaq 0x2b8(%rsp), %rdi
callq 0x1cc4a
leaq 0x18(%rsp), %rdi
callq 0x18718
leaq 0x88(%rsp), %rdi
callq 0x1963e
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6af75(%rip), %rdi     # 0x7cf98
leaq 0x2e82b(%rip), %rsi     # 0x40855
callq 0xe540
xorl %edi, %edi
callq 0xe6a0
jmp 0x1215f
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x32620
jmp 0x12162
jmp 0x120aa
jmp 0x120aa
movq %rax, %rbx
jmp 0x12186
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0xe290
jmp 0x12071
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xe290
jmp 0x12193
movq %rax, %rbx
jmp 0x12193
movq %rax, %rbx
jmp 0x1219d
jmp 0x120b2
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xe290
jmp 0x12179
movq %rax, %rbx
jmp 0x12179
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x12158
jmp 0x1215f
jmp 0x1215f
jmp 0x1215f
movq %rax, %rbx
jmp 0x120fc
movq %rax, %rbx
jmp 0x12120
movq %rax, %rbx
jmp 0x120ef
movq %rax, %rbx
jmp 0x12113
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x194d6
leaq 0x1f8(%rsp), %rdi
callq 0xe290
leaq 0x180(%rsp), %rdi
jmp 0x12158
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x194d6
leaq 0x240(%rsp), %rdi
callq 0xe290
leaq 0x1a0(%rsp), %rdi
jmp 0x12158
jmp 0x1215f
movq %rax, %rbx
jmp 0x12150
movq %rax, %rbx
jmp 0x12143
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x194d6
leaq 0x288(%rsp), %rdi
callq 0xe290
leaq 0x1c0(%rsp), %rdi
callq 0xe290
jmp 0x12162
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1961c
leaq 0xa8(%rsp), %rdi
callq 0x32620
leaq 0x108(%rsp), %rdi
callq 0x216f2
leaq 0x2b8(%rsp), %rdi
callq 0x1cc4a
leaq 0x18(%rsp), %rdi
callq 0x18718
leaq 0x88(%rsp), %rdi
callq 0x1963e
movq %rbx, %rdi
callq 0xe9f0