// File: /workspace/github_cpp_makefile_star2_O1/migueeelvargas[P]Auto-Complete/DictionaryTrie.cpp
// Function: DictionaryTrie::getPrefixWords(TrieNode*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::greater<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void DictionaryTrie::getPrefixWords (TrieNode* curr, std::string prefix,
  std::multimap<int, std::string, std::greater<int>> &prefixWords) {

  // Base case
  if (curr == NULL)
    return;

  // Traverse the left side of TST
  getPrefixWords(curr->right, prefix, prefixWords);
  getPrefixWords(curr->left, prefix, prefixWords);

  // Check if node is a word, & store prefix + current character
  if(curr->isAWord)
    prefixWords.insert(std::pair<int, std::string>(curr->freq, prefix + curr->symbol));

  // getPrefixWords(curr->mid, prefix.append(&(curr->symbol)), prefixWords);
  getPrefixWords(curr->mid, prefix + curr->symbol, prefixWords);  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
testq %rsi, %rsi
je 0x66b4
movq %rdx, %r15
movq %rsi, %r12
movq 0x10(%rsi), %r13
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rbp
movq %rcx, %r14
movq %rdi, %rbx
movq %rbp, %rdi
callq 0x34b0
movq %rbx, 0x28(%rsp)
movq %rbx, %rdi
movq %r14, %rbx
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x6490
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x650f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x8(%r12), %r13
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rbp
movq %rbp, %rdi
callq 0x34b0
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x6490
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x656a
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpb $0x1, 0x20(%r12)
jne 0x6647
movsbl (%r12), %ebp
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x34b0
movq 0x8(%r13), %rsi
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
movl %ebp, %r8d
callq 0x2310
movl 0x24(%r12), %eax
leaq 0x88(%rsp), %r13
movl %eax, -0x18(%r13)
movq %r13, -0x10(%r13)
movq 0x8(%rsp), %rax
cmpq %r14, %rax
je 0x65e4
movq %rax, 0x78(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x65ed
movups (%r14), %xmm0
movups %xmm0, (%r13)
movq 0x10(%rsp), %rax
leaq 0x70(%rsp), %rsi
movq %rax, 0x10(%rsi)
movq %r14, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %rbx, %rdi
callq 0x67c8
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x6630
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6647
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x18(%r12), %r13
movsbl (%r12), %ebp
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x34b0
movq 0x8(%r15), %rsi
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
movl %ebp, %r8d
callq 0x2310
leaq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rcx
callq 0x6490
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x66b4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x66e8
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x66e8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6748
movq 0x18(%rsp), %rsi
jmp 0x6740
jmp 0x66fb
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x6748
movq 0x40(%rsp), %rsi
jmp 0x6740
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x6748
movq 0xa8(%rsp), %rsi
jmp 0x6740
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x6748
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22e0