// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/linearalign.c
// Function: gt_linearalign_compute_local_generic
GtWord gt_linearalign_compute_local_generic(GtLinspaceManagement *spacemanager,
                                            const GtScoreHandler *scorehandler,
                                            GtAlignment *align,
                                            const GtUchar *useq,
                                            GtUword ustart,
                                            GtUword ulen,
                                            const GtUchar *vseq,
                                            GtUword vstart,
                                            GtUword vlen)
{
  GtWord *Ltabcolumn,
         score = GT_WORD_MAX;
  GtUwordPair *Starttabcolumn;
  GtUword ulen_part, ustart_part, vlen_part, vstart_part;
  GtMaxcoordvalue *max;

  gt_assert(spacemanager && scorehandler && align);
  gt_linspace_management_set_ulen(spacemanager,ulen);

  if (ulen == 0UL || vlen == 0UL)
  {
     /* empty alignment */
    return 0;
  }
  else if (vlen == 1UL)
  {
    gt_linspace_management_check_local(spacemanager,
                                       (ulen+1)*(vlen+1)-1, ulen,
                                       sizeof (GtWord),
                                       sizeof (GtWord *));
    return gt_squarealign_calculate_local_generic(spacemanager, align,
                                                  useq, ustart, ulen,
                                                  vseq, vstart, vlen,
                                                  scorehandler);
  }
  else if (gt_linspace_management_checksquare_local(spacemanager, ulen, vlen,
                                                    sizeof (*Ltabcolumn),
                                                    sizeof (*Starttabcolumn)))
  {
    /* call 2dim */
    return gt_squarealign_calculate_local_generic(spacemanager, align,
                                                  useq, ustart, ulen,
                                                  vseq, vstart, vlen,
                                                  scorehandler);
  }

  gt_linspace_management_check_local(spacemanager,
                                     ulen, vlen,
                                     sizeof (*Ltabcolumn),
                                     sizeof (*Starttabcolumn));

  max = evaluateallLScolumns(spacemanager, scorehandler,
                             useq, ustart, ulen,
                             vseq, vstart, vlen);

  if (gt_maxcoordvalue_get_length_safe(max))
  {
    GtScoreHandler *costhandler;

    ustart_part = ustart+(gt_maxcoordvalue_get_start(max)).a;
    vstart_part = vstart+(gt_maxcoordvalue_get_start(max)).b;
    ulen_part = gt_maxcoordvalue_get_row_length(max);
    vlen_part = gt_maxcoordvalue_get_col_length(max);
    score = gt_maxcoordvalue_get_value(max);

    gt_alignment_set_seqs(align, useq + ustart_part, ulen_part,
                                 vseq + vstart_part, vlen_part);
    costhandler = gt_scorehandler2costhandler(scorehandler);
    /* call global function */
    gt_calc_linearalign(spacemanager,
                        costhandler, align,
                        useq, ustart_part, ulen_part,
                        vseq, vstart_part, vlen_part);
    gt_scorehandler_delete(costhandler);
  } else
  {
    /*empty alignment */
    return 0;
  }
  return score;
}

// Assembly:
subq $0xc8, %rsp
movq 0xe0(%rsp), %rax
movq 0xd8(%rsp), %rax
movq 0xd0(%rsp), %rax
movq %rdi, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
movq %rdx, 0xa8(%rsp)
movq %rcx, 0xa0(%rsp)
movq %r8, 0x98(%rsp)
movq %r9, 0x90(%rsp)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x80(%rsp)
cmpq $0x0, 0xb8(%rsp)
je 0x19cc82
cmpq $0x0, 0xb0(%rsp)
je 0x19cc82
cmpq $0x0, 0xa8(%rsp)
jne 0x19ccba
movq 0x49f317(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x379380(%rip), %rsi    # 0x516013
leaq 0x3b07d8(%rip), %rdx    # 0x54d472
leaq 0x3bb6a4(%rip), %rcx    # 0x558345
leaq 0x3bb64c(%rip), %r8     # 0x5582f4
movl $0x28b, %r9d            # imm = 0x28B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x19ccbc
movq 0xb8(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x1a36b0
cmpq $0x0, 0x90(%rsp)
je 0x19cce7
cmpq $0x0, 0xe0(%rsp)
jne 0x19ccf8
movq $0x0, 0xc0(%rsp)
jmp 0x19d024
cmpq $0x1, 0xe0(%rsp)
jne 0x19cdad
movq 0xb8(%rsp), %rdi
movq 0x90(%rsp), %rsi
addq $0x1, %rsi
movq 0xe0(%rsp), %rax
addq $0x1, %rax
imulq %rax, %rsi
subq $0x1, %rsi
movq 0x90(%rsp), %rdx
movl $0x8, %r8d
movq %r8, %rcx
callq 0x1a3420
movq 0xb8(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0xd0(%rsp), %r9
movq 0xd8(%rsp), %r11
movq 0xe0(%rsp), %r10
movq 0xb0(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1e1730
movq %rax, 0xc0(%rsp)
jmp 0x19d024
movq 0xb8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movl $0x8, %ecx
movl $0x10, %r8d
callq 0x1a3660
testb $0x1, %al
jne 0x19cddb
jmp 0x19ce43
movq 0xb8(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0xd0(%rsp), %r9
movq 0xd8(%rsp), %r11
movq 0xe0(%rsp), %r10
movq 0xb0(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1e1730
movq %rax, 0xc0(%rsp)
jmp 0x19d024
jmp 0x19ce45
jmp 0x19ce47
movq 0xb8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movl $0x8, %ecx
movl $0x10, %r8d
callq 0x1a3420
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0xd0(%rsp), %r9
movq 0xd8(%rsp), %r10
movq 0xe0(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x19d040
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1acb30
testb $0x1, %al
jne 0x19ced5
jmp 0x19d006
movq 0x98(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1ac590
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
addq 0x38(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1ac590
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
addq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1ac970
movq %rax, 0x70(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1aca50
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1ac4c0
movq %rax, 0x80(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
addq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0xd0(%rsp), %rcx
addq 0x58(%rsp), %rcx
movq 0x60(%rsp), %r8
callq 0x129f60
movq 0xb0(%rsp), %rdi
callq 0x1d1450
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x70(%rsp), %r9
movq 0xd0(%rsp), %r11
movq 0x58(%rsp), %r10
movq 0x60(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x19bdf0
movq 0x48(%rsp), %rdi
callq 0x1d1150
jmp 0x19d014
movq $0x0, 0xc0(%rsp)
jmp 0x19d024
movq 0x80(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)