// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes-sfx-partssuf.c
// Function: gt_suftabparts_rc_fit_memlimit
int gt_suftabparts_rc_fit_memlimit(size_t estimatedspace,
                                GtUword maximumspace,
                                const GtBcktab *bcktab,
                                const GtRandomcodestab *fct,
                                const GtSfxmappedrangelist *sfxmrlist,
                                GtUword totallength,
                                unsigned int bitsforseqnumrelpos,
                                GtUword specialcharacters,
                                GtUword numofsuffixestosort,
                                bool suftabuint,
                                GtError *err)
{
  unsigned int parts;
  GtSuftabparts_rc *suftabparts_rc;
  GtUword size_mapped = gt_Sfxmappedrangelist_size_entire(sfxmrlist);

  gt_error_check(err);
  for (parts = 1U; parts <= 500U; parts++)
  {
    size_t suftabsize;
    GtUword numofentries;

    suftabparts_rc = gt_suftabparts_rc_new(parts,
                                     bcktab,
                                     fct,
                                     sfxmrlist,
                                     numofsuffixestosort,
                                     specialcharacters + 1,
                                     NULL);
    gt_assert(suftabparts_rc != NULL);
    numofentries = gt_suftabparts_rc_largest_width(suftabparts_rc);
    if (bcktab != NULL)
    {
      gt_assert(fct == NULL);
      suftabsize = gt_suffixsortspace_requiredspace(numofentries,
                                                    totallength,
                                                    suftabuint);
    } else
    {
      gt_assert(fct != NULL);
      suftabsize = gt_spmsuftab_requiredspace(numofentries,
                                              totallength,
                                              bitsforseqnumrelpos);
    }
    if (parts == 1U)
    {
      if ((GtUword) (suftabsize + estimatedspace) <= maximumspace)
      {
        gt_suftabparts_rc_delete(suftabparts_rc);
        return (int) parts;
      }
    } else
    {
      GtUword largest
        = gt_suftabparts_rc_largestsizemappedpartwise(suftabparts_rc);
      if ((GtUword) (suftabsize + largest + estimatedspace - size_mapped)
                           <= maximumspace)
      {
        gt_log_log("return parts = %u as suftabsize=%.2f +"
                   "largest=%.2f + estimated=%.2f - size_mapped=%2.f <= %.2f",
                    parts,
                    GT_MEGABYTES(suftabsize),
                    GT_MEGABYTES(largest),
                    GT_MEGABYTES(estimatedspace),
                    GT_MEGABYTES(size_mapped),
                    GT_MEGABYTES(maximumspace));
        gt_suftabparts_rc_delete(suftabparts_rc);
        return (int) parts;
      }
    }
    gt_suftabparts_rc_delete(suftabparts_rc);
  }
  gt_error_set(err,"cannot compute enhanced suffix array in at most " GT_WU
               " bytes", maximumspace);
  return -1;
}

