// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x10(%rsp)
movq %rsi, (%rsp)
testq %rdi, %rdi
je 0xf720b
cmpq $0x0, (%rsp)
je 0xf720b
testq %rdx, %rdx
je 0xf720b
movq %r9, %r12
movq %r8, %rbx
movq %rdx, 0x28(%rsp)
movq 0xe0(%rsp), %rbp
movq %rdi, 0x18(%rsp)
movq %r9, %rsi
callq 0xf9932
testq %r12, %r12
sete %al
testq %rbp, %rbp
sete %cl
orb %al, %cl
je 0xf6e4c
xorl %eax, %eax
addq $0x98, %rsp
jmp 0xf6eed
movq 0xd8(%rsp), %r15
movq 0xd0(%rsp), %r13
cmpq $0x1, %rbp
jne 0xf6ea2
leaq 0x1(,%r12,2), %rsi
pushq $0x8
popq %rcx
movq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r12, %rdx
movq %rcx, %r8
callq 0xf9854
subq $0x8, %rsp
movq %r14, %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbx, %rcx
movq %r12, %r8
movq %r13, %r9
pushq 0x8(%rsp)
pushq $0x1
jmp 0xf6edf
pushq $0x8
popq %rcx
pushq $0x10
popq %r8
movq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xf9929
testb %al, %al
je 0xf6ef8
subq $0x8, %rsp
movq %r14, %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbx, %rcx
movq %r12, %r8
movq %r13, %r9
pushq 0x8(%rsp)
pushq %rbp
pushq %r15
callq 0x11f220
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, 0x8(%rsp)
pushq $0x8
popq %rcx
pushq $0x10
popq %r8
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xf9854
movq %r14, %rdi
callq 0xf9975
movq %rax, %rbx
movq %r14, %rdi
callq 0xf9981
testq %rbx, %rbx
je 0xf7243
movq %rax, %r14
testq %rax, %rax
je 0xf7243
leaq 0x1(%r12), %rax
leaq 0x8(%r14), %rcx
xorl %edx, %edx
cmpq %rdx, %rax
je 0xf6f60
andq $0x0, (%rbx,%rdx,8)
movq %rdx, -0x8(%rcx)
andq $0x0, (%rcx)
incq %rdx
addq $0x10, %rcx
jmp 0xf6f45
movq 0x18(%rsp), %rdi
callq 0xf99de
movq %rax, %rdx
leaq (%r15,%r13), %rax
decq %rax
movq %rax, 0x50(%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x48(%rsp)
pushq $0x1
popq %rax
movq %r12, 0x68(%rsp)
movq %r14, 0x58(%rsp)
movq %rdx, 0x38(%rsp)
cmpq %rbp, %rax
ja 0xf711b
testq %rdx, %rdx
je 0xf71dd
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, %r15
movb (%rax,%rcx), %bpl
movq (%rsp), %rdi
callq 0x114a6a
movq (%rbx), %r13
movups (%r14), %xmm0
movaps %xmm0, 0x70(%rsp)
andq $0x0, (%rbx)
movq %rax, 0x20(%rsp)
andq $0x0, (%r14)
movq %r15, 0x30(%rsp)
movq %r15, 0x8(%r14)
movzbl %bpl, %eax
movl %eax, 0x44(%rsp)
movq 0x48(%rsp), %r14
pushq $0x1
popq %rbp
cmpq %r12, %rbp
ja 0xf70ec
movaps 0x70(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movq (%rbx,%rbp,8), %r15
leaq -0x8(%r14), %r12
movups -0x8(%r14), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x20(%rsp), %rax
addq %r15, %rax
movq %rax, (%rbx,%rbp,8)
movq 0x60(%rsp), %rax
movzbl -0x1(%rax,%rbp), %esi
movq (%rsp), %rdi
movl 0x44(%rsp), %edx
callq 0x114b2c
addq %r13, %rax
movq (%rbx,%rbp,8), %r13
cmpq %r13, %rax
jl 0xf7071
movq %rax, (%rbx,%rbp,8)
movaps 0x80(%rsp), %xmm0
movups %xmm0, (%r12)
movq (%rbx,%rbp,8), %r13
movq -0x8(%rbx,%rbp,8), %rax
addq 0x20(%rsp), %rax
cmpq %r13, %rax
movq 0x38(%rsp), %rdi
jle 0xf7097
movq %rax, (%rbx,%rbp,8)
movups -0x18(%r14), %xmm0
movups %xmm0, (%r12)
movq (%rbx,%rbp,8), %r13
testq %r13, %r13
jns 0xf70b1
andq $0x0, (%rbx,%rbp,8)
movq %rbp, -0x8(%r14)
movq 0x30(%rsp), %rax
movq %rax, (%r14)
movq (%rbx,%rbp,8), %r13
callq 0xff5d4
cmpq %rax, %r13
movq 0x68(%rsp), %r12
jle 0xf70dd
movq (%rbx,%rbp,8), %rsi
movq -0x8(%r14), %rdx
movq (%r14), %rcx
movq 0x38(%rsp), %rdi
movq %rbp, %r8
movq 0x30(%rsp), %r9
callq 0xff728
incq %rbp
addq $0x10, %r14
movq %r15, %r13
jmp 0xf7005
movq 0x30(%rsp), %rax
incq %rax
movq 0xd0(%rsp), %r13
movq 0xd8(%rsp), %r15
movq 0xe0(%rsp), %rbp
movq 0x58(%rsp), %r14
movq 0x38(%rsp), %rdx
jmp 0xf6fa9
movq %rdx, %r14
movq %rdx, %rdi
callq 0xff8b0
testb %al, %al
movq 0x8(%rsp), %rbp
je 0xf6e3e
movq %r14, %rdi
callq 0xff659
addq %rax, %rbp
movq %r14, %rdi
callq 0xff659
movq %rbp, 0x8(%rsp)
movq %rdx, %rbx
addq %r15, %rbx
movq %r14, %rdi
callq 0xff7c0
movq %rax, %r15
movq %r14, %rdi
callq 0xff838
movq %rax, %r12
movq %r14, %rdi
callq 0xff5d4
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %r14
leaq (%r14,%rbp), %rsi
leaq (%rbx,%r13), %rcx
movq 0x28(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rdx
movq %r12, %r8
callq 0xb4f1f
movq (%rsp), %rdi
callq 0x114c1c
movq %r13, %r10
movq %rax, %r13
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq 0x10(%rsp), %r8
movq %r15, %r9
pushq %r12
pushq %rbx
pushq %r10
callq 0xf6440
addq $0x20, %rsp
movq %r13, %rdi
callq 0x114a03
movq 0x20(%rsp), %rax
jmp 0xf6e40
movq 0x340d84(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ede25(%rip), %rsi    # 0x2e5013
leaq 0x22f068(%rip), %rdx    # 0x32625d
leaq 0x22f06d(%rip), %rcx    # 0x326269
leaq 0x22ed51(%rip), %r8     # 0x325f54
movl $0x22f, %r9d            # imm = 0x22F
jmp 0xf7237
movq 0x340d56(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1eddf7(%rip), %rsi    # 0x2e5013
leaq 0x22410d(%rip), %rdx    # 0x31b330
leaq 0x22ed7b(%rip), %rcx    # 0x325fa5
leaq 0x22ed23(%rip), %r8     # 0x325f54
movl $0x28b, %r9d            # imm = 0x28B
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x340d1e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1eddbf(%rip), %rsi    # 0x2e5013
leaq 0x22efc4(%rip), %rdx    # 0x32621f
leaq 0x22efea(%rip), %rcx    # 0x32624c
leaq 0x22eceb(%rip), %r8     # 0x325f54
movl $0x21a, %r9d            # imm = 0x21A
jmp 0xf7237