// File: /workspace/github_cpp_makefile_star2_O1/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 0x2728
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1c22(%rip), %rsi      # 0x4004
leaq 0x1c1f(%rip), %rdx      # 0x4008
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x33d4
leaq 0x60(%rsp), %rbx
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1bfe(%rip), %rsi      # 0x4009
leaq 0x1bfb(%rip), %rdx      # 0x400d
movq %rbx, %rdi
callq 0x33d4
leaq 0x80(%rsp), %rbx
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1be5(%rip), %rsi      # 0x401a
leaq 0x1be9(%rip), %rdx      # 0x4025
movq %rbx, %rdi
callq 0x33d4
leaq 0xa0(%rsp), %rbx
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1baf(%rip), %rsi      # 0x400e
leaq 0x1ba9(%rip), %rdx      # 0x400f
movq %rbx, %rdi
callq 0x33d4
leaq 0xc0(%rsp), %rbx
leaq 0xd0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b9a(%rip), %rsi      # 0x4023
leaq 0x1b95(%rip), %rdx      # 0x4025
movq %rbx, %rdi
callq 0x33d4
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x5, %edx
callq 0x284c
movq $-0xa0, %rbx
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x24cc
movq (%r14), %rsi
incq %rsi
callq 0x2120
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x24b8
leaq 0x40(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1b2b(%rip), %rsi      # 0x4010
leaq 0x1b39(%rip), %rdx      # 0x4025
callq 0x33d4
leaq 0xe0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2894
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
leaq 0x147(%rip), %rax       # 0x265c
movq %rax, 0x18(%rdx)
leaq 0x1f0(%rip), %rax       # 0x2710
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2b72
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 0x2e68
leaq 0xe0(%rsp), %rdi
callq 0x2ec4
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x25ae
movq %rax, %r14
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 0x2f3b
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x25d5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2120
jmp 0x25d5
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2e68
jmp 0x2646
movq %rax, %r14
leaq 0xe0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x21b0
movb $0x1, %al
jmp 0x260f
jmp 0x2600
jmp 0x2600
jmp 0x2600
movq %rax, %r14
xorl %eax, %eax
jmp 0x260f
movq %rax, %r14
xorl %eax, %eax
movq %r15, %rbx
cmpq %rbx, %r15
sete %cl
orb %al, %cl
jne 0x2646
addq $-0x10, %rbx
leaq 0x40(%rsp), %r15
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x2636
movq (%rbx), %rsi
incq %rsi
callq 0x2120
leaq -0x20(%rbx), %rax
addq $-0x10, %rbx
cmpq %r15, %rbx
movq %rax, %rbx
jne 0x2622
leaq 0xe0(%rsp), %rdi
callq 0x2ec4
movq %r14, %rdi
callq 0x2180
nop