// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes-sfx-partssuf.c
// Function: gt_suftabparts_rc_new
GtSuftabparts_rc *gt_suftabparts_rc_new(unsigned int numofparts,
                                  const GtBcktab *bcktab,
                                  const GtRandomcodestab *fct,
                                  const GtSfxmappedrangelist *sfxmrlist,
                                  GtUword numofsuffixestoinsert,
                                  GtUword fullspecials,
                                  GtLogger *logger)
{
  GtSuftabparts_rc *suftabparts_rc;
  GtUword size_mapped;
  unsigned int part;

  gt_assert((bcktab == NULL && fct != NULL) ||
            (bcktab != NULL && fct == NULL));
  suftabparts_rc = gt_malloc(sizeof *suftabparts_rc);
  suftabparts_rc->largestsizemappedpartwise = 0;
  suftabparts_rc->fct = fct;
  gt_assert(suftabparts_rc != NULL);
  if (numofsuffixestoinsert == 0)
  {
    suftabparts_rc->numofparts = 0;
  } else
  {
    if (numofsuffixestoinsert < (GtUword) numofparts ||
        (bcktab != NULL && gt_bcktab_prefixlength(bcktab) == 1U))
    {
      suftabparts_rc->numofparts = 1U;
    } else
    {
      suftabparts_rc->numofparts = numofparts;
    }
  }
  if (suftabparts_rc->numofparts == 0)
  {
    gt_assert(numofparts != 0);
    suftabparts_rc->largestsuftabwidth = fullspecials/numofparts+1;
    suftabparts_rc->largestsizemappedpartwise
      = gt_Sfxmappedrangelist_size_entire(sfxmrlist);
    suftabparts_rc->components = NULL;
  } else
  {
    unsigned int remainder;
    GtUword secondidx, randombound = 0, secondbound,
                  suftaboffset = 0, sumofwidth = 0;
    const GtUword widthofsuftabpart
      = numofsuffixestoinsert/suftabparts_rc->numofparts;

    suftabparts_rc->components
      = gt_malloc(sizeof (*suftabparts_rc->components) *
          suftabparts_rc->numofparts);
    remainder = (unsigned int) (numofsuffixestoinsert %
                                (GtUword) suftabparts_rc->numofparts);
    suftabparts_rc->largestsuftabwidth = 0;
    for (part=0; part < suftabparts_rc->numofparts; part++)
    {
      if (remainder > 0)
      {
        suftaboffset += widthofsuftabpart + 1;
        remainder--;
      } else
      {
        suftaboffset += widthofsuftabpart;
      }
      if (part == suftabparts_rc->numofparts - 1)
      {
        secondidx = bcktab != NULL ? gt_bcktab_numofallcodes(bcktab)
                                   : gt_randomcodes_numofsamples(fct);
      } else
      {
        secondidx = bcktab != NULL
                      ? gt_bcktab_findfirstlarger(bcktab,(GtCodetype) 1,
                                                  (GtCodetype) 0,suftaboffset)
                      : gt_randomcodes_findfirstsamplelarger(fct,suftaboffset);
      }
      suftabparts_rc->components[part].nextidx = secondidx;
      secondbound = bcktab != NULL
                      ? gt_bcktab_get_leftborder(bcktab,secondidx)
                      : gt_randomcodes_get_sample(fct,secondidx);
      if (part == 0)
      {
        suftabparts_rc->components[part].widthofpart = secondbound;
        suftabparts_rc->components[part].suftaboffset = 0;
      } else
      {
        gt_assert(secondbound >= randombound);
        suftabparts_rc->components[part].widthofpart = secondbound -
          randombound;
        suftabparts_rc->components[part].suftaboffset = randombound;
      }
      if (suftabparts_rc->largestsuftabwidth <
          suftabparts_rc->components[part].widthofpart)
      {
        suftabparts_rc->largestsuftabwidth
          = suftabparts_rc->components[part].widthofpart;
      }
      sumofwidth += suftabparts_rc->components[part].widthofpart;
      suftabparts_rc->components[part].sumofwidth = sumofwidth;
      randombound = secondbound;
    }
    gt_assert(sumofwidth == numofsuffixestoinsert);
  }
  gt_suftabparts_rc_removeemptyparts(suftabparts_rc,numofsuffixestoinsert,
      logger);
  if (suftabparts_rc->numofparts > 0)
  {
    gt_assert(suftabparts_rc->components != NULL);
    for (part=0; part < suftabparts_rc->numofparts; part++)
    {
      suftabparts_rc->components[part].minindex
        = gt_suftabparts_rc_minindex_raw(part,suftabparts_rc);
      suftabparts_rc->components[part].maxindex
        = gt_suftabparts_rc_maxindex_raw(part,suftabparts_rc);
    }
    for (part=1U; part < suftabparts_rc->numofparts; part++)
    {
      if (suftabparts_rc->components[part].minindex !=
            suftabparts_rc->components[part-1].maxindex + 1)
      {
        suftabparts_rc->components[part].minindex
          = suftabparts_rc->components[part-1].maxindex + 1;
      }
    }
    for (part=0; part < suftabparts_rc->numofparts; part++)
    {
      size_mapped = gt_Sfxmappedrangelist_size_mapped(sfxmrlist,
          gt_suftabparts_rc_minindex(part,suftabparts_rc),
          gt_suftabparts_rc_maxindex(part,suftabparts_rc));
      if (suftabparts_rc->largestsizemappedpartwise < size_mapped)
      {
        suftabparts_rc->largestsizemappedpartwise = size_mapped;
      }
    }
  }
  return suftabparts_rc;
}

