// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
testq %rdi, %rdi
je 0x3267e0
movq %rsi, %r15
testq %rsi, %rsi
je 0x3267e5
movq %rdx, %rbp
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
setne %dl
orb %al, %dl
je 0x3267ea
movq %r9, %r14
movq %rdi, %rbx
testq %rbp, %rbp
movq %rcx, 0x10(%rsp)
movl %r8d, 0x44(%rsp)
movsd %xmm0, 0x48(%rsp)
je 0x326377
leaq (%rcx,%rcx,2), %rax
leaq 0x18(,%rax,8), %rdi
leaq 0xbefb4(%rip), %r13     # 0x3e5190
movq %r13, %rsi
movl $0xe2, %edx
callq 0x104226
movq %rax, 0x8(%rsp)
leaq (%r15,%r15,2), %r12
leaq 0x18(,%r12,8), %rdi
movq %r13, %rsi
movl $0xe3, %edx
callq 0x104226
leaq 0x1(%r15), %rsi
cmpq $0x1, %rsi
movq %r15, %rcx
adcq $0x1, %rcx
movq %rax, %r9
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 0x326221
movq 0x10(%rsp), %r13
cmpq %r13, %r15
movq %r13, %rdx
cmovaq %r15, %rdx
movq 0x10(%r9,%r12,8), %rax
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups (%r9,%r12,8), %xmm0
movups %xmm0, (%rcx)
testq %r13, %r13
movsd 0x48(%rsp), %xmm2
je 0x326506
movq %rdx, 0x50(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x20(%rsp)
leaq (%r9,%r12,8), %rax
movq %rax, 0x30(%rsp)
cmpq $0x3, %rsi
movl $0x2, %edx
cmovaeq %rsi, %rdx
decq %rdx
movq %r9, %rax
addq $0x28, %rax
movq %rax, 0x28(%rsp)
movl $0x1, %edi
movq %r9, 0x18(%rsp)
movq %rdi, 0x10(%r9)
leaq -0x1(%rdi), %r8
movq (%r9), %rcx
movq 0x28(%rsp), %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %r15d, %r15d
movq %r8, %r12
incq %rcx
movb (%rbx,%r10), %al
xorl %r14d, %r14d
cmpb (%rbp,%r8), %al
setne %r14b
addq %r11, %r14
movq -0x10(%r9), %r11
movq -0x8(%r9), %r13
movq (%r9), %rsi
leaq 0x1(%r11), %rax
cmpq %rax, %r14
jae 0x3262fb
cmpq %rcx, %r14
jae 0x3262fb
movq %r15, -0x8(%r9)
jmp 0x32630f
cmpq %rcx, %rax
jb 0x326315
movq -0x20(%r9), %rax
movq -0x18(%r9), %r12
movq %rax, -0x8(%r9)
movq %rcx, %r14
movq %r12, (%r9)
movq %r14, %rax
movq %rax, -0x10(%r9)
incq %r10
addq $0x18, %r9
movq %rax, %rcx
movq %r13, %r15
movq %rsi, %r12
cmpq %r10, %rdx
jne 0x3262c6
leaq (%rdi,%rdi,2), %rax
movq 0x30(%rsp), %r8
movq 0x10(%r8), %rcx
movq 0x8(%rsp), %rsi
movq %rcx, 0x10(%rsi,%rax,8)
movups (%r8), %xmm0
movups %xmm0, (%rsi,%rax,8)
incq %rdi
movq 0x10(%rsp), %r13
cmpq %r13, %rdi
movq 0x18(%rsp), %r9
jbe 0x3262aa
movq 0x20(%rsp), %r14
movq 0x38(%rsp), %r15
movq 0x50(%rsp), %rdx
jmp 0x326506
testl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
jne 0x3267f9
movq %r14, 0x20(%rsp)
leaq (%r15,%r15,2), %r12
leaq 0x18(,%r12,8), %r13
leaq 0xbedf4(%rip), %r14     # 0x3e5190
movq %r13, %rdi
movq %r14, %rsi
movl $0xda, %edx
callq 0x104226
movq %rax, 0x8(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movl $0xdb, %edx
callq 0x104226
leaq 0x1(%r15), %rdx
cmpq $0x1, %rdx
movq %r15, %rcx
adcq $0x1, %rcx
movq %rax, %r9
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 0x3263db
leaq (%r9,%r12,8), %rax
movq %rax, 0x30(%rsp)
movq 0x10(%r9,%r12,8), %rax
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups (%r9,%r12,8), %xmm0
movups %xmm0, (%rcx)
cmpq $0x3, %rdx
movl $0x2, %ecx
cmovaeq %rdx, %rcx
decq %rcx
movq %r9, %rax
addq $0x28, %rax
movq %rax, 0x28(%rsp)
movl $0x1, %esi
movsd 0x48(%rsp), %xmm2
movq %r15, 0x38(%rsp)
movq %r9, 0x18(%rsp)
movq %rsi, 0x10(%r9)
leaq -0x1(%rsi), %r12
movq (%r9), %rax
movq 0x28(%rsp), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %edx, %edx
movq %r12, %rdi
incq %rax
movb (%rbx,%r9), %r14b
xorl %r11d, %r11d
cmpb (%rbx,%r12), %r14b
setne %r11b
addq %r10, %r11
movq -0x10(%r8), %r10
movq -0x8(%r8), %r15
movq (%r8), %r13
leaq 0x1(%r10), %r14
cmpq %r14, %r11
jae 0x326491
cmpq %rax, %r11
jae 0x326491
movq %rdx, -0x8(%r8)
jmp 0x3264a5
cmpq %rax, %r14
jb 0x3264ab
movq -0x20(%r8), %rdx
movq -0x18(%r8), %rdi
movq %rdx, -0x8(%r8)
movq %rax, %r11
movq %rdi, (%r8)
movq %r11, %r14
movq %r14, -0x10(%r8)
incq %r9
addq $0x18, %r8
movq %r14, %rax
movq %r15, %rdx
movq %r13, %rdi
cmpq %r9, %rcx
jne 0x32645d
leaq (%rsi,%rsi,2), %rax
movq 0x30(%rsp), %r8
movq 0x10(%r8), %rdx
movq 0x8(%rsp), %rdi
movq %rdx, 0x10(%rdi,%rax,8)
movups (%r8), %xmm0
movups %xmm0, (%rdi,%rax,8)
incq %rsi
movq 0x38(%rsp), %r15
cmpq %r15, %rsi
movq 0x18(%rsp), %r9
jbe 0x326442
movq %r15, %rdx
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %r13
movl 0x44(%rsp), %edi
cmpl $0x2, %edi
sete %al
testq %rbp, %rbp
movq %rdx, %xmm0
punpckldq 0x213c0(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x213c8(%rip), %xmm0    # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
cvttsd2si %xmm1, %rdx
sete %cl
movq %rdx, %rsi
subsd 0x217d5(%rip), %xmm1    # 0x347d20
sarq $0x3f, %rsi
cvttsd2si %xmm1, %rbx
andq %rsi, %rbx
orq %rdx, %rbx
testl %edi, %edi
sete %dl
orb %cl, %dl
je 0x326573
andb %al, %cl
movzbl %cl, %eax
addl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x326607
leaq (,%r13,2), %rax
addq %r13, %rax
movq 0x8(%rsp), %rcx
cmpq %rbx, (%rcx,%rax,8)
ja 0x3265a0
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3265a0
cmpq $0x0, 0x10(%rax)
je 0x3265ff
leaq 0x10(%r9), %rax
xorl %ecx, %ecx
cmpq %rbx, -0x10(%rax)
ja 0x3265b2
cmpq $0x0, (%rax)
je 0x3265eb
incq %rcx
addq $0x18, %rax
cmpq %r15, %rcx
jbe 0x3265a6
movq 0x8(%rsp), %rax
addq $0x8, %rax
xorl %ecx, %ecx
cmpq %rbx, -0x8(%rax)
ja 0x3265d5
cmpq $0x0, (%rax)
je 0x3265f5
incq %rcx
addq $0x18, %rax
cmpq %r13, %rcx
jbe 0x3265c9
movl $0x1, 0x10(%rsp)
jmp 0x326607
movl $0x4, 0x10(%rsp)
jmp 0x326607
movl $0x3, 0x10(%rsp)
jmp 0x326607
movl $0x2, 0x10(%rsp)
testl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
jne 0x326711
movb 0x90(%rsp), %r8b
testq %rbp, %rbp
movq %r9, 0x18(%rsp)
je 0x326762
testq %r13, %r13
je 0x3267ef
cmpq %r14, %r13
jb 0x32670a
movq %r13, %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdx
cmpq %rbx, %rdx
ja 0x326667
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x326674
decq %rbp
cmpq %r14, %rbp
jae 0x32663e
jmp 0x32670a
movq %r15, %rdi
subq 0x8(%rax), %rdi
cmpq %r14, %rdi
jb 0x3266a4
movq %rbp, %rsi
movl $0x1, %ecx
movq 0xa0(%rsp), %r8
callq *0x98(%rsp)
movb 0x90(%rsp), %r8b
movq 0x18(%rsp), %r9
decq %rbp
cmpq %r14, %rbp
jb 0x32670a
testb %r8b, %r8b
jne 0x32663e
jmp 0x32670a
leaq (%r15,%r15,2), %rax
movq (%r9,%rax,8), %rdx
cmpq %rbx, %rdx
ja 0x326707
leaq (%r9,%rax,8), %rax
cmpq $0x0, 0x8(%rax)
jne 0x326707
movq %r13, %rsi
subq 0x10(%rax), %rsi
cmpq %r14, %rsi
jb 0x3266f8
movq %r15, %rdi
xorl %ecx, %ecx
movq 0xa0(%rsp), %r8
callq *0x98(%rsp)
movb 0x90(%rsp), %r8b
movq 0x18(%rsp), %r9
decq %r15
cmpq %r14, %r15
jb 0x326723
testb %r8b, %r8b
jne 0x3266b3
jmp 0x326723
decq %r15
cmpq %r14, %r15
jae 0x3266b3
jmp 0x326723
xorl $0x3, %edi
movl 0x10(%rsp), %eax
xorl $0x1, %eax
orl %edi, %eax
je 0x326613
leaq 0xbea66(%rip), %r14     # 0x3e5190
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x108, %edx            # imm = 0x108
movq %r9, %rbx
callq 0x1045eb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x109, %edx            # imm = 0x109
callq 0x1045eb
movl 0x10(%rsp), %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %r12
decq %r12
je 0x3267f4
cmpq %r14, %r12
jb 0x326723
leaq (%r12,%r12,2), %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdx
cmpq %rbx, %rdx
ja 0x3267db
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq $0x0, 0x10(%rax)
jne 0x3267db
movq %r15, %rdi
subq 0x8(%rax), %rdi
cmpq %r14, %rdi
jb 0x3267c5
movq %r12, %rsi
movl $0x1, %ecx
movq 0xa0(%rsp), %r8
callq *0x98(%rsp)
movb 0x90(%rsp), %r8b
movq 0x18(%rsp), %r9
decq %r12
cmpq %r14, %r12
jb 0x326723
testb %r8b, %r8b
jne 0x326773
jmp 0x326723
decq %r12
jmp 0x32676e
callq 0x95263
callq 0x9522a
callq 0x9514a
callq 0x95183
callq 0x951ba
callq 0x951f1