// File: ruankotovich[P]TextCorrection-Trie/src/trie.hpp
// Function: trie::Trie_t::searchSimilarKeyword(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
std::priority_queue<TrieResponse_t, std::vector<TrieResponse_t>, TrieResponseComparator_t> searchSimilarKeyword(std::string& keyword)
    {
      std::priority_queue<TrieResponse_t, std::vector<TrieResponse_t>, TrieResponseComparator_t> ocurrencesQueue;

      std::transform(keyword.begin(), keyword.end(), keyword.begin(), ::tolower);

      std::set<ActiveNode_t> lastActiveNodes = this->m_activeNodeSet;

      wchar_t chart[keyword.size()];
      push_string_to_wchar(chart, keyword);

      for (unsigned int i = 0; i < wcslen(chart); i++) {
        lastActiveNodes = buildNewSet(lastActiveNodes, m_characterMap[chart[i]]);
      }

      for (auto node : lastActiveNodes) {

        if (node.node->isEndOfWord()) {
          for (auto& _target : *node.node->getValues()) {
            ocurrencesQueue.emplace(_target, node.editDistance);
          }
        }
      }

      return ocurrencesQueue;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x138(%rbp)
movq %rdi, %rax
movq %rax, -0x130(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x113b0
movq -0x18(%rbp), %rdi
callq 0x2160
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20e0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2160
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x1d33a(%rip), %rcx     # 0x20fd0
callq 0x53e0
movq %rax, -0x120(%rbp)
jmp 0x3ca4
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0x78, %rsi
leaq -0x80(%rbp), %rdi
callq 0x113e0
jmp 0x3cc5
movq -0x18(%rbp), %rdi
callq 0x2120
movq -0x128(%rbp), %rdi
movq %rax, %rcx
movq %rcx, %rax
movq %rsp, %rdx
movq %rdx, -0x88(%rbp)
leaq 0xf(,%rcx,4), %rcx
andq $-0x10, %rcx
movq %rsp, %rsi
subq %rcx, %rsi
movq %rsi, -0x140(%rbp)
movq %rsi, %rsp
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdx
callq 0x5f20
movl $0x0, -0x94(%rbp)
movq -0x140(%rbp), %rdi
movl -0x94(%rbp), %eax
movq %rax, -0x148(%rbp)
callq 0x2150
movq %rax, %rcx
movq -0x148(%rbp), %rax
cmpq %rcx, %rax
jae 0x3dfa
movq -0x140(%rbp), %rax
movq -0x128(%rbp), %rdi
addq $0x8, %rdi
movl -0x94(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0xcc(%rbp)
leaq -0xcc(%rbp), %rsi
callq 0x95a0
movq %rax, -0x150(%rbp)
jmp 0x3d7d
movq -0x128(%rbp), %rsi
movq -0x150(%rbp), %rax
movl (%rax), %ecx
leaq -0xc8(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x11410
jmp 0x3d9f
leaq -0x80(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x11b80
leaq -0xc8(%rbp), %rdi
callq 0x4680
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x3d1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3f58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4680
jmp 0x3f58
leaq -0x80(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x11bb0
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x11be0
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x11c10
testb $0x1, %al
jne 0x3e47
jmp 0x3f23
leaq -0xe0(%rbp), %rdi
callq 0x11c30
movq (%rax), %rcx
movq %rcx, -0xf8(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xf0(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x97d0
testb $0x1, %al
jne 0x3e7d
jmp 0x3f10
movq -0xf8(%rbp), %rdi
callq 0x10e10
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rdi
callq 0x11060
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rdi
callq 0x11090
movq %rax, -0x110(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x112e0
testb $0x1, %al
jne 0x3ecf
jmp 0x3f0e
leaq -0x108(%rbp), %rdi
callq 0x11350
movq -0x138(%rbp), %rdi
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x11c50
jmp 0x3efe
jmp 0x3f00
leaq -0x108(%rbp), %rdi
callq 0x11360
jmp 0x3eb6
jmp 0x3f10
jmp 0x3f12
leaq -0xe0(%rbp), %rdi
callq 0x11cb0
jmp 0x3e2b
movb $0x1, -0x19(%rbp)
movq -0x88(%rbp), %rax
movq %rax, %rsp
leaq -0x80(%rbp), %rdi
callq 0x4680
testb $0x1, -0x19(%rbp)
jne 0x3f4c
movq -0x138(%rbp), %rdi
callq 0x3ff0
movq -0x130(%rbp), %rax
movq %rbp, %rsp
popq %rbp
retq
movq -0x138(%rbp), %rdi
callq 0x3ff0
movq -0x40(%rbp), %rdi
callq 0x2300
nopl (%rax)