// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/diagonalbandalign.c
// Function: gt_diagonalbandalignment_in_square_space_generic
GtUword gt_diagonalbandalignment_in_square_space_generic(GtLinspaceManagement
                                                         *space,
                                                         GtAlignment *align,
                                                         const GtUchar *useq,
                                                         GtUword ustart,
                                                         GtUword ulen,
                                                         const GtUchar *vseq,
                                                         GtUword vstart,
                                                         GtUword vlen,
                                                         GtWord left_dist,
                                                         GtWord right_dist,
                                                         const GtScoreHandler
                                                         *scorehandler)
{
  GtUword **EDtabcolumn, distance;

  gt_assert(align && scorehandler);

  if ((left_dist > GT_MIN(0, (GtWord)vlen-(GtWord)ulen))||
      (right_dist < GT_MAX(0, (GtWord)vlen-(GtWord)ulen)))
  {
    gt_assert(false);
  }

  if (space == NULL)
  {
    /*use it in normally case*/
    gt_array2dim_malloc(EDtabcolumn, (ulen+1), (vlen+1));
  }
  else
  {
    /*use it in lineraspace context*/
    EDtabcolumn = gt_linspace_management_change_to_square(space, ulen, vlen);
  }

  diagonalband_fillDPtab_in_square_space(EDtabcolumn, useq, ustart, ulen,
                                         vseq, vstart, vlen,
                                         left_dist, right_dist, scorehandler);

  distance = EDtabcolumn[ulen][vlen];
  /* reconstruct alignment from 2dimarray EDtabcolumn */
  gt_reconstructalignment_from_EDtab(align, EDtabcolumn, useq, ustart, ulen,
                                     vseq, vstart, vlen, scorehandler);

  if (space == NULL)
  {
    gt_array2dim_delete(EDtabcolumn);
  }
  return distance;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x132b8a
cmpq $0x0, 0x80(%rsp)
je 0x132b8a
movq %r9, %r13
movq %r8, %r15
movq 0x68(%rsp), %rbx
movq %rbx, %r8
subq %r15, %r8
movq %r8, %r9
sarq $0x3f, %r9
andq %r8, %r9
xorl %eax, %eax
testq %r8, %r8
cmovgq %r8, %rax
cmpq 0x70(%rsp), %r9
jl 0x132b8f
cmpq 0x78(%rsp), %rax
jg 0x132b8f
movq %rsi, 0x20(%rsp)
movq %rdx, %r14
movq %rcx, %rbp
testq %rdi, %rdi
movq %rdi, 0x18(%rsp)
je 0x132a54
movq %r15, %rsi
movq %rbx, %rdx
callq 0x15be6b
movq %rax, %r12
jmp 0x132ade
movq %r13, 0x8(%rsp)
leaq 0x1(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x8(,%r15,8), %r13
leaq 0x2481aa(%rip), %rsi    # 0x37ac1b
movq %r13, %rdi
movl $0xac, %edx
callq 0x104226
movq %rax, %r12
leaq 0x1(%rbx), %rdi
imulq %r13, %rdi
leaq 0x24818b(%rip), %rsi    # 0x37ac1b
movl $0xac, %edx
callq 0x104226
movq %rax, (%r12)
cmpq $0x2, 0x10(%rsp)
jb 0x132ad9
movq %rbx, %rsi
leaq 0x8(,%rbx,8), %rax
movq (%r12), %rcx
addq %rax, %rcx
xorl %edx, %edx
movq 0x8(%rsp), %r13
movq 0x70(%rsp), %r10
movq %rcx, 0x8(%r12,%rdx,8)
addq %rax, %rcx
incq %rdx
cmpq %rdx, %r15
jne 0x132ac4
movq %rsi, %rbx
jmp 0x132ae3
movq 0x8(%rsp), %r13
movq 0x70(%rsp), %r10
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r15, %rcx
movq %r13, %r8
movq 0x60(%rsp), %r9
movq 0x80(%rsp), %rax
pushq %rax
pushq 0x80(%rsp)
pushq %r10
pushq %rbx
callq 0x132b94
addq $0x20, %rsp
movq (%r12,%r15,8), %rax
movq %r13, %r9
movq (%rax,%rbx,8), %r13
subq $0x8, %rsp
movq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r15, %r8
pushq 0x88(%rsp)
pushq %rbx
pushq 0x78(%rsp)
callq 0x16cd5a
addq $0x20, %rsp
cmpq $0x0, 0x18(%rsp)
jne 0x132b78
movq (%r12), %rdi
leaq 0x2480c0(%rip), %rbx    # 0x37ac1b
movq %rbx, %rsi
movl $0xbf, %edx
callq 0x1045eb
movq %r12, %rdi
movq %rbx, %rsi
movl $0xbf, %edx
callq 0x1045eb
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3eedd
callq 0x3ef16