// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/diagband-struct.c
// Function: gt_diagband_statistics_add
void gt_diagband_statistics_add(void *v_diagband_statistics,
                                /* remove GT_UNUSED once arguments are used */
                                GT_UNUSED const GtEncseq *aencseq,
                                GT_UNUSED const GtEncseq *bencseq,
                                GT_UNUSED GtUword aseqnum,
                                GT_UNUSED GtUword bseqnum,
                                const GtDiagbandStruct *diagband_struct,
                                const GtDiagbandseedMaximalmatch *memstore,
                                GT_UNUSED unsigned int seedlength,
                                const GtSeedpairPositions *seedstore,
                                GtUword segment_length)
{
  GtUword idx;
  GtDiagbandStatistics *diagband_statistics
    = (GtDiagbandStatistics *) v_diagband_statistics;

  if (diagband_statistics->track == NULL)
  {
    GT_INITBITTAB(diagband_statistics->track,diagband_struct->num_diagbands);
  } else
  {
    GT_CLEARBITTAB(diagband_statistics->track,diagband_struct->num_diagbands);
  }
  if (seedstore != NULL)
  {
    for (idx = 0; idx < segment_length; idx++)
    {
      const GtUword diagband_idx
        = GT_DIAGBANDSEED_DIAGONALBAND(diagband_struct->amaxlen,
                                       diagband_struct->logdiagbandwidth,
                                       seedstore[idx].apos,
                                       seedstore[idx].bpos);
      gt_diagband_statistics_score_add(diagband_statistics,diagband_struct,
                                       diagband_idx);
    }
  } else
  {
    gt_assert(memstore != NULL);
    for (idx = 0; idx < segment_length; idx++)
    {
      const GtUword diagband_idx
        = GT_DIAGBANDSEED_DIAGONALBAND(diagband_struct->amaxlen,
                                       diagband_struct->logdiagbandwidth,
                                       memstore[idx].apos,
                                       memstore[idx].bpos);
      gt_diagband_statistics_score_add(diagband_statistics,diagband_struct,
                                       diagband_idx);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %rdi, %r14
movq 0x40(%rsp), %r13
movq 0x10(%rdi), %rdi
movq 0x10(%r9), %rax
leaq -0x1(%rax), %rcx
shrq $0x6, %rcx
cmpq $0x40, %rax
leaq 0x8(,%rcx,8), %rax
movl $0x8, %r15d
cmovaeq %rax, %r15
testq %rdi, %rdi
jne 0x312171
leaq 0xd7c16(%rip), %rdx     # 0x3e9d71
xorl %edi, %edi
movq %r15, %rsi
movl $0x13e, %ecx            # imm = 0x13E
callq 0x1094e6
movq %rax, %rdi
movq %rax, 0x10(%r14)
movq 0x48(%rsp), %r12
xorl %esi, %esi
movq %r15, %rdx
callq 0x173a0
testq %r13, %r13
je 0x3121e3
testq %r12, %r12
je 0x312243
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movq 0x10(%r14), %rsi
xorl %edi, %edi
movl 0x4(%r13,%rdi,8), %eax
addq (%rbx), %rax
movl (%r13,%rdi,8), %ecx
subq %rcx, %rax
movb 0x8(%rbx), %cl
shrq %cl, %rax
movq %rdx, %r8
movl %eax, %ecx
shrq %cl, %r8
movq %rax, %rcx
shrq $0x6, %rcx
testq %r8, (%rsi,%rcx,8)
jne 0x3121d9
movq 0x30(%rbx), %r9
movl (%r9,%rax,4), %eax
addq %rax, 0x8(%r14)
orq %r8, (%rsi,%rcx,8)
incq %rdi
cmpq %rdi, %r12
jne 0x31219e
jmp 0x312243
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
je 0x31224d
testq %r12, %r12
je 0x312243
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
movq 0x10(%r14), %rdi
addq $0x4, %rdx
movl (%rdx), %eax
addq (%rbx), %rax
movl -0x4(%rdx), %ecx
subq %rcx, %rax
movb 0x8(%rbx), %cl
shrq %cl, %rax
movq %rsi, %r8
movl %eax, %ecx
shrq %cl, %r8
movq %rax, %rcx
shrq $0x6, %rcx
testq %r8, (%rdi,%rcx,8)
jne 0x31223a
movq 0x30(%rbx), %r9
movl (%r9,%rax,4), %eax
addq %rax, 0x8(%r14)
orq %r8, (%rdi,%rcx,8)
addq $0xc, %rdx
decq %r12
jne 0x312204
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x90e66
nop