// Assembly:
subq $0xa8, %rsp
movq 0xb0(%rsp), %rax
movl %edi, 0xa4(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %r9, 0x78(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x4d97b1
cmpq $0x0, 0x90(%rsp)
jne 0x4d97ff
cmpq $0x0, 0x98(%rsp)
je 0x4d97c7
cmpq $0x0, 0x90(%rsp)
je 0x4d97ff
movq 0x1627d2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c83b(%rip), %rsi     # 0x516013
leaq 0xb2089(%rip), %rdx     # 0x58b868
leaq 0xe0ae5(%rip), %rcx     # 0x5ba2cb
leaq 0xe0a17(%rip), %r8      # 0x5ba204
movl $0xb7, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d9801
movl $0x28, %edi
leaq 0xe09f7(%rip), %rsi     # 0x5ba204
movl $0xb8, %edx
callq 0xe80f0
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x90(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x20(%rax)
cmpq $0x0, 0x70(%rsp)
jne 0x4d987a
movq 0x162757(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c7c0(%rip), %rsi     # 0x516013
leaq 0xa5326(%rip), %rdx     # 0x57eb80
leaq 0xe0a6a(%rip), %rcx     # 0x5ba2cb
leaq 0xe099c(%rip), %r8      # 0x5ba204
movl $0xbb, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d987c
cmpq $0x0, 0x80(%rsp)
jne 0x4d9895
movq 0x70(%rsp), %rax
movl $0x0, 0xc(%rax)
jmp 0x4d98e5
movq 0x80(%rsp), %rax
movl 0xa4(%rsp), %ecx
cmpq %rcx, %rax
jb 0x4d98c6
cmpq $0x0, 0x98(%rsp)
je 0x4d98d4
movq 0x98(%rsp), %rdi
callq 0x205eb0
cmpl $0x1, %eax
jne 0x4d98d4
movq 0x70(%rsp), %rax
movl $0x1, 0xc(%rax)
jmp 0x4d98e3
movl 0xa4(%rsp), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0xc(%rax)
jmp 0x4d98e5
movq 0x70(%rsp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x4d9985
jmp 0x4d98f6
cmpl $0x0, 0xa4(%rsp)
jne 0x4d9938
movq 0x162699(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c702(%rip), %rsi     # 0x516013
leaq 0xb1fa6(%rip), %rdx     # 0x58b8be
leaq 0xe09ac(%rip), %rcx     # 0x5ba2cb
leaq 0xe08de(%rip), %r8      # 0x5ba204
movl $0xcc, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d993a
movq 0x78(%rsp), %rax
movl 0xa4(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
addq $0x1, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x88(%rsp), %rdi
callq 0x2ccd50
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x70(%rsp), %rax
movq $0x0, (%rax)
jmp 0x4d9d06
movq $0x0, 0x50(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movl 0xc(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rax
movl 0xc(%rax), %eax
imulq $0x30, %rax, %rdi
leaq 0xe0837(%rip), %rsi     # 0x5ba204
movl $0xdb, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, (%rax)
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movl 0xc(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x60(%rsp)
movq 0x70(%rsp), %rax
movq $0x0, 0x18(%rax)
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movq 0x70(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x4d9cb9
cmpl $0x0, 0x60(%rsp)
jbe 0x4d9a4b
movq 0x30(%rsp), %rax
addq $0x1, %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x60(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x4d9a5a
movq 0x30(%rsp), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x64(%rsp), %eax
movq 0x70(%rsp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4d9aaa
cmpq $0x0, 0x98(%rsp)
je 0x4d9a8c
movq 0x98(%rsp), %rdi
callq 0x206600
movq %rax, 0x28(%rsp)
jmp 0x4d9a9e
movq 0x90(%rsp), %rdi
callq 0x4dbc60
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x4d9af8
cmpq $0x0, 0x98(%rsp)
je 0x4d9ad7
movq 0x98(%rsp), %rdi
movq 0x40(%rsp), %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2067d0
movq %rax, 0x20(%rsp)
jmp 0x4d9aee
movq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4dbc70
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
cmpq $0x0, 0x98(%rsp)
je 0x4d9b37
movq 0x98(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x2037f0
movq %rax, 0x18(%rsp)
jmp 0x4d9b4e
movq 0x90(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x4dbb60
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpl $0x0, 0x64(%rsp)
jne 0x4d9b9b
movq 0x48(%rsp), %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
jmp 0x4d9c20
jmp 0x4d9b9d
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0x4d9be1
movq 0x1623f0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c459(%rip), %rsi     # 0x516013
leaq 0xe0720(%rip), %rdx     # 0x5ba2e1
leaq 0xe0703(%rip), %rcx     # 0x5ba2cb
leaq 0xe0635(%rip), %r8      # 0x5ba204
movl $0xfe, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d9be3
movq 0x48(%rsp), %rcx
subq 0x50(%rsp), %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x50(%rsp), %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x4d9c62
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
addq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq %rax, 0x50(%rsp)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x4d9a12
jmp 0x4d9cbb
movq 0x38(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x4d9d02
movq 0x1622cf(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c338(%rip), %rsi     # 0x516013
leaq 0xb1c7c(%rip), %rdx     # 0x58b95e
leaq 0xe05e2(%rip), %rcx     # 0x5ba2cb
leaq 0xe0514(%rip), %r8      # 0x5ba204
movl $0x10d, %r9d            # imm = 0x10D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d9d04
jmp 0x4d9d06
movq 0x70(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0xb0(%rsp), %rdx
callq 0x4d9f20
movq 0x70(%rsp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0x4d9f12
jmp 0x4d9d31
movq 0x70(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x4d9d74
movq 0x16225d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c2c6(%rip), %rsi     # 0x516013
leaq 0xe05a8(%rip), %rdx     # 0x5ba2fc
leaq 0xe0570(%rip), %rcx     # 0x5ba2cb
leaq 0xe04a2(%rip), %r8      # 0x5ba204
movl $0x113, %r9d            # imm = 0x113
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d9d76
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movq 0x70(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x4d9de9
movl 0x64(%rsp), %edi
movq 0x70(%rsp), %rsi
callq 0x4da1e0
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movl 0x64(%rsp), %edi
movq 0x70(%rsp), %rsi
callq 0x4da2c0
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x4d9d7e
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
movq 0x70(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x4d9e88
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movl 0x64(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movq 0x28(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x4d9e76
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x64(%rsp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
jmp 0x4d9e78
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x4d9df1
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movq 0x70(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x4d9f10
movq 0x88(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x64(%rsp), %edi
movq 0x70(%rsp), %rsi
callq 0x4d9580
movq %rax, 0x10(%rsp)
movl 0x64(%rsp), %edi
movq 0x70(%rsp), %rsi
callq 0x4d95b0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x2ccc50
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
cmpq 0x68(%rsp), %rax
jae 0x4d9f01
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x4d9f03
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x4d9e90
jmp 0x4d9f12
movq 0x70(%rsp), %rax
addq $0xa8, %rsp
retq
nop