// File: /workspace/github_c_makefile_star2_O1/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 0x138f3e
cmpq $0x0, 0x80(%rsp)
je 0x138f3e
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 0x138f43
cmpq 0x78(%rsp), %rax
jg 0x138f43
movq %rsi, 0x20(%rsp)
movq %rdx, %r14
movq %rcx, %rbp
testq %rdi, %rdi
movq %rdi, 0x18(%rsp)
je 0x138e08
movq %r15, %rsi
movq %rbx, %rdx
callq 0x163bd7
movq %rax, %r12
jmp 0x138e92
movq %r13, 0x8(%rsp)
leaq 0x1(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x8(,%r15,8), %r13
leaq 0x24b14e(%rip), %rsi    # 0x383f73
movq %r13, %rdi
movl $0xac, %edx
callq 0x1092b2
movq %rax, %r12
leaq 0x1(%rbx), %rdi
imulq %r13, %rdi
leaq 0x24b12f(%rip), %rsi    # 0x383f73
movl $0xac, %edx
callq 0x1092b2
movq %rax, (%r12)
cmpq $0x2, 0x10(%rsp)
jb 0x138e8d
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 0x138e78
movq %rsi, %rbx
jmp 0x138e97
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 0x138f48
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 0x174fb2
addq $0x20, %rsp
cmpq $0x0, 0x18(%rsp)
jne 0x138f2c
movq (%r12), %rdi
leaq 0x24b064(%rip), %rbx    # 0x383f73
movq %rbx, %rsi
movl $0xbf, %edx
callq 0x109670
movq %r12, %rdi
movq %rbx, %rsi
movl $0xbf, %edx
callq 0x109670
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3f9c6
callq 0x3f9ff