// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/string_matching.c
// Function: gt_string_matching_kmp
GtUword gt_string_matching_kmp(const char *s, GtUword n,
                                     const char *p, GtUword m,
                                     GtProcessMatch process_match, void *data)
{
  GtUword *prefixtab,
                j = 0,   /* position in s corresponding to the first character
                            in p */
                cpl = 0; /* length of common prefix of s[j]..s[n-1] and p */
  char b, c;
  gt_assert(s && p);
  if (!m || !n) /* no match possible */
    return 0;
  prefixtab = compute_prefixtab(p, m);
  while (j + cpl < n) {
    if (cpl == m) {                     /* case (1)  */
      if (process_match) {
        if (process_match(j, data))
            break;
      }
      j = j + cpl - prefixtab[cpl];
      cpl = prefixtab[cpl];
    }
    else {                              /* case (2)  */
      b = s[j+cpl];
      c = p[cpl];
      if (b != c) {
        if (cpl > 0) {
          j = j + cpl - prefixtab[cpl]; /* case (2a) */
          cpl = prefixtab[cpl];
        }
        else
          j++;                          /* case (2b) */

      }
      else
        cpl++;                          /* case (2c) */
    }
  }
  /* do not miss match at the last possible position */
  if (cpl == m && process_match)
    process_match(j, data);
  gt_free(prefixtab);
  return cpl;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %r9, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x1e9d14
cmpq $0x0, 0x38(%rsp)
jne 0x1e9d4c
movq 0x452285(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x32c2ee(%rip), %rsi    # 0x516013
leaq 0x37e411(%rip), %rdx    # 0x56813d
leaq 0x37e447(%rip), %rcx    # 0x56817a
leaq 0x37e421(%rip), %r8     # 0x56815b
movl $0x58, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1e9d4e
cmpq $0x0, 0x30(%rsp)
je 0x1e9d5e
cmpq $0x0, 0x40(%rsp)
jne 0x1e9d6c
movq $0x0, 0x50(%rsp)
jmp 0x1e9ed5
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1e9ee0
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x1e9e90
movq 0x8(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x1e9dfc
cmpq $0x0, 0x28(%rsp)
je 0x1e9dc7
movq 0x28(%rsp), %rax
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1e9dc0
jmp 0x1e9dc5
jmp 0x1e9e90
jmp 0x1e9dc7
movq 0x10(%rsp), %rax
addq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdx
subq (%rcx,%rdx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
jmp 0x1e9e8b
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
addq 0x8(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x7(%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x6(%rsp)
movsbl 0x7(%rsp), %eax
movsbl 0x6(%rsp), %ecx
cmpl %ecx, %eax
je 0x1e9e7b
cmpq $0x0, 0x8(%rsp)
jbe 0x1e9e6b
movq 0x10(%rsp), %rax
addq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdx
subq (%rcx,%rdx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
jmp 0x1e9e79
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x1e9e89
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x1e9e8b
jmp 0x1e9d80
movq 0x8(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x1e9eb5
cmpq $0x0, 0x28(%rsp)
je 0x1e9eb5
movq 0x28(%rsp), %rax
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq *%rax
movq 0x18(%rsp), %rdi
leaq 0x37e29a(%rip), %rsi    # 0x56815b
movl $0x78, %edx
callq 0xe88c0
movq 0x8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nop