// File: /workspace/github_cpp_makefile_star2_O3/bubiche[P]wu_manber/./wu_manber.hpp
// Function: wu_manber::WuManber<char, std::char_traits<char>>::preProcess(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void preProcess(const std::vector<StringType> &patterns) {
      m_ = 0;
      for (const auto &pattern : patterns) {
        std::size_t patternLength = pattern.size();
        if (patternLength < B_) {
          if (patternLength == 1) {
            lengthOnePatterns_.push_back(pattern);
          } else if (patternLength == 2) {
            lengthTwoPatterns_.push_back(pattern);
          }
          continue;
        }
        m_ = (!m_) ? patternLength : std::min(patternLength, m_);
        patternList_.push_back(pattern);
      }
      k_ = patternList_.size();

      // fill default value for SHIFT table
      for (std::size_t i = 0; i < tableSize_; ++i) {
        shiftTable_[i] = m_ - B_ + 1;
      }

      // fill HASH/PREFIX and SHIFT tables
      for (std::size_t i = 0; i < k_; ++i) {
        for (std::size_t j = m_; j >= B_; --j) {
          unsigned int hashValue = getWuManberTableHashFromText_(patternList_[i], j - 1);

          std::size_t shiftLength = m_ - j;
          shiftTable_[hashValue] = std::min(shiftTable_[hashValue], shiftLength);
          if (!shiftLength) {
            PatternHash patternHashToAdd;
            patternHashToAdd.idx = i;

            // calculate this prefixHash to help us skip some patterns if there are collisions in hashPrefixTable_
            patternHashToAdd.prefixHash = getPrefixHashFromText_(patternList_[i], 0);
            hashPrefixTable_[hashValue].push_back(patternHashToAdd);
          }
        }
      }

      isShortPatternExist_ = (lengthOnePatterns_.size() > 0) || (lengthTwoPatterns_.size() > 0);
      if (isShortPatternExist_) {
        lengthOnePatternLookup_.resize(alphabetSize_);
        lengthTwoPatternLookup_.resize(alphabetSize_);
        for (std::size_t i = 0; i < alphabetSize_; ++i) {
          lengthOnePatternLookup_[i] = -1;
          lengthTwoPatternLookup_[i].resize(alphabetSize_);
          for (std::size_t j = 0; j < alphabetSize_; ++j) {
            lengthTwoPatternLookup_[i][j] = -1;
          }
        }

        for (std::size_t i = 0; i < lengthOnePatterns_.size(); ++i) {
          lengthOnePatternLookup_[static_cast<std::size_t>(lengthOnePatterns_[i][0])] = i;
        }

        for (std::size_t i = 0; i < lengthTwoPatterns_.size(); ++i) {
          lengthTwoPatternLookup_[static_cast<std::size_t>(lengthTwoPatterns_[i][0])][static_cast<std::size_t>(lengthTwoPatterns_[i][1])] = i;
        }
      }

      isInitialized_ = true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
movq (%rsi), %r14
movq 0x8(%rsi), %r15
cmpq %r15, %r14
je 0x28fe
leaq 0x58(%rbx), %r12
leaq 0xc8(%rbx), %r13
leaq 0xb0(%rbx), %rbp
movq 0x8(%r14), %rax
cmpq $0x2, %rax
ja 0x28d1
movq %rbp, %rdi
cmpq $0x1, %rax
je 0x28ed
movq %r13, %rdi
cmpq $0x2, %rax
je 0x28ed
jmp 0x28f5
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
movq %rax, %rdx
cmovbq %rcx, %rdx
testq %rcx, %rcx
cmoveq %rax, %rdx
movq %rdx, 0x8(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq 0x3660
addq $0x20, %r14
cmpq %r15, %r14
jne 0x28b3
movq 0x60(%rbx), %rax
subq 0x58(%rbx), %rax
sarq $0x5, %rax
movq %rax, 0x10(%rbx)
cmpq $0x0, 0x20(%rbx)
je 0x2934
movq 0x28(%rbx), %rax
xorl %ecx, %ecx
movq 0x8(%rbx), %rdx
addq $-0x2, %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq 0x20(%rbx), %rcx
jb 0x291b
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x2a0d
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
movq 0x8(%rbx), %r12
cmpq $0x3, %r12
jb 0x2a01
movq %r12, %r13
negq %r13
movq %r15, %rbp
shlq $0x5, %rbp
movq 0x58(%rbx), %rax
movq (%rax,%rbp), %rsi
movsbl -0x1(%r12,%rsi), %eax
movzwl 0x18(%rbx), %ecx
shll %cl, %eax
movsbl -0x2(%r12,%rsi), %edx
addl %eax, %edx
shll %cl, %edx
movsbl -0x3(%r12,%rsi), %eax
addl %edx, %eax
xorl %edx, %edx
divq 0x20(%rbx)
movq 0x8(%rbx), %rax
movq 0x28(%rbx), %rdi
leaq (%rax,%r13), %r8
movq (%rdi,%rdx,8), %r9
cmpq %r9, %r8
cmovbq %r8, %r9
movq %r9, (%rdi,%rdx,8)
cmpq %rax, %r12
jne 0x29ed
movq %r15, 0x10(%rsp)
movsbl (%rsi), %eax
shll %cl, %eax
movsbl 0x1(%rsi), %ecx
addl %eax, %ecx
movl %ecx, 0x8(%rsp)
movq 0x40(%rbx), %rax
leaq (%rdx,%rdx,2), %rcx
leaq (%rax,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x29e5
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x29ed
movq %r14, %rdx
callq 0x38ca
decq %r12
incq %r13
cmpq $0x2, %r12
ja 0x2960
movq 0x10(%rbx), %rax
incq %r15
cmpq %rax, %r15
jb 0x2945
movq 0xb8(%rbx), %rax
cmpq 0xb0(%rbx), %rax
je 0x2a23
movb $0x1, 0x70(%rbx)
jmp 0x2a3b
movq 0xd0(%rbx), %rax
cmpq 0xc8(%rbx), %rax
setne 0x70(%rbx)
je 0x2b45
leaq 0x80(%rbx), %r15
movq 0x78(%rbx), %rsi
movq %r15, %rdi
callq 0x2f4a
leaq 0x98(%rbx), %r14
movq 0x78(%rbx), %rsi
movq %r14, %rdi
callq 0x369e
cmpq $0x0, 0x78(%rbx)
je 0x2ac2
xorl %r12d, %r12d
movq 0x80(%rbx), %rax
movq $-0x1, (%rax,%r12,8)
leaq (%r12,%r12,2), %r13
leaq (,%r13,8), %rdi
addq 0x98(%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0x2f4a
cmpq $0x0, 0x78(%rbx)
je 0x2ac2
movq (%r14), %rax
movq (%rax,%r13,8), %rax
xorl %ecx, %ecx
movq $-0x1, (%rax,%rcx,8)
incq %rcx
movq 0x78(%rbx), %rdx
cmpq %rdx, %rcx
jb 0x2aa6
incq %r12
cmpq %rdx, %r12
jb 0x2a6b
movq 0xb0(%rbx), %rax
movq 0xb8(%rbx), %rcx
subq %rax, %rcx
je 0x2afd
sarq $0x5, %rcx
movq (%r15), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %esi, %esi
movq (%rax), %rdi
movsbq (%rdi), %rdi
movq %rsi, (%rdx,%rdi,8)
incq %rsi
addq $0x20, %rax
cmpq %rsi, %rcx
jne 0x2ae6
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
subq %rax, %rcx
je 0x2b45
sarq $0x5, %rcx
movq (%r14), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %esi, %esi
movq (%rax), %rdi
movsbq (%rdi), %r8
leaq (%r8,%r8,2), %r8
movsbq 0x1(%rdi), %rdi
movq (%rdx,%r8,8), %r8
movq %rsi, (%r8,%rdi,8)
incq %rsi
addq $0x20, %rax
cmpq %rsi, %rcx
jne 0x2b21
movb $0x1, 0xe0(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop