// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
testl %r8d, %r8d
je 0x1e7d0b
movl %r8d, %ebp
movq %rcx, %r12
movl %edx, %r14d
movq %rsi, %r13
movq %rdi, %r15
leaq 0x1cee5c(%rip), %rsi    # 0x3b65b1
movl $0x48, %edi
movl $0x169, %edx            # imm = 0x169
callq 0x104226
movq %rax, %rbx
movq %r12, (%rax)
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0x18c054
movl %eax, 0x1c(%rbx)
movl %ebp, 0x14(%rbx)
movl %ebp, %eax
imull %ebp, %eax
movl %eax, 0x18(%rbx)
movq %r13, 0x8(%rbx)
movl %r14d, 0x10(%rbx)
movl %ebp, %r15d
leaq (,%r15,4), %rdi
leaq 0x1cee12(%rip), %r14    # 0x3b65b1
movq %r14, %rsi
movl $0x170, %edx            # imm = 0x170
callq 0x104226
movq %rax, 0x20(%rbx)
movq %r15, %r13
shlq $0x4, %r13
movq %r13, %rdi
movq %r14, %rsi
movl $0x172, %edx            # imm = 0x172
callq 0x104226
movq %rax, 0x38(%rbx)
leaq (,%r15,8), %rdi
movq %r14, %rsi
movl $0x174, %edx            # imm = 0x174
callq 0x104226
movq %rax, 0x40(%rbx)
movq %r13, %rdi
imulq %r15, %rdi
movq %r14, %rsi
movl $0x174, %edx            # imm = 0x174
callq 0x104226
movq 0x40(%rbx), %rcx
movq %rax, (%rcx)
cmpl $0x1, %ebp
je 0x1e7821
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, %r15
jne 0x1e7809
cmpl $0x2, 0x1c(%rbx)
jne 0x1e78d6
movq %r15, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x18c2f5
movq %rax, %r12
decq %r12
xorl %r14d, %r14d
leaq 0x28(%rsp), %r13
xorl %r15d, %r15d
xorl %eax, %eax
xorl %ebp, %ebp
movq (%rbx), %r8
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movl %eax, %r9d
callq 0x18be28
addq 0x30(%rsp), %r14
testl %eax, %eax
je 0x1e7896
cmpq $0x0, 0x38(%rsp)
jne 0x1e7ced
movq 0x40(%rbx), %rcx
movl %r15d, %edx
movq (%rcx,%rdx,8), %rcx
leal -0x1(%rax), %edx
shlq $0x4, %rdx
movq %r14, 0x8(%rcx,%rdx)
jmp 0x1e78c4
movq 0x40(%rbx), %rcx
movl %r15d, %edx
movq (%rcx,%rdx,8), %rcx
movl 0x14(%rbx), %esi
decl %esi
shlq $0x4, %rsi
movq %r14, 0x8(%rcx,%rsi)
addq 0x38(%rsp), %r14
movq 0x38(%rbx), %rcx
shlq $0x4, %rdx
movq %r14, 0x8(%rcx,%rdx)
incl %r15d
incq %rbp
cmpq %r12, %rbp
jbe 0x1e784f
movq 0x8(%rsp), %r15
jmp 0x1e7bad
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x18c2f5
movq %rax, 0x8(%rsp)
movl 0x14(%rbx), %edi
movl 0x1c(%rbx), %esi
addl $-0x2, %esi
callq 0x105ed6
movq %rax, 0x28(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x18c2e6
movq %rax, 0x30(%rbx)
movl 0x14(%rbx), %r14d
movq 0x8(%rbx), %r12
movl 0x10(%rbx), %eax
xorl %ecx, %ecx
movl %eax, 0x4(%rsp)
cmpl $0x1, %eax
setne %cl
movl %ecx, (%rsp)
movq %r12, %rdi
callq 0xe7b9c
movq %rax, 0x40(%rsp)
leaq (,%r14,8), %r13
leaq 0x1cec70(%rip), %rsi    # 0x3b65b1
movq %r13, %rdi
movl $0xa4, %edx
callq 0x104226
movq %rax, %rbp
testq %r14, %r14
je 0x1e7963
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x173a0
movl (%rsp), %eax
addl %eax, %eax
movl %eax, (%rsp)
movq %r12, %rdi
callq 0xeacd6
testb %al, %al
movq 0x10(%rsp), %r14
je 0x1e7a58
movq %rbp, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq %r12, %rdi
movl $0x1, %esi
callq 0xeae2c
movq %rax, %r13
movl 0x4(%rsp), %ebp
movl %ebp, %eax
orl $0x2, %eax
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
cmpl $0x3, %eax
jne 0x1e7a00
callq 0xeae9a
testb %al, %al
movl (%rsp), %r12d
je 0x1e7a46
leaq 0x28(%rsp), %rbp
movq 0x30(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
jae 0x1e79ef
movq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0xe7bbc
cmpb $-0x3, %al
ja 0x1e79ef
movzbl %al, %eax
movq 0x18(%rsp), %rcx
incq (%rcx,%rax,8)
movq %r13, %rdi
movq %rbp, %rsi
callq 0xeae9a
testb %al, %al
jne 0x1e79c6
jmp 0x1e7a46
callq 0xeae9a
testb %al, %al
je 0x1e7a46
leaq 0x28(%rsp), %r12
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x1e7a37
decq %rsi
movq 0x20(%rsp), %rdi
movl %ebp, %edx
callq 0xe7bbc
cmpb $-0x3, %al
ja 0x1e7a37
movzbl %al, %eax
movq 0x18(%rsp), %rcx
incq (%rcx,%rax,8)
movq %r13, %rdi
movq %r12, %rsi
callq 0xeae9a
testb %al, %al
jne 0x1e7a0e
movq %r13, %rdi
callq 0xeb455
movq 0x18(%rsp), %rbp
movq 0x20(%rsp), %r12
movl 0x4(%rsp), %eax
orl $0x2, %eax
movq %r12, %rdi
cmpl $0x3, %eax
jne 0x1e7a87
callq 0xec67e
testq %rax, %rax
jne 0x1e7ab5
movq %r12, %rdi
xorl %esi, %esi
movl (%rsp), %edx
callq 0xe7bbc
cmpb $-0x2, %al
jb 0x1e7aad
callq 0x76b7a
callq 0xec686
testq %rax, %rax
jne 0x1e7ab5
movq 0x40(%rsp), %rsi
decq %rsi
movq %r12, %rdi
movl 0x4(%rsp), %edx
callq 0xe7bbc
cmpb $-0x2, %al
jae 0x1e7d10
movzbl %al, %eax
incq (%rbp,%rax,8)
movq %rbp, %r12
cmpl $0x0, 0x18(%rbx)
je 0x1e7b99
decq 0x8(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x28(%rbx), %rcx
movq %rcx, %rsi
imulq %r13, %rsi
addq 0x30(%rbx), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
cmpq %rax, %r13
jne 0x1e7cf7
movq (%rbx), %rcx
movq %r14, %rdi
movq 0x8(%rsp), %rdx
callq 0x18bf4d
movq %rax, %rsi
leaq 0x1(%r13), %rcx
movl 0x14(%rbx), %r9d
movl %ecx, %eax
xorl %edx, %edx
divl %r9d
movl %edx, %edi
movl %r13d, %eax
xorl %edx, %edx
divl %r9d
cmpl %ebp, %eax
jne 0x1e7cf2
movl %ebp, %r8d
testl %edi, %edi
je 0x1e7b46
decl %edi
cmpl %edx, %edi
jne 0x1e7cfc
movl %edi, %eax
movq 0x40(%rbx), %rdx
movq (%rdx,%r8,8), %rdx
shlq $0x4, %rax
movq %rsi, 0x8(%rdx,%rax)
jmp 0x1e7b8a
movq %rsi, %rdi
subq (%r12,%r8,8), %rdi
jb 0x1e7d06
leal -0x1(%r9), %r10d
movl %r13d, %eax
xorl %edx, %edx
divl %r9d
cmpl %r10d, %edx
jne 0x1e7d01
movl %edx, %eax
movq 0x40(%rbx), %rdx
movq (%rdx,%r8,8), %rdx
shlq $0x4, %rax
movq %rdi, 0x8(%rdx,%rax)
movq 0x38(%rbx), %rax
shlq $0x4, %r8
movq %rsi, 0x8(%rax,%r8)
incl %ebp
movl 0x18(%rbx), %eax
movq %rcx, %r13
cmpq %rax, %rcx
jb 0x1e7acc
leaq 0x1cea11(%rip), %rsi    # 0x3b65b1
movq %r12, %rdi
movl $0x15c, %edx            # imm = 0x15C
callq 0x1045eb
movq 0x20(%rbx), %rdi
leaq 0x1(%r15), %rax
andq $-0x2, %rax
leaq -0x1(%r15), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x170e51(%rip), %xmm1   # 0x358a20
xorl %ecx, %ecx
movdqa 0x170e57(%rip), %xmm2   # 0x358a30
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x170e57(%rip), %xmm4   # 0x358a40
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, %edx
notl %edx
testb $0x1, %dl
je 0x1e7c1d
movl %ecx, (%rdi,%rcx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1e7c32
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rdi,%rcx,4)
addq $0x2, %rcx
paddq %xmm4, %xmm1
cmpq %rcx, %rax
jne 0x1e7be9
leaq 0xcf(%rip), %r8         # 0x1e7d15
movl $0x4, %edx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x10c638
movq %rbx, %rdi
callq 0x1e7d74
movl 0x14(%rbx), %eax
testq %rax, %rax
je 0x1e7cd3
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
xorl %ebp, %ebp
cmpq %r11, %r9
je 0x1e7ca3
cmpb $0x0, 0x1(%r10,%r11)
jne 0x1e7ca3
movb $0x1, 0x1(%r10,%r11)
movb $0x1, %bpl
movb %bpl, (%r10,%r11)
addq $0x10, %r11
cmpq %r11, %rdi
jne 0x1e7c8b
movb $0x1, 0x1(%rdx,%r9)
xorl %r10d, %r10d
movq (%rsi,%r10,8), %r11
movb $0x1, 0x1(%r11,%r9)
incq %r10
cmpq %r10, %rax
jne 0x1e7cb9
incq %r8
cmpq %rax, %r8
jne 0x1e7c7c
movq %rbx, %rdi
callq 0x1e7d74
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x76d09
callq 0x76c25
callq 0x76bec
callq 0x76c5e
callq 0x76c97
callq 0x76cd0
callq 0x76d42
callq 0x76bb3