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

  gt_assert(align != NULL);
  if (spacemanager == NULL)
  {
    /*use it in normally case*/
    gt_array2dim_malloc(Ltabcolumn, (ulen+1), (vlen+1));
    max = gt_maxcoordvalue_new();
  }
  else
  {
    /*use it in lineraspace context*/
    Ltabcolumn = (GtWord **)
                 gt_linspace_management_change_to_square(spacemanager,
                                                         ulen, vlen);
    max = gt_linspace_management_get_maxspace(spacemanager);
  }

  score = fillDPtab_in_square_space_local(Ltabcolumn, max, useq, ustart, ulen,
                                          vseq, vstart, vlen, scorehandler);

  /* reconstruct local alignment from 2dimarray Ltabcolumn */
  gt_reconstructalignment_from_Ltab(align, Ltabcolumn, max,
                                    useq, ustart, ulen,
                                    vseq, vstart, vlen,
                                    scorehandler);

  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(Ltabcolumn);
    gt_maxcoordvalue_delete(max);
  }
  return score;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
movq 0xc0(%rsp), %rax
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rax
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq %rcx, 0x80(%rsp)
movq %r8, 0x78(%rsp)
movq %r9, 0x70(%rsp)
movq $0x0, 0x68(%rsp)
cmpq $0x0, 0x90(%rsp)
jne 0x1e17c6
movq 0x45a80b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x334874(%rip), %rsi    # 0x516013
leaq 0x37ff0b(%rip), %rdx    # 0x5616b1
leaq 0x385886(%rip), %rcx    # 0x567033
leaq 0x3857ee(%rip), %r8     # 0x566fa2
movl $0x138, %r9d            # imm = 0x138
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1e17c8
cmpq $0x0, 0x98(%rsp)
jne 0x1e189e
movq 0x78(%rsp), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
leaq 0x3857b7(%rip), %rsi    # 0x566fa2
movl $0x13c, %edx            # imm = 0x13C
callq 0xe80f0
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
movq 0xb8(%rsp), %rax
addq $0x1, %rax
imulq %rax, %rdi
leaq 0x385784(%rip), %rsi    # 0x566fa2
movl $0x13c, %edx            # imm = 0x13C
callq 0xe80f0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, (%rax)
movq $0x1, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x1e1892
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movq 0xb8(%rsp), %rax
addq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdx
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x1e183c
callq 0x1ac420
movq %rax, 0x58(%rsp)
jmp 0x1e18cf
movq 0x98(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0xb8(%rsp), %rdx
callq 0x1a3830
movq %rax, 0x60(%rsp)
movq 0x98(%rsp), %rdi
callq 0x1a3800
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x70(%rsp), %r9
movq 0xb0(%rsp), %r11
movq 0xb8(%rsp), %r10
movq 0xc0(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1e1ab0
movq %rax, 0x68(%rsp)
movq 0x90(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq 0x80(%rsp), %r8
movq 0x78(%rsp), %r9
movq 0x70(%rsp), %rbx
movq 0xb0(%rsp), %r11
movq 0xb8(%rsp), %r10
movq 0xc0(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x1c6af0
movq 0x58(%rsp), %rdi
callq 0x1acb30
testb $0x1, %al
jne 0x1e1992
jmp 0x1e1a56
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1ac590
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
addq 0x40(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1ac590
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
addq 0x38(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1ac970
movq %rax, 0x78(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1aca50
movq %rax, 0xb8(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
addq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
addq 0xb0(%rsp), %rcx
movq 0xb8(%rsp), %r8
callq 0x129f60
cmpq $0x0, 0x98(%rsp)
jne 0x1e1a9a
movq 0x60(%rsp), %rax
movq (%rax), %rdi
leaq 0x385532(%rip), %rsi    # 0x566fa2
movl $0x15e, %edx            # imm = 0x15E
callq 0xe88c0
movq 0x60(%rsp), %rdi
leaq 0x38551c(%rip), %rsi    # 0x566fa2
movl $0x15e, %edx            # imm = 0x15E
callq 0xe88c0
movq 0x58(%rsp), %rdi
callq 0x1ac490
movq 0x68(%rsp), %rax
addq $0xa0, %rsp
popq %rbx
retq
nopl (%rax,%rax)