// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/sfx-suffixer.c
// Function: gt_Sfxiterator_delete
int gt_Sfxiterator_delete(Sfxiterator *sfi,GtError *err)
{
  bool haserr = false;

  if (sfi == NULL)
  {
    return 0;
  }
#ifdef SKDEBUG
  if (sfi->bcktab != NULL)
  {
    gt_bcktab_checkcountspecialcodes(sfi->bcktab);
  }
#endif
  if (sfi->sri != NULL)
  {
    gt_specialrangeiterator_delete(sfi->sri);
  }
  gt_free(sfi->spaceCodeatposition);
  sfi->spaceCodeatposition = NULL;
  gt_suffixsortspace_delete(sfi->suffixsortspace,
                            sfi->sfxstrategy.spmopt_minlength == 0
                              ? true : false);
  if (sfi->suftabparts != NULL &&
      gt_suftabparts_numofparts(sfi->suftabparts) > 1U &&
      sfi->outfpbcktab != NULL)
  {
    gt_suftabparts_showallrecords(sfi->suftabparts,true);
    if (gt_bcktab_remap_all(sfi->bcktab,err) != 0)
    {
      haserr = true;
    } else
    {
      int ret = gt_bcktab_flush_to_file(sfi->outfpbcktab,sfi->bcktab,err);
      gt_fa_fclose(sfi->outfpbcktab);
      if (ret != 0)
      {
        haserr = true;
      }
    }
  }
  gt_bcktab_delete(sfi->bcktab);
#ifdef GT_THREADS_ENABLED
#ifdef GT_THREADS_PARTITION
  gt_suftabparts_multi_delete(sfi->partitions_for_threads,
                              gt_suftabparts_numofparts(sfi->suftabparts));
#endif
#endif
  gt_suftabparts_delete(sfi->suftabparts);
  gt_Outlcpinfo_delete(sfi->outlcpinfoforsample);
  if (sfi->mappedmarkprefixbuckets == NULL)
  {
    gt_free(sfi->markprefixbuckets);
  }
  gt_Sfxmappedrange_delete(sfi->mappedmarkprefixbuckets);
  sfi->mappedmarkprefixbuckets = NULL;
  gt_free(sfi->marksuffixbuckets);
  gt_differencecover_delete(sfi->dcov);
  gt_SSSPbuf_delete(sfi->sssp_buf);
  gt_free(sfi);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1f6a27
movq %rsi, %r14
movq %rdi, %rbx
movq 0xe8(%rdi), %rdi
testq %rdi, %rdi
je 0x1f68e8
callq 0xeb455
movq 0x108(%rbx), %rdi
leaq 0x1c3926(%rip), %rsi    # 0x3ba21c
movl $0x22b, %edx            # imm = 0x22B
callq 0x1045eb
movq $0x0, 0x108(%rbx)
movq 0x90(%rbx), %rdi
xorl %esi, %esi
cmpl $0x0, 0x50(%rbx)
sete %sil
callq 0x1fc765
movq 0x68(%rbx), %rdi
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x1f698c
callq 0x1eff10
cmpl $0x2, %eax
jb 0x1f698c
cmpq $0x0, 0xf0(%rbx)
je 0x1f698c
movq 0x68(%rbx), %rdi
movl $0x1, %esi
callq 0x1ef5e4
movq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x18bc76
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1f698c
movq 0x78(%rbx), %rsi
movq 0xf0(%rbx), %rdi
movq %r14, %rdx
callq 0x18b708
movl %eax, %r14d
movq 0xf0(%rbx), %rdi
callq 0xfd018
xorl %ebp, %ebp
negl %r14d
sbbl %ebp, %ebp
movq 0x78(%rbx), %rdi
callq 0x18b533
movq 0x68(%rbx), %rdi
callq 0x1efe4a
movq 0x70(%rbx), %rdi
callq 0x1ec697
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
jne 0x1f69d2
movq 0x130(%rbx), %rdi
leaq 0x1c385b(%rip), %rsi    # 0x3ba21c
movl $0x24d, %edx            # imm = 0x24D
callq 0x1045eb
movq 0x158(%rbx), %rdi
callq 0x1ef400
movq $0x0, 0x158(%rbx)
movq 0x138(%rbx), %rdi
leaq 0x1c382c(%rip), %r14    # 0x3ba21c
movq %r14, %rsi
movl $0x251, %edx            # imm = 0x251
callq 0x1045eb
movq 0x88(%rbx), %rdi
callq 0x1e86ed
movq 0xe0(%rbx), %rdi
callq 0x1fcd27
movq %rbx, %rdi
movq %r14, %rsi
movl $0x254, %edx            # imm = 0x254
callq 0x1045eb
jmp 0x1f6a29
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq