// File: /workspace/github_cpp_makefile_star2_O3/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), %rdi
cmpb $0x68, (%rdi)
jne 0x2413
cmpb $0x74, 0x1(%rdi)
jne 0x2413
cmpb $0x0, 0x2(%rdi)
je 0x28dc
leaq 0x3bea(%rip), %rsi      # 0x6004
callq 0x21a0
testl %eax, %eax
setne %r12b
xorl %ebp, %ebp
movl $0x30, %edi
callq 0x2140
movq %rax, %rbx
movq %rax, %rdi
callq 0x47e8
movl $0x38, %edi
callq 0x2140
movq %rax, %r14
movq %rax, %rdi
callq 0x4210
movl $0x10, %edi
callq 0x2140
movq %rax, %r15
movq %rax, %rdi
callq 0x4b6c
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 0x3b80(%rip), %rsi      # 0x600f
leaq 0x3b7a(%rip), %rdx      # 0x6010
movq %rsp, %rdi
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x24c1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3b40(%rip), %rsi      # 0x600e
leaq 0x3b3b(%rip), %rdx      # 0x6010
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x24fd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3aff(%rip), %rsi      # 0x6009
leaq 0x3aff(%rip), %rdx      # 0x6010
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2539
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3acb(%rip), %rsi      # 0x6011
leaq 0x3ac5(%rip), %rdx      # 0x6012
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2575
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3a91(%rip), %rsi      # 0x6013
leaq 0x3a8d(%rip), %rdx      # 0x6016
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x25b1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3a59(%rip), %rsi      # 0x6017
leaq 0x3a5a(%rip), %rdx      # 0x601f
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x25ed
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x3a24(%rip), %rsi      # 0x601e
leaq 0x3a1e(%rip), %rdx      # 0x601f
callq 0x417a
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2629
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x39ea(%rip), %rsi      # 0x6020
leaq 0x39e7(%rip), %rdx      # 0x6024
callq 0x417a
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2665
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x39b3(%rip), %rsi      # 0x6025
leaq 0x39ae(%rip), %rdx      # 0x6027
callq 0x417a
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x26a1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x397a(%rip), %rsi      # 0x6028
leaq 0x3976(%rip), %rdx      # 0x602b
callq 0x417a
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x3f0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x26dd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
testb %r12b, %r12b
je 0x2769
movq 0x68eb(%rip), %r12      # 0x8fd8
leaq 0x3938(%rip), %rsi      # 0x602c
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 0x68b8(%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 0x2973
jmp 0x2878
testb %bpl, %bpl
je 0x27f5
movq 0x685f(%rip), %r12      # 0x8fd8
leaq 0x38b6(%rip), %rsi      # 0x6036
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 0x682c(%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 0x2e4f
jmp 0x2878
movq 0x67dc(%rip), %r12      # 0x8fd8
leaq 0x3843(%rip), %rsi      # 0x6046
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 0x67a9(%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 0x3272
movq %rbx, %rdi
callq 0x48bc
movl $0x30, %esi
movq %rbx, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x42e0
movl $0x38, %esi
movq %r14, %rdi
callq 0x2150
movq %r15, %rdi
callq 0x4b7c
movl $0x10, %esi
movq %r15, %rdi
callq 0x2150
leaq 0x40(%rsp), %rdi
callq 0x3e16
leaq 0x20(%rsp), %rdi
callq 0x3e16
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
xorl %r12d, %r12d
jmp 0x2427
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
jmp 0x290b
jmp 0x2954
movq %rax, %r12
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2957
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2957
jmp 0x2954
movq %rax, %r12
movl $0x10, %esi
movq %r15, %rdi
jmp 0x294d
movq %rax, %r12
movl $0x38, %esi
movq %r14, %rdi
jmp 0x294d
movq %rax, %r12
movl $0x30, %esi
movq %rbx, %rdi
callq 0x2150
jmp 0x296b
movq %rax, %r12
leaq 0x40(%rsp), %rdi
callq 0x3e16
leaq 0x20(%rsp), %rdi
callq 0x3e16
movq %r12, %rdi
callq 0x21f0