// File: /workspace/github_cpp_makefile_star2_O3/bubiche[P]wu_manber/main.cpp
// Function: main
int main()
{
  // simple driver program for th Wu - Manber algorithm
  wu_manber::WuManber<char> wuManber;
  std::vector<std::string> patternList = { "some", "word", "abracadabra", "x", "ra" };
  std::string text = "xrayx someabracadabra";
  wuManber.preProcess(patternList);
  wuManber.scan(text,
    [](const std::string &pattern, size_t indexInPatternList, size_t startIndexInText) {
      std::cout << "Matched pattern #" << indexInPatternList <<": '" << pattern << "' at position " << startIndexInText << std::endl;
    }
  );
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0xe0(%rsp), %rdi
movl $0x8000, %edx           # imm = 0x8000
movl $0x4, %esi
callq 0x2710
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1c22(%rip), %rsi      # 0x4004
leaq 0x1c1f(%rip), %rdx      # 0x4008
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x33e2
leaq 0x60(%rsp), %r15
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1bfe(%rip), %rsi      # 0x4009
leaq 0x1bfb(%rip), %rdx      # 0x400d
movq %r15, %rdi
callq 0x33e2
leaq 0x80(%rsp), %r15
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1be5(%rip), %rsi      # 0x401a
leaq 0x1be9(%rip), %rdx      # 0x4025
movq %r15, %rdi
callq 0x33e2
leaq 0xa0(%rsp), %r15
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1baf(%rip), %rsi      # 0x400e
leaq 0x1ba9(%rip), %rdx      # 0x400f
movq %r15, %rdi
callq 0x33e2
leaq 0xc0(%rsp), %r15
leaq 0xd0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1b9a(%rip), %rsi      # 0x4023
leaq 0x1b95(%rip), %rdx      # 0x4025
movq %r15, %rdi
callq 0x33e2
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x5, %edx
callq 0x2834
movq $-0xa0, %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x24cc
movq (%rbx), %rsi
incq %rsi
callq 0x2120
addq $-0x20, %rbx
addq $0x20, %r14
jne 0x24b8
leaq 0x40(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1b2b(%rip), %rsi      # 0x4010
leaq 0x1b39(%rip), %rdx      # 0x4025
callq 0x33e2
leaq 0xe0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x287c
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
leaq 0x12f(%rip), %rax       # 0x2644
movq %rax, 0x18(%rdx)
leaq 0x1d8(%rip), %rax       # 0x26f8
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2b5c
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x254f
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x2566
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x2e6a
leaq 0xe0(%rsp), %rdi
callq 0x2ec8
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x25ae
movq %rax, %rbx
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x25b9
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x25b9
movq %rax, %rdi
callq 0x2f3f
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x25d5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2120
jmp 0x25d5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2e6a
jmp 0x262e
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x21b0
jmp 0x262e
jmp 0x25fe
jmp 0x25fe
jmp 0x25fe
movq %rax, %rbx
addq $-0x10, %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2619
movq (%r15), %rsi
incq %rsi
callq 0x2120
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x2605
jmp 0x262e
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x2ec8
movq %rbx, %rdi
callq 0x2180
nop