// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-suffixgetset.c
// Function: gt_suffixsortspace_new_generic
static GtSuffixsortspace *gt_suffixsortspace_new_generic(GtUword numofentries,
                                                  GtUword maxvalue,
                                                  bool useuint,
                                                  void *tab2clone,
                                                  GT_UNUSED GtLogger *logger)
{
  GtSuffixsortspace *suffixsortspace;

  gt_assert(numofentries > 0);
  suffixsortspace = gt_malloc(sizeof (*suffixsortspace));
  suffixsortspace->maxindex = numofentries-1;
  suffixsortspace->maxvalue = maxvalue;
  suffixsortspace->longestidx.defined = false;
  suffixsortspace->longestidx.valueunsignedlong = 0;
  suffixsortspace->exportptr.ulongtabsectionptr = NULL;
  suffixsortspace->exportptr.uinttabsectionptr = NULL;
  suffixsortspace->currentexport = false;
  suffixsortspace->partoffset = 0;
  suffixsortspace->bucketleftidx = 0;
  suffixsortspace->widthrelative2bucketleftidx = 0;
#if defined (_LP64) || defined (_WIN64)
  gt_logger_log(logger,"%s suffix_sort_space: suftab uses %dbit values: "
                       "maxvalue="GT_WU",numofentries="GT_WU,
                       tab2clone == NULL ? "create" : "clone",
                       gt_decide_to_use_uint(useuint,maxvalue) ? 32 : 64,
                       maxvalue,numofentries);
#endif
  if (gt_decide_to_use_uint(useuint,maxvalue))
  {
    if (tab2clone == NULL)
    {
      GtUword sufspacesize
        = gt_safe_mult_ulong_check((GtUword)
                                   sizeof (*suffixsortspace->uinttab),
                                   numofentries,
                                   gt_suffixsortspace_overflow_abort,
                                   &numofentries);
      suffixsortspace->uinttab = gt_malloc((size_t) sufspacesize);
      suffixsortspace->clonenumber = 0;
    } else
    {
      suffixsortspace->uinttab = (uint32_t *) tab2clone;
      suffixsortspace->clonenumber = UINT_MAX; /* undefined */
    }
    suffixsortspace->ulongtab = NULL;
  } else
  {
    if (tab2clone == NULL)
    {
      GtUword sufspacesize
        = gt_safe_mult_ulong_check((GtUword)
                                   sizeof (*suffixsortspace->ulongtab),
                                   numofentries,
                                   gt_suffixsortspace_overflow_abort,
                                   &numofentries);
      suffixsortspace->ulongtab = gt_malloc((size_t) sufspacesize);
      suffixsortspace->clonenumber = 0;
    } else
    {
      suffixsortspace->ulongtab = (GtUword *) tab2clone;
      suffixsortspace->clonenumber = UINT_MAX; /* undefined */
    }
    suffixsortspace->uinttab = NULL;
  }
  return suffixsortspace;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0x1af3ef
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r15
leaq 0x1ac0f6(%rip), %rsi    # 0x35b3b8
pushq $0x60
popq %rdi
pushq $0x63
popq %rdx
callq 0x93160
movq %rax, %rbx
leaq -0x1(%r15), %rax
movq %rax, 0x28(%rbx)
movq %r12, 0x30(%rbx)
xorl %eax, %eax
movb %al, 0x8(%rbx)
movb %al, (%rbx)
testq %r14, %r14
leaq 0x168024(%rip), %rax    # 0x317311
leaq 0x1ac101(%rip), %rdx    # 0x35b3f5
cmoveq %rax, %rdx
movq %r12, %rax
shrq $0x20, %rax
sete %r13b
andb %bpl, %r13b
movl %r13d, %eax
xorb $0x1, %al
movzbl %al, %ecx
shll $0x5, %ecx
addl $0x20, %ecx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
movups %xmm0, 0x38(%rbx)
andq $0x0, 0x48(%rbx)
leaq 0x1ac640(%rip), %rsi    # 0x35b970
movq 0x10(%rsp), %rdi
movq %r12, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x92e71
cmpb $0x1, %r13b
jne 0x1af384
pushq $0x50
popq %r12
pushq $0x58
popq %r13
testq %r14, %r14
jne 0x1af391
leaq 0x1ac05c(%rip), %r14    # 0x35b3b8
leaq 0x107a(%rip), %r8       # 0x1b03dd
pushq $0x4
popq %rdi
pushq $0x7e
popq %rcx
leaq 0x8(%rsp), %r9
movq %r15, %rsi
movq %r14, %rdx
callq 0xa4775
pushq $0x7f
popq %rdx
movq %rax, %rdi
movq %r14, %rsi
jmp 0x1af3c7
pushq $0x58
popq %r12
pushq $0x50
popq %r13
testq %r14, %r14
je 0x1af396
pushq $-0x1
popq %rax
jmp 0x1af3d1
leaq 0x1ac01b(%rip), %r14    # 0x35b3b8
leaq 0x1039(%rip), %r8       # 0x1b03dd
pushq $0x8
popq %rdi
leaq 0x8(%rsp), %r9
movq %r15, %rsi
movq %r14, %rdx
movl $0x90, %ecx
callq 0xa4775
movq %rax, %rdi
movq %r14, %rsi
movl $0x91, %edx
callq 0x93160
movq %rax, %r14
xorl %eax, %eax
movq %r14, (%rbx,%r13)
movl %eax, 0x4(%rbx)
andq $0x0, (%rbx,%r12)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x288b72(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x135c13(%rip), %rsi    # 0x2e5013
leaq 0x198140(%rip), %rdx    # 0x347547
leaq 0x1ac543(%rip), %rcx    # 0x35b951
leaq 0x1abfa3(%rip), %r8     # 0x35b3b8
pushq $0x62
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390