// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/diagband-struct.c
// Function: gt_diagband_struct_single_update
void gt_diagband_struct_single_update(GtDiagbandStruct *diagband_struct,
                                      GtDiagbandseedPosition apos,
                                      GtDiagbandseedPosition bpos,
                                      GtDiagbandseedPosition matchlength)
{
  GtUword diagband_idx;

  gt_assert(diagband_struct != NULL);
  diagband_idx = GT_DIAGBANDSEED_DIAGONALBAND(diagband_struct->amaxlen,
                                              diagband_struct->logdiagbandwidth,
                                              apos,
                                              bpos);
  gt_assert(diagband_idx < diagband_struct->num_diagbands);
  if (diagband_struct->lastpos[diagband_idx] == 0 /* first matches */||
      /* match with end position bpos begins strictly after previous match */
      diagband_struct->lastpos[diagband_idx] + matchlength <= bpos)
  {
    /* no overlap */
    diagband_struct->lastpos[diagband_idx] = bpos;
    if (diagband_struct->score[diagband_idx] == 0)
    {
      diagband_struct->used_diagbands++;
    }
    diagband_struct->score[diagband_idx] += matchlength;
  } else
  {
    /* overlap: add positions after last counted position */
    if (diagband_struct->lastpos[diagband_idx] < bpos)
    {
      const GtUword addlength = bpos - diagband_struct->lastpos[diagband_idx];

      diagband_struct->lastpos[diagband_idx] = bpos;
      if (diagband_struct->score[diagband_idx] == 0)
      {
        diagband_struct->used_diagbands++;
      }
      diagband_struct->score[diagband_idx] += addlength;
    }
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x4a33b5
movq 0x198c1c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x72c85(%rip), %rsi     # 0x516013
leaq 0x112882(%rip), %rdx    # 0x5b5c17
leaq 0x112893(%rip), %rcx    # 0x5b5c2f
leaq 0x1127f5(%rip), %r8     # 0x5b5b98
movl $0x71, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a33b7
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x18(%rsp), %ecx
addq %rcx, %rax
movl 0x1c(%rsp), %ecx
subq %rcx, %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq %cl, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x4a3426
movq 0x198bab(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x72c14(%rip), %rsi     # 0x516013
leaq 0x11284a(%rip), %rdx    # 0x5b5c50
leaq 0x112822(%rip), %rcx    # 0x5b5c2f
leaq 0x112784(%rip), %r8     # 0x5b5b98
movl $0x76, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a3428
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x4a3457
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
addl 0x14(%rsp), %eax
cmpl 0x18(%rsp), %eax
ja 0x4a34ae
movl 0x18(%rsp), %edx
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x4a3491
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl 0x14(%rsp), %edx
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rsp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0x4a3537
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x18(%rsp), %eax
jae 0x4a3535
movl 0x18(%rsp), %eax
movq 0x20(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x8(%rsp), %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, %eax
movq %rax, (%rsp)
movl 0x18(%rsp), %edx
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x4a351a
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq (%rsp), %rsi
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addq %rsi, %rdx
movl %edx, (%rax,%rcx,4)
jmp 0x4a3537
addq $0x28, %rsp
retq
nopl (%rax)