// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/eis-seqranges.c
// Function: gt_SRLReadFromStream
struct seqRangeList *
gt_SRLReadFromStream(FILE *fp, const MRAEnc *alphabet,
                  enum SRLFeatures features, GT_UNUSED GtError *err)
{
  struct seqRangeList *newRangeList;
  size_t numRanges;
  gt_assert(fp && err);
  newRangeList = gt_malloc(sizeof (struct seqRangeList));
  newRangeList->alphabet = alphabet;
  newRangeList->symBits = requiredSymbolBits(gt_MRAEncGetSize(alphabet) - 1);
  if (newRangeList->symBits)
    newRangeList->maxRangeLen =
      (((GtUword)1) << (symLenStrBits - newRangeList->symBits)) - 1;
  else
    newRangeList->maxRangeLen = ~(GtUword)0;
  gt_xfread(&(newRangeList->numRanges), sizeof (newRangeList->numRanges), 1,
            fp);
  numRanges = newRangeList->numRanges;
  newRangeList->partialSymSums = NULL;
  newRangeList->ranges = gt_malloc(sizeof (struct seqRange) *
                                   (newRangeList->numRangesStorable
                                   = numRanges));
  gt_xfread(newRangeList->ranges, sizeof (struct seqRange), numRanges, fp);
  if (features & SRL_PARTIAL_SYMBOL_SUMS)
  {
    GtUword *partialSymSums;
    size_t numSyms = gt_MRAEncGetSize(alphabet), i;
    newRangeList->partialSymSums = partialSymSums =
     gt_malloc(sizeof (GtUword) * gt_MRAEncGetSize(alphabet) * numRanges);
    memset(partialSymSums, 0, sizeof (GtUword) * numSyms);
    for (i = 1; i < numRanges; ++i)
    {
      struct seqRange *lastRange = newRangeList->ranges + i - 1;
      Symbol lastSym = seqRangeSym(lastRange, newRangeList->symBits);
      memcpy(partialSymSums + i * numSyms, partialSymSums + (i - 1) * numSyms,
             sizeof (GtUword) * numSyms);
      partialSymSums[i * numSyms + lastSym] +=
        seqRangeLen(lastRange, newRangeList->symBits);
    }
  }
  return newRangeList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x2ae4c0
testq %rcx, %rcx
je 0x2ae4c0
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r13
leaq 0xd3c3c(%rip), %rsi     # 0x381f80
pushq $0x38
popq %rdi
movl $0x1de, %edx            # imm = 0x1DE
callq 0x93160
movq %rax, %rbx
movq %r12, 0x20(%rax)
movq %r12, %rdi
callq 0x14906a
decb %al
movzbl %al, %edi
callq 0x2ad656
movl %eax, 0x28(%rbx)
movl %eax, %ecx
negb %cl
pushq $-0x1
popq %rdx
shlq %cl, %rdx
xorl %ecx, %ecx
cmpl $0x1, %eax
sbbq %rcx, %rcx
notq %rdx
orq %rdx, %rcx
movq %rcx, 0x30(%rbx)
leaq 0x8(%rbx), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
movq %r13, %rcx
callq 0xb2fab
movq 0x8(%rbx), %r14
andq $0x0, 0x18(%rbx)
movq %r14, (%rbx)
movq %r14, %rdi
shlq $0x4, %rdi
leaq 0xd3bc7(%rip), %rsi     # 0x381f80
movl $0x1ec, %edx            # imm = 0x1EC
callq 0x93160
movq %rbx, (%rsp)
movq %rax, 0x10(%rbx)
pushq $0x10
popq %rsi
movq %rax, %rdi
movq %r14, 0x8(%rsp)
movq %r14, %rdx
movq %r13, %rcx
callq 0xb2fab
testb $0x1, %bpl
jne 0x2ae3fa
movq (%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x14906a
movl %eax, %ebp
movq %r12, %rdi
callq 0x14906a
movzwl %ax, %edi
imulq 0x8(%rsp), %rdi
shlq $0x3, %rdi
leaq 0xd3b60(%rip), %rsi     # 0x381f80
movl $0x1f3, %edx            # imm = 0x1F3
callq 0x93160
movq %rax, %rbx
movq (%rsp), %rax
movq %rbx, 0x18(%rax)
movzwl %bp, %edx
shll $0x3, %edx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movq %rdx, 0x10(%rsp)
callq 0x17380
movq (%rsp), %r12
cmpq 0x8(%rsp), %r15
jae 0x2ae3e7
movq 0x10(%r12), %rbp
addq %r14, %rbp
movl 0x28(%r12), %esi
movq %rbp, %rdi
callq 0x2adb53
movq %r15, 0x20(%rsp)
movl %eax, %r15d
movq %r14, 0x18(%rsp)
movq 0x10(%rsp), %r14
leaq (%rbx,%r14), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x17630
movl 0x28(%r12), %esi
movq %rbp, %rdi
callq 0x2adb40
movzbl %r15b, %ecx
movq 0x20(%rsp), %r15
leaq (%r14,%rcx,8), %rcx
movq 0x18(%rsp), %r14
addq %rax, (%rbx,%rcx)
incq %r15
addq $0x10, %r14
movq %r13, %rbx
jmp 0x2ae451
movq 0x189aa1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x36b42(%rip), %rsi     # 0x2e5013
leaq 0xd3bf0(%rip), %rdx     # 0x3820c8
leaq 0xd3bf3(%rip), %rcx     # 0x3820d2
leaq 0xd3a9a(%rip), %r8      # 0x381f80
movl $0x1dd, %r9d            # imm = 0x1DD
xorl %eax, %eax
callq 0x17a50
callq 0x17390