// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/diagband-struct.c
// Function: gt_diagband_struct_reset
void gt_diagband_struct_reset(GtDiagbandStruct *diagband_struct,
                              const GtSeedpairPositions *seedstore,
                              const GtDiagbandseedMaximalmatch *memstore,
                              GtUword segment_length)
{
  gt_assert(diagband_struct != NULL);
  if (diagband_struct->used_diagbands * 3 >= diagband_struct->num_diagbands)
  { /* >= 33% of diagbands are used */
    memset(diagband_struct->score,0,
           sizeof *diagband_struct->score * diagband_struct->num_diagbands);
    memset(diagband_struct->lastpos,0,
           sizeof *diagband_struct->lastpos * diagband_struct->num_diagbands);
    diagband_struct->reset_with_memset++;
  } else
  {
    GtUword idx;

    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);
        diagband_struct->score[diagband_idx] = 0;
        diagband_struct->lastpos[diagband_idx] = 0;
      }
    } 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);
        diagband_struct->score[diagband_idx] = 0;
        diagband_struct->lastpos[diagband_idx] = 0;
      }
    }
    diagband_struct->reset_from_matches++;
  }
  diagband_struct->used_diagbands = 0;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x4a37b8
movq 0x198819(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x72882(%rip), %rsi     # 0x516013
leaq 0x11247f(%rip), %rdx    # 0x5b5c17
leaq 0x11252c(%rip), %rcx    # 0x5b5ccb
leaq 0x1123f2(%rip), %r8     # 0x5b5b98
movl $0xbf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a37ba
movq 0x30(%rsp), %rax
imulq $0x3, 0x18(%rax), %rax
movq 0x30(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x4a381f
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x19360
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x19360
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
jmp 0x4a399f
cmpq $0x0, 0x28(%rsp)
je 0x4a38b9
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x4a38b4
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
addq %rcx, %rax
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rdx
movl (%rcx,%rdx,8), %ecx
subq %rcx, %rax
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq %cl, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x4a3834
jmp 0x4a398e
jmp 0x4a38bb
cmpq $0x0, 0x20(%rsp)
jne 0x4a38fb
movq 0x1986d6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x7273f(%rip), %rsi     # 0x516013
leaq 0x1123bf(%rip), %rdx    # 0x5b5c9a
leaq 0x1123e9(%rip), %rcx    # 0x5b5ccb
leaq 0x1122af(%rip), %r8     # 0x5b5b98
movl $0xd9, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a38fd
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x4a398c
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
imulq $0xc, 0x10(%rsp), %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
addq %rcx, %rax
movq 0x20(%rsp), %rcx
imulq $0xc, 0x10(%rsp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
subq %rcx, %rax
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq %cl, %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movq (%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x4a3906
jmp 0x4a398e
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq 0x30(%rsp), %rax
movq $0x0, 0x18(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)