// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-partssuf.c
// Function: gt_suftabparts_removeemptyparts
static void gt_suftabparts_removeemptyparts(GtSuftabparts *suftabparts,
                                            GT_UNUSED GtUword totalwidth,
                                            GtLogger *logger)
{
#undef SKDEBUG
#ifdef SKDEBUG
  gt_log_log("before removal");
  gt_suftabparts_showallrecords(suftabparts,false);
#endif
  gt_assert(suftabparts != NULL);
  if (suftabparts->numofparts > 0)
  {
    unsigned int destpart, srcpart;
    GtUword GT_UNUSED sumwidth = 0;

    for (destpart = 0, srcpart = 0; srcpart < suftabparts->numofparts;
         srcpart++)
    {
      if (suftabparts->components[srcpart].widthofpart > 0)
      {
        if (destpart < srcpart)
        {
          suftabparts->components[destpart] = suftabparts->components[srcpart];
        }
        destpart++;
      }
    }
    if (destpart < srcpart)
    {
      suftabparts->components[destpart-1].nextidx
        = suftabparts->components[suftabparts->numofparts-1].nextidx;
      suftabparts->numofparts -= (srcpart - destpart);
      gt_assert(suftabparts->numofparts == destpart);
    }
    for (srcpart = 0; srcpart < suftabparts->numofparts; srcpart++)
    {
      gt_assert(suftabparts->components[srcpart].widthofpart > 0);
      sumwidth+=suftabparts->components[srcpart].widthofpart;
      gt_logger_log(logger,"widthofpart[%u]="GT_WU"",
                    srcpart,
                    suftabparts->components[srcpart].widthofpart);
    }
    gt_assert(sumwidth == totalwidth);
  }
#ifdef SKDEBUG
  gt_log_log("after removal");
  gt_suftabparts_showallrecords(suftabparts,true);
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x2cddb3
movq 0x36e21e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x248287(%rip), %rsi    # 0x516013
leaq 0x2bf8d2(%rip), %rdx    # 0x58d665
leaq 0x2bde51(%rip), %rcx    # 0x58bbeb
leaq 0x2bd9f9(%rip), %r8     # 0x58b79a
movl $0x83, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cddb5
movq 0x20(%rsp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0x2ce013
movq $0x0, (%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x2cde57
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jbe 0x2cde48
movl 0xc(%rsp), %eax
cmpl 0x8(%rsp), %eax
jae 0x2cde3d
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl 0xc(%rsp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movl 0x8(%rsp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movl $0x30, %edx
callq 0x19610
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x2cde4a
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2cdddc
movl 0xc(%rsp), %eax
cmpl 0x8(%rsp), %eax
jae 0x2cdf00
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0xc(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl 0x8(%rsp), %edx
subl 0xc(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0xc(%rax)
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
cmpl 0xc(%rsp), %eax
je 0x2cdefc
movq 0x36e0d5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24813e(%rip), %rsi    # 0x516013
leaq 0x2bdd2f(%rip), %rdx    # 0x58bc0b
leaq 0x2bdd08(%rip), %rcx    # 0x58bbeb
leaq 0x2bd8b0(%rip), %r8     # 0x58b79a
movl $0x9a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cdefe
jmp 0x2cdf00
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x2cdfca
jmp 0x2cdf1c
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
ja 0x2cdf6d
movq 0x36e064(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2480cd(%rip), %rsi    # 0x516013
leaq 0x2bdce2(%rip), %rdx    # 0x58bc2f
leaq 0x2bdc97(%rip), %rcx    # 0x58bbeb
leaq 0x2bd83f(%rip), %r8     # 0x58b79a
movl $0x9e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cdf6f
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
addq (%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %edx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq 0x2bdcad(%rip), %rsi    # 0x58bc60
movb $0x0, %al
callq 0xe7cd0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2cdf08
jmp 0x2cdfcc
movq (%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x2ce00f
movq 0x36dfc2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24802b(%rip), %rsi    # 0x516013
leaq 0x2bdc85(%rip), %rdx    # 0x58bc74
leaq 0x2bdbf5(%rip), %rcx    # 0x58bbeb
leaq 0x2bd79d(%rip), %r8     # 0x58b79a
movl $0xa4, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ce011
jmp 0x2ce013
addq $0x28, %rsp
retq
nopl (%rax,%rax)