// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
testq %rdi, %rdi
je 0x2c7c60
movq %rsi, %r14
testq %rsi, %rsi
je 0x2c7c91
movq %r9, %rbx
movq %rcx, %r15
movq %rdx, %r9
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
setne %cl
orb %al, %cl
je 0x2c7cc2
movq %rdi, %r12
testq %r9, %r9
movl %r8d, 0x2c(%rsp)
movsd %xmm0, 0x8(%rsp)
je 0x2c79e4
cmpq %r15, %r14
movq %r15, %r13
cmovaq %r14, %r13
imulq $0x18, %r15, %rdi
addq $0x18, %rdi
leaq 0xbdc06(%rip), %rsi     # 0x38558a
movl $0xe2, %edx
movq %r12, 0x20(%rsp)
movq %r9, %r12
callq 0x93160
movq %rax, %rbp
leaq 0x10(%rsp), %rax
movq %rbp, (%rax)
imulq $0x18, %r14, %rdi
addq $0x18, %rdi
leaq 0xbdbda(%rip), %rsi     # 0x38558a
movl $0xe3, %edx
callq 0x93160
leaq 0x30(%rsp), %r9
movq %rax, 0x18(%rsp)
movq %rax, (%r9)
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
leaq 0x10(%rsp), %r8
callq 0x2c7d54
movq %r12, %r8
jmp 0x2c7a5c
movq %r9, 0x20(%rsp)
testl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
jne 0x2c7d1c
imulq $0x18, %r14, %r13
addq $0x18, %r13
leaq 0xbdb85(%rip), %rsi     # 0x38558a
movq %r13, %rdi
movl $0xda, %edx
callq 0x93160
movq %rax, %rbp
leaq 0x10(%rsp), %rax
movq %rbp, (%rax)
movq %r13, %rdi
leaq 0xbdb63(%rip), %rsi     # 0x38558a
movl $0xdb, %edx
callq 0x93160
leaq 0x30(%rsp), %r9
movq %rax, 0x18(%rsp)
movq %rax, (%r9)
movq %r12, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r14, %rcx
leaq 0x10(%rsp), %r8
callq 0x2c7d54
movq %r14, %r13
movq 0x20(%rsp), %r8
movl 0x2c(%rsp), %edi
cmpl $0x2, %edi
sete %al
testq %r8, %r8
movq %r13, %xmm0
punpckldq 0x1fe6a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1fe72(%rip), %xmm0    # 0x2e78f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %rdx
sete %cl
movq %rdx, %rsi
subsd 0x2027d(%rip), %xmm1    # 0x2e7d20
sarq $0x3f, %rsi
cvttsd2si %xmm1, %r12
andq %rsi, %r12
orq %rdx, %r12
testl %edi, %edi
sete %dl
orb %cl, %dl
movq %r8, %rdx
je 0x2c7acb
andb %al, %cl
movzbl %cl, %eax
addl %eax, %eax
movl %eax, 0x8(%rsp)
jmp 0x2c7b44
imulq $0x18, %r15, %rax
cmpq %r12, (%rbp,%rax)
ja 0x2c7aeb
addq %rbp, %rax
cmpq $0x0, 0x8(%rax)
jne 0x2c7aeb
cmpq $0x0, 0x10(%rax)
je 0x2c7c58
movq 0x18(%rsp), %rax
addq $0x10, %rax
xorl %ecx, %ecx
pushq $0x4
popq %rsi
cmpq %r14, %rcx
ja 0x2c7b13
cmpq %r12, -0x10(%rax)
ja 0x2c7b0a
cmpq $0x0, (%rax)
je 0x2c7b3a
incq %rcx
addq $0x18, %rax
jmp 0x2c7af9
addq $0x8, %rbp
xorl %eax, %eax
pushq $0x1
popq %rsi
pushq $0x3
popq %rcx
cmpq %r15, %rax
ja 0x2c7b3a
cmpq %r12, -0x8(%rbp)
ja 0x2c7b31
cmpq $0x0, (%rbp)
je 0x2c7b40
incq %rax
addq $0x18, %rbp
jmp 0x2c7b1f
movl %esi, 0x8(%rsp)
jmp 0x2c7b44
movl %ecx, 0x8(%rsp)
testl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
jne 0x2c7be6
movq 0x80(%rsp), %r10
movq 0x78(%rsp), %rax
movb 0x70(%rsp), %r13b
testq %rdx, %rdx
je 0x2c7bfa
movzbl %r13b, %edx
leaq 0x10(%rsp), %r9
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %r15, %r8
pushq %r10
pushq %rax
callq 0x2c7ec0
addq $0x10, %rsp
testq %r15, %r15
je 0x2c7cf0
imulq $0x18, %r14, %rax
movq 0x18(%rsp), %rcx
leaq (%rax,%rcx), %rbp
addq $0x10, %rbp
cmpq %rbx, %r14
jb 0x2c7c1a
movq -0x10(%rbp), %rdx
cmpq %r12, %rdx
ja 0x2c7bdd
cmpq $0x0, -0x8(%rbp)
jne 0x2c7bdd
movq %r15, %rsi
subq (%rbp), %rsi
cmpq %rbx, %rsi
jb 0x2c7bd8
movq %r14, %rdi
xorl %ecx, %ecx
movq 0x80(%rsp), %r8
callq *0x78(%rsp)
testb %r13b, %r13b
je 0x2c7c1a
decq %r14
addq $-0x18, %rbp
jmp 0x2c7ba6
xorl $0x3, %edi
movl 0x8(%rsp), %eax
xorl $0x1, %eax
orl %edi, %eax
je 0x2c7b50
jmp 0x2c7c1a
leaq -0x1(%r14), %r8
movzbl %r13b, %edx
leaq 0x10(%rsp), %r9
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rcx
pushq %r10
pushq %rax
callq 0x2c7ec0
popq %rax
popq %rcx
movq 0x10(%rsp), %rdi
leaq 0xbd964(%rip), %rbx     # 0x38558a
movq %rbx, %rsi
movl $0x108, %edx            # imm = 0x108
callq 0x936f9
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movl $0x109, %edx            # imm = 0x109
callq 0x936f9
movl 0x8(%rsp), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
popq %rax
jmp 0x2c7ac5
movq 0x170301(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d3a2(%rip), %rsi     # 0x2e5013
leaq 0xbd664(%rip), %rdx     # 0x3852dc
leaq 0xbd8fd(%rip), %rcx     # 0x38557c
leaq 0xbd904(%rip), %r8      # 0x38558a
movl $0xd0, %r9d
jmp 0x2c7d48
movq 0x1702d0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d371(%rip), %rsi     # 0x2e5013
leaq 0x8f1d9(%rip), %rdx     # 0x356e82
leaq 0xbd8cc(%rip), %rcx     # 0x38557c
leaq 0xbd8d3(%rip), %r8      # 0x38558a
movl $0xd1, %r9d
jmp 0x2c7d48
movq 0x17029f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d340(%rip), %rsi     # 0x2e5013
leaq 0xbd8cb(%rip), %rdx     # 0x3855a5
leaq 0xbd89b(%rip), %rcx     # 0x38557c
leaq 0xbd8a2(%rip), %r8      # 0x38558a
movl $0xd3, %r9d
jmp 0x2c7d48
movq 0x170271(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d312(%rip), %rsi     # 0x2e5013
leaq 0x4f8a6(%rip), %rdx     # 0x3175ae
leaq 0xbd9f5(%rip), %rcx     # 0x385704
leaq 0xbd874(%rip), %r8      # 0x38558a
pushq $0x6a
popq %r9
jmp 0x2c7d48
movq 0x170245(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d2e6(%rip), %rsi     # 0x2e5013
leaq 0xbd88a(%rip), %rdx     # 0x3855be
leaq 0xbd841(%rip), %rcx     # 0x38557c
leaq 0xbd848(%rip), %r8      # 0x38558a
movl $0xd5, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390