// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movb %dl, %al
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
andb $0x1, %al
movb %al, 0x47(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
cmpq $0x0, 0x50(%rsp)
ja 0x2e9560
movq 0x352a71(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x22cada(%rip), %rsi    # 0x516013
leaq 0x2904b8(%rip), %rdx    # 0x5799f8
leaq 0x2a5011(%rip), %rcx    # 0x58e558
leaq 0x2a4a75(%rip), %r8     # 0x58dfc3
movl $0x62, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2e9562
movl $0x60, %edi
leaq 0x2a4a55(%rip), %rsi    # 0x58dfc3
movl $0x63, %edx
callq 0xe80f0
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x48(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x28(%rsp), %rax
movb $0x0, 0x8(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x28(%rsp), %rax
movb $0x0, (%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x38(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdx
leaq 0x2a49e1(%rip), %rax    # 0x58dff3
leaq 0x25fc8d(%rip), %rcx    # 0x5492a6
cmpq $0x0, %rdx
cmoveq %rcx, %rax
movq %rax, 0x10(%rsp)
movb 0x47(%rsp), %al
movq 0x48(%rsp), %rsi
andb $0x1, %al
movzbl %al, %edi
callq 0x2e9480
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movb %al, %sil
movl $0x40, %ecx
movl $0x20, %eax
testb $0x1, %sil
cmovnel %eax, %ecx
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %r9
leaq 0x2a4f0f(%rip), %rsi    # 0x58e577
movb $0x0, %al
callq 0xe7cd0
movb 0x47(%rsp), %al
movq 0x48(%rsp), %rsi
andb $0x1, %al
movzbl %al, %edi
callq 0x2e9480
testb $0x1, %al
jne 0x2e968b
jmp 0x2e971b
cmpq $0x0, 0x38(%rsp)
jne 0x2e96ef
movq 0x50(%rsp), %rsi
movl $0x4, %edi
leaq 0x2a491f(%rip), %rdx    # 0x58dfc3
movl $0x7e, %ecx
leaq 0x1a20(%rip), %r8       # 0x2eb0d0
leaq 0x50(%rsp), %r9
callq 0x109db0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x2a48f8(%rip), %rsi    # 0x58dfc3
movl $0x7f, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x28(%rsp), %rax
movl $0x0, 0x4(%rax)
jmp 0x2e9709
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, 0x50(%rax)
jmp 0x2e97a6
cmpq $0x0, 0x38(%rsp)
jne 0x2e977f
movq 0x50(%rsp), %rsi
movl $0x8, %edi
leaq 0x2a488f(%rip), %rdx    # 0x58dfc3
movl $0x90, %ecx
leaq 0x1990(%rip), %r8       # 0x2eb0d0
leaq 0x50(%rsp), %r9
callq 0x109db0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x2a4868(%rip), %rsi    # 0x58dfc3
movl $0x91, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x28(%rsp), %rax
movl $0x0, 0x4(%rax)
jmp 0x2e9799
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, 0x58(%rax)
movq 0x28(%rsp), %rax
addq $0x58, %rsp
retq