// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
testl %r8d, %r8d
je 0x1f147f
movl %r8d, %r12d
movq %rcx, %r13
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x1ced29(%rip), %rsi    # 0x3bfbd1
movl $0x48, %edi
movl $0x169, %edx            # imm = 0x169
callq 0x1092b2
movq %rax, %rbx
movq %r13, (%rax)
movq %r15, 0x18(%rsp)
movq %r15, %rdi
callq 0x1946cf
movl %eax, 0x1c(%rbx)
movl %r12d, 0x14(%rbx)
movl %r12d, %eax
imull %r12d, %eax
movl %eax, 0x18(%rbx)
movq %r14, 0x8(%rbx)
movl %ebp, 0x10(%rbx)
movq %r12, %r14
movl %r14d, %r12d
leaq (,%r12,4), %rdi
leaq 0x1cecda(%rip), %r15    # 0x3bfbd1
movq %r15, %rsi
movl $0x170, %edx            # imm = 0x170
callq 0x1092b2
movq %rax, 0x20(%rbx)
movq %r12, %r13
shlq $0x4, %r13
movq %r13, %rdi
movq %r15, %rsi
movl $0x172, %edx            # imm = 0x172
callq 0x1092b2
movq %rax, 0x38(%rbx)
leaq (,%r12,8), %rdi
movq %r15, %rsi
movl $0x174, %edx            # imm = 0x174
callq 0x1092b2
movq %rax, 0x40(%rbx)
movq %r13, %rdi
imulq %r12, %rdi
movq %r15, %rsi
movl $0x174, %edx            # imm = 0x174
callq 0x1092b2
movq 0x40(%rbx), %rcx
movq %rax, (%rcx)
movq %r14, 0x50(%rsp)
cmpl $0x1, %r14d
je 0x1f0f7f
movl $0x1, %eax
movq 0x40(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdx
addq %r13, %rdx
movq %rdx, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r12
jne 0x1f0f67
cmpl $0x2, 0x1c(%rbx)
jne 0x1f1034
movq %r12, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x1949a8
movq %rax, %r15
decq %r15
xorl %r14d, %r14d
leaq 0x30(%rsp), %r13
xorl %r12d, %r12d
xorl %eax, %eax
xorl %ebp, %ebp
movq (%rbx), %r8
movq %r13, %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
movq %r15, %rcx
movl %eax, %r9d
callq 0x19449f
addq 0x38(%rsp), %r14
testl %eax, %eax
je 0x1f0ff4
cmpq $0x0, 0x40(%rsp)
jne 0x1f1461
movq 0x40(%rbx), %rcx
movl %r12d, %edx
movq (%rcx,%rdx,8), %rcx
leal -0x1(%rax), %edx
shlq $0x4, %rdx
movq %r14, 0x8(%rcx,%rdx)
jmp 0x1f1022
movq 0x40(%rbx), %rcx
movl %r12d, %edx
movq (%rcx,%rdx,8), %rcx
movl 0x14(%rbx), %esi
decl %esi
shlq $0x4, %rsi
movq %r14, 0x8(%rcx,%rsi)
addq 0x40(%rsp), %r14
movq 0x38(%rbx), %rcx
shlq $0x4, %rdx
movq %r14, 0x8(%rcx,%rdx)
incl %r12d
incq %rbp
cmpq %r15, %rbp
jbe 0x1f0fad
movq 0x10(%rsp), %r12
jmp 0x1f1312
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x1949a8
movq %rax, 0x10(%rsp)
movl 0x14(%rbx), %edi
movl 0x1c(%rbx), %esi
addl $-0x2, %esi
callq 0x10af8d
movq %rax, 0x28(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x194999
movq %rax, 0x30(%rbx)
movl 0x14(%rbx), %r14d
movq 0x8(%rbx), %r13
movl 0x10(%rbx), %eax
xorl %ecx, %ecx
movl %eax, 0xc(%rsp)
cmpl $0x1, %eax
setne %cl
movl %ecx, 0x8(%rsp)
movq %r13, %rdi
callq 0xec1d8
movq %rax, 0x48(%rsp)
leaq (,%r14,8), %r15
leaq 0x1ceb31(%rip), %rsi    # 0x3bfbd1
movq %r15, %rdi
movl $0xa4, %edx
callq 0x1092b2
movq %rax, %rbp
testq %r14, %r14
je 0x1f10c2
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x173a0
movl 0x8(%rsp), %eax
addl %eax, %eax
movl %eax, 0x8(%rsp)
movq %r13, %rdi
callq 0xef27f
testb %al, %al
movq 0x18(%rsp), %r14
je 0x1f11ba
movq %rbp, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %r13, %rdi
movl $0x1, %esi
callq 0xef3d9
movq %rax, %r15
movl 0xc(%rsp), %ebp
movl %ebp, %eax
orl $0x2, %eax
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
cmpl $0x3, %eax
jne 0x1f1162
callq 0xef451
testb %al, %al
movl 0x8(%rsp), %r13d
je 0x1f11a8
leaq 0x30(%rsp), %rbp
movq 0x38(%rsp), %rsi
cmpq 0x48(%rsp), %rsi
jae 0x1f1151
movq 0x28(%rsp), %rdi
movl %r13d, %edx
callq 0xec1f8
cmpb $-0x3, %al
ja 0x1f1151
movzbl %al, %eax
movq 0x20(%rsp), %rcx
incq (%rcx,%rax,8)
movq %r15, %rdi
movq %rbp, %rsi
callq 0xef451
testb %al, %al
jne 0x1f1128
jmp 0x1f11a8
callq 0xef451
testb %al, %al
je 0x1f11a8
leaq 0x30(%rsp), %r13
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x1f1199
decq %rsi
movq 0x28(%rsp), %rdi
movl %ebp, %edx
callq 0xec1f8
cmpb $-0x3, %al
ja 0x1f1199
movzbl %al, %eax
movq 0x20(%rsp), %rcx
incq (%rcx,%rax,8)
movq %r15, %rdi
movq %r13, %rsi
callq 0xef451
testb %al, %al
jne 0x1f1170
movq %r15, %rdi
callq 0xefa48
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %r13
movl 0xc(%rsp), %eax
orl $0x2, %eax
movq %r13, %rdi
cmpl $0x3, %eax
jne 0x1f11ea
callq 0xf0c7a
testq %rax, %rax
jne 0x1f1218
movq %r13, %rdi
xorl %esi, %esi
movl 0x8(%rsp), %edx
callq 0xec1f8
cmpb $-0x2, %al
jb 0x1f1210
callq 0x78807
callq 0xf0c82
testq %rax, %rax
jne 0x1f1218
movq 0x48(%rsp), %rsi
decq %rsi
movq %r13, %rdi
movl 0xc(%rsp), %edx
callq 0xec1f8
cmpb $-0x2, %al
jae 0x1f1484
movzbl %al, %eax
incq (%rbp,%rax,8)
movq %rbp, %r13
cmpl $0x0, 0x18(%rbx)
je 0x1f12fe
decq 0x10(%rsp)
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x28(%rbx), %rcx
movq %rcx, %rsi
imulq %r15, %rsi
addq 0x30(%rbx), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
cmpq %rax, %r15
jne 0x1f146b
movq (%rbx), %rcx
movq %r14, %rdi
movq 0x10(%rsp), %rdx
callq 0x1945c8
movq %rax, %rsi
leaq 0x1(%r15), %rcx
movl 0x14(%rbx), %r9d
movq %rcx, %rax
xorl %edx, %edx
divq %r9
movq %rdx, %rdi
movq %r15, %rax
xorl %edx, %edx
divq %r9
movl %ebp, %r8d
cmpq %r8, %rax
jne 0x1f1466
testq %rdi, %rdi
je 0x1f12ac
decl %edi
cmpq %rdx, %rdi
jne 0x1f1470
movq 0x40(%rbx), %rax
movq (%rax,%r8,8), %rax
shlq $0x4, %rdi
movq %rsi, 0x8(%rax,%rdi)
jmp 0x1f12ef
movq %rsi, %rdi
subq (%r13,%r8,8), %rdi
jb 0x1f147a
leal -0x1(%r9), %r10d
movq %r15, %rax
xorl %edx, %edx
divq %r9
cmpl %r10d, %edx
jne 0x1f1475
movq 0x40(%rbx), %rax
movq (%rax,%r8,8), %rax
shlq $0x4, %r10
movq %rdi, 0x8(%rax,%r10)
movq 0x38(%rbx), %rax
shlq $0x4, %r8
movq %rsi, 0x8(%rax,%r8)
incl %ebp
movl 0x18(%rbx), %eax
movq %rcx, %r15
cmpq %rax, %rcx
jb 0x1f122f
leaq 0x1ce8cc(%rip), %rsi    # 0x3bfbd1
movq %r13, %rdi
movl $0x15c, %edx            # imm = 0x15C
callq 0x109670
movq 0x50(%rsp), %rdx
cmpl $0x1, %edx
adcl $0x0, %edx
movq 0x20(%rbx), %rax
leaq 0x1(%rdx), %rcx
andq $-0x2, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x170732(%rip), %xmm1   # 0x361a70
xorl %edx, %edx
movdqa 0x170738(%rip), %xmm2   # 0x361a80
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x170738(%rip), %xmm4   # 0x361a90
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x1f138d
movl %edx, (%rax,%rdx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x1f13a3
leal 0x1(%rdx), %esi
movl %esi, 0x4(%rax,%rdx,4)
addq $0x2, %rdx
paddq %xmm4, %xmm1
cmpq %rdx, %rcx
jne 0x1f1358
movq 0x20(%rbx), %rdi
leaq 0xce(%rip), %r8         # 0x1f1489
movl $0x4, %edx
movq %r12, %rsi
movq %rbx, %rcx
callq 0x1118d4
movq %rbx, %rdi
callq 0x1f14ea
movl 0x14(%rbx), %eax
testq %rax, %rax
je 0x1f1447
movq 0x20(%rbx), %rcx
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rsi
movq %rax, %rdi
shlq $0x4, %rdi
xorl %r8d, %r8d
movl (%rcx,%r8,4), %r9d
movq (%rsi,%r9,8), %r10
shlq $0x4, %r9
xorl %r11d, %r11d
cmpq %r11, %r9
je 0x1f1416
cmpb $0x0, 0x1(%r10,%r11)
jne 0x1f1416
movw $0x101, (%r10,%r11)     # imm = 0x101
jmp 0x1f141b
movb $0x0, (%r10,%r11)
addq $0x10, %r11
cmpq %r11, %rdi
jne 0x1f1400
movb $0x1, 0x1(%rdx,%r9)
xorl %r10d, %r10d
movq (%rsi,%r10,8), %r11
movb $0x1, 0x1(%r11,%r9)
incq %r10
cmpq %r10, %rax
jne 0x1f142d
incq %r8
cmpq %rax, %r8
jne 0x1f13f1
movq %rbx, %rdi
callq 0x1f14ea
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x78996
callq 0x788b2
callq 0x78879
callq 0x788eb
callq 0x78924
callq 0x7895d
callq 0x789cf
callq 0x78840