// File: elarielcl[P]ArielsSequitur/TestSequitur.cpp
// Function: main
int main() {
  vector<char*> v;
  vector <char*> :: iterator s;

  v.push_back((char*)"abcdbcabcd");
  v.push_back((char*)"cdddcdaddcd");
  v.push_back((char*)"cdddcdaddcdcdddcdaddcdcdddcdaddcdcdddcdaddcdcdddcdaddcdcdddcdaddcdcdddcdaddcdcdddcdaddcd");
  v.push_back((char*)"aaaaaaaaaaaaaaaaaaaaaaaa");
  v.push_back((char*)"ababababababababab");

  cout << "SIMPLE TEST" << endl << "=====================================" << endl << endl;
  for (s = v.begin(); s != v.end(); ++s)
    simpleTest(*s);

  vector<int> nOR;
  nOR.push_back(3);
  nOR.push_back(3);
  nOR.push_back(6);
  nOR.push_back(4);
  nOR.push_back(4); // Precomputed Values
  cout << "GRAMMAR SIZE TEST" << endl << "=====================================" << endl << endl;
  for (int i = 0; i < nOR.size(); ++i)
    numberOfRulesTest(v[i], nOR[i]);


  vector<int> sizes;
  sizes.push_back(8);
  sizes.push_back(9);
  sizes.push_back(15);
  sizes.push_back(9);
  sizes.push_back(9); // Precomputed Values
  cout << "GRAMMAR SIZE TEST" << endl << "=====================================" << endl << endl;
  for (int i = 0; i < sizes.size(); ++i)
    grammarSizeTest(v[i], sizes[i]);

  cout << "RULE USAGE TEST" << endl << "=====================================" << endl << endl;
  for (s = v.begin(); s != v.end(); ++s)
    ruleUsageTest(*s);

  cout << "DIGRAM UNIQUENESS TEST" << endl << "=====================================" << endl << endl;
  for (s = v.begin(); s != v.end(); ++s)
    digramUniquenessTest(*s);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movl $0x0, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x3db0
leaq -0x28(%rbp), %rdi
callq 0x3dd0
movq -0xf8(%rbp), %rdi
leaq 0x8adb(%rip), %rax      # 0xb004
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x3df0
jmp 0x2538
leaq 0x8b1d(%rip), %rax      # 0xb05c
movq %rax, -0x48(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3df0
jmp 0x2552
leaq 0x8ab6(%rip), %rax      # 0xb00f
movq %rax, -0x50(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3df0
jmp 0x256c
leaq 0x8af5(%rip), %rax      # 0xb068
movq %rax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3df0
jmp 0x2586
leaq 0x8af4(%rip), %rax      # 0xb081
movq %rax, -0x60(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3df0
jmp 0x25a0
movq 0xea31(%rip), %rdi      # 0x10fd8
leaq 0x8ae6(%rip), %rsi      # 0xb094
callq 0x2150
movq %rax, -0x100(%rbp)
jmp 0x25bc
movq -0x100(%rbp), %rdi
movq 0xe9fe(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x108(%rbp)
jmp 0x25d8
movq -0x108(%rbp), %rdi
leaq 0x8aba(%rip), %rsi      # 0xb0a0
callq 0x2150
movq %rax, -0x110(%rbp)
jmp 0x25f4
movq -0x110(%rbp), %rdi
movq 0xe9c6(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x118(%rbp)
jmp 0x2610
movq -0x118(%rbp), %rdi
movq 0xe9aa(%rip), %rsi      # 0x10fc8
callq 0x2190
jmp 0x2625
leaq -0x20(%rbp), %rdi
callq 0x3e20
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3e90
movq %rax, -0x70(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3e50
testb $0x1, %al
jne 0x265a
jmp 0x268b
leaq -0x28(%rbp), %rdi
callq 0x3ec0
movq (%rax), %rdi
callq 0x2c40
jmp 0x266d
jmp 0x266f
leaq -0x28(%rbp), %rdi
callq 0x3ee0
jmp 0x263a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2c2a
leaq -0x88(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x3f00
movq -0x120(%rbp), %rdi
movl $0x3, -0x8c(%rbp)
leaq -0x8c(%rbp), %rsi
callq 0x3f20
jmp 0x26bd
movl $0x3, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3f20
jmp 0x26dc
movl $0x6, -0x94(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x94(%rbp), %rsi
callq 0x3f20
jmp 0x26fb
movl $0x4, -0x98(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3f20
jmp 0x271a
movl $0x4, -0x9c(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0x3f20
jmp 0x2739
movq 0xe898(%rip), %rdi      # 0x10fd8
leaq 0x897f(%rip), %rsi      # 0xb0c6
callq 0x2150
movq %rax, -0x128(%rbp)
jmp 0x2755
movq -0x128(%rbp), %rdi
movq 0xe865(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x130(%rbp)
jmp 0x2771
movq -0x130(%rbp), %rdi
leaq 0x8921(%rip), %rsi      # 0xb0a0
callq 0x2150
movq %rax, -0x138(%rbp)
jmp 0x278d
movq -0x138(%rbp), %rdi
movq 0xe82d(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x140(%rbp)
jmp 0x27a9
movq -0x140(%rbp), %rdi
movq 0xe811(%rip), %rsi      # 0x10fc8
callq 0x2190
jmp 0x27be
movl $0x0, -0xa0(%rbp)
movslq -0xa0(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3f50
movq %rax, %rcx
movq -0x148(%rbp), %rax
cmpq %rcx, %rax
jae 0x2852
movslq -0xa0(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3f70
movq (%rax), %rax
movq %rax, -0x150(%rbp)
movslq -0xa0(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x3f90
movq -0x150(%rbp), %rdi
movl (%rax), %esi
callq 0x2eb0
jmp 0x282e
jmp 0x2830
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x27c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2c1e
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x3f00
movq -0x158(%rbp), %rdi
movl $0x8, -0xbc(%rbp)
leaq -0xbc(%rbp), %rsi
callq 0x3f20
jmp 0x2884
movl $0x9, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3f20
jmp 0x28a3
movl $0xf, -0xc4(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
callq 0x3f20
jmp 0x28c2
movl $0x9, -0xc8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3f20
jmp 0x28e1
movl $0x9, -0xcc(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xcc(%rbp), %rsi
callq 0x3f20
jmp 0x2900
movq 0xe6d1(%rip), %rdi      # 0x10fd8
leaq 0x87b8(%rip), %rsi      # 0xb0c6
callq 0x2150
movq %rax, -0x160(%rbp)
jmp 0x291c
movq -0x160(%rbp), %rdi
movq 0xe69e(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x168(%rbp)
jmp 0x2938
movq -0x168(%rbp), %rdi
leaq 0x875a(%rip), %rsi      # 0xb0a0
callq 0x2150
movq %rax, -0x170(%rbp)
jmp 0x2954
movq -0x170(%rbp), %rdi
movq 0xe666(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x178(%rbp)
jmp 0x2970
movq -0x178(%rbp), %rdi
movq 0xe64a(%rip), %rsi      # 0x10fc8
callq 0x2190
jmp 0x2985
movl $0x0, -0xd0(%rbp)
movslq -0xd0(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3f50
movq %rax, %rcx
movq -0x180(%rbp), %rax
cmpq %rcx, %rax
jae 0x2a25
movslq -0xd0(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3f70
movq (%rax), %rax
movq %rax, -0x188(%rbp)
movslq -0xd0(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x3f90
movq -0x188(%rbp), %rdi
movl (%rax), %esi
callq 0x3050
jmp 0x29f5
jmp 0x29f7
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x298f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3fb0
jmp 0x2c1e
movq 0xe5ac(%rip), %rdi      # 0x10fd8
leaq 0x86a5(%rip), %rsi      # 0xb0d8
callq 0x2150
movq %rax, -0x190(%rbp)
jmp 0x2a41
movq -0x190(%rbp), %rdi
movq 0xe579(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x198(%rbp)
jmp 0x2a5d
movq -0x198(%rbp), %rdi
leaq 0x8635(%rip), %rsi      # 0xb0a0
callq 0x2150
movq %rax, -0x1a0(%rbp)
jmp 0x2a79
movq -0x1a0(%rbp), %rdi
movq 0xe541(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x1a8(%rbp)
jmp 0x2a95
movq -0x1a8(%rbp), %rdi
movq 0xe525(%rip), %rsi      # 0x10fc8
callq 0x2190
jmp 0x2aaa
leaq -0x20(%rbp), %rdi
callq 0x3e20
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3e90
movq %rax, -0xe0(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3e50
testb $0x1, %al
jne 0x2aeb
jmp 0x2b0b
leaq -0x28(%rbp), %rdi
callq 0x3ec0
movq (%rax), %rdi
callq 0x31f0
jmp 0x2afe
jmp 0x2b00
leaq -0x28(%rbp), %rdi
callq 0x3ee0
jmp 0x2ac5
movq 0xe4c6(%rip), %rdi      # 0x10fd8
leaq 0x85cf(%rip), %rsi      # 0xb0e8
callq 0x2150
movq %rax, -0x1b0(%rbp)
jmp 0x2b27
movq -0x1b0(%rbp), %rdi
movq 0xe493(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x1b8(%rbp)
jmp 0x2b43
movq -0x1b8(%rbp), %rdi
leaq 0x854f(%rip), %rsi      # 0xb0a0
callq 0x2150
movq %rax, -0x1c0(%rbp)
jmp 0x2b5f
movq -0x1c0(%rbp), %rdi
movq 0xe45b(%rip), %rsi      # 0x10fc8
callq 0x2190
movq %rax, -0x1c8(%rbp)
jmp 0x2b7b
movq -0x1c8(%rbp), %rdi
movq 0xe43f(%rip), %rsi      # 0x10fc8
callq 0x2190
jmp 0x2b90
leaq -0x20(%rbp), %rdi
callq 0x3e20
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3e90
movq %rax, -0xf0(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x3e50
testb $0x1, %al
jne 0x2bd1
jmp 0x2bf1
leaq -0x28(%rbp), %rdi
callq 0x3ec0
movq (%rax), %rdi
callq 0x3810
jmp 0x2be4
jmp 0x2be6
leaq -0x28(%rbp), %rdi
callq 0x3ee0
jmp 0x2bab
leaq -0xb8(%rbp), %rdi
callq 0x3fb0
leaq -0x88(%rbp), %rdi
callq 0x3fb0
leaq -0x20(%rbp), %rdi
callq 0x4010
movl -0x4(%rbp), %eax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0x3fb0
leaq -0x20(%rbp), %rdi
callq 0x4010
movq -0x38(%rbp), %rdi
callq 0x2260
nopl (%rax)