// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/affinealign.c
// Function: gt_affinealign_calculate_local_generic
GtWord gt_affinealign_calculate_local_generic(GtLinspaceManagement
                                             *spacemanager,
                                             const GtScoreHandler *scorehandler,
                                             GtAlignment *align,
                                             const GtUchar *useq,
                                             GtUword ustart,
                                             GtUword ulen,
                                             const GtUchar *vseq,
                                             GtUword vstart,
                                             GtUword vlen)
{
  GtWord score = 0;
  GtAffinealignDPentry **Atabcolumn;
  GtMaxcoordvalue *max;

  gt_assert(align != NULL);
  if (spacemanager == NULL)
  {
    /*use it in normally case*/
    gt_array2dim_malloc(Atabcolumn,(ulen+1),(vlen+1));
    max = gt_maxcoordvalue_new();
  }
  else
  {
    /*use it in lineraspace context*/
    gt_assert((ulen+1)*(vlen+1)*sizeof(**Atabcolumn) <=
               gt_linspace_management_get_valueTabsize(spacemanager));

    Atabcolumn = gt_linspace_management_get_rTabspace(spacemanager);
    *Atabcolumn = gt_linspace_management_get_valueTabspace(spacemanager);

    GtUword idx;
    for (idx = 1;idx < ulen+1;idx++)
      Atabcolumn[idx] = Atabcolumn[idx-1] + vlen + 1;
    max = gt_linspace_management_get_maxspace(spacemanager);
  }

  score = affinealign_fill_table_local(Atabcolumn, scorehandler, max,
                                       useq, ustart, ulen,
                                       vseq, vstart, vlen,
                                       GT_WORD_MAX, GT_WORD_MAX,
                                       GT_WORD_MAX, GT_WORD_MAX);

  /* reconstruct local alignment from 2dimarray Atabcolumn */
  affinealign_traceback_local(align, Atabcolumn, max);

  if (gt_maxcoordvalue_get_length_safe(max))
  {
    ustart = ustart + (gt_maxcoordvalue_get_start(max)).a;
    vstart = vstart + (gt_maxcoordvalue_get_start(max)).b;
    ulen = gt_maxcoordvalue_get_row_length(max);
    vlen = gt_maxcoordvalue_get_col_length(max);

    gt_alignment_set_seqs(align, &useq[ustart], ulen,
                                 &vseq[vstart], vlen);
  }

  if (spacemanager == NULL)
  {
    gt_array2dim_delete(Atabcolumn);
    gt_maxcoordvalue_delete(max);
  }
  return score;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq 0xf0(%rsp), %rax
movq 0xe8(%rsp), %rax
movq 0xe0(%rsp), %rax
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
movq %rcx, 0xb0(%rsp)
movq %r8, 0xa8(%rsp)
movq %r9, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
cmpq $0x0, 0xb8(%rsp)
jne 0x48592f
movq 0x1b66a2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x9070b(%rip), %rsi     # 0x516013
leaq 0xdbda2(%rip), %rdx     # 0x5616b1
leaq 0x12bbf8(%rip), %rcx    # 0x5b150e
leaq 0x12baef(%rip), %r8     # 0x5b140c
movl $0x211, %r9d            # imm = 0x211
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x485931
cmpq $0x0, 0xc8(%rsp)
jne 0x485a34
movq 0xa0(%rsp), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
leaq 0x12bab5(%rip), %rsi    # 0x5b140c
movl $0x215, %edx            # imm = 0x215
callq 0xe80f0
movq %rax, 0x90(%rsp)
movq 0xa0(%rsp), %rax
addq $0x1, %rax
imulq $0x30, %rax, %rdi
movq 0xf0(%rsp), %rax
addq $0x1, %rax
imulq %rax, %rdi
leaq 0x12ba7c(%rip), %rsi    # 0x5b140c
movl $0x215, %edx            # imm = 0x215
callq 0xe80f0
movq %rax, %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq $0x1, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq 0xa0(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x485a22
movq 0x90(%rsp), %rax
movq 0x80(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movq 0xf0(%rsp), %rax
addq $0x1, %rax
imulq $0x30, %rax, %rax
addq %rax, %rdx
movq 0x90(%rsp), %rax
movq 0x80(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x4859b4
callq 0x1ac420
movq %rax, 0x88(%rsp)
jmp 0x485b59
jmp 0x485a36
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq 0xf0(%rsp), %rcx
addq $0x1, %rcx
imulq %rcx, %rax
imulq $0x30, %rax, %rax
movq %rax, 0x50(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x1a37b0
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
jbe 0x485aad
movq 0x1b6524(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x9058d(%rip), %rsi     # 0x516013
leaq 0x12baa8(%rip), %rdx    # 0x5b1535
leaq 0x12ba7a(%rip), %rcx    # 0x5b150e
leaq 0x12b971(%rip), %r8     # 0x5b140c
movl $0x21c, %r9d            # imm = 0x21C
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x485aaf
movq 0xc8(%rsp), %rdi
callq 0x1a3750
movq %rax, 0x90(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x1a3720
movq %rax, %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq $0x1, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq 0xa0(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x485b44
movq 0x90(%rsp), %rax
movq 0x78(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
imulq $0x30, 0xf0(%rsp), %rax
addq %rax, %rdx
addq $0x30, %rdx
movq 0x90(%rsp), %rax
movq 0x78(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x485ae8
movq 0xc8(%rsp), %rdi
callq 0x1a3800
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0xb0(%rsp), %rcx
movq 0xa8(%rsp), %r8
movq 0xa0(%rsp), %r9
movq 0xe0(%rsp), %rbx
movq 0xe8(%rsp), %r11
movq 0xf0(%rsp), %r10
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x485d50
movq %rax, 0x98(%rsp)
movq 0xb8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x487510
movq 0x88(%rsp), %rdi
callq 0x1acb30
testb $0x1, %al
jne 0x485c0d
jmp 0x485ce6
movq 0xa8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1ac590
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x68(%rsp)
movq %rdx, 0x70(%rsp)
addq 0x68(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1ac590
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq %rdx, 0x60(%rsp)
addq 0x60(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1ac970
movq %rax, 0xa0(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1aca50
movq %rax, 0xf0(%rsp)
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
addq 0xa8(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0xe0(%rsp), %rcx
addq 0xe8(%rsp), %rcx
movq 0xf0(%rsp), %r8
callq 0x129f60
cmpq $0x0, 0xc8(%rsp)
jne 0x485d33
movq 0x90(%rsp), %rax
movq (%rax), %rdi
leaq 0x12b709(%rip), %rsi    # 0x5b140c
movl $0x23d, %edx            # imm = 0x23D
callq 0xe88c0
movq 0x90(%rsp), %rdi
leaq 0x12b6f0(%rip), %rsi    # 0x5b140c
movl $0x23d, %edx            # imm = 0x23D
callq 0xe88c0
movq 0x88(%rsp), %rdi
callq 0x1ac490
movq 0x98(%rsp), %rax
addq $0xd0, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)