// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]fase/IGtrie.cpp
// Function: IGtrie::enumerateFrom(int, long long, long long, int, int)
void IGtrie::enumerateFrom(int currentNode, long long int label, long long int parLabel, int parSize, int remaining)
{
  if (remaining == 0)
  {
    enumeration.push_back(make_pair(label, labelCount[currentNode]));
    return;
  }

  int i;
  for (i = 0; i < LB_WORD_SIZE; i++)
    if (labelPaths[currentNode][i] != -1)
    {
      long long int tmpLabel = parLabel;
      int tmpSize = parSize;

      if (labelLeaf[labelPaths[currentNode][i]])
      {
        int digits = labelLeaf[labelPaths[currentNode][i]];
        tmpLabel |= (i << tmpSize);
        tmpSize += digits;
        enumerateFrom(labelPaths[currentNode][i], ((label << tmpSize) | tmpLabel), 0, 0, remaining - 1);
      }
      else
      {
        int digits = LB_WORD_LEN;
        tmpLabel |= (i << tmpSize);
        tmpSize += digits;
        enumerateFrom(labelPaths[currentNode][i], label, tmpLabel, tmpSize, remaining);
      }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x8e5b
movq -0x70(%rbp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, -0x78(%rbp)
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
leaq (%rax,%rcx,4), %rsi
leaq -0x18(%rbp), %rdi
callq 0x9100
movq -0x78(%rbp), %rdi
movl %edx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x30(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x90d0
jmp 0x8f90
movl $0x0, -0x4c(%rbp)
cmpl $0x10, -0x4c(%rbp)
jge 0x8f90
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4c(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0x8f80
movq -0x70(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq 0x10(%rcx), %rax
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x4c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x8f30
movq -0x70(%rbp), %rdi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x4c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movl -0x4c(%rbp), %eax
movl -0x5c(%rbp), %ecx
shll %cl, %eax
cltq
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x60(%rbp), %eax
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq 0x8(%rdi), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4c(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq -0x18(%rbp), %rdx
movl -0x5c(%rbp), %eax
movl %eax, %ecx
shlq %cl, %rdx
orq -0x58(%rbp), %rdx
movl -0x28(%rbp), %r9d
subl $0x1, %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x8de0
jmp 0x8f7e
movq -0x70(%rbp), %rdi
movl $0x4, -0x64(%rbp)
movl -0x4c(%rbp), %eax
movl -0x5c(%rbp), %ecx
shll %cl, %eax
cltq
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x64(%rbp), %eax
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq 0x8(%rdi), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4c(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq -0x18(%rbp), %rdx
movq -0x58(%rbp), %rcx
movl -0x5c(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x8de0
jmp 0x8f80
jmp 0x8f82
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8e62
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)