// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0x146ae5
movq %rdx, %r14
movq %rsi, %r12
movq %rsi, %rdi
callq 0x14906a
movzwl %ax, %ebx
movl 0x4(%r12), %eax
shlq $0x2, %rax
leaq (%rax,%rbx,8), %rdi
addq $0x68, %rdi
leaq 0x1fc81f(%rip), %rsi    # 0x343160
pushq $0x7e
popq %rdx
callq 0x93160
movq %rax, %r15
andq $0x0, 0x50(%rax)
movq %r12, 0x8(%rax)
movq %r12, %rdi
callq 0x14906a
testw %ax, %ax
je 0x146abd
movl %eax, %ebp
movq %r14, 0x20(%rsp)
pushq $0x1
popq %rdx
movq %r12, %rdi
movl $0xfc, %esi
callq 0x149198
movq %r12, %rdi
callq 0x14906a
movzwl %bp, %ecx
incl %ecx
movzwl %ax, %eax
cmpl %eax, %ecx
jne 0x146b0f
leaq (%r15,%rbx,8), %rbx
addq $0x68, %rbx
movq %r15, %r14
addq $0x58, %r15
movq %r12, %rdi
callq 0x14906a
movzwl %ax, %r13d
movq %r12, %rdi
movl $0xfe, %esi
callq 0x146cd2
movzbl %al, %ebp
movb %bpl, 0x24(%r14)
movl $0x1, 0x28(%r14)
movq %r15, 0x38(%r14)
movq %rbx, 0x48(%r14)
movq 0x8(%rsp), %rbx
movq %rbx, (%r14)
movq %r13, 0x18(%rsp)
movq %r13, 0x10(%r14)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
movq %rax, %r13
movq %rax, 0x18(%r14)
movq 0x10(%rbx), %r12
movq %r14, 0x10(%rsp)
movq 0x38(%r14), %r15
andq $0x0, (%r15)
xorl %ebx, %ebx
cmpq %rbx, %rbp
je 0x146a31
movq (%r15,%rbx,8), %r14
movzbl %bl, %esi
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0x147ce6
addq %r14, %rax
movq %rax, 0x8(%r15,%rbx,8)
incq %rbx
jmp 0x146a08
movq (%r15,%rbp,8), %rbx
movq 0x8(%rsp), %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x147ce6
addq %rbx, %rax
decq %rax
movq %rax, 0x8(%r15,%rbp,8)
cmpq (%r15,%rbp,8), %rax
jb 0x146b39
leal 0x2(%rbp), %eax
movq 0x18(%rsp), %r14
movzbl %al, %ebp
cmpq %r14, %rbp
jae 0x146a93
leal -0x1(%rbp), %eax
movq -0x8(%r15,%rbp,8), %rbx
movzbl %al, %esi
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0x147ce6
addq %rbx, %rax
movq %rax, (%r15,%rbp,8)
leal 0x1(%rbp), %eax
jmp 0x146a64
movq -0x8(%r15,%rbp,8), %rax
incq %rax
movq %rax, (%r15,%rbp,8)
cmpq %r12, (%r15,%r14,8)
jne 0x146b63
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x145e47
jmp 0x146ad3
leaq 0x1fc69c(%rip), %rsi    # 0x343160
movq %r15, %rdi
movl $0x85, %edx
callq 0x936f9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2f147c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x19e51d(%rip), %rsi    # 0x2e5013
leaq 0x23a9a3(%rip), %rdx    # 0x3814a0
leaq 0x1fc64f(%rip), %rcx    # 0x343153
leaq 0x1fc655(%rip), %r8     # 0x343160
pushq $0x74
jmp 0x146b8b
movq 0x2f1452(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x19e4f3(%rip), %rsi    # 0x2e5013
leaq 0x1fcab0(%rip), %rdx    # 0x3435d7
leaq 0x1fca91(%rip), %rcx    # 0x3435bf
leaq 0x1fc62b(%rip), %r8     # 0x343160
pushq $0x40
jmp 0x146b8b
movq 0x2f1428(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x19e4c9(%rip), %rsi    # 0x2e5013
leaq 0x1fcab5(%rip), %rdx    # 0x343606
leaq 0x1fca67(%rip), %rcx    # 0x3435bf
leaq 0x1fc601(%rip), %r8     # 0x343160
pushq $0x54
jmp 0x146b8b
movq 0x2f13fe(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x19e49f(%rip), %rsi    # 0x2e5013
leaq 0x1fcaa4(%rip), %rdx    # 0x34361f
leaq 0x1fca3d(%rip), %rcx    # 0x3435bf
leaq 0x1fc5d7(%rip), %r8     # 0x343160
pushq $0x61
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390