// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-ovlfind-kmp.c
// Function: gt_ovlfind_kmp
GtContfind gt_ovlfind_kmp(const char *u, GtUword u_length,
    const gt_kmp_t *u_pi, const char *v, GtUword v_length,
    const gt_kmp_t *v_pi, GtOvlfindMode m, GtUword min_length,
    bool find_nonmaximal, void(*spmproc) (GtUword /* overlap length */,
    bool /* true if suffix of u == prefix of v, false if prefix of
    u == suffix of v */, void* /* spmprocdata */), void* spmprocdata)
{
  GtContfind retval = GT_CONTFIND_OFF;
  bool self_comparison;

  gt_assert(u != NULL);
  gt_assert(u_length > 0);
  gt_assert(u_pi != NULL);
  self_comparison = (v == NULL);
  gt_assert(self_comparison || v_length > 0);
  gt_assert(self_comparison || v_pi != NULL);
  gt_assert(!self_comparison || m == GT_OVLFIND_SPM || m == GT_OVLFIND_ALL);

  if (self_comparison && m == GT_OVLFIND_ALL)
    retval = GT_CONTFIND_EQ;
  if (m != GT_OVLFIND_SPM && !self_comparison)
  {
    if (u_length == v_length)
      retval = memcmp(u, v, (size_t)u_length) == 0
               ? GT_CONTFIND_EQ : GT_CONTFIND_NO;
    else if (u_length < v_length)
      retval = contfind_kmp(u, u_length, u_pi, v, v_length)
               ? GT_CONTFIND_U : GT_CONTFIND_NO;
    else /* u_length > v_length */
      retval = contfind_kmp(v, v_length, v_pi, u, u_length)
               ? GT_CONTFIND_V : GT_CONTFIND_NO;
    if (m == GT_OVLFIND_PROPER_SPM && retval != GT_CONTFIND_NO)
      return retval;
  }
  if (m != GT_OVLFIND_CNT)
  {
    if (self_comparison)
    {
      spmfind_kmp(u, u_length, u, u_length, u_pi, min_length, find_nonmaximal,
                 self_comparison, spmproc, true, spmprocdata);
    }
    else
    {
      spmfind_kmp(u, u_length, v, v_length, v_pi, min_length, find_nonmaximal,
                 self_comparison, spmproc, true, spmprocdata);
      spmfind_kmp(v, v_length, u, u_length, u_pi, min_length, find_nonmaximal,
                 self_comparison, spmproc, false, spmprocdata);
    }
  }
  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x2c9769
movq %rsi, %r14
testq %rsi, %rsi
je 0x2c9796
testq %rdx, %rdx
je 0x2c97c0
movq %r8, %r12
movq %rcx, %r13
testq %rcx, %rcx
sete %al
testq %r8, %r8
setne %cl
orb %al, %cl
je 0x2c97ea
testq %r13, %r13
sete %al
testq %r9, %r9
setne %cl
orb %al, %cl
je 0x2c9814
movq %rdi, %r15
movl 0x50(%rsp), %ebp
testq %r13, %r13
jne 0x2c9609
testl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
jne 0x2c984a
cmpl $0x2, %ebp
sete %al
testq %r13, %r13
sete %cl
testl %ebp, %ebp
sete %sil
orb %cl, %sil
movq %rdx, 0x10(%rsp)
je 0x2c96aa
andb %al, %cl
movzbl %cl, %ebx
addl %ebx, %ebx
cmpl $0x1, %ebp
je 0x2c974e
movq 0x70(%rsp), %r11
movb 0x60(%rsp), %al
movq 0x58(%rsp), %r10
subq $0x8, %rsp
testq %r13, %r13
je 0x2c96eb
movzbl %al, %ebp
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r9, %r8
movq %r10, %r9
pushq %r11
pushq $0x1
movq 0x80(%rsp), %rax
pushq %rax
pushq $0x0
pushq %rbp
callq 0x2c9905
addq $0x28, %rsp
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq 0x18(%rsp), %r8
movq 0x60(%rsp), %r9
pushq 0x78(%rsp)
pushq $0x0
pushq 0x80(%rsp)
pushq $0x0
pushq %rbp
jmp 0x2c9714
cmpq %r12, %r14
movq %r9, 0x8(%rsp)
jne 0x2c96cc
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x177e0
xorl %ebx, %ebx
cmpl $0x1, %eax
adcl $0x1, %ebx
jmp 0x2c973b
jae 0x2c971f
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rcx
movq %r12, %r8
callq 0x2c9874
movzbl %al, %eax
leal 0x1(,%rax,2), %ebx
jmp 0x2c973b
movq %r10, %r9
pushq $0x1
popq %r10
movzbl %al, %eax
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq 0x18(%rsp), %r8
pushq %r11
pushq %r10
pushq 0x80(%rsp)
pushq %r10
pushq %rax
callq 0x2c9905
addq $0x30, %rsp
jmp 0x2c974e
movq %r13, %rdi
movq %r12, %rsi
movq %r9, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x2c9874
movzbl %al, %eax
leal (%rax,%rax,2), %ebx
incl %ebx
cmpl $0x3, %ebp
jne 0x2c975f
cmpl $0x1, %ebx
movq 0x8(%rsp), %r9
je 0x2c9630
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %r9
jmp 0x2c9630
movq 0x16e7f8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b899(%rip), %rsi     # 0x2e5013
leaq 0xbbb5b(%rip), %rdx     # 0x3852dc
leaq 0xbbfc3(%rip), %rcx     # 0x38574b
leaq 0xbbf82(%rip), %r8      # 0x385711
pushq $0x72
jmp 0x2c983c
movq 0x16e7cb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b86c(%rip), %rsi     # 0x2e5013
leaq 0xbbb61(%rip), %rdx     # 0x38530f
leaq 0xbbf96(%rip), %rcx     # 0x38574b
leaq 0xbbf55(%rip), %r8      # 0x385711
pushq $0x73
jmp 0x2c983c
movq 0x16e7a1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b842(%rip), %rsi     # 0x2e5013
leaq 0xbbf82(%rip), %rdx     # 0x38575a
leaq 0xbbf6c(%rip), %rcx     # 0x38574b
leaq 0xbbf2b(%rip), %r8      # 0x385711
pushq $0x74
jmp 0x2c983c
movq 0x16e777(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b818(%rip), %rsi     # 0x2e5013
leaq 0xbbb1a(%rip), %rdx     # 0x38531c
leaq 0xbbf42(%rip), %rcx     # 0x38574b
leaq 0xbbf01(%rip), %r8      # 0x385711
pushq $0x76
jmp 0x2c983c
movq 0x16e74d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b7ee(%rip), %rsi     # 0x2e5013
leaq 0xbbf3b(%rip), %rdx     # 0x385767
leaq 0xbbf18(%rip), %rcx     # 0x38574b
leaq 0xbbed7(%rip), %r8      # 0x385711
pushq $0x77
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x16e717(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b7b8(%rip), %rsi     # 0x2e5013
leaq 0xbbada(%rip), %rdx     # 0x38533c
leaq 0xbbee2(%rip), %rcx     # 0x38574b
leaq 0xbbea1(%rip), %r8      # 0x385711
pushq $0x78
jmp 0x2c983c