// File: migueeelvargas[P]Auto-Complete/test.cpp
// Function: modeBST(DictionaryBST*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void modeBST (DictionaryBST* dictionaryBST, 
              std::vector<std::string>& words) {
  /* Test - insert() */
  std::cout << "Inserting strings..." << std::endl;
  for( auto i = words.begin(); i != words.end(); ++i) {
    if (dictionaryBST->insert(*i))
      std::cout << "Inserted " << "\"" << *i << "\"" << std::endl;

    else {
      std::cout << "\"" << *i << "\"" << " is already in dictionary." << std::endl;
      pass = false;
    }
  }
  if (pass)
    std::cout << "PASSED." << std::endl;
  else 
    std::cout << "FAILED." << std::endl;

  /* Testing - find() - should all return TRUE */
  words.push_back("alpha");

  std::cout << "Finding strings..." << std::endl;
  for( auto i = words.begin(); i != words.end(); ++i) {
    if (dictionaryBST->find(*i)) {
      std::cout << "Found " << "\"" << *i << "\"" << std::endl;
      std::cout << "Freq: " << "\"" << *i << "\"" << std::endl;
    }

    else 
      std::cout << "\"" << *i << "\"" << " is not in the dictionary." << std::endl;
  }
  std::cout << "Done." << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xe17e(%rip), %rdi      # 0x10fd8
leaq 0x827c(%rip), %rsi      # 0xb0dd
callq 0x21a0
movq %rax, %rdi
movq 0xe158(%rip), %rsi      # 0x10fc8
callq 0x21e0
movq -0x10(%rbp), %rdi
callq 0x43e0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4450
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4410
testb $0x1, %al
jne 0x2ea5
jmp 0x2ff0
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x4480
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x20a0
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x6ed0
movb %al, -0xa9(%rbp)
jmp 0x2ee7
leaq -0x40(%rbp), %rdi
callq 0x2100
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x2efc
jmp 0x2f7a
movq 0xe0d5(%rip), %rdi      # 0x10fd8
leaq 0x814a(%rip), %rsi      # 0xb054
callq 0x21a0
movq %rax, %rdi
leaq 0x8145(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, -0xc8(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x4480
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x8117(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, %rdi
movq 0xe072(%rip), %rsi      # 0x10fc8
callq 0x21e0
jmp 0x2fe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2100
jmp 0x32fa
movq 0xe057(%rip), %rdi      # 0x10fd8
leaq 0x80d6(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, -0xd0(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x4480
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x80a8(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, %rdi
leaq 0x809b(%rip), %rsi      # 0xb060
callq 0x21a0
movq %rax, %rdi
movq 0xdff4(%rip), %rsi      # 0x10fc8
callq 0x21e0
movb $0x0, 0xe1c8(%rip)      # 0x111a8
jmp 0x2fe2
leaq -0x18(%rbp), %rdi
callq 0x44a0
jmp 0x2e82
testb $0x1, 0xe1b1(%rip)      # 0x111a8
je 0x301d
movq 0xdfd8(%rip), %rdi      # 0x10fd8
leaq 0x8074(%rip), %rsi      # 0xb07b
callq 0x21a0
movq %rax, %rdi
movq 0xdfb2(%rip), %rsi      # 0x10fc8
callq 0x21e0
jmp 0x303f
movq 0xdfb4(%rip), %rdi      # 0x10fd8
leaq 0x8058(%rip), %rsi      # 0xb083
callq 0x21a0
movq %rax, %rdi
movq 0xdf8e(%rip), %rsi      # 0x10fc8
callq 0x21e0
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x22f0
movq -0xd8(%rbp), %rdx
leaq 0x8023(%rip), %rsi      # 0xb08b
leaq -0x70(%rbp), %rdi
callq 0x42d0
jmp 0x3073
movq -0xe0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x42a0
jmp 0x3085
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0x71(%rbp), %rdi
callq 0x2210
movq 0xdf3a(%rip), %rdi      # 0x10fd8
leaq 0x7fec(%rip), %rsi      # 0xb091
callq 0x21a0
movq %rax, %rdi
movq 0xdf14(%rip), %rsi      # 0x10fc8
callq 0x21e0
movq -0x10(%rbp), %rdi
callq 0x43e0
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4450
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4410
testb $0x1, %al
jne 0x30ef
jmp 0x32cf
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4480
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x20a0
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x6f70
movb %al, -0xe1(%rbp)
jmp 0x3134
leaq -0xa8(%rbp), %rdi
callq 0x2100
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x314f
jmp 0x3260
movq 0xde82(%rip), %rdi      # 0x10fd8
leaq 0x7f47(%rip), %rsi      # 0xb0a4
callq 0x21a0
movq %rax, %rdi
leaq 0x7ef2(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, -0x108(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4480
movq -0x108(%rbp), %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x7ec4(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, %rdi
movq 0xde1f(%rip), %rsi      # 0x10fc8
callq 0x21e0
movq 0xde23(%rip), %rdi      # 0x10fd8
leaq 0x7eef(%rip), %rsi      # 0xb0ab
callq 0x21a0
movq %rax, %rdi
leaq 0x7e93(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, -0x100(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4480
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x7e65(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, %rdi
movq 0xddc0(%rip), %rsi      # 0x10fc8
callq 0x21e0
jmp 0x32bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3235
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0x71(%rbp), %rdi
callq 0x2210
jmp 0x32fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x2100
jmp 0x32fa
movq 0xdd71(%rip), %rdi      # 0x10fd8
leaq 0x7df0(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, -0x110(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4480
movq -0x110(%rbp), %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x7dc2(%rip), %rsi      # 0xb05e
callq 0x21a0
movq %rax, %rdi
leaq 0x7e07(%rip), %rsi      # 0xb0b2
callq 0x21a0
movq %rax, %rdi
movq 0xdd0e(%rip), %rsi      # 0x10fc8
callq 0x21e0
jmp 0x32c1
leaq -0x80(%rbp), %rdi
callq 0x44a0
jmp 0x30c6
movq 0xdd02(%rip), %rdi      # 0x10fd8
leaq 0x7df0(%rip), %rsi      # 0xb0cd
callq 0x21a0
movq %rax, %rdi
movq 0xdcdc(%rip), %rsi      # 0x10fc8
callq 0x21e0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x22e0
nopw %cs:(%rax,%rax)