// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
testq %rdi, %rdi
je 0x3194c4
testq %rcx, %rcx
je 0x3194c4
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
leaq 0xd1f52(%rip), %r13     # 0x3eb291
movl $0x38, %edi
movq %r13, %rsi
movl $0x1de, %edx            # imm = 0x1DE
callq 0x1092b2
movq %rax, %rbx
movq %r15, 0x20(%rax)
movq %r15, %rdi
callq 0x1a67a7
decl %eax
movzbl %al, %edi
callq 0x2f9d04
movl %eax, 0x28(%rbx)
movl %eax, %ecx
negb %cl
movq $-0x1, %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
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x125604
movq 0x8(%rbx), %r14
movq $0x0, 0x18(%rbx)
movq %r14, (%rbx)
movq %r14, %rdi
shlq $0x4, %rdi
movq %r13, %rsi
movl $0x1ec, %edx            # imm = 0x1EC
callq 0x1092b2
movq %rax, 0x10(%rbx)
movl $0x10, %esi
movq %rax, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x125604
testb $0x1, %bpl
je 0x3194b2
movq %r15, %rdi
callq 0x1a67a7
movl %eax, %ebp
movq %r15, %rdi
callq 0x1a67a7
movzwl %ax, %edi
imulq %r14, %rdi
shlq $0x3, %rdi
leaq 0xd1e86(%rip), %rsi     # 0x3eb291
movl $0x1f3, %edx            # imm = 0x1F3
callq 0x1092b2
movq %rax, %r12
movq %rax, 0x18(%rbx)
movzwl %bp, %r13d
shll $0x3, %r13d
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x173a0
cmpq $0x2, %r14
jb 0x3194b2
decq %r14
movl $0x8, %r15d
movq %r14, 0x10(%rsp)
movl 0x28(%rbx), %edx
movq %r13, %r14
movq 0x10(%rbx), %r13
addq %r15, %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x2fddcc
movb %al, 0xf(%rsp)
movq %rbx, %rbp
leaq (%r12,%r14), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x17660
movl 0x28(%rbp), %esi
movl $0x40, %edx
subl %esi, %edx
movq %r13, %rdi
movq %r14, %r13
movq 0x10(%rsp), %r14
callq 0x2fcc2c
movzbl 0xf(%rsp), %ecx
leaq (,%rcx,8), %rcx
addq %r13, %rcx
addq %rax, (%r12,%rcx)
addq $0x10, %r15
movq %rbx, %r12
movq %rbp, %rbx
decq %r14
jne 0x319440
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x92424