// File: migueeelvargas[P]Auto-Complete/util.cpp
// Function: Utils::load_dict(DictionaryTrie&, std::istream&)
void Utils::load_dict(DictionaryTrie& dict, istream& words)
{
  unsigned int freq;
  string data = "";
  string temp_word = "";
  string word = "";
  vector<string> word_string;
  unsigned int i = 0;
  while(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
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x33d0
movq -0x2c8(%rbp), %rdx
leaq 0x61c7(%rip), %rsi      # 0xe098
leaq -0x38(%rbp), %rdi
callq 0x4c60
jmp 0x7edc
leaq -0x39(%rbp), %rdi
callq 0x3280
leaq -0x71(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x33d0
movq -0x2d0(%rbp), %rdx
leaq 0x6195(%rip), %rsi      # 0xe098
leaq -0x70(%rbp), %rdi
callq 0x4c60
jmp 0x7f0e
leaq -0x71(%rbp), %rdi
callq 0x3280
leaq -0x99(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x33d0
movq -0x2d8(%rbp), %rdx
leaq 0x6160(%rip), %rsi      # 0xe098
leaq -0x98(%rbp), %rdi
callq 0x4c60
jmp 0x7f46
leaq -0x99(%rbp), %rdi
callq 0x3280
leaq -0xb8(%rbp), %rdi
callq 0x4b30
movl $0x0, -0xbc(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3080
movq %rax, -0x2e0(%rbp)
jmp 0x7f7e
movq -0x2e0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x32e0
movb %al, -0x2e1(%rbp)
jmp 0x7f9c
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x7fab
jmp 0x82a1
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x33f0
movb %al, -0x2e2(%rbp)
jmp 0x7fc6
movb -0x2e2(%rbp), %al
testb $0x1, %al
jne 0x7fd2
jmp 0x8039
jmp 0x82a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x3280
jmp 0x82fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x71(%rbp), %rdi
callq 0x3280
jmp 0x82f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x3280
jmp 0x82ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x82d4
leaq 0x6058(%rip), %rsi      # 0xe098
leaq -0x70(%rbp), %rdi
callq 0x3330
jmp 0x804b
leaq 0x6046(%rip), %rsi      # 0xe098
leaq -0x98(%rbp), %rdi
callq 0x3330
jmp 0x8060
leaq 0x609a(%rip), %rdx      # 0xe101
leaq -0xe0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x8840
jmp 0x8079
leaq -0x38(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
leaq -0xe0(%rbp), %rsi
movq %rsi, -0x2f8(%rbp)
callq 0x32c0
movq -0x2f8(%rbp), %rdi
callq 0x3170
movq -0x2f0(%rbp), %rsi
leaq -0x260(%rbp), %rdi
movl $0x8, %edx
callq 0x33b0
jmp 0x80bd
leaq -0x260(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x3050
jmp 0x80cf
jmp 0x80d1
jmp 0x80d3
leaq -0x260(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x32f0
jmp 0x80e5
leaq 0x6016(%rip), %rsi      # 0xe102
leaq -0x70(%rbp), %rdi
callq 0x88c0
movb %al, -0x2f9(%rbp)
jmp 0x80fd
movb -0x2f9(%rbp), %al
testb $0x1, %al
jne 0x8109
jmp 0x811c
jmp 0x8141
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x8293
leaq -0x70(%rbp), %rdi
callq 0x3360
cmpq $0x0, %rax
jbe 0x813f
leaq -0xb8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x88f0
jmp 0x813d
jmp 0x813f
jmp 0x80d1
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movq %rax, -0x308(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x59a0
movq %rax, %rcx
movq -0x308(%rbp), %rax
cmpq %rcx, %rax
jae 0x821a
cmpl $0x0, -0xbc(%rbp)
jbe 0x81bb
leaq 0x5f7d(%rip), %rdx      # 0xe104
leaq -0x280(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x8840
jmp 0x819c
leaq -0x98(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x32c0
leaq -0x280(%rbp), %rdi
callq 0x3170
movl -0xbc(%rbp), %eax
movl %eax, %esi
leaq -0xb8(%rbp), %rdi
callq 0x89e0
movq %rax, %rdx
leaq -0x2a0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x8960
jmp 0x81e7
leaq -0x98(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x32c0
leaq -0x2a0(%rbp), %rdi
callq 0x3170
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x814b
movq -0x8(%rbp), %rax
movq %rax, -0x310(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x30f0
jmp 0x823a
movq -0x310(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x2c0(%rbp), %rsi
callq 0x8f40
jmp 0x8252
leaq -0x2c0(%rbp), %rdi
callq 0x3170
leaq -0xb8(%rbp), %rdi
callq 0x8a00
leaq -0x260(%rbp), %rdi
callq 0x3120
jmp 0x7f68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x3170
leaq -0x260(%rbp), %rdi
callq 0x3120
jmp 0x82d4
leaq -0xb8(%rbp), %rdi
callq 0x4b50
leaq -0x98(%rbp), %rdi
callq 0x3170
leaq -0x70(%rbp), %rdi
callq 0x3170
leaq -0x38(%rbp), %rdi
callq 0x3170
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
leaq -0xb8(%rbp), %rdi
callq 0x4b50
leaq -0x98(%rbp), %rdi
callq 0x3170
leaq -0x70(%rbp), %rdi
callq 0x3170
leaq -0x38(%rbp), %rdi
callq 0x3170
movq -0x48(%rbp), %rdi
callq 0x33c0
nopw (%rax,%rax)