// File: /workspace/github_cpp_makefile_star2_O1/migueeelvargas[P]Auto-Complete/test.cpp
// Function: main
int main(int argc, char* argv[]) {
  int mode = 0;
  
  if (strcmp(argv[1], "ht") == 0)
    mode = 1;
  else if(strcmp(argv[1], "trie") == 0)
    mode = 2;

  DictionaryBST* dictionaryBST = new DictionaryBST();
  DictionaryHashtable* dictionaryHT = new DictionaryHashtable();
  DictionaryTrie* dictionaryTrie = new DictionaryTrie();

  std::vector<std::string> words;
  std::vector<std::string> wordsNotIn;

  // words.push_back("basketball");
  // words.push_back("basket");
  // words.push_back("ball");
  // words.push_back("basement");

  words.push_back("b");
  words.push_back("bb");
  words.push_back("bbb bbb");
  words.push_back("c");
  words.push_back("ddd");
  words.push_back("dd dd dd");
  words.push_back("d");
  // words.push_back("miguel");
  // words.push_back("miguel");

  wordsNotIn.push_back("base");
  wordsNotIn.push_back("ba");
  wordsNotIn.push_back("bas");


  if (mode == 0) {
    std::cout << "Mode: BST" << std::endl << std::endl;
    modeBST(dictionaryBST, words);
  }
  else if (mode == 1) {
    std::cout << "Mode: Hashtable" << std::endl << std::endl;
    modeHT(dictionaryHT, words);
  }

  else {
    std::cout << "Mode: Trie" << std::endl << std::endl;
    modeTrie(dictionaryTrie, words, wordsNotIn);
  }

  delete(dictionaryBST);
  delete(dictionaryHT);
  delete(dictionaryTrie);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq 0x8(%rsi), %rbx
leaq 0x3bff(%rip), %rsi      # 0x6004
movq %rbx, %rdi
callq 0x21a0
movl %eax, %ebp
testl %eax, %eax
je 0x242a
leaq 0x3bed(%rip), %rsi      # 0x6007
movq %rbx, %rdi
callq 0x21a0
testl %eax, %eax
setne %r12b
jmp 0x242d
xorl %r12d, %r12d
movl $0x30, %edi
callq 0x2140
movq %rax, %rbx
movq %rax, %rdi
callq 0x47cc
movl $0x38, %edi
callq 0x2140
movq %rax, %r14
movq %rax, %rdi
callq 0x41f4
movl $0x10, %edi
callq 0x2140
movq %rax, %r15
movq %rax, %rdi
callq 0x4b50
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x3b7d(%rip), %rsi      # 0x6012
leaq 0x3b77(%rip), %rdx      # 0x6013
movq %rsp, %rdi
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x24c7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3b3d(%rip), %rsi      # 0x6011
leaq 0x3b38(%rip), %rdx      # 0x6013
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2503
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3afc(%rip), %rsi      # 0x600c
leaq 0x3afc(%rip), %rdx      # 0x6013
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x253f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3ac8(%rip), %rsi      # 0x6014
leaq 0x3ac2(%rip), %rdx      # 0x6015
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x257b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3a8e(%rip), %rsi      # 0x6016
leaq 0x3a8a(%rip), %rdx      # 0x6019
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x25b7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3a56(%rip), %rsi      # 0x601a
leaq 0x3a57(%rip), %rdx      # 0x6022
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x25f3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3a21(%rip), %rsi      # 0x6021
leaq 0x3a1b(%rip), %rdx      # 0x6022
callq 0x4162
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x262f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x39e7(%rip), %rsi      # 0x6023
leaq 0x39e4(%rip), %rdx      # 0x6027
callq 0x4162
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x266b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x39b0(%rip), %rsi      # 0x6028
leaq 0x39ab(%rip), %rdx      # 0x602a
callq 0x4162
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x26a7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3977(%rip), %rsi      # 0x602b
leaq 0x3973(%rip), %rdx      # 0x602e
callq 0x4162
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x3efa
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x26e3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
testb %r12b, %r12b
je 0x276f
movq 0x68e5(%rip), %r12      # 0x8fd8
leaq 0x3935(%rip), %rsi      # 0x602f
movl $0x9, %edx
movq %r12, %rdi
callq 0x2180
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x68b2(%rip), %rdi      # 0x8fd8
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x296a
jmp 0x287a
testl %ebp, %ebp
je 0x27fc
movq 0x685a(%rip), %r12      # 0x8fd8
leaq 0x38c4(%rip), %rsi      # 0x6049
movl $0xa, %edx
movq %r12, %rdi
callq 0x2180
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x6827(%rip), %rdi      # 0x8fd8
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r15, %rdi
callq 0x3269
jmp 0x287a
movq 0x67d5(%rip), %r12      # 0x8fd8
leaq 0x382f(%rip), %rsi      # 0x6039
movl $0xf, %edx
movq %r12, %rdi
callq 0x2180
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x67a2(%rip), %rdi      # 0x8fd8
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x2e46
movq %rbx, %rdi
callq 0x48a0
movl $0x30, %esi
movq %rbx, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x42c4
movl $0x38, %esi
movq %r14, %rdi
callq 0x2150
movq %r15, %rdi
callq 0x4b60
movl $0x10, %esi
movq %r15, %rdi
callq 0x2150
leaq 0x40(%rsp), %rdi
callq 0x3e0e
leaq 0x20(%rsp), %rdi
callq 0x3e0e
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
jmp 0x2902
jmp 0x294b
movq %rax, %r12
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x294e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x294e
jmp 0x294b
movq %rax, %r12
movl $0x10, %esi
movq %r15, %rdi
jmp 0x2944
movq %rax, %r12
movl $0x38, %esi
movq %r14, %rdi
jmp 0x2944
movq %rax, %r12
movl $0x30, %esi
movq %rbx, %rdi
callq 0x2150
jmp 0x2962
movq %rax, %r12
leaq 0x40(%rsp), %rdi
callq 0x3e0e
leaq 0x20(%rsp), %rdi
callq 0x3e0e
movq %r12, %rdi
callq 0x21f0