// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/util.cpp
// Function: Utils::load_dict(DictionaryTrie&, std::istream&, unsigned int)
void Utils::load_dict(DictionaryTrie& dict, istream& words, unsigned int num_words)
{
  unsigned int freq;
  string data = "";
  string temp_word = "";
  string word = "";
  vector<string> word_string;
  unsigned int i = 0;
  unsigned int j = 0;
  for(; j < num_words; j++)
    {
      getline(words, data);
      if(words.eof()) break;
      temp_word = "";
      word = "";
      data = data + " .";
      istringstream iss(data);
      iss >> freq;
      while(1)
        {
          iss >> temp_word;
          if(temp_word == ".") break;
          if(temp_word.length() > 0) word_string.push_back(temp_word);
        }
      for(i = 0; i < word_string.size(); i++)
        {
          if(i > 0) word = word + " ";
          word = word + word_string[i];
        }
      dict.insert(word, freq);
      word_string.clear();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movl %edx, 0xc(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x40(%rsp)
leaq 0x1c9e(%rip), %rbx      # 0x60b4
leaq 0x68(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
movq %rbx, %rsi
callq 0x2f6e
leaq 0x48(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
movq %rbx, %rsi
callq 0x2f6e
leaq 0x1c6d(%rip), %rsi      # 0x60b4
leaq 0x88(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
callq 0x2f6e
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
xorl %eax, %eax
leaq 0x48(%rsp), %r15
leaq 0x88(%rsp), %rbx
leaq 0xe8(%rsp), %rbp
leaq 0x1c94(%rip), %r13      # 0x611e
leaq 0xc8(%rsp), %r14
movl %eax, 0x10(%rsp)
cmpl 0xc(%rsp), %eax
je 0x4620
movq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2060
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rcx,%rax)
jne 0x4620
movq %r15, %rdi
leaq 0x1be4(%rip), %rsi      # 0x60b4
callq 0x2310
movq %rbx, %rdi
leaq 0x1bd5(%rip), %rsi      # 0x60b4
callq 0x2310
movq %rbp, %rdi
leaq 0x68(%rsp), %r12
movq %r12, %rsi
leaq 0x1c27(%rip), %rdx      # 0x611d
callq 0x46cb
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2220
movq %rbp, %rdi
callq 0x2100
movq %rbp, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x22c0
movq %rbp, %rdi
leaq 0x14(%rsp), %rsi
callq 0x22d0
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2230
movq %r15, %rdi
movq %r13, %rsi
callq 0x4703
testb %al, %al
jne 0x455a
cmpq $0x0, 0x50(%rsp)
je 0x4529
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x4710
jmp 0x4529
xorl %r12d, %r12d
movl %r12d, %r12d
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r12, %rcx
jbe 0x45d2
testq %r12, %r12
je 0x45a5
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x1b98(%rip), %rdx      # 0x6120
callq 0x46cb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2100
movq 0x20(%rsp), %rax
movq %r12, %rdx
shlq $0x5, %rdx
addq %rax, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x473c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2100
incl %r12d
jmp 0x455d
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2260
movl 0x14(%rsp), %edx
movq 0x40(%rsp), %rdi
leaq 0xa8(%rsp), %r12
movq %r12, %rsi
callq 0x490c
movq %r12, %rdi
callq 0x2100
leaq 0x20(%rsp), %rdi
callq 0x4774
movq %rbp, %rdi
callq 0x2110
movl 0x10(%rsp), %eax
incl %eax
jmp 0x4492
leaq 0x20(%rsp), %rdi
callq 0x2f46
leaq 0x88(%rsp), %rdi
callq 0x2100
leaq 0x48(%rsp), %rdi
callq 0x2100
leaq 0x68(%rsp), %rdi
callq 0x2100
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x46af
movq %rax, %rbx
jmp 0x46b9
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2100
jmp 0x468b
jmp 0x467f
jmp 0x467f
jmp 0x4688
movq %rax, %rbx
jmp 0x4698
jmp 0x4688
jmp 0x4688
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2110
leaq 0x20(%rsp), %rdi
callq 0x2f46
leaq 0x88(%rsp), %rdi
callq 0x2100
leaq 0x48(%rsp), %rdi
callq 0x2100
leaq 0x68(%rsp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x22e0