// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/eis-seqranges.c
// Function: gt_SRLAppendNewRange
void
gt_SRLAppendNewRange(struct seqRangeList *rangeList,
                  GtUword pos,
                  GtUword len,
                  Symbol esym)
{
  gt_assert(rangeList);
  if (len)
  {
    Symbol sym = MRAEncMapSymbol(rangeList->alphabet, esym);
    struct seqRange *p;
    GtUword *pSums;
    size_t numRanges = rangeList->numRanges,
      numSyms = gt_MRAEncGetSize(rangeList->alphabet),
      numNewRanges = len/rangeList->maxRangeLen
      + ((len%rangeList->maxRangeLen)?1:0);
    unsigned symBits = rangeList->symBits;
    if (numRanges + numNewRanges > rangeList->numRangesStorable)
    {
      size_t newSize = numRanges + 2 * numNewRanges;
      rangeList->ranges = gt_realloc(rangeList->ranges,
                                     sizeof (struct seqRange) * newSize);
      if (rangeList->partialSymSums)
        rangeList->partialSymSums =
          gt_realloc(rangeList->partialSymSums, sizeof (GtUword)
                     * numSyms * newSize);
      rangeList->numRangesStorable = newSize;
    }
    p = rangeList->ranges + numRanges;
    if (rangeList->partialSymSums)
      pSums = rangeList->partialSymSums + numSyms * numRanges;
    else
      pSums = NULL;
    while (len > rangeList->maxRangeLen)
    {
      p->startPos = pos;
      seqRangeSetSym(p, sym, symBits);
      seqRangeSetLen(p, rangeList->maxRangeLen, symBits);
      pos += rangeList->maxRangeLen;
      len -= rangeList->maxRangeLen;
      if (numRanges && pSums)
      {
        GtUword *spDest = pSums, *spSrc = pSums - numSyms;
        size_t i;
        for (i = 0; i < numSyms; ++i)
        {
          *spDest++ = *spSrc++;
        }
        pSums[seqRangeSym(p - 1, symBits)] += seqRangeLen(p - 1, symBits);
        pSums += numSyms;
      }
      else if (pSums)
      {
        memset(pSums, 0, sizeof (GtUword) * numSyms);
        pSums += numSyms;
      }
      ++p;
      ++numRanges;
    }
    if (len)
    {
      p->startPos = pos;
      seqRangeSetSym(p, sym, symBits);
      seqRangeSetLen(p, len, symBits);
      if (numRanges && pSums)
      {
        GtUword *spDest = pSums, *spSrc = pSums - numSyms;
        size_t i;
        for (i = 0; i < numSyms; ++i)
        {
          *spDest++ = *spSrc++;
        }
        pSums[seqRangeSym(p - 1, symBits)] += seqRangeLen(p - 1, symBits);
        pSums += numSyms;
      }
      else if (pSums)
      {
        memset(pSums, 0, sizeof (GtUword) * numSyms);
        pSums += numSyms;
      }
      ++numRanges;
    }
    gt_assert(numRanges == rangeList->numRanges + numNewRanges);
    rangeList->numRanges = numRanges;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0x2ada94
movq %rdx, %rbx
testq %rdx, %rdx
je 0x2ada85
movq %rsi, 0x28(%rsp)
movq 0x8(%rsp), %r15
movq 0x20(%r15), %rdi
movzbl %cl, %esi
callq 0x2adaf8
movl %eax, %ebp
movq 0x8(%r15), %r12
movq 0x20(%r15), %rdi
callq 0x14906a
movl %eax, %ecx
movq %rbx, 0x38(%rsp)
movq %rbx, %rax
xorl %edx, %edx
divq 0x30(%r15)
movq %rax, %r14
movzwl %cx, %eax
movq %rax, 0x20(%rsp)
cmpq $0x1, %rdx
sbbq $-0x1, %r14
movl 0x28(%r15), %ecx
movq %r12, 0x18(%rsp)
leaq (%r14,%r12), %rax
cmpq (%r15), %rax
movq %r14, 0x40(%rsp)
movl %ecx, 0x14(%rsp)
jbe 0x2ad86b
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %rax
leaq (%rax,%r14,2), %r12
movq 0x8(%rsp), %r13
movq 0x10(%r13), %rdi
movq %r12, %rsi
shlq $0x4, %rsi
leaq 0xd474f(%rip), %rdx     # 0x381f80
pushq $0x65
popq %rcx
callq 0x93472
movq %rax, 0x10(%r13)
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0x2ad87b
imulq %r12, %rbx
shlq $0x3, %rbx
leaq 0xd472b(%rip), %rdx     # 0x381f80
pushq $0x69
popq %rcx
movq %rbx, %rsi
callq 0x93472
movq 0x8(%rsp), %rcx
movq %rax, 0x18(%rcx)
jmp 0x2ad87d
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rdx
jmp 0x2ad88a
xorl %eax, %eax
movq 0x28(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %r12, (%rcx)
movq 0x18(%rsp), %rsi
movq %rsi, %rbx
shlq $0x4, %rbx
movq 0x8(%rsp), %rcx
addq 0x10(%rcx), %rbx
movq %rsi, %rcx
movq 0x20(%rsp), %rsi
imulq %rsi, %rcx
testq %rax, %rax
leaq (%rax,%rcx,8), %r13
cmoveq %rax, %r13
leal (,%rsi,8), %r15d
movq %r15, 0x48(%rsp)
negq %r15
movzbl %bpl, %eax
movl %eax, 0x34(%rsp)
movq 0x38(%rsp), %r14
movq 0x8(%rsp), %rax
cmpq 0x30(%rax), %r14
jbe 0x2ad9b6
movq %rdx, 0x28(%rsp)
movq %rdx, (%rbx)
movq %rbx, %rdi
movl 0x34(%rsp), %esi
movl 0x14(%rsp), %ebp
movl %ebp, %edx
callq 0x2adb1e
movq %rbx, %rdi
movq 0x8(%rsp), %r12
movq 0x30(%r12), %rsi
movl %ebp, %edx
callq 0x2adb2b
movq %r13, %rcx
movq 0x30(%r12), %r12
cmpq $0x0, 0x18(%rsp)
je 0x2ad93d
testq %rcx, %rcx
je 0x2ad93d
movq 0x20(%rsp), %rax
subq $0x1, %rax
jb 0x2ad953
movq (%rcx,%r15), %rdx
movq %rdx, (%rcx)
addq $0x8, %rcx
jmp 0x2ad92a
testq %rcx, %rcx
je 0x2ad9b1
movq %r13, %rdi
xorl %esi, %esi
movq 0x48(%rsp), %rdx
callq 0x17380
jmp 0x2ad98e
movq %r14, 0x38(%rsp)
movl 0x14(%rsp), %r14d
leaq -0x10(%rbx), %rbp
movq %rbp, %rdi
movl %r14d, %esi
callq 0x2adb40
movq %rax, 0x50(%rsp)
movq %rbp, %rdi
movl %r14d, %esi
movq 0x38(%rsp), %r14
callq 0x2adb53
movzbl %al, %eax
movq 0x50(%rsp), %rcx
addq %rcx, (%r13,%rax,8)
movq 0x20(%rsp), %rax
leaq (%r13,%rax,8), %r13
movq 0x28(%rsp), %rdx
addq %r12, %rdx
subq %r12, %r14
addq $0x10, %rbx
incq 0x18(%rsp)
jmp 0x2ad8d3
xorl %r13d, %r13d
jmp 0x2ad998
testq %r14, %r14
je 0x2ada1e
movq %rdx, (%rbx)
movq %rbx, %rdi
movl 0x34(%rsp), %esi
movl 0x14(%rsp), %ebp
movl %ebp, %edx
callq 0x2adb1e
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2adb2b
movq %r13, %rdi
cmpq $0x0, 0x18(%rsp)
movq 0x40(%rsp), %r14
je 0x2ada25
testq %rdi, %rdi
je 0x2ada25
movq 0x20(%rsp), %rax
leal (,%rax,8), %eax
negq %rax
movq %rdi, %rcx
movl 0x14(%rsp), %r12d
subq $0x1, 0x20(%rsp)
jb 0x2ada38
movq (%rcx,%rax), %rdx
movq %rdx, (%rcx)
addq $0x8, %rcx
jmp 0x2ada09
movq 0x40(%rsp), %r14
jmp 0x2ada67
testq %rdi, %rdi
je 0x2ada62
xorl %esi, %esi
movq 0x48(%rsp), %rdx
callq 0x17380
jmp 0x2ada62
movq %rbx, %r13
addq $-0x10, %r13
movq %rdi, %r15
movq %r13, %rdi
movl %r12d, %esi
callq 0x2adb40
movq %rax, %rbx
movq %r13, %rdi
movl %r12d, %esi
callq 0x2adb53
movzbl %al, %eax
addq %rbx, (%r15,%rax,8)
incq 0x18(%rsp)
movq 0x8(%rsp), %rax
addq 0x8(%rax), %r14
cmpq %r14, 0x18(%rsp)
jne 0x2adac0
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18a4cd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3756e(%rip), %rsi     # 0x2e5013
leaq 0xd44ee(%rip), %rdx     # 0x381f9a
leaq 0xd4515(%rip), %rcx     # 0x381fc8
leaq 0xd44c6(%rip), %r8      # 0x381f80
pushq $0x56
popq %r9
jmp 0x2adaec
movq 0x18a4a1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37542(%rip), %rsi     # 0x2e5013
leaq 0xd4505(%rip), %rdx     # 0x381fdd
leaq 0xd44e9(%rip), %rcx     # 0x381fc8
leaq 0xd449a(%rip), %r8      # 0x381f80
movl $0xa2, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390