// Assembly:
subq $0x78, %rsp
movq 0xa0(%rsp), %rax
movb 0x98(%rsp), %al
movq 0x90(%rsp), %r10
movq 0x88(%rsp), %r10
movl 0x80(%rsp), %r10d
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r9, 0x40(%rsp)
andb $0x1, %al
movb %al, 0x3f(%rsp)
movq 0x48(%rsp), %rdi
callq 0x2ccd50
movq %rax, 0x28(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x4da794
movq 0xa0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x4da75c
jmp 0x4da794
movq 0x16183d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b8a6(%rip), %rsi     # 0x516013
leaq 0x3ba4b(%rip), %rdx     # 0x5161bf
leaq 0xdfcf7(%rip), %rcx     # 0x5ba472
leaq 0xdfa82(%rip), %r8      # 0x5ba204
movl $0x1a2, %r9d            # imm = 0x1A2
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da796
movl $0x1, 0x38(%rsp)
cmpl $0x1f4, 0x38(%rsp)      # imm = 0x1F4
ja 0x4daa56
movl 0x38(%rsp), %edi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
addq $0x1, %r9
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x4d9760
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x4da827
movq 0x1617aa(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b813(%rip), %rsi     # 0x516013
leaq 0xa4379(%rip), %rdx     # 0x57eb80
leaq 0xdfc64(%rip), %rcx     # 0x5ba472
leaq 0xdf9ef(%rip), %r8      # 0x5ba204
movl $0x1af, %r9d            # imm = 0x1AF
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da829
movq 0x30(%rsp), %rdi
callq 0x4da5f0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x4da8a3
jmp 0x4da842
cmpq $0x0, 0x50(%rsp)
je 0x4da882
movq 0x16174f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b7b8(%rip), %rsi     # 0x516013
leaq 0xb12d8(%rip), %rdx     # 0x58bb3a
leaq 0xdfc09(%rip), %rcx     # 0x5ba472
leaq 0xdf994(%rip), %r8      # 0x5ba204
movl $0x1b3, %r9d            # imm = 0x1B3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da884
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
movb 0x3f(%rsp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x2e93c0
movq %rax, 0x20(%rsp)
jmp 0x4da902
jmp 0x4da8a5
cmpq $0x0, 0x50(%rsp)
jne 0x4da8e5
movq 0x1616ec(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b755(%rip), %rsi     # 0x516013
leaq 0xb1281(%rip), %rdx     # 0x58bb46
leaq 0xdfba6(%rip), %rcx     # 0x5ba472
leaq 0xdf931(%rip), %r8      # 0x5ba204
movl $0x1b9, %r9d            # imm = 0x1B9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da8e7
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x80(%rsp), %edx
callq 0x2eece0
movq %rax, 0x20(%rsp)
cmpl $0x1, 0x38(%rsp)
jne 0x4da936
movq 0x20(%rsp), %rax
addq 0x68(%rsp), %rax
cmpq 0x60(%rsp), %rax
ja 0x4da931
movq 0x30(%rsp), %rdi
callq 0x4da3d0
movl 0x38(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x4daa79
jmp 0x4daa3c
movq 0x30(%rsp), %rdi
callq 0x4da640
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
addq 0x10(%rsp), %rax
addq 0x68(%rsp), %rax
subq 0x28(%rsp), %rax
cmpq 0x60(%rsp), %rax
ja 0x4daa3a
movl 0x38(%rsp), %esi
movq 0x20(%rsp), %xmm0
movaps 0x3dfbb(%rip), %xmm6    # 0x518930
punpckldq %xmm6, %xmm0    # xmm0 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
movapd 0x3dfbf(%rip), %xmm5    # 0x518940
subpd %xmm5, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x3df90(%rip), %xmm4    # 0x518928
mulsd %xmm4, %xmm0
movq 0x10(%rsp), %xmm1
punpckldq %xmm6, %xmm1    # xmm1 = xmm1[0],xmm6[0],xmm1[1],xmm6[1]
subpd %xmm5, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm1
movq 0x68(%rsp), %xmm2
punpckldq %xmm6, %xmm2    # xmm2 = xmm2[0],xmm6[0],xmm2[1],xmm6[1]
subpd %xmm5, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
mulsd %xmm4, %xmm2
movq 0x28(%rsp), %xmm3
punpckldq %xmm6, %xmm3    # xmm3 = xmm3[0],xmm6[0],xmm3[1],xmm6[1]
subpd %xmm5, %xmm3
movaps %xmm3, %xmm7
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm7, %xmm3
mulsd %xmm4, %xmm3
movq 0x60(%rsp), %xmm4
punpckldq %xmm6, %xmm4    # xmm4 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
subpd %xmm5, %xmm4
movaps %xmm4, %xmm5
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
addsd %xmm5, %xmm4
movsd 0x3df0c(%rip), %xmm5    # 0x518920
divsd %xmm5, %xmm4
leaq 0xb1133(%rip), %rdi     # 0x58bb52
movb $0x5, %al
callq 0xe7740
movq 0x30(%rsp), %rdi
callq 0x4da3d0
movl 0x38(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x4daa79
jmp 0x4daa3c
movq 0x30(%rsp), %rdi
callq 0x4da3d0
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x4da79e
movq 0xa0(%rsp), %rdi
movq 0x60(%rsp), %rdx
leaq 0xb1147(%rip), %rsi     # 0x58bbb1
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)