// File: /workspace/github_cpp_makefile_star2_O3/jaxonwang[P]suffixtree/main.cc
// Function: main
int main(int argc, char *argv[]) {

  if (argc != 2) {
    std::cout << "Usage: a.out str" << std::endl;
    return -1;
  }

  std::string s1 = rand_str(stoi(argv[1]));

  auto t_start = steady_clock::now();
  SuffixTreeNaive st2{s1};
  st2.build();

  auto t_end = steady_clock::now();
  auto dur = duration<double>(t_end - t_start).count();
  cout << "Test: naive Execution time: " << dur << endl;

  t_start = steady_clock::now();
  SuffixTreeImpl st1{s1};
  st1.build();
  t_end = steady_clock::now();
  dur = duration<double>(t_end - t_start).count();
  cout << "Test: impl Execution time: " << dur << endl;

  std::cout << (st2 == st1) << std::endl;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
cmpl $0x2, %edi
jne 0x279f
movq 0x8(%rsi), %rsi
leaq -0x98(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x2090
movq -0x98(%rbp), %rbx
callq 0x2040
movq %rax, %r14
movl (%rax), %r12d
movl $0x0, (%rax)
leaq -0xe0(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x21f0
cmpq %rbx, (%r15)
je 0x27f6
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x2802
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x2802
testl %ecx, %ecx
jne 0x25c2
movl %r12d, (%r14)
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x245c
leaq -0x88(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x25e3
callq 0x2180
callq 0x21e0
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2adc
leaq -0xe0(%rbp), %rdi
callq 0x2870
callq 0x21e0
movq %rax, %r14
movq 0x59ba(%rip), %rdi      # 0x7fd0
leaq 0x2a04(%rip), %rsi      # 0x5021
movl $0x1c, %edx
callq 0x21c0
subq %rbx, %r14
cvtsi2sd %r14, %xmm0
divsd 0x29d1(%rip), %xmm0     # 0x5008
movq 0x5992(%rip), %rdi      # 0x7fd0
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
callq 0x21e0
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2adc
leaq -0x98(%rbp), %rdi
movq $0x0, 0x48(%rdi)
callq 0x29e2
callq 0x21e0
movq %rax, %r14
movq 0x5928(%rip), %rdi      # 0x7fd0
leaq 0x298f(%rip), %rsi      # 0x503e
movl $0x1b, %edx
callq 0x21c0
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x293c(%rip), %xmm0     # 0x5008
movq 0x58fd(%rip), %rdi      # 0x7fd0
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0xb8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3e20
movzbl %al, %esi
movq 0x58b4(%rip), %rdi      # 0x7fd0
callq 0x2270
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0x2be0
movq -0x30(%rbx), %rdi
cmpq %r15, %rdi
je 0x2765
callq 0x2180
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
callq 0x2be0
movq -0x30(%rbx), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x2789
callq 0x2180
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x279b
callq 0x2180
xorl %eax, %eax
jmp 0x27e6
movq 0x582a(%rip), %rbx      # 0x7fd0
leaq 0x2863(%rip), %rsi      # 0x5010
movl $0x10, %edx
movq %rbx, %rdi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x285d(%rip), %rdi      # 0x505a
callq 0x20e0
leaq 0x2851(%rip), %rdi      # 0x505a
callq 0x2210
jmp 0x2836
jmp 0x2836
movq %rax, %rbx
jmp 0x2856
movq %rax, %rbx
jmp 0x282d
movq %rax, %rbx
jmp 0x2868
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x282d
movl %r12d, (%r14)
leaq -0x88(%rbp), %rax
jmp 0x285a
movq %rax, %rbx
jmp 0x284a
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x2aa2
leaq -0xe0(%rbp), %rdi
callq 0x2aa2
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2868
callq 0x2180
movq %rbx, %rdi
callq 0x2290