// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-copysort.c
// Function: gt_copysort_new
GtBucketspec2 *gt_copysort_new(const GtBcktab *bcktab,
                               const GtEncseq *encseq,
                               GtReadmode readmode,
                               GtUword partwidth,
                               unsigned int numofchars)
{
  GtBucketspec2 *bucketspec2;
  unsigned int idx;

  gt_assert(numofchars > 0);
  bucketspec2 = gt_malloc(sizeof (*bucketspec2));
  bucketspec2->partwidth = partwidth;
  bucketspec2->prefixlength = gt_bcktab_prefixlength(bcktab);
  bucketspec2->numofchars = numofchars;
  bucketspec2->numofcharssquared = numofchars * numofchars;
  bucketspec2->encseq = encseq;
  bucketspec2->readmode = readmode;
  bucketspec2->order = gt_malloc(sizeof (*bucketspec2->order) * numofchars);
  bucketspec2->superbuckettab
    = gt_malloc(sizeof (*bucketspec2->superbuckettab) * numofchars);
  gt_array2dim_malloc(bucketspec2->subbuckettab,(GtUword) numofchars,
                      (GtUword) numofchars);
  if (bucketspec2->prefixlength == 2U)
  {
    fill2subbuckets(bucketspec2,bcktab);
  } else
  {
    fillanysubbuckets(bucketspec2,bcktab);
  }
  for (idx = 0; idx<numofchars; idx++)
  {
    bucketspec2->order[idx] = idx;
  }
  gt_qsort_r(bucketspec2->order,(size_t) numofchars,
             sizeof (*bucketspec2->order),bucketspec2,
             comparesuperbucketsizes);
  resetsorted(bucketspec2);
#ifdef SHOWBUCKETSPEC2
  showbucketspec2(bucketspec2);
#endif
  determinehardwork(bucketspec2);
  resetsorted(bucketspec2);
  return bucketspec2;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl %edx, 0x34(%rsp)
movq %rcx, 0x28(%rsp)
movl %r8d, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
ja 0x2bb46b
movq 0x380b66(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x25abcf(%rip), %rsi    # 0x516013
leaq 0x2cdf9c(%rip), %rdx    # 0x5893e7
leaq 0x2cdfa4(%rip), %rcx    # 0x5893f6
leaq 0x2cdfad(%rip), %r8     # 0x589406
movl $0x168, %r9d            # imm = 0x168
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2bb46d
movl $0x48, %edi
leaq 0x2cdf8d(%rip), %rsi    # 0x589406
movl $0x169, %edx            # imm = 0x169
callq 0xe80f0
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rdi
callq 0x205eb0
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x1c(%rax)
movl 0x24(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x14(%rax)
movl 0x24(%rsp), %ecx
imull 0x24(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x38(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x34(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
movl 0x24(%rsp), %eax
movl %eax, %edi
shlq $0x2, %rdi
leaq 0x2cdf15(%rip), %rsi    # 0x589406
movl $0x170, %edx            # imm = 0x170
callq 0xe80f0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movl 0x24(%rsp), %eax
movl %eax, %edi
shlq $0x4, %rdi
leaq 0x2cdeee(%rip), %rsi    # 0x589406
movl $0x172, %edx            # imm = 0x172
callq 0xe80f0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x38(%rax)
movl 0x24(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x2cdec7(%rip), %rsi    # 0x589406
movl $0x174, %edx            # imm = 0x174
callq 0xe80f0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x40(%rax)
movl 0x24(%rsp), %eax
movl %eax, %edi
shlq $0x4, %rdi
movl 0x24(%rsp), %eax
imulq %rax, %rdi
leaq 0x2cde98(%rip), %rsi    # 0x589406
movl $0x174, %edx            # imm = 0x174
callq 0xe80f0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq %rcx, (%rax)
movq $0x1, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x24(%rsp), %ecx
cmpq %rcx, %rax
jae 0x2bb5e1
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movl 0x24(%rsp), %eax
shlq $0x4, %rax
addq %rax, %rdx
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x2bb590
movq 0x18(%rsp), %rax
cmpl $0x2, 0x1c(%rax)
jne 0x2bb5fd
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x2bb690
jmp 0x2bb60c
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x2bb810
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x24(%rsp), %eax
jae 0x2bb63f
movl 0x14(%rsp), %edx
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x14(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x2bb614
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdi
movl 0x24(%rsp), %eax
movl %eax, %esi
movq 0x18(%rsp), %rcx
movl $0x4, %edx
leaq 0x561(%rip), %r8        # 0x2bbbc0
callq 0xfb9e0
movq 0x18(%rsp), %rdi
callq 0x2bbc50
movq 0x18(%rsp), %rdi
callq 0x2bbd40
movq 0x18(%rsp), %rdi
callq 0x2bbc50
movq 0x18(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)