// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/eis-bwtseq.c
// Function: gt_newBWTSeq
BWTSeq *
gt_newBWTSeq(EISeq *seqIdx, MRAEnc *alphabet,
          const enum rangeSortMode *defaultRangeSort)
{
  BWTSeq *bwtSeq;
  GtUword *counts;
  size_t countsOffset, rangeSortOffset, totalSize;
  enum rangeSortMode *rangeSort;
  unsigned alphabetSize;
  gt_assert(seqIdx);
  /* alphabetSize is increased by one to handle the flattened
   * terminator symbol correctly */
  alphabetSize = gt_MRAEncGetSize(alphabet) + 1;
  countsOffset = offsetAlign(sizeof (struct BWTSeq), sizeof (GtUword));
  rangeSortOffset = offsetAlign(countsOffset
                                + sizeof (GtUword) * (alphabetSize + 1),
                                sizeof (enum rangeSortMode));
  totalSize = rangeSortOffset + sizeof (enum rangeSortMode)
    * MRAEncGetNumRanges(alphabet);
  bwtSeq = gt_malloc(totalSize);
  bwtSeq->pckbuckettable = NULL;
  counts = (GtUword *)((char  *)bwtSeq + countsOffset);
  rangeSort = (enum rangeSortMode *)((char *)bwtSeq + rangeSortOffset);
  if (!initBWTSeqFromEncSeqIdx(bwtSeq, seqIdx, alphabet, counts, rangeSort,
                               defaultRangeSort))
  {
    gt_free(bwtSeq);
    bwtSeq = NULL;
  }
  return bwtSeq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x19bd6a
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
callq 0x19e077
movzwl %ax, %ebx
movl 0x4(%r12), %eax
shlq $0x2, %rax
leaq (%rax,%rbx,8), %rdi
addq $0x68, %rdi
leaq 0x2072aa(%rip), %rsi    # 0x3a2de9
movl $0x7e, %edx
callq 0x104226
movq %rax, %r14
movq $0x0, 0x50(%rax)
movq %r12, 0x8(%rax)
movq %r12, %rdi
callq 0x19e077
testw %ax, %ax
je 0x19bc68
movl %eax, %ebp
movq %r12, %rdi
movl $0xfc, %esi
movl $0x1, %edx
callq 0x19e1bf
movq %r12, %rdi
callq 0x19e077
movzwl %bp, %ecx
incl %ecx
movzwl %ax, %eax
cmpl %eax, %ecx
jne 0x19bd6f
movq %r12, %rdi
callq 0x19e077
cmpl $0x1, (%r12)
jne 0x19bd74
leaq (%r14,%rbx,8), %rcx
addq $0x68, %rcx
movq %r14, %rdx
addq $0x58, %rdx
movzwl %ax, %esi
movzbl 0x116(%r12), %r12d
movb %r12b, 0x24(%r14)
movl $0x1, 0x28(%r14)
movq %rdx, 0x38(%r14)
movq %rcx, 0x48(%r14)
movq %r15, (%r14)
movq %rsi, 0x8(%rsp)
movq %rsi, 0x10(%r14)
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movzwl %r12w, %ebp
movq %rax, 0x10(%rsp)
movq %rax, 0x18(%r14)
movq 0x10(%r15), %rax
movq %rax, (%rsp)
movq %r14, 0x18(%rsp)
movq 0x38(%r14), %r14
movq $0x0, (%r14)
testw %r12w, %r12w
movq %r13, 0x20(%rsp)
je 0x19bc83
movl %r12d, %r13d
xorl %ebx, %ebx
movq (%r14,%rbx,8), %r12
movq 0x8(%r15), %rdi
callq 0x19e077
cmpw %bx, %ax
jbe 0x19bd60
movq (%r15), %rax
movzbl %bl, %esi
movq %r15, %rdi
movq (%rsp), %rdx
movq 0x10(%rsp), %rcx
callq *0x8(%rax)
addq %r12, %rax
movq %rax, 0x8(%r14,%rbx,8)
incq %rbx
cmpq %rbx, %rbp
jne 0x19bc21
movq (%r14,%rbp,8), %rbx
decq %rbx
movl %r13d, %r12d
jmp 0x19bc8a
leaq 0x20717a(%rip), %rsi    # 0x3a2de9
movq %r14, %rdi
movl $0x85, %edx
callq 0x1045eb
xorl %ebx, %ebx
jmp 0x19bd4e
movq $-0x1, %rbx
movq 0x8(%r15), %rdi
callq 0x19e077
cmpw %r12w, %ax
jbe 0x19bd79
movq (%r15), %rax
movq %r15, %rdi
movl %ebp, %esi
movq (%rsp), %rdx
movq 0x10(%rsp), %rcx
callq *0x8(%rax)
addq %rbx, %rax
movq %rax, 0x8(%r14,%rbp,8)
cmpq (%r14,%rbp,8), %rax
jb 0x19bd7e
addb $0x2, %r12b
movzbl %r12b, %ebx
cmpq 0x8(%rsp), %rbx
jae 0x19bd21
addl $0x3, %ebp
leal -0x1(%rbp), %eax
movzbl %al, %eax
leal -0x1(%rax), %r13d
movq -0x8(%r14,%rax,8), %r12
movq 0x8(%r15), %rdi
callq 0x19e077
movzbl %r13b, %ecx
cmpw %cx, %ax
jbe 0x19bd65
movq (%r15), %rax
movzbl %r13b, %esi
movq %r15, %rdi
movq (%rsp), %rdx
movq 0x10(%rsp), %rcx
callq *0x8(%rax)
addq %r12, %rax
movq %rax, (%r14,%rbx,8)
movzbl %bpl, %ebx
incb %bpl
cmpq 0x8(%rsp), %rbx
jb 0x19bcd5
movq -0x8(%r14,%rbx,8), %rax
incq %rax
movq %rax, (%r14,%rbx,8)
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
cmpq %rcx, (%r14,%rax,8)
jne 0x19bd83
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x19b3fe
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5f798
callq 0x5f806
callq 0x5f8ab
callq 0x5f761
callq 0x173b0
callq 0x5f7cf
callq 0x5f874
callq 0x5f83d