// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]TextCorrection-Trie/src/trie.hpp
// Function: trie::Trie_t::buildActiveNodeSet(bool)
void buildActiveNodeSet(bool _onlyFinalWords)
    {
      std::queue<std::pair<TrieNode_t*, int>> seekQueue;
      std::unordered_map<TrieNode_t*, TrieNode_t*> father;
      std::set<TrieNode_t*> visited;
      seekQueue.emplace(this->m_lambdaNode.get(), 0); // add the lambdaNode to the seek
      m_activeNodeSet.emplace(this->m_lambdaNode.get(), 0); // add the lambdaNode to the activeSet
      father.emplace(this->m_lambdaNode.get(), nullptr); // set lambdaNode father as nullptr

      /* initialization */

      while (!seekQueue.empty()) {
        auto currentNode = seekQueue.front(); // get currentNode
        seekQueue.pop();

        for (TrieNode_t* child : currentNode.first->getChildren()) {

          // verify if the child hasn't been visited recently
          if (visited.find(child) == visited.end()) {
            int currentLevel = currentNode.second + 1;

            visited.emplace(child); // add child to the visited set
            father.emplace(child, currentNode.first); // set current vertex as father

            if (currentLevel < m_fuzzyLimitThreshold) { // add the child on the seek only if it has a threshold < fuzzy
              seekQueue.emplace(child, currentLevel);
            }

            if (!_onlyFinalWords || child->isEndOfWord()) { // verify if this child is end of word
              TrieNode_t* currentChild = child;
              m_activeNodeSet.emplace(currentChild, currentLevel); // add the child to the activeSet

              auto currentChild_it = father.find(child);

              // add all the father's father's father's ... father's of this child to the activeSet
              while (currentChild_it->second != nullptr) {

                if (m_activeNodeSet.emplace(currentChild_it->second, --currentLevel).second) {
                  currentChild_it = father.find(currentChild_it->second);
                } else {
                  break;
                }
              }
            }
          }
        }
      }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %esi, 0x1c(%rsp)
movq %rdi, %r14
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4742
leaq 0xc0(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
leaq 0x68(%rsp), %rcx
andl $0x0, (%rcx)
andq $0x0, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
andq $0x0, 0x20(%rcx)
movups %xmm0, -0x8(%rax)
movq (%r14), %rax
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x20(%rsp), %rdx
andl $0x0, (%rdx)
movq %rbx, %rdi
callq 0x49d6
leaq 0x78(%r14), %r15
movq (%r14), %rax
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x20(%rsp), %rdx
andl $0x0, (%rdx)
movq %r15, %rdi
callq 0x4c1a
movq %r14, 0x50(%rsp)
movq (%r14), %rax
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x90(%rsp), %rdi
callq 0x4db6
leaq 0x38(%rsp), %r14
leaq 0x90(%rsp), %r12
leaq 0xc(%rsp), %rbx
movq 0xd8(%rsp), %rax
cmpq %rax, 0xf8(%rsp)
je 0x2e95
movups (%rax), %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x5112
movq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x475e
movq 0x38(%rsp), %rbp
movq 0x40(%rsp), %r13
cmpq %r13, %rbp
je 0x2e83
movq (%rbp), %rax
movq %rax, 0x10(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x52e0
leaq 0x68(%rsp), %rcx
cmpq %rcx, %rax
je 0x2dc1
addq $0x8, %rbp
jmp 0x2d90
movl 0x28(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5336
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x54bc
movl 0xc(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0xdc(%rcx), %eax
jge 0x2e12
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x558a
movq 0x10(%rsp), %rax
cmpb $0x0, 0x1c(%rsp)
je 0x2e24
cmpb $0x1, 0x34(%rax)
jne 0x2dbb
movq %rax, 0x58(%rsp)
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
movq %rbx, %rdx
callq 0x5636
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x56e0
movq %rax, %r14
cmpq $0x0, 0x10(%r14)
je 0x2dbb
addq $0x10, %r14
decl 0xc(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5636
testb $0x1, %dl
je 0x2dbb
movq %r12, %rdi
movq %r14, %rsi
callq 0x56e0
movq %rax, %r14
jmp 0x2e49
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x56fe
jmp 0x2d4e
leaq 0x60(%rsp), %rdi
callq 0x571c
leaq 0x90(%rsp), %rdi
callq 0x5774
leaq 0xc8(%rsp), %rdi
callq 0x57f6
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ed1
jmp 0x2ed1
jmp 0x2ed1
movq %rax, %rbx
jmp 0x2eed
jmp 0x2ee0
jmp 0x2ee0
jmp 0x2ee0
jmp 0x2ee0
jmp 0x2ee0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x56fe
leaq 0x60(%rsp), %rdi
callq 0x571c
leaq 0x90(%rsp), %rdi
callq 0x5774
leaq 0xc8(%rsp), %rdi
callq 0x57f6
movq %rbx, %rdi
callq 0x2280
nop