// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/rdj-ovlfind-dp.c
// Function: gt_ovlfind_dp
GtContfind gt_ovlfind_dp(const char *u, GtUword m,
                         const char *v, GtUword n,
                         double max_error, GtOvlfindMode mode,
                         GtUword min_length, bool find_submaximal,
                         void (*smpproc)
                           (GtUword /* length on u */,
                            GtUword /* length on v */,
                            GtUword /* unit edit distance */,
                            bool /* true if suffix comes from u,
                                    false if suffix comes from v */,
                            void* /* procdata */),
                         void* smpprocdata)
{
  GtOvlfindDpCell *row, *col;
  GtUword max_edist;
  GtContfind retval = GT_CONTFIND_OFF;
  bool self_comparison;

  gt_assert(u != NULL);
  gt_assert(m > 0);
  self_comparison = (v == NULL);
  gt_assert(self_comparison || n > 0);
  gt_assert(!self_comparison || mode == GT_OVLFIND_SPM ||
      mode == GT_OVLFIND_ALL);

  if (self_comparison)
  {
    max_edist = (GtUword)(max_error * m);
    row = gt_malloc(sizeof (GtOvlfindDpCell) * (m + 1));
    col = gt_malloc(sizeof (GtOvlfindDpCell) * (m + 1));

    run_dp(u, m, u, m, &row, &col);
  }
  else
  {
    max_edist = (GtUword)(max_error * GT_MAX(m,n));
    row = gt_malloc(sizeof (GtOvlfindDpCell) * (n + 1));
    col = gt_malloc(sizeof (GtOvlfindDpCell) * (m + 1));

    run_dp(u, m, v, n, &row, &col);
    /* decomment to show row and col to debug log: */
    /* print_row_and_col(row, m, col, n); */
  }

  if (self_comparison && mode == GT_OVLFIND_ALL)
    retval = GT_CONTFIND_EQ;
  if (mode != GT_OVLFIND_SPM && !self_comparison)
  {
    if (eqlfind_dp(max_edist, row+n))
      retval = GT_CONTFIND_EQ;
    else if (v_contfind_dp(max_edist, m, &col))
      retval = GT_CONTFIND_V;
    else if (u_contfind_dp(max_edist, n, &row))
      retval = GT_CONTFIND_U;
    else
      retval = GT_CONTFIND_NO;
  }
  if (mode == GT_OVLFIND_SPM || mode == GT_OVLFIND_ALL ||
      (mode == GT_OVLFIND_PROPER_SPM && retval == GT_CONTFIND_NO))
  {
    if (self_comparison)
    {
      u_smpfind_dp(min_length, max_edist, find_submaximal, m, m-1, &row,
                   smpproc, smpprocdata);
    }
    else
    {
      u_smpfind_dp(min_length, max_edist, find_submaximal, m, n, &row,
                   smpproc, smpprocdata);
      v_smpfind_dp(min_length, max_edist, find_submaximal, m, n, &col,
                   smpproc, smpprocdata);
    }
  }

  gt_free(row);
  gt_free(col);
  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0x330ed1
movq %rsi, %r15
testq %rsi, %rsi
je 0x330ed6
movq %rdx, %rbp
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
setne %dl
orb %al, %dl
je 0x330edb
movq %r9, %r14
testq %rbp, %rbp
movq %rcx, 0x18(%rsp)
movl %r8d, 0x54(%rsp)
movsd %xmm0, 0x60(%rsp)
jne 0x330889
testl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
jne 0x330eea
testq %rbp, %rbp
je 0x330a66
leaq (%rcx,%rcx,2), %rax
leaq 0x18(,%rax,8), %rdi
leaq 0xbe0b8(%rip), %r13     # 0x3ee954
movq %r13, %rsi
movl $0xe2, %edx
callq 0x1092b2
movq %rax, 0x20(%rsp)
leaq (%r15,%r15,2), %r12
leaq 0x18(,%r12,8), %rdi
movq %r13, %rsi
movl $0xe3, %edx
callq 0x1092b2
leaq 0x1(%r15), %rsi
cmpq $0x1, %rsi
movq %r15, %rcx
adcq $0x1, %rcx
movq %rax, %r8
addq $0x10, %rax
xorl %edx, %edx
xorl %edi, %edi
movq %rdi, -0x8(%rax)
movq %rdx, (%rax)
movq %rdx, -0x10(%rax)
incq %rdi
addq $0x18, %rax
cmpq %rdi, %rcx
jne 0x3308e1
movq 0x18(%rsp), %rcx
cmpq %rcx, %r15
movq %rcx, %rdx
cmovaq %r15, %rdx
movq 0x10(%r8,%r12,8), %rax
movq 0x20(%rsp), %r13
movq %rax, 0x10(%r13)
movups (%r8,%r12,8), %xmm0
movups %xmm0, (%r13)
testq %rcx, %rcx
je 0x330a5c
movq %rdx, 0x58(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x28(%rsp)
leaq (%r8,%r12,8), %rax
movq %rax, 0x40(%rsp)
cmpq $0x3, %rsi
movl $0x2, %edx
cmovaeq %rsi, %rdx
movq %r8, %rax
addq $0x28, %rax
movq %rax, 0x38(%rsp)
decq %rdx
movl $0x1, %edi
movq %r8, 0x10(%rsp)
movq %rdi, 0x10(%r8)
movq %rdi, 0x48(%rsp)
leaq -0x1(%rdi), %rax
xorl %r9d, %r9d
movq 0x38(%rsp), %r10
xorl %r11d, %r11d
xorl %r12d, %r12d
movq %rax, %r8
movq -0x28(%r10), %rsi
incq %rsi
movq %rbp, %rbx
movb (%rbp,%rax), %cl
xorl %r14d, %r14d
movq 0x8(%rsp), %rdi
cmpb %cl, (%rdi,%r9)
setne %r14b
addq %r11, %r14
movq -0x10(%r10), %r11
movq -0x8(%r10), %r15
movq (%r10), %r13
leaq 0x1(%r11), %rcx
cmpq %rcx, %r14
setb %bpl
cmpq %rsi, %r14
setb %dil
andb %bpl, %dil
cmpb $0x1, %dil
jne 0x3309d4
movq %r12, -0x8(%r10)
movq %rbx, %rbp
jmp 0x3309eb
cmpq %rsi, %rcx
movq %rbx, %rbp
jb 0x3309f1
movq -0x20(%r10), %rcx
movq -0x18(%r10), %r8
movq %rcx, -0x8(%r10)
movq %rsi, %r14
movq %r8, (%r10)
movq %r14, %rcx
movq %rcx, -0x10(%r10)
addq $0x18, %r10
incq %r9
movq %r15, %r12
movq %r13, %r8
cmpq %r9, %rdx
jne 0x330984
movq 0x48(%rsp), %rdi
leaq (%rdi,%rdi,2), %rax
movq 0x40(%rsp), %rsi
movq 0x10(%rsi), %rcx
movq 0x20(%rsp), %r13
movq %rcx, 0x10(%r13,%rax,8)
movups (%rsi), %xmm0
movups %xmm0, (%r13,%rax,8)
incq %rdi
cmpq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
jbe 0x330966
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %r12
movq 0x58(%rsp), %rdx
jmp 0x330c03
movq 0x18(%rsp), %r12
jmp 0x330c03
movq %rbp, 0x38(%rsp)
movq %r14, 0x28(%rsp)
leaq (%r15,%r15,2), %rbx
leaq 0x18(,%rbx,8), %r13
leaq 0xbded1(%rip), %r14     # 0x3ee954
movq %r13, %rdi
movq %r14, %rsi
movl $0xda, %edx
callq 0x1092b2
movq %rax, 0x20(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movl $0xdb, %edx
callq 0x1092b2
leaq 0x1(%r15), %rdx
cmpq $0x1, %rdx
movq %r15, %rcx
adcq $0x1, %rcx
movq %rax, %r8
addq $0x10, %rax
xorl %esi, %esi
xorl %edi, %edi
movq %rdi, -0x8(%rax)
movq %rsi, (%rax)
movq %rsi, -0x10(%rax)
incq %rdi
addq $0x18, %rax
cmpq %rdi, %rcx
jne 0x330ac2
leaq (%r8,%rbx,8), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%r8,%rbx,8), %rax
movq 0x20(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups (%r8,%rbx,8), %xmm0
movups %xmm0, (%rcx)
cmpq $0x3, %rdx
movl $0x2, %ecx
cmovaeq %rdx, %rcx
movq %r8, %rax
addq $0x28, %rax
movq %rax, 0x48(%rsp)
decq %rcx
movl $0x1, %esi
movq %r15, 0x30(%rsp)
movq %r8, 0x10(%rsp)
movq %rsi, 0x10(%r8)
movq %rsi, %rbx
leaq -0x1(%rsi), %rdi
xorl %r8d, %r8d
movq 0x48(%rsp), %r9
xorl %r10d, %r10d
xorl %r13d, %r13d
movq %rdi, %r11
movq -0x28(%r9), %r15
incq %r15
movq 0x8(%rsp), %rdx
movb (%rdx,%rdi), %al
xorl %r14d, %r14d
cmpb %al, (%rdx,%r8)
setne %r14b
addq %r10, %r14
movq -0x10(%r9), %r10
movq -0x8(%r9), %r12
movq (%r9), %rdx
leaq 0x1(%r10), %rax
cmpq %rax, %r14
setb %sil
cmpq %r15, %r14
setb %bpl
andb %sil, %bpl
cmpb $0x1, %bpl
jne 0x330b88
movq %r13, -0x8(%r9)
jmp 0x330b9c
cmpq %r15, %rax
jb 0x330ba2
movq -0x20(%r9), %rax
movq -0x18(%r9), %r11
movq %rax, -0x8(%r9)
movq %r15, %r14
movq %r11, (%r9)
movq %r14, %rax
movq %rax, -0x10(%r9)
addq $0x18, %r9
incq %r8
movq %r12, %r13
movq %rdx, %r11
cmpq %r8, %rcx
jne 0x330b3f
movq %rbx, %rsi
leaq (%rbx,%rbx,2), %rax
movq 0x40(%rsp), %rdi
movq 0x10(%rdi), %rdx
movq 0x20(%rsp), %r13
movq %rdx, 0x10(%r13,%rax,8)
movups (%rdi), %xmm0
movups %xmm0, (%r13,%rax,8)
incq %rsi
movq 0x30(%rsp), %r15
cmpq %r15, %rsi
movq 0x10(%rsp), %r8
jbe 0x330b23
movq %r15, %rdx
movq 0x28(%rsp), %r14
movq 0x18(%rsp), %r12
movq 0x38(%rsp), %rbp
movl 0x54(%rsp), %edi
cmpl $0x2, %edi
sete %al
testq %rbp, %rbp
movq %rdx, %xmm0
punpckldq 0x1fcc3(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1fccb(%rip), %xmm0    # 0x3508f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x60(%rsp), %xmm1
cvttsd2si %xmm1, %rdx
sete %cl
movq %rdx, %rsi
subsd 0x200d6(%rip), %xmm1    # 0x350d20
sarq $0x3f, %rsi
cvttsd2si %xmm1, %rbx
andq %rsi, %rbx
orq %rdx, %rbx
testl %edi, %edi
sete %dl
orb %cl, %dl
je 0x330c6e
andb %al, %cl
movzbl %cl, %eax
addl %eax, %eax
jmp 0x330cf6
leaq (%r12,%r12,2), %rax
cmpq %rbx, (%r13,%rax,8)
ja 0x330c96
leaq (,%rax,8), %rax
addq %r13, %rax
cmpq $0x0, 0x8(%rax)
jne 0x330c96
cmpq $0x0, 0x10(%rax)
je 0x330ec4
leaq 0x10(%r8), %rax
movb $0x1, %dl
xorl %ecx, %ecx
cmpq %rbx, -0x10(%rax)
ja 0x330caa
cmpq $0x0, (%rax)
je 0x330cb9
incq %rcx
addq $0x18, %rax
cmpq %r15, %rcx
setbe %dl
jbe 0x330c9e
movl $0x4, 0x8(%rsp)
testb $0x1, %dl
jne 0x330cfa
leaq 0x8(%r13), %rax
movb $0x1, %dl
xorl %ecx, %ecx
cmpq %rbx, -0x8(%rax)
ja 0x330cda
cmpq $0x0, (%rax)
je 0x330ce9
incq %rcx
addq $0x18, %rax
cmpq %r12, %rcx
setbe %dl
jbe 0x330cce
movzbl %dl, %eax
andl $0x1, %eax
leal 0x1(,%rax,2), %eax
movl %eax, 0x8(%rsp)
testl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
jne 0x330e38
movb 0xa0(%rsp), %cl
testq %rbp, %rbp
movq %r8, 0x10(%rsp)
je 0x330e4a
testq %r12, %r12
je 0x330ee0
cmpq %r14, %r12
jb 0x330df6
movq %r12, %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq (%r13,%rax,8), %rdx
cmpq %rbx, %rdx
ja 0x330d57
leaq (,%rax,8), %rax
addq %r13, %rax
cmpq $0x0, 0x10(%rax)
je 0x330d64
decq %rbp
cmpq %r14, %rbp
jae 0x330d30
jmp 0x330df6
movq %r15, %rdi
subq 0x8(%rax), %rdi
cmpq %r14, %rdi
jb 0x330d93
movq %rbp, %rsi
movl $0x1, %ecx
movq 0xb0(%rsp), %r8
callq *0xa8(%rsp)
movb 0xa0(%rsp), %cl
movq 0x10(%rsp), %r8
decq %rbp
cmpq %r14, %rbp
jb 0x330df6
testb %cl, %cl
jne 0x330d30
jmp 0x330df6
leaq (%r15,%r15,2), %rax
movq (%r8,%rax,8), %rdx
cmpq %rbx, %rdx
ja 0x330df3
leaq (%r8,%rax,8), %rax
cmpq $0x0, 0x8(%rax)
jne 0x330df3
movq %r12, %rsi
subq 0x10(%rax), %rsi
cmpq %r14, %rsi
jb 0x330de5
movq %r15, %rdi
xorl %ecx, %ecx
movq 0xb0(%rsp), %r8
callq *0xa8(%rsp)
movb 0xa0(%rsp), %cl
movq 0x10(%rsp), %r8
decq %r15
cmpq %r14, %r15
jb 0x330dfb
testb %cl, %cl
jne 0x330da1
jmp 0x330dfb
decq %r15
cmpq %r14, %r15
jae 0x330da1
leaq 0xbdb52(%rip), %r14     # 0x3ee954
movq %r13, %rdi
movq %r14, %rsi
movl $0x108, %edx            # imm = 0x108
movq %r8, %rbx
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x109, %edx            # imm = 0x109
callq 0x109670
movl 0x8(%rsp), %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %edi
jne 0x330dfb
cmpl $0x1, 0x8(%rsp)
je 0x330d06
jmp 0x330dfb
movq %r15, %r12
decq %r12
je 0x330ee5
cmpq %r14, %r12
jb 0x330dfb
leaq (%r12,%r12,2), %rax
movq (%r13,%rax,8), %rdx
cmpq %rbx, %rdx
ja 0x330ebf
leaq (,%rax,8), %rax
addq %r13, %rax
cmpq $0x0, 0x10(%rax)
jne 0x330ebf
movq %r15, %rdi
subq 0x8(%rax), %rdi
cmpq %r14, %rdi
jb 0x330eaa
movq %r12, %rsi
movl $0x1, %ecx
movq 0xb0(%rsp), %r8
callq *0xa8(%rsp)
movb 0xa0(%rsp), %cl
movq 0x10(%rsp), %r8
decq %r12
cmpq %r14, %r12
jb 0x330dfb
testb %cl, %cl
jne 0x330e5b
jmp 0x330dfb
decq %r12
jmp 0x330e56
movl $0x2, 0x8(%rsp)
jmp 0x330cfa
callq 0x9725a
callq 0x97221
callq 0x97141
callq 0x9717a
callq 0x971b1
callq 0x971e8