// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/string_matching.c
// Function: gt_string_matching_bmh
void gt_string_matching_bmh(const char *s, GtUword n,
                            const char *p, GtUword m,
                            GtProcessMatch process_match, void *data)
{
  GtUword i, j, pos, d[UCHAR_MAX];
  gt_assert(s && p);
  if (m > n || !m || !n) /* no match possible */
    return;
  /* preprocessing */
  for (i = 0; i < UCHAR_MAX; i++)
    d[i] = m;
  for (j = 0; j < m-1; j++)
    d[(unsigned) p[j]] = m-(j+1);
  /* searching */
  pos = 0;
  while (pos <= n-m) {
    j = m;
    while (j > 0 && s[pos+j-1] == p[j-1])
      j--;
    if (j == 0 && process_match) {
      if (process_match(pos, data))
        return;
    }
    pos += d[(unsigned) s[pos+m-1]];
  }
}

// Assembly:
subq $0x858, %rsp            # imm = 0x858
movq %rdi, 0x850(%rsp)
movq %rsi, 0x848(%rsp)
movq %rdx, 0x840(%rsp)
movq %rcx, 0x838(%rsp)
movq %r8, 0x830(%rsp)
movq %r9, 0x828(%rsp)
cmpq $0x0, 0x850(%rsp)
je 0x1e9a7d
cmpq $0x0, 0x840(%rsp)
jne 0x1e9ab5
movq 0x45251c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x32c585(%rip), %rsi    # 0x516013
leaq 0x37e6a8(%rip), %rdx    # 0x56813d
leaq 0x37e6a8(%rip), %rcx    # 0x568144
leaq 0x37e6b8(%rip), %r8     # 0x56815b
movl $0x25, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1e9ab7
movq 0x838(%rsp), %rax
cmpq 0x848(%rsp), %rax
ja 0x1e9adf
cmpq $0x0, 0x838(%rsp)
je 0x1e9adf
cmpq $0x0, 0x848(%rsp)
jne 0x1e9ae4
jmp 0x1e9cbb
movq $0x0, 0x820(%rsp)
cmpq $0xff, 0x820(%rsp)
jae 0x1e9b29
movq 0x838(%rsp), %rcx
movq 0x820(%rsp), %rax
movq %rcx, 0x10(%rsp,%rax,8)
movq 0x820(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x820(%rsp)
jmp 0x1e9af0
movq $0x0, 0x818(%rsp)
movq 0x818(%rsp), %rax
movq 0x838(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x1e9b96
movq 0x838(%rsp), %rcx
movq 0x818(%rsp), %rax
addq $0x1, %rax
subq %rax, %rcx
movq 0x840(%rsp), %rax
movq 0x818(%rsp), %rdx
movsbl (%rax,%rdx), %eax
movl %eax, %eax
movq %rcx, 0x10(%rsp,%rax,8)
movq 0x818(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x818(%rsp)
jmp 0x1e9b35
movq $0x0, 0x810(%rsp)
movq 0x810(%rsp), %rax
movq 0x848(%rsp), %rcx
subq 0x838(%rsp), %rcx
cmpq %rcx, %rax
ja 0x1e9cbb
movq 0x838(%rsp), %rax
movq %rax, 0x818(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x818(%rsp)
movb %al, 0xf(%rsp)
jbe 0x1e9c25
movq 0x850(%rsp), %rax
movq 0x810(%rsp), %rcx
addq 0x818(%rsp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
movq 0x840(%rsp), %rcx
movq 0x818(%rsp), %rdx
subq $0x1, %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x1e9c2f
jmp 0x1e9c45
movq 0x818(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x818(%rsp)
jmp 0x1e9bd3
cmpq $0x0, 0x818(%rsp)
jne 0x1e9c7f
cmpq $0x0, 0x830(%rsp)
je 0x1e9c7f
movq 0x830(%rsp), %rax
movq 0x810(%rsp), %rdi
movq 0x828(%rsp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1e9c7b
jmp 0x1e9c7d
jmp 0x1e9cbb
jmp 0x1e9c7f
movq 0x850(%rsp), %rax
movq 0x810(%rsp), %rcx
addq 0x838(%rsp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
movl %eax, %eax
movq 0x10(%rsp,%rax,8), %rax
addq 0x810(%rsp), %rax
movq %rax, 0x810(%rsp)
jmp 0x1e9ba2
addq $0x858, %rsp            # imm = 0x858
retq
nopw %cs:(%rax,%rax)