// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, 0x8(%rdi)
movq (%rsi), %r14
movq 0x8(%rsi), %r15
leaq 0x58(%rdi), %r12
leaq 0xc8(%rdi), %r13
leaq 0xb0(%rdi), %rbp
cmpq %r15, %r14
je 0x275a
movq 0x8(%r14), %rax
cmpq $0x2, %rax
ja 0x2730
movq %rbp, %rdi
cmpq $0x1, %rax
je 0x274c
movq %r13, %rdi
cmpq $0x2, %rax
je 0x274c
jmp 0x2754
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 0x343e
addq $0x20, %r14
jmp 0x270d
movq 0x60(%rbx), %rcx
subq 0x58(%rbx), %rcx
movq 0x28(%rbx), %rax
sarq $0x5, %rcx
movq %rcx, 0x10(%rbx)
xorl %ecx, %ecx
cmpq 0x20(%rbx), %rcx
jae 0x2787
movq 0x8(%rbx), %rdx
addq $-0x2, %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
jmp 0x2770
xorl %r12d, %r12d
cmpq 0x10(%rbx), %r12
jae 0x2824
movq 0x8(%rbx), %r15
movq %r15, %r13
negq %r13
movq %r12, %rbp
shlq $0x5, %rbp
cmpq $0x2, %r15
jbe 0x281c
movq 0x58(%rbx), %rsi
addq %rbp, %rsi
leaq -0x1(%r15), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x346a
movq 0x8(%rbx), %rcx
movq 0x28(%rbx), %rdx
leaq (%rcx,%r13), %rsi
movl %eax, %eax
movq (%rdx,%rax,8), %rdi
cmpq %rdi, %rsi
cmovbq %rsi, %rdi
movq %rdi, (%rdx,%rax,8)
cmpq %r15, %rcx
jne 0x2814
movq %r12, 0x10(%rsp)
movq 0x58(%rbx), %rcx
movq (%rcx,%rbp), %rdx
movsbl (%rdx), %esi
movb 0x18(%rbx), %cl
shll %cl, %esi
movsbl 0x1(%rdx), %ecx
addl %esi, %ecx
movl %ecx, 0x8(%rsp)
imulq $0x18, %rax, %rdi
addq 0x40(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3494
incq %r13
movq %r14, %r15
jmp 0x27a5
incq %r12
jmp 0x278a
movq 0xb8(%rbx), %rax
cmpq 0xb0(%rbx), %rax
je 0x283a
movb $0x1, 0x70(%rbx)
jmp 0x2852
movq 0xd0(%rbx), %rax
cmpq 0xc8(%rbx), %rax
setne 0x70(%rbx)
je 0x2940
leaq 0x80(%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0x2c46
leaq 0x98(%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0x34b2
movq 0x78(%rbx), %rax
xorl %r14d, %r14d
cmpq %rax, %r14
jae 0x28c5
movq 0x80(%rbx), %rax
orq $-0x1, (%rax,%r14,8)
imulq $0x18, %r14, %r15
movq 0x98(%rbx), %rdi
addq %r15, %rdi
movq 0x78(%rbx), %rsi
callq 0x2c46
addq 0x98(%rbx), %r15
xorl %ecx, %ecx
movq 0x78(%rbx), %rax
cmpq %rax, %rcx
jae 0x28c0
movq (%r15), %rax
orq $-0x1, (%rax,%rcx,8)
incq %rcx
jmp 0x28aa
incq %r14
jmp 0x2879
movq 0xb8(%rbx), %rax
movq 0x80(%rbx), %rcx
movq 0xb0(%rbx), %rdx
subq %rdx, %rax
sarq $0x5, %rax
xorl %esi, %esi
cmpq %rsi, %rax
je 0x28fc
movq (%rdx), %rdi
movsbq (%rdi), %rdi
movq %rsi, (%rcx,%rdi,8)
incq %rsi
addq $0x20, %rdx
jmp 0x28e3
movq 0xd0(%rbx), %rax
movq 0x98(%rbx), %rcx
movq 0xc8(%rbx), %rdx
subq %rdx, %rax
sarq $0x5, %rax
xorl %esi, %esi
cmpq %rsi, %rax
je 0x2940
movq (%rdx), %rdi
movsbq (%rdi), %r8
imulq $0x18, %r8, %r8
movsbq 0x1(%rdi), %rdi
movq (%rcx,%r8), %r8
movq %rsi, (%r8,%rdi,8)
incq %rsi
addq $0x20, %rdx
jmp 0x291a
movb $0x1, 0xe0(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq