// File: /workspace/github_c_makefile_star2_O2/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 0x1a902a
movq %rsi, %r14
movq %rdi, %rbx
movq 0xe8(%rdi), %rdi
testq %rdi, %rdi
je 0x1a8fb4
callq 0x74a09
movq 0x108(%rbx), %rdi
leaq 0x1b16ba(%rip), %rsi    # 0x35a67c
movl $0x22b, %edx            # imm = 0x22B
callq 0x936f9
andq $0x0, 0x108(%rbx)
movq 0x90(%rbx), %rdi
xorl %esi, %esi
cmpl $0x0, 0x50(%rbx)
sete %sil
callq 0x1af510
movq 0x68(%rbx), %rdi
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x1a905a
callq 0x1a137a
cmpl $0x2, %eax
jb 0x1a905a
cmpq $0x0, 0xf0(%rbx)
je 0x1a905a
movq 0x68(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x1a06ec
movq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x135094
testl %eax, %eax
je 0x1a9031
pushq $-0x1
popq %rbp
jmp 0x1a905a
xorl %ebp, %ebp
jmp 0x1a90f0
movq 0x78(%rbx), %rsi
movq 0xf0(%rbx), %rdi
movq %r14, %rdx
callq 0x134a7b
movl %eax, %r14d
movq 0xf0(%rbx), %rdi
callq 0x8a4fd
xorl %ebp, %ebp
negl %r14d
sbbl %ebp, %ebp
movq 0x78(%rbx), %rdi
callq 0x13484d
movq 0x68(%rbx), %rdi
callq 0x1a11bd
movq 0x70(%rbx), %rdi
callq 0x19cbc7
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
jne 0x1a90a0
movq 0x130(%rbx), %rdi
leaq 0x1b15ed(%rip), %rsi    # 0x35a67c
movl $0x24d, %edx            # imm = 0x24D
callq 0x936f9
movq 0x158(%rbx), %rdi
callq 0x1a04c6
andq $0x0, 0x158(%rbx)
movq 0x138(%rbx), %rdi
leaq 0x1b15c1(%rip), %r14    # 0x35a67c
movq %r14, %rsi
movl $0x251, %edx            # imm = 0x251
callq 0x936f9
movq 0x88(%rbx), %rdi
callq 0x198253
movq 0xe0(%rbx), %rdi
callq 0x1b0054
movq %rbx, %rdi
movq %r14, %rsi
movl $0x254, %edx            # imm = 0x254
callq 0x936f9
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq