// File: 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 %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movl $0x0, -0x4(%rbp)
leaq -0xf0(%rbp), %rdi
movl $0x4, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x2d70
movb $0x1, -0x1d9(%rbp)
leaq -0x1b8(%rbp), %rax
movq %rax, -0x240(%rbp)
movq %rax, -0x1c0(%rbp)
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x2260
movq -0x240(%rbp), %rdi
movq -0x238(%rbp), %rdx
leaq 0x6bd4(%rip), %rsi      # 0x9020
callq 0x2ed0
jmp 0x2453
leaq -0x198(%rbp), %rax
movq %rax, -0x250(%rbp)
movq %rax, -0x1c0(%rbp)
leaq -0x1d5(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x2260
movq -0x250(%rbp), %rdi
movq -0x248(%rbp), %rdx
leaq 0x6b95(%rip), %rsi      # 0x9025
callq 0x2ed0
jmp 0x2497
leaq -0x178(%rbp), %rax
movq %rax, -0x260(%rbp)
movq %rax, -0x1c0(%rbp)
leaq -0x1d6(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x2260
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rdx
leaq 0x6b62(%rip), %rsi      # 0x9036
callq 0x2ed0
jmp 0x24db
leaq -0x158(%rbp), %rax
movq %rax, -0x270(%rbp)
movq %rax, -0x1c0(%rbp)
leaq -0x1d7(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x2260
movq -0x270(%rbp), %rdi
movq -0x268(%rbp), %rdx
leaq 0x6b12(%rip), %rsi      # 0x902a
callq 0x2ed0
jmp 0x251f
leaq -0x138(%rbp), %rax
movq %rax, -0x280(%rbp)
movq %rax, -0x1c0(%rbp)
leaq -0x1d8(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x2260
movq -0x280(%rbp), %rdi
movq -0x278(%rbp), %rdx
leaq 0x6ae3(%rip), %rsi      # 0x903f
callq 0x2ed0
jmp 0x2563
movb $0x0, -0x1d9(%rbp)
leaq -0x1b8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq $0x5, -0x110(%rbp)
leaq -0x1da(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x2f80
movq -0x288(%rbp), %rcx
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
leaq -0x108(%rbp), %rdi
callq 0x2fa0
jmp 0x25b9
leaq -0x1da(%rbp), %rdi
callq 0x3020
leaq -0x1b8(%rbp), %rax
movq %rax, -0x298(%rbp)
addq $0xa0, %rax
movq %rax, -0x290(%rbp)
movq -0x290(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x20e0
movq -0x298(%rbp), %rcx
movq -0x2a0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x290(%rbp)
jne 0x25e0
leaq -0x1d8(%rbp), %rdi
callq 0x21c0
leaq -0x1d7(%rbp), %rdi
callq 0x21c0
leaq -0x1d6(%rbp), %rdi
callq 0x21c0
leaq -0x1d5(%rbp), %rdi
callq 0x21c0
leaq -0x1c1(%rbp), %rdi
callq 0x21c0
leaq -0x201(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x2260
movq -0x2a8(%rbp), %rdx
leaq 0x69be(%rip), %rsi      # 0x902c
leaq -0x200(%rbp), %rdi
callq 0x2ed0
jmp 0x267c
leaq -0x201(%rbp), %rdi
callq 0x21c0
leaq -0xf0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x3040
jmp 0x269d
leaq -0x228(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
leaq -0x229(%rbp), %rsi
callq 0x2910
movq -0x2b0(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x3640
jmp 0x26d3
leaq -0x228(%rbp), %rdi
callq 0x3b40
movl $0x0, -0x4(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x20e0
leaq -0x108(%rbp), %rdi
callq 0x3b60
leaq -0xf0(%rbp), %rdi
callq 0x3bc0
movl -0x4(%rbp), %eax
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x2822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x2816
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x280a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x27fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x27f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x1da(%rbp), %rdi
callq 0x3020
leaq -0x1b8(%rbp), %rax
movq %rax, -0x2c0(%rbp)
addq $0xa0, %rax
movq %rax, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x20e0
movq -0x2c0(%rbp), %rcx
movq -0x2c8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2b8(%rbp)
jne 0x27bf
jmp 0x27f2
leaq -0x1d8(%rbp), %rdi
callq 0x21c0
leaq -0x1d7(%rbp), %rdi
callq 0x21c0
leaq -0x1d6(%rbp), %rdi
callq 0x21c0
leaq -0x1d5(%rbp), %rdi
callq 0x21c0
leaq -0x1c1(%rbp), %rdi
callq 0x21c0
testb $0x1, -0x1d9(%rbp)
jne 0x2839
jmp 0x2886
movq -0x1c0(%rbp), %rax
leaq -0x1b8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x2d0(%rbp)
je 0x2884
movq -0x2d0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x20e0
movq -0x2d8(%rbp), %rax
leaq -0x1b8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x2d0(%rbp)
jne 0x2853
jmp 0x2886
jmp 0x28f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x201(%rbp), %rdi
callq 0x21c0
jmp 0x28e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x28da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3b40
leaq -0x200(%rbp), %rdi
callq 0x20e0
leaq -0x108(%rbp), %rdi
callq 0x3b60
leaq -0xf0(%rbp), %rdi
callq 0x3bc0
movq -0x1d0(%rbp), %rdi
callq 0x2250
nopw (%rax,%rax)