// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/idxlocalisw.c
// Function: applysmithwaterman
static void applysmithwaterman(SWdpresource *dpresource,
                               const GtEncseq *encseq,
                               GtUword encsequnit,
                               GtUword startpos,
                               GtUword endpos,
                               const GtUchar *query,
                               GtUword querylen)
{
  Scoretype score;
  Maxscorecoord maxpair;
  DPregion maxentry;

  if (dpresource->allocatedswcol < querylen + 1)
  {
    dpresource->allocatedswcol = querylen + 1;
    dpresource->swcol = gt_realloc(dpresource->swcol,
                                   sizeof *dpresource->swcol
                                   * dpresource->allocatedswcol);
    dpresource->swentrycol = gt_realloc(dpresource->swentrycol,
                                        sizeof *dpresource->swentrycol
                                        * dpresource->allocatedswcol);
  }
  score = swlocalsimilarityscore(dpresource->swcol,&maxpair,
                                 &dpresource->scorevalues,
                                 query,querylen,encseq,startpos,endpos);
  if (score >= (Scoretype) dpresource->scorethreshold)
  {
    GtIdxMatch match;

    swlocalsimilarityregion(dpresource->swentrycol,
                            &maxentry,
                            &dpresource->scorevalues,
                            query,maxpair.umax,
                            encseq,startpos,startpos + maxpair.vmax);
    gt_assert(maxentry.similarity == score);
    match.dbabsolute = false;
    match.dbstartpos = maxentry.start2;
    match.dblen = maxentry.len2;
    match.dbseqnum = encsequnit;
    match.querystartpos = maxentry.start1;
    match.querylen = maxentry.len1;
    gt_assert(maxentry.similarity >= 0);
    match.distance = (GtUword) maxentry.similarity;
    if (dpresource->showalignment)
    {
      if (dpresource->allocatedmaxedges <
          (maxentry.len1 + 1) * (maxentry.len2 + 1))
      {
        dpresource->allocatedmaxedges
          = (maxentry.len1 + 1) * (maxentry.len2 + 1);
        dpresource->maxedges
          = gt_realloc(dpresource->maxedges,
                       sizeof *dpresource->maxedges
                       * dpresource->allocatedmaxedges);
      }
      gt_alignment_reset(dpresource->alignment);
      if (dpresource->allocateddbsubstring < (GtUword) maxentry.len2)
      {
        dpresource->allocateddbsubstring = (GtUword) maxentry.len2;
        dpresource->dbsubstring
          = gt_realloc(dpresource->dbsubstring,
                       sizeof *dpresource->dbsubstring
                       * dpresource->allocateddbsubstring);
      }
      swproducealignment(dpresource->alignment,
                         dpresource->dbsubstring,
                         dpresource->maxedges,
                         dpresource->swcol,
                         &dpresource->scorevalues,
                         dpresource->scorethreshold,
                         query + maxentry.start1,
                         maxentry.len1,
                         encseq,
                         startpos + maxentry.start2,
                         startpos + maxentry.start2 + maxentry.len2);
      match.alignment = dpresource->alignment;
      match.dbsubstring = dpresource->dbsubstring;
    } else
    {
      match.dbsubstring = NULL;
      match.alignment = NULL;
    }
    dpresource->processmatch(dpresource->processmatchinfo,&match);
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq 0x100(%rsp), %rax
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq %rdx, 0xd0(%rsp)
movq %rcx, 0xc8(%rsp)
movq %r8, 0xc0(%rsp)
movq %r9, 0xb8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x100(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x25a570
movq 0x100(%rsp), %rcx
addq $0x1, %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rsi
shlq $0x3, %rsi
leaq 0x32051e(%rip), %rdx    # 0x57aa3c
movl $0x165, %ecx            # imm = 0x165
callq 0xe8540
movq %rax, %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0xe0(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0xe0(%rsp), %rax
imulq $0x18, 0x50(%rax), %rsi
leaq 0x3204e5(%rip), %rdx    # 0x57aa3c
movl $0x168, %ecx            # imm = 0x168
callq 0xe8540
movq %rax, %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0xe0(%rsp), %rdx
addq $0x10, %rdx
movq 0xb8(%rsp), %rcx
movq 0x100(%rsp), %r8
movq 0xd8(%rsp), %r9
movq 0xc8(%rsp), %r10
movq 0xc0(%rsp), %rax
leaq 0xa0(%rsp), %rsi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x25ab20
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq 0xe0(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jl 0x25a936
movq 0xe0(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0xe0(%rsp), %rdx
addq $0x10, %rdx
movq 0xb8(%rsp), %rcx
movq 0xa0(%rsp), %r8
movq 0xd8(%rsp), %r9
movq 0xc8(%rsp), %r10
movq 0xc8(%rsp), %rax
addq 0xa8(%rsp), %rax
leaq 0x78(%rsp), %rsi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x25ae40
movq 0x98(%rsp), %rax
cmpq 0xb0(%rsp), %rax
je 0x25a68d
movq 0x3e1944(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2bb9ad(%rip), %rsi    # 0x516013
leaq 0x3203e7(%rip), %rdx    # 0x57aa54
leaq 0x3203fd(%rip), %rcx    # 0x57aa71
leaq 0x3203c1(%rip), %r8     # 0x57aa3c
movl $0x176, %r9d            # imm = 0x176
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x25a68f
movb $0x0, 0x30(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x98(%rsp)
jge 0x25a715
movq 0x3e18bc(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2bb925(%rip), %rsi    # 0x516013
leaq 0x32038f(%rip), %rdx    # 0x57aa84
leaq 0x320375(%rip), %rcx    # 0x57aa71
leaq 0x320339(%rip), %r8     # 0x57aa3c
movl $0x17d, %r9d            # imm = 0x17D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x25a717
movq 0x98(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xe0(%rsp), %rax
testb $0x1, (%rax)
je 0x25a905
movq 0xe0(%rsp), %rax
movq 0x58(%rax), %rax
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
movq 0x90(%rsp), %rdx
addq $0x1, %rdx
imulq %rdx, %rcx
cmpq %rcx, %rax
jae 0x25a7c0
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
movq 0x90(%rsp), %rax
addq $0x1, %rax
imulq %rax, %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0xe0(%rsp), %rax
movq 0x58(%rax), %rsi
shlq $0x0, %rsi
leaq 0x320295(%rip), %rdx    # 0x57aa3c
movl $0x189, %ecx            # imm = 0x189
callq 0xe8540
movq %rax, %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x12a560
movq 0xe0(%rsp), %rax
movq 0x60(%rax), %rax
cmpq 0x90(%rsp), %rax
jae 0x25a837
movq 0x90(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0xe0(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0xe0(%rsp), %rax
movq 0x60(%rax), %rsi
shlq $0x0, %rsi
leaq 0x32021e(%rip), %rdx    # 0x57aa3c
movl $0x192, %ecx            # imm = 0x192
callq 0xe8540
movq %rax, %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0xe0(%rsp), %rax
movq 0x48(%rax), %rsi
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rdx
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0xe0(%rsp), %r8
addq $0x10, %r8
movq 0xe0(%rsp), %rax
movq 0x38(%rax), %r9
movq 0xb8(%rsp), %r14
addq 0x80(%rsp), %r14
movq 0x78(%rsp), %rbx
movq 0xd8(%rsp), %r11
movq 0xc8(%rsp), %r10
addq 0x88(%rsp), %r10
movq 0xc8(%rsp), %rax
addq 0x88(%rsp), %rax
addq 0x90(%rsp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x25b2d0
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0xe0(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x25a917
movq $0x0, 0x50(%rsp)
movq $0x0, 0x70(%rsp)
movq 0xe0(%rsp), %rax
movq 0x70(%rax), %rax
movq 0xe0(%rsp), %rcx
movq 0x78(%rcx), %rdi
leaq 0x30(%rsp), %rsi
callq *%rax
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
nopw %cs:(%rax,%rax)