// File: /workspace/github_c_makefile_star2_O1/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 0x2001b9
movq %rsi, %r14
movq %rdi, %rbx
movq 0xe8(%rdi), %rdi
testq %rdi, %rdi
je 0x20007c
callq 0xefa48
movq 0x108(%rbx), %rdi
leaq 0x1c3802(%rip), %rsi    # 0x3c388c
movl $0x22b, %edx            # imm = 0x22B
callq 0x109670
movq $0x0, 0x108(%rbx)
movq 0x90(%rbx), %rdi
xorl %esi, %esi
cmpl $0x0, 0x50(%rbx)
sete %sil
callq 0x205e63
movq 0x68(%rbx), %rdi
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x200120
callq 0x1f969d
cmpl $0x2, %eax
jb 0x200120
cmpq $0x0, 0xf0(%rbx)
je 0x200120
movq 0x68(%rbx), %rdi
movl $0x1, %esi
callq 0x1f8d94
movq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x1942e2
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x200120
movq 0x78(%rbx), %rsi
movq 0xf0(%rbx), %rdi
movq %r14, %rdx
callq 0x193d7e
movl %eax, %r14d
movq 0xf0(%rbx), %rdi
callq 0x101e80
xorl %ebp, %ebp
negl %r14d
sbbl %ebp, %ebp
movq 0x78(%rbx), %rdi
callq 0x193ba9
movq 0x68(%rbx), %rdi
callq 0x1f95d7
movq 0x70(%rbx), %rdi
callq 0x1f5e75
cmpq $0x0, 0x158(%rbx)
jne 0x20015d
movq 0x130(%rbx), %rdi
leaq 0x1c3739(%rip), %rsi    # 0x3c388c
movl $0x24d, %edx            # imm = 0x24D
callq 0x109670
movq 0x158(%rbx), %rdi
callq 0x1f8bb6
movq $0x0, 0x158(%rbx)
movq 0x138(%rbx), %rdi
leaq 0x1c370a(%rip), %r14    # 0x3c388c
movq %r14, %rsi
movl $0x251, %edx            # imm = 0x251
callq 0x109670
movq 0x88(%rbx), %rdi
callq 0x1f1e44
movq 0xe0(%rbx), %rdi
callq 0x206426
movq %rbx, %rdi
movq %r14, %rsi
movl $0x254, %edx            # imm = 0x254
callq 0x109670
jmp 0x2001bb
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq