// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/rdj-ovlfind-bf.c
// Function: gt_ovlfind_bf
GtContfind gt_ovlfind_bf(const char *u, GtUword u_length,
    const char *v, GtUword v_length, 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);
  self_comparison = (v == NULL);
  gt_assert(self_comparison || v_length > 0);
  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_bf(u, u_length, v, v_length)
               ? GT_CONTFIND_U : GT_CONTFIND_NO;
    else /* u_length > v_length */
      retval = contfind_bf(v, v_length, 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_bf(u, u_length, u, u_length, min_length, find_nonmaximal,
                 self_comparison, spmproc, true, spmprocdata);
    }
    else
    {
      spmfind_bf(u, u_length, v, v_length, min_length, find_nonmaximal,
                 self_comparison, spmproc, true, spmprocdata);
      spmfind_bf(v, v_length, u, u_length, 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 0x32f1c5
movq %rsi, %r15
testq %rsi, %rsi
je 0x32f1ca
movq %rcx, %rbp
movq %rdx, %r12
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
setne %cl
orb %al, %cl
je 0x32f1cf
movq %r9, %rbx
movq %rdi, %r14
testq %r12, %r12
jne 0x32efb1
testl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
jne 0x32f1d4
cmpl $0x2, %r8d
sete %al
testq %r12, %r12
sete %cl
movl %r8d, 0xc(%rsp)
testl %r8d, %r8d
sete %dl
orb %cl, %dl
je 0x32efdf
andb %al, %cl
movzbl %cl, %r13d
addl %r13d, %r13d
movl 0xc(%rsp), %edx
jmp 0x32f0c8
movq %r15, %r13
subq %rbp, %r13
jne 0x32f004
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x17830
xorl %r13d, %r13d
cmpl $0x1, %eax
adcl $0x1, %r13d
jmp 0x32f0af
jae 0x32f055
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x17830
movl $0x3, %r13d
testl %eax, %eax
je 0x32f0af
movq %rbp, 0x10(%rsp)
movq %rbp, %r13
subq %r15, %r13
movl $0x1, %ebp
cmpq %r13, %rbp
ja 0x32f09c
leaq (%r12,%rbp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x17830
incq %rbp
testl %eax, %eax
jne 0x32f032
movl $0x3, %r13d
jmp 0x32f0a2
jbe 0x32f1d9
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x17830
testl %eax, %eax
je 0x32f0a9
movq %rbp, 0x10(%rsp)
movl $0x1, %ebp
cmpq %r13, %rbp
ja 0x32f09c
leaq (%r14,%rbp), %rsi
movq %r12, %rdi
movq 0x10(%rsp), %rdx
callq 0x17830
incq %rbp
testl %eax, %eax
jne 0x32f077
movl $0x4, %r13d
jmp 0x32f0a2
movl $0x1, %r13d
movq 0x10(%rsp), %rbp
jmp 0x32f0af
movl $0x4, %r13d
movl 0xc(%rsp), %edx
cmpl $0x3, %edx
sete %al
cmpl $0x1, %r13d
setne %cl
testb %cl, %al
jne 0x32f1b3
cmpl $0x1, %edx
je 0x32f1b3
testq %r12, %r12
je 0x32f172
cmpq %rbp, %r15
movq %rbp, 0x10(%rsp)
cmovbq %r15, %rbp
cmpq %rbx, %rbp
jb 0x32f1b3
movl %r13d, 0xc(%rsp)
addq %r14, %r15
movq %rbp, %r13
movq %r15, %rdi
subq %r13, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x17830
testl %eax, %eax
jne 0x32f127
movq %r13, %rdi
movl $0x1, %esi
movq 0x60(%rsp), %rdx
callq *0x58(%rsp)
cmpb $0x0, 0x50(%rsp)
je 0x32f12f
decq %r13
cmpq %rbx, %r13
jae 0x32f0fa
cmpq %rbx, %rbp
movl 0xc(%rsp), %r13d
jb 0x32f1b3
addq 0x10(%rsp), %r12
movq %r12, %rdi
subq %rbp, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x17830
testl %eax, %eax
jne 0x32f168
movq %rbp, %rdi
xorl %esi, %esi
movq 0x60(%rsp), %rdx
callq *0x58(%rsp)
cmpb $0x0, 0x50(%rsp)
je 0x32f1b3
decq %rbp
cmpq %rbx, %rbp
jae 0x32f13e
jmp 0x32f1b3
leaq -0x1(%r15), %r12
cmpq %rbx, %r12
jb 0x32f1b3
addq %r14, %r15
movq %r15, %rdi
subq %r12, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x17830
testl %eax, %eax
jne 0x32f1ab
movq %r12, %rdi
movl $0x1, %esi
movq 0x60(%rsp), %rdx
callq *0x58(%rsp)
cmpb $0x0, 0x50(%rsp)
je 0x32f1b3
decq %r12
cmpq %rbx, %r12
jae 0x32f17e
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x970d1
callq 0x9709a
callq 0x96ff5
callq 0x97063
callq 0x9702c