// File: /workspace/github_c_makefile_star2_O2/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
movl %edx, 0x10(%rsp)
testl %r8d, %r8d
je 0x1975b0
movl %r8d, %r13d
movq %rcx, %r14
movq %rsi, %rbp
movq %rdi, %r15
leaq 0x1bfa13(%rip), %r12    # 0x356a11
pushq $0x48
popq %rdi
movq %r12, %rsi
movl $0x169, %edx            # imm = 0x169
callq 0x93160
movq %rax, %rbx
movq %r14, (%rax)
movq %r15, %rdi
callq 0x1356a1
movl %eax, 0x1c(%rbx)
movl %r13d, 0x14(%rbx)
movl %r13d, %r14d
imull %r13d, %r13d
movl %r13d, 0x18(%rbx)
movq %rbp, 0x8(%rbx)
movl 0x10(%rsp), %eax
movl %eax, 0x10(%rbx)
leaq (,%r14,4), %rdi
movq %r12, %rsi
movl $0x170, %edx            # imm = 0x170
callq 0x93160
movq %rax, 0x20(%rbx)
movq %r14, %r13
shlq $0x4, %r13
movq %r13, %rdi
movq %r12, %rsi
movl $0x172, %edx            # imm = 0x172
callq 0x93160
movq %rax, 0x38(%rbx)
leaq (,%r14,8), %rdi
movq %r12, %rsi
movl $0x174, %edx            # imm = 0x174
callq 0x93160
movq %rax, 0x40(%rbx)
movq %r13, %rdi
imulq %r14, %rdi
movq %r12, %rsi
movl $0x174, %edx            # imm = 0x174
callq 0x93160
movq 0x40(%rbx), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rax
cmpq %rax, %r14
je 0x1970be
movq 0x40(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdx
addq %r13, %rdx
movq %rdx, (%rcx,%rax,8)
incq %rax
jmp 0x1970a4
movq %r14, 0x20(%rsp)
cmpl $0x2, 0x1c(%rbx)
jne 0x197168
movq %r15, %r14
movq %r15, %rdi
callq 0x1359e8
movq %rax, %r12
decq %r12
xorl %r13d, %r13d
xorl %eax, %eax
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq %r12, %r13
ja 0x197305
movq (%rbx), %r8
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
movl %eax, %r9d
callq 0x1353c2
addq 0x38(%rsp), %rbp
movl %r15d, %ecx
testl %eax, %eax
je 0x197138
cmpq $0x0, 0x40(%rsp)
jne 0x197578
movq 0x40(%rbx), %rdx
movq (%rdx,%rcx,8), %rcx
leal -0x1(%rax), %edx
shlq $0x4, %rdx
movq %rbp, 0x8(%rcx,%rdx)
jmp 0x197163
movq 0x40(%rbx), %rdx
movq (%rdx,%rcx,8), %rdx
movl 0x14(%rbx), %esi
decl %esi
shlq $0x4, %rsi
movq %rbp, 0x8(%rdx,%rsi)
addq 0x40(%rsp), %rbp
movq 0x38(%rbx), %rdx
shlq $0x4, %rcx
movq %rbp, 0x8(%rdx,%rcx)
incl %r15d
incq %r13
jmp 0x1970e8
movq %r15, %rdi
callq 0x1359e8
movq %rax, 0x10(%rsp)
movl 0x14(%rbx), %edi
movl 0x1c(%rbx), %esi
addl $-0x2, %esi
callq 0x95871
movq %rax, 0x28(%rbx)
pushq $0x2
popq %rsi
movq %r15, %r14
movq %r15, %rdi
callq 0x1359d9
movq %rax, 0x30(%rbx)
movl 0x14(%rbx), %r15d
movq 0x8(%rbx), %r12
movl 0x10(%rbx), %ebp
movq %r12, %rdi
callq 0x7055e
movq %rax, 0x28(%rsp)
leaq (,%r15,8), %rdi
leaq 0x1bf851(%rip), %rsi    # 0x356a11
movl $0xa4, %edx
callq 0x93160
movq %rax, %r13
xorl %eax, %eax
cmpq %rax, %r15
je 0x1971df
andq $0x0, (%r13,%rax,8)
incq %rax
jmp 0x1971cf
xorl %eax, %eax
cmpl $0x1, %ebp
setne %al
addl %eax, %eax
movl %eax, 0xc(%rsp)
movq %r12, %rdi
callq 0x740a6
testb %al, %al
movq %r14, %r15
movq 0x20(%rsp), %r14
je 0x1972ab
pushq $0x1
popq %rsi
movq %r12, 0x18(%rsp)
movq %r12, %rdi
callq 0x741f0
movl %ebp, %ecx
movq %rax, %rbp
movl %ecx, 0x8(%rsp)
movl %ecx, %eax
orl $0x2, %eax
leaq 0x30(%rsp), %r12
cmpl $0x3, %eax
jne 0x19728b
movq %rbp, %rdi
movq %r12, %rsi
callq 0x7428b
testb %al, %al
je 0x19729a
movq 0x38(%rsp), %rsi
cmpq 0x28(%rsp), %rsi
jae 0x19722d
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %edx
callq 0x705e4
cmpb $-0x3, %al
ja 0x19722d
movzbl %al, %eax
incq (%r13,%rax,8)
jmp 0x19722d
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x19728b
decq %rsi
movq 0x18(%rsp), %rdi
movl 0x8(%rsp), %edx
callq 0x705e4
cmpb $-0x3, %al
ja 0x19728b
movzbl %al, %eax
incq (%r13,%rax,8)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x7428b
testb %al, %al
jne 0x197264
movq %rbp, %rdi
callq 0x74a09
movq 0x18(%rsp), %r12
movl 0x8(%rsp), %ebp
movl %ebp, %eax
orl $0x2, %eax
movq %r12, %rdi
cmpl $0x3, %eax
jne 0x19730f
callq 0x7627b
testq %rax, %rax
jne 0x19733b
movq %r12, %rdi
xorl %esi, %esi
movl 0xc(%rsp), %edx
callq 0x705e4
cmpb $-0x2, %al
jb 0x197333
movq 0x2a0c8d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14dd2e(%rip), %rsi    # 0x2e5013
leaq 0x16c92b(%rip), %rdx    # 0x303c17
leaq 0x1bf973(%rip), %rcx    # 0x356c66
leaq 0x1bf717(%rip), %r8     # 0x356a11
movl $0xd0, %r9d
jmp 0x1975a4
movq 0x20(%rsp), %r14
jmp 0x19742c
callq 0x76283
testq %rax, %rax
jne 0x19733b
movq 0x28(%rsp), %rsi
decq %rsi
movq %r12, %rdi
movl %ebp, %edx
callq 0x705e4
cmpb $-0x2, %al
jae 0x19763d
movzbl %al, %eax
incq (%r13,%rax,8)
decq 0x10(%rsp)
xorl %eax, %eax
xorl %ebp, %ebp
movl %eax, %r12d
movl 0x18(%rbx), %eax
cmpq %rax, %rbp
jae 0x197418
movq 0x28(%rbx), %rcx
movq %rcx, %rsi
imulq %rbp, %rsi
addq 0x30(%rbx), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
cmpq %rax, %rbp
jne 0x1974eb
movq (%rbx), %rcx
movq %r15, %rdi
movq 0x10(%rsp), %rdx
callq 0x13559f
movq %rax, %rcx
movl 0x14(%rbx), %edi
leal 0x1(%rbp), %eax
xorl %edx, %edx
divl %edi
movl %edx, %esi
movl %ebp, %eax
xorl %edx, %edx
divl %edi
cmpl %r12d, %eax
jne 0x19751c
testl %esi, %esi
je 0x1973c7
decl %esi
cmpl %edx, %esi
jne 0x19754a
movl %esi, %eax
movq 0x40(%rbx), %rdx
movq (%rdx,%r12,8), %rdx
shlq $0x4, %rax
movq %rcx, 0x8(%rdx,%rax)
incq %rbp
jmp 0x197347
movq %rcx, %rsi
subq (%r13,%r12,8), %rsi
jb 0x1975de
leal -0x1(%rdi), %r8d
movl %ebp, %eax
xorl %edx, %edx
divl %edi
cmpl %r8d, %edx
jne 0x19760c
incq %rbp
movl %edx, %eax
movq 0x40(%rbx), %rdx
movq (%rdx,%r12,8), %rdx
shlq $0x4, %rax
movq %rsi, 0x8(%rdx,%rax)
movq 0x38(%rbx), %rax
movq %r12, %rdx
shlq $0x4, %rdx
movq %rcx, 0x8(%rax,%rdx)
leal 0x1(%r12), %eax
jmp 0x197344
leaq 0x1bf5f2(%rip), %rsi    # 0x356a11
movq %r13, %rdi
movl $0x15c, %edx            # imm = 0x15C
callq 0x936f9
movq 0x20(%rbx), %rdi
xorl %eax, %eax
cmpq %rax, %r14
je 0x19743f
movl %eax, (%rdi,%rax,4)
incq %rax
jmp 0x197432
leaq 0x228(%rip), %r8        # 0x19766e
pushq $0x4
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
callq 0x9d5a0
movq %rbx, %rdi
callq 0x1976a5
movl 0x14(%rbx), %eax
movq %rax, %rcx
shlq $0x4, %rcx
xorl %edx, %edx
cmpq %rax, %rdx
je 0x1974d1
movq 0x20(%rbx), %rdi
movq 0x40(%rbx), %rsi
movl (%rdi,%rdx,4), %edi
movq (%rsi,%rdi,8), %r8
shlq $0x4, %rdi
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0x1974ab
xorl %r10d, %r10d
cmpq %r9, %rdi
je 0x1974a1
cmpb $0x0, 0x1(%r8,%r9)
jne 0x1974a1
movb $0x1, 0x1(%r8,%r9)
movb $0x1, %r10b
movb %r10b, (%r8,%r9)
addq $0x10, %r9
jmp 0x197483
movq 0x38(%rbx), %r8
movb $0x1, 0x1(%r8,%rdi)
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x1974cc
movq (%rsi,%r8,8), %r9
movb $0x1, 0x1(%r9,%rdi)
incq %r8
jmp 0x1974b8
incq %rdx
jmp 0x197468
movq %rbx, %rdi
callq 0x1976a5
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2a0a76(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14db17(%rip), %rsi    # 0x2e5013
leaq 0x1bf635(%rip), %rdx    # 0x356b38
leaq 0x1bf659(%rip), %rcx    # 0x356b63
leaq 0x1bf500(%rip), %r8     # 0x356a11
movl $0x144, %r9d            # imm = 0x144
jmp 0x1975a4
movq 0x2a0a45(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14dae6(%rip), %rsi    # 0x2e5013
leaq 0x1bf641(%rip), %rdx    # 0x356b75
leaq 0x1bf628(%rip), %rcx    # 0x356b63
leaq 0x1bf4cf(%rip), %r8     # 0x356a11
movl $0x14a, %r9d            # imm = 0x14A
jmp 0x1975a4
movq 0x2a0a17(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14dab8(%rip), %rsi    # 0x2e5013
leaq 0x1bf6c6(%rip), %rdx    # 0x356c28
leaq 0x1bf5fa(%rip), %rcx    # 0x356b63
leaq 0x1bf4a1(%rip), %r8     # 0x356a11
movl $0x157, %r9d            # imm = 0x157
jmp 0x1975a4
movq 0x2a09e9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14da8a(%rip), %rsi    # 0x2e5013
leaq 0x1bf577(%rip), %rdx    # 0x356b07
leaq 0x1bf591(%rip), %rcx    # 0x356b28
leaq 0x1bf473(%rip), %r8     # 0x356a11
movl $0x128, %r9d            # imm = 0x128
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2a09b1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14da52(%rip), %rsi    # 0x2e5013
leaq 0x1bf42a(%rip), %rdx    # 0x3569f2
leaq 0x1bf432(%rip), %rcx    # 0x356a01
leaq 0x1bf43b(%rip), %r8     # 0x356a11
movl $0x168, %r9d            # imm = 0x168
jmp 0x1975a4
movq 0x2a0983(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14da24(%rip), %rsi    # 0x2e5013
leaq 0x1bf5bb(%rip), %rdx    # 0x356bb1
leaq 0x1bf566(%rip), %rcx    # 0x356b63
leaq 0x1bf40d(%rip), %r8     # 0x356a11
movl $0x14d, %r9d            # imm = 0x14D
jmp 0x1975a4
movq 0x2a0955(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14d9f6(%rip), %rsi    # 0x2e5013
leaq 0x1bf5b8(%rip), %rdx    # 0x356bdc
leaq 0x1bf538(%rip), %rcx    # 0x356b63
leaq 0x1bf3df(%rip), %r8     # 0x356a11
movl $0x14f, %r9d            # imm = 0x14F
jmp 0x1975a4
movq 0x2a0924(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14d9c5(%rip), %rsi    # 0x2e5013
leaq 0x16c5c2(%rip), %rdx    # 0x303c17
leaq 0x1bf60a(%rip), %rcx    # 0x356c66
leaq 0x1bf3ae(%rip), %r8     # 0x356a11
movl $0xd8, %r9d
jmp 0x1975a4