// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x70, %rsp
movq 0x8(%rsi), %rdi
cmpb $0x68, (%rdi)
jne 0x2411
cmpb $0x74, 0x1(%rdi)
jne 0x2411
cmpb $0x0, 0x2(%rdi)
je 0x274c
leaq 0x2bec(%rip), %rsi      # 0x5004
callq 0x21e0
testl %eax, %eax
setne %r12b
xorl %ebp, %ebp
pushq $0x30
popq %rdi
callq 0x2170
movq %rax, %rbx
movq %rax, %rdi
callq 0x3bd8
pushq $0x38
popq %rdi
callq 0x2170
movq %rax, %r14
movq %rax, %rdi
callq 0x35dc
pushq $0x10
popq %rdi
callq 0x2170
movq %rax, %r15
movq %rax, %rdi
callq 0x3f48
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
leaq 0x2b91(%rip), %rsi      # 0x500f
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2b61(%rip), %rsi      # 0x500e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2b2d(%rip), %rsi      # 0x5009
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2b06(%rip), %rsi      # 0x5011
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2ad9(%rip), %rsi      # 0x5013
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2aae(%rip), %rsi      # 0x5017
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2a86(%rip), %rsi      # 0x501e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2a59(%rip), %rsi      # 0x5020
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2a2f(%rip), %rsi      # 0x5025
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2a03(%rip), %rsi      # 0x5028
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x32bc
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x337e
leaq 0x10(%rsp), %rdi
callq 0x20b0
testb %r12b, %r12b
je 0x2684
movq 0x597f(%rip), %rdi      # 0x7fd8
leaq 0x29cc(%rip), %rsi      # 0x502c
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
callq 0x20c0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x27d1
jmp 0x26f0
testb %bpl, %bpl
je 0x26bb
movq 0x5948(%rip), %rdi      # 0x7fd8
leaq 0x299f(%rip), %rsi      # 0x5036
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
callq 0x20c0
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x2a7f
jmp 0x26f0
movq 0x5916(%rip), %rdi      # 0x7fd8
leaq 0x297d(%rip), %rsi      # 0x5046
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
callq 0x20c0
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
callq 0x2cc5
movq %rbx, %rdi
callq 0x3c74
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x2180
movq %r14, %rdi
callq 0x3676
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0x2180
movq %r15, %rdi
callq 0x3f52
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x2180
leaq 0x50(%rsp), %rdi
callq 0x32f8
leaq 0x30(%rsp), %rdi
callq 0x32f8
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
xorl %r12d, %r12d
jmp 0x2425
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
jmp 0x277b
jmp 0x27b2
movq %rax, %r12
leaq 0x10(%rsp), %rdi
callq 0x20b0
jmp 0x27b5
jmp 0x27b2
movq %rax, %r12
pushq $0x10
popq %rsi
movq %r15, %rdi
jmp 0x27ab
movq %rax, %r12
pushq $0x38
popq %rsi
movq %r14, %rdi
jmp 0x27ab
movq %rax, %r12
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x2180
jmp 0x27c9
movq %rax, %r12
leaq 0x50(%rsp), %rdi
callq 0x32f8
leaq 0x30(%rsp), %rdi
callq 0x32f8
movq %r12, %rdi
callq 0x2230