// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x28(%rsp)
movq %rdx, 0x48(%rsp)
testq %rdx, %rdx
je 0x295b21
movq %r8, %rbx
movq %rdi, %r13
movq %rsi, 0x38(%rsp)
movq 0xb0(%rsp), %r12
movq %r9, 0x20(%rsp)
leaq 0x1(%r9), %r15
testq %rdi, %rdi
movq %rdi, 0x40(%rsp)
je 0x2953db
leaq 0x1(%r12), %rax
imulq %r15, %rax
imulq $0x30, %rax, %r14
movq %r13, %rdi
callq 0xf999b
cmpq %rax, %r14
ja 0x295b7d
pushq $0x1
popq %r14
movq %r13, %rdi
callq 0xf9981
movq %rax, %r12
movq %r13, %rdi
callq 0xf9975
movq %r12, %rbp
movq %rax, (%r12)
movq 0xb0(%rsp), %r12
imulq $0x30, %r12, %rax
cmpq %r15, %r14
jae 0x2953c9
movq -0x8(%rbp,%r14,8), %rcx
addq %rax, %rcx
addq $0x30, %rcx
movq %rcx, (%rbp,%r14,8)
incq %r14
jmp 0x2953ae
movq %r13, %rdi
callq 0xf99de
movq %rax, 0x8(%rsp)
movq %rbp, %r14
jmp 0x295447
leaq (,%r15,8), %rdi
leaq 0xe7032(%rip), %r14     # 0x37c41c
movq %r14, %rsi
movl $0x215, %edx            # imm = 0x215
callq 0x93160
incq %r12
movq %r15, %rcx
imulq %r12, %rcx
imulq $0x30, %rcx, %rdi
movq %r14, %rsi
movq %rax, %r14
movl $0x215, %edx            # imm = 0x215
callq 0x93160
movq %rax, (%r14)
pushq $0x1
popq %rax
imulq $0x30, %r12, %rcx
cmpq %r15, %rax
jae 0x295435
movq -0x8(%r14,%rax,8), %rdx
addq %rcx, %rdx
movq %rdx, (%r14,%rax,8)
incq %rax
jmp 0x29541f
callq 0xff598
movq %rax, 0x8(%rsp)
movq 0xb0(%rsp), %r12
movabsq $-0x8000000000000000, %rbp # imm = 0x8000000000000000
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x29547b
movq %rdi, %r12
callq 0x114a29
movq %rax, %r15
movq %r12, %rdi
movq 0xb0(%rsp), %r12
callq 0x114a6a
movq %rax, %r11
jmp 0x295482
leaq -0x1(%rbp), %r11
movq %r11, %r15
movq 0x20(%rsp), %r8
movq (%r14), %rax
movq %rbp, (%rax)
movq %rbp, 0x8(%rax)
movq %rbp, 0x10(%rax)
andq $0x0, 0x18(%rax)
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movabsq $0x300000003, %rcx      # imm = 0x300000003
movq %rcx, 0x20(%rax)
movl $0x3, 0x28(%rax)
addq %r11, %r15
pushq $0x1
popq %rax
movabsq $0x100000003, %rcx      # imm = 0x100000003
cmpq %r8, %rax
ja 0x2954f8
movq (%r14,%rax,8), %rdx
movq %rbp, (%rdx)
movq %r15, 0x8(%rdx)
movq %rbp, 0x10(%rdx)
andq $0x0, 0x18(%rdx)
movq %rcx, 0x20(%rdx)
movl $0x3, 0x28(%rdx)
incq %rax
jmp 0x2954cf
leaq (%rsi,%rdi), %rax
decq %rax
movq %rax, 0x58(%rsp)
addq %rbx, 0x28(%rsp)
xorl %eax, %eax
testq %r15, %r15
cmovgq %r15, %rax
movq %rax, 0x50(%rsp)
negq %r8
pushq $0x1
popq %r13
leaq -0x1(%rbp), %rcx
movq %rcx, 0x60(%rsp)
movq %r14, 0x10(%rsp)
movq %r8, 0x20(%rsp)
movq %r11, 0x18(%rsp)
cmpq %r12, %r13
ja 0x295807
movq (%r14), %rax
imulq $0x30, %r13, %r12
movq %rbp, (%rax,%r12)
movq %rbp, 0x8(%rax,%r12)
movq %r15, 0x10(%rax,%r12)
movq 0x50(%rsp), %rbx
movq %rbx, 0x18(%rax,%r12)
movabsq $0x300000003, %rcx      # imm = 0x300000003
movq %rcx, 0x20(%rax,%r12)
movl $0x2, 0x28(%rax,%r12)
movq 0x8(%rsp), %rdi
callq 0xff5d4
cmpq %rax, %rbx
jle 0x29559c
movq (%r14), %rax
movq 0x18(%rax,%r12), %rsi
movq 0x8(%rsp), %rdi
xorl %edx, %edx
movq %r13, %rcx
callq 0xff778
movq %r13, 0x30(%rsp)
leaq -0x1(%r13), %rax
imulq $0x30, %rax, %rbx
pushq $0x1
popq %r13
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r8
leaq (%r8,%r13), %rax
cmpq $0x1, %rax
je 0x2957f2
movq 0x60(%rsp), %rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2955f7
movq 0x28(%rsp), %rax
movzbl -0x1(%rax,%r13), %esi
movq 0x58(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl (%rax,%rcx), %edx
callq 0x114b2c
movq 0x18(%rsp), %r11
movq -0x8(%r14,%r13,8), %rsi
movq (%rsi,%rbx), %rcx
movq 0x8(%rsi,%rbx), %rdx
leaq (%rcx,%rax), %r8
cmpq %rbp, %rcx
cmoveq %rbp, %r8
leaq (%rdx,%rax), %rdi
cmpq %rbp, %rdx
cmoveq %rbp, %rdi
movq 0x10(%rsi,%rbx), %rcx
leaq (%rcx,%rax), %r9
cmpq %rbp, %rcx
cmoveq %rbp, %r9
movq 0x18(%rsi,%rbx), %rcx
addq %rcx, %rax
cmpq %rbp, %rcx
cmoveq %rbp, %rax
cmpq %rdi, %r8
movq %rdi, %rcx
cmovgq %r8, %rcx
cmpq %rax, %r9
cmovgq %r9, %rax
cmpq %rax, %rcx
cmovgq %rcx, %rax
movq (%r14,%r13,8), %rcx
leaq (%rcx,%r12), %rdx
movq %rax, (%rcx,%r12)
cmpq %rax, %r8
jne 0x295669
andl $0x0, 0x20(%rdx)
jmp 0x29568c
cmpq %rax, %rdi
jne 0x295677
movl $0x1, 0x20(%rdx)
jmp 0x29568c
cmpq %rax, %r9
jne 0x295685
movl $0x2, 0x20(%rdx)
jmp 0x29568c
movl $0x3, 0x20(%rdx)
movq (%rsi,%r12), %rdi
movq 0x8(%rsi,%r12), %r8
leaq (%rdi,%r15), %r9
cmpq %rbp, %rdi
cmoveq %rbp, %r9
leaq (%r8,%r11), %rdi
cmpq %rbp, %r8
cmoveq %rbp, %rdi
movq 0x10(%rsi,%r12), %r10
leaq (%r10,%r15), %r8
cmpq %rbp, %r10
cmoveq %rbp, %r8
movq 0x18(%rsi,%r12), %rsi
leaq (%rsi,%r15), %r14
cmpq %rbp, %rsi
cmoveq %rbp, %r14
cmpq %rdi, %r9
movq %rdi, %rsi
cmovgq %r9, %rsi
cmpq %r14, %r8
cmovgq %r8, %r14
cmpq %r14, %rsi
cmovgq %rsi, %r14
movq %r14, 0x8(%rcx,%r12)
cmpq %r14, %r9
jne 0x2956f3
andl $0x0, 0x24(%rdx)
jmp 0x295716
cmpq %r14, %rdi
jne 0x295701
movl $0x1, 0x24(%rdx)
jmp 0x295716
cmpq %r14, %r8
jne 0x29570f
movl $0x2, 0x24(%rdx)
jmp 0x295716
movl $0x3, 0x24(%rdx)
movq (%rcx,%rbx), %rsi
movq 0x8(%rcx,%rbx), %r8
leaq (%rsi,%r15), %r9
cmpq %rbp, %rsi
cmoveq %rbp, %r9
leaq (%r8,%r15), %rdi
cmpq %rbp, %r8
cmoveq %rbp, %rdi
movq 0x10(%rcx,%rbx), %rsi
leaq (%rsi,%r11), %r8
cmpq %rbp, %rsi
cmoveq %rbp, %r8
movq 0x18(%rcx,%rbx), %r10
leaq (%r10,%r15), %rsi
cmpq %rbp, %r10
cmoveq %rbp, %rsi
cmpq %rdi, %r9
movq %rdi, %r10
cmovgq %r9, %r10
cmpq %rsi, %r8
cmovgq %r8, %rsi
cmpq %rsi, %r10
cmovgq %r10, %rsi
movq %rsi, 0x10(%rcx,%r12)
cmpq %rsi, %r9
jne 0x29577d
andl $0x0, 0x28(%rdx)
jmp 0x2957a0
cmpq %rsi, %rdi
jne 0x29578b
movl $0x1, 0x28(%rdx)
jmp 0x2957a0
cmpq %rsi, %r8
jne 0x295799
movl $0x2, 0x28(%rdx)
jmp 0x2957a0
movl $0x3, 0x28(%rdx)
cmpq %r14, %rax
cmovgq %rax, %r14
cmpq %rsi, %r14
cmovleq %rsi, %r14
testq %r14, %r14
jg 0x2957b6
xorl %r14d, %r14d
movq %r14, 0x18(%rcx,%r12)
movq 0x8(%rsp), %rdi
callq 0xff5d4
cmpq %rax, %r14
movq 0x10(%rsp), %r14
jle 0x2957ea
movq (%r14,%r13,8), %rax
movq 0x18(%rax,%r12), %rsi
movq 0x8(%rsp), %rdi
movq %r13, %rdx
movq 0x30(%rsp), %rcx
callq 0xff778
incq %r13
jmp 0x2955ad
movq 0x30(%rsp), %r13
incq %r13
movq 0xb0(%rsp), %r12
jmp 0x295536
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xff5d4
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0xff6e3
movq %rax, %r15
movq %r14, %rax
movq %rdx, %r14
movq (%rax,%r15,8), %rax
imulq $0x30, %rdx, %r12
movq (%rax,%r12), %rcx
movq 0x8(%rax,%r12), %rdx
cmpq %rdx, %rcx
cmovgq %rcx, %rdx
movq 0x10(%rax,%r12), %rcx
movq 0x18(%rax,%r12), %r13
cmpq %r13, %rcx
cmovgq %rcx, %r13
cmpq %r13, %rdx
cmovgq %rdx, %r13
movq %rbx, %rdi
callq 0xff5d4
cmpq %r13, %rax
jne 0x295b4f
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rcx
xorl %eax, %eax
cmpq %r13, (%rcx,%r12)
je 0x29588a
addq %r12, %rcx
xorl %eax, %eax
cmpq %r13, 0x8(%rcx)
setne %al
incl %eax
decq %rbp
movq 0x48(%rsp), %r13
cmpl $0x3, %eax
je 0x29595e
movq %r15, %rcx
orq %r14, %rcx
je 0x295958
cmpl $0x2, %eax
je 0x295929
cmpl $0x1, %eax
je 0x2958ff
testl %eax, %eax
jne 0x295a2b
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rax
imulq $0x30, %r14, %r12
cmpq %rbp, (%rax,%r12)
je 0x295ae9
movq %r13, %rdi
callq 0xb5208
testq %r15, %r15
je 0x295abb
testq %r14, %r14
je 0x295abb
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rax
addq %r12, %rax
addq $0x20, %rax
decq %r15
jmp 0x29594e
movq %r13, %rdi
callq 0xb5258
testq %r15, %r15
je 0x295a5c
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rax
imulq $0x30, %r14, %rcx
addq %rcx, %rax
addq $0x24, %rax
decq %r15
jmp 0x295951
movq %r13, %rdi
callq 0xb52a8
testq %r14, %r14
je 0x295a8d
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rax
imulq $0x30, %r14, %rcx
addq %rcx, %rax
addq $0x28, %rax
decq %r14
movl (%rax), %eax
jmp 0x295892
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xff614
movq %rbx, %rdi
callq 0xff8b0
testb %al, %al
movq 0x40(%rsp), %r12
je 0x2959dc
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xff659
movq %rax, %r14
movq %rbx, %rdi
callq 0xff659
movq %rdx, %r15
movq %rbx, %rdi
callq 0xff7c0
movq %r13, %rbp
movq %rax, %r13
movq %rbx, %rdi
callq 0xff838
movq 0x28(%rsp), %rsi
addq %r14, %rsi
movq 0xa0(%rsp), %rcx
addq %r15, %rcx
addq 0xa8(%rsp), %rcx
movq %rbp, %rdi
movq %r13, %rdx
movq %rax, %r8
callq 0xb4f1f
testq %r12, %r12
jne 0x295a17
movq 0x10(%rsp), %r15
movq (%r15), %rdi
leaq 0xe6a2c(%rip), %r14     # 0x37c41c
movq %r14, %rsi
movl $0x23d, %edx            # imm = 0x23D
callq 0x936f9
movq %r15, %rdi
movq %r14, %rsi
movl $0x23d, %edx            # imm = 0x23D
callq 0x936f9
movq 0x8(%rsp), %rdi
callq 0xff5bf
movq 0x18(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a2536(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f5d7(%rip), %rsi     # 0x2e5013
leaq 0x90fa9(%rip), %rdx     # 0x3269ec
leaq 0xe6bfb(%rip), %rcx     # 0x37c645
leaq 0xe69cb(%rip), %r8      # 0x37c41c
movl $0x1fc, %r9d            # imm = 0x1FC
jmp 0x295b15
movq 0x1a2505(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f5a6(%rip), %rsi     # 0x2e5013
leaq 0x7912f(%rip), %rdx     # 0x30eba3
leaq 0xe6bca(%rip), %rcx     # 0x37c645
leaq 0xe699a(%rip), %r8      # 0x37c41c
movl $0x1f2, %r9d            # imm = 0x1F2
jmp 0x295b15
movq 0x1a24d4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f575(%rip), %rsi     # 0x2e5013
leaq 0x6a8aa(%rip), %rdx     # 0x30034f
leaq 0xe6b99(%rip), %rcx     # 0x37c645
leaq 0xe6969(%rip), %r8      # 0x37c41c
movl $0x1f8, %r9d            # imm = 0x1F8
jmp 0x295b15
movq 0x1a24a6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f547(%rip), %rsi     # 0x2e5013
leaq 0x85ad4(%rip), %rdx     # 0x31b5a7
leaq 0xe6b6b(%rip), %rcx     # 0x37c645
leaq 0xe693b(%rip), %r8      # 0x37c41c
movl $0x1eb, %r9d            # imm = 0x1EB
jmp 0x295b15
movq 0x1a2478(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f519(%rip), %rsi     # 0x2e5013
leaq 0xe6936(%rip), %rdx     # 0x37c437
leaq 0xe6b3d(%rip), %rcx     # 0x37c645
leaq 0xe690d(%rip), %r8      # 0x37c41c
movl $0x1e8, %r9d            # imm = 0x1E8
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x1a2440(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f4e1(%rip), %rsi     # 0x2e5013
leaq 0x996c5(%rip), %rdx     # 0x32f1fe
leaq 0xe69de(%rip), %rcx     # 0x37c51e
leaq 0xe68d5(%rip), %r8      # 0x37c41c
movl $0x211, %r9d            # imm = 0x211
jmp 0x295b15
movq 0x1a2412(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f4b3(%rip), %rsi     # 0x2e5013
leaq 0xe6afa(%rip), %rdx     # 0x37c661
leaq 0xe6ad7(%rip), %rcx     # 0x37c645
leaq 0xe68a7(%rip), %r8      # 0x37c41c
movl $0x1db, %r9d            # imm = 0x1DB
jmp 0x295b15
movq 0x1a23e4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4f485(%rip), %rsi     # 0x2e5013
leaq 0xe69b0(%rip), %rdx     # 0x37c545
leaq 0xe6982(%rip), %rcx     # 0x37c51e
leaq 0xe6879(%rip), %r8      # 0x37c41c
movl $0x21c, %r9d            # imm = 0x21C
jmp 0x295b15