// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/idxlocalisw.c
// Function: swlocalsimilarityscore
static Scoretype swlocalsimilarityscore(Scoretype *scol,
                                        Maxscorecoord *maxpair,
                                        const Scorevalues *scorevalues,
                                        const GtUchar *useq,
                                        GtUword ulen,
                                        const GtEncseq *vencseq,
                                        GtUword startpos,
                                        GtUword endpos)
{
  Scoretype val, we, nw, *scolptr, maximalscore = 0;
  const GtUchar *uptr;
  GtUchar vcurrent;
  GtUword j;

  maxpair->umax = maxpair->vmax = 0;
  for (scolptr = scol; scolptr <= scol + ulen; scolptr++)
  {
    *scolptr = 0;
  }
  for (j = startpos; j < endpos; j++)
  {
    nw = 0;
    vcurrent = gt_encseq_get_encoded_char(vencseq,j,
                                                   GT_READMODE_FORWARD);
    gt_assert(vcurrent != (GtUchar) GT_SEPARATOR);
    for (scolptr = scol+1, uptr = useq; uptr < useq + ulen; scolptr++, uptr++)
    {
      gt_assert(*uptr != (GtUchar) GT_SEPARATOR);
      we = *scolptr;
      *scolptr = *(scolptr-1) + scorevalues->gapextend;
      if ((val = nw + REPLACEMENTSCORE(scorevalues,*uptr,vcurrent)) > *scolptr)
      {
        *scolptr = val;
      }
      if ((val = we + scorevalues->gapextend) > *scolptr)
      {
        *scolptr = val;
      }
      if (*scolptr < 0)
      {
        *scolptr = 0;
      } else
      {
        if (*scolptr > maximalscore)
        {
          maximalscore = *scolptr;
          maxpair->umax = (GtUword) (uptr - useq + 1);
          maxpair->vmax = (GtUword) (j - startpos + 1);
        }
      }
      nw = we;
    }
  }
  return maximalscore;
}

// Assembly:
subq $0x88, %rsp
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x78(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x78(%rsp), %rax
movq $0x0, (%rax)
movq 0x80(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0x80(%rsp), %rcx
movq 0x60(%rsp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
ja 0x25abc1
movq 0x38(%rsp), %rax
movq $0x0, (%rax)
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x38(%rsp)
jmp 0x25ab87
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x98(%rsp), %rax
jae 0x25ae2e
movq $0x0, 0x40(%rsp)
movq 0x58(%rsp), %rdi
movq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0xa9da0
movb %al, 0x27(%rsp)
movzbl 0x27(%rsp), %eax
cmpl $0xff, %eax
jne 0x25ac43
movq 0x3e138e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2bb3f7(%rip), %rsi    # 0x516013
leaq 0x31fe7a(%rip), %rdx    # 0x57aa9d
leaq 0x31fe96(%rip), %rcx    # 0x57aac0
leaq 0x31fe0b(%rip), %r8     # 0x57aa3c
movl $0x3e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x25ac45
movq 0x80(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x68(%rsp), %rcx
addq 0x60(%rsp), %rcx
cmpq %rcx, %rax
jae 0x25ae19
jmp 0x25ac7a
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x25acc1
movq 0x3e1310(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2bb379(%rip), %rsi    # 0x516013
leaq 0x31fe36(%rip), %rdx    # 0x57aad7
leaq 0x31fe18(%rip), %rcx    # 0x57aac0
leaq 0x31fd8d(%rip), %r8     # 0x57aa3c
movl $0x41, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x25acc3
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rcx
movq 0x70(%rsp), %rax
addq 0x18(%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
movzbl 0x27(%rsp), %ecx
cmpl %ecx, %eax
jne 0x25ad14
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xfe, %eax
jl 0x25ad24
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x25ad31
movq 0x70(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
jle 0x25ad5a
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq 0x70(%rsp), %rcx
addq 0x18(%rcx), %rax
movq %rax, 0x50(%rsp)
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
jle 0x25ad84
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x38(%rsp), %rax
cmpq $0x0, (%rax)
jge 0x25ad9d
movq 0x38(%rsp), %rax
movq $0x0, (%rax)
jmp 0x25adee
movq 0x38(%rsp), %rax
movq (%rax), %rax
cmpq 0x30(%rsp), %rax
jle 0x25adec
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rcx
movq 0x68(%rsp), %rax
subq %rax, %rcx
addq $0x1, %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rcx
subq 0x90(%rsp), %rcx
addq $0x1, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x25adee
movq 0x48(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x25ac60
jmp 0x25ae1b
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x25abce
movq 0x30(%rsp), %rax
addq $0x88, %rsp
retq
nopl (%rax,%rax)