// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: fillViaequallength
static int fillViaequallength(GtEncseq *encseq,
                              GtDustMasker *dust_masker, /* NULL if not used */
                              GT_UNUSED Gtssptaboutinfo *ssptaboutinfo,
                              GtSequenceBuffer *fb,
                              GtError *err)
{
  GtUchar cc;
  char orig;
  GtUword pos,
          fillexceptionrangeidx = 0,
          mapposition = 0,
          nextcheckpos = GT_UNDEF_UWORD,
          pagenumber = 0,
          lastexceptionrangelength = 0;
  int retval;
  GtSWtable_uint32 *exceptiontable = &(encseq->exceptiontable.st_uint32);
  DECLARESEQBUFFER(encseq->twobitencoding); /* in fillViaequallength */
  gt_error_check(err);

  if (encseq->has_exceptiontable) {
    exceptiontable->positions = gt_malloc(sizeof (*exceptiontable->positions) *
                                         exceptiontable->numofpositionstostore);
    exceptiontable->rangelengths =
                               gt_malloc(sizeof(*exceptiontable->rangelengths) *
                                         exceptiontable->numofpositionstostore);
    exceptiontable->endidxinpage =
                               gt_malloc(sizeof(*exceptiontable->endidxinpage) *
                                         exceptiontable->numofpages);
    exceptiontable->mappositions =
                              gt_malloc(sizeof (*exceptiontable->mappositions) *
                                        exceptiontable->numofpositionstostore);

    nextcheckpos = exceptiontable->maxrangevalue;
  }
  gt_assert(encseq->equallength.defined);
  for (pos=0; /* Nothing */; pos++) {
    retval = gt_sequence_buffer_next_with_original(fb, dust_masker, &cc,
                                                   &orig, err);
    if (retval == 1) {
      if (encseq->has_exceptiontable && cc != (GtUchar) GT_SEPARATOR) {
        if (orig == encseq->maxchars[cc]) {
          if (lastexceptionrangelength > 0) {
            exceptiontable->rangelengths[fillexceptionrangeidx-1]
              = (uint32_t) (lastexceptionrangelength-1);
            lastexceptionrangelength = 0;
          }
        }
        else {
          /* at beginning of exception range */
          if (lastexceptionrangelength == 0) {
            /* store remainder of currentposition: this value is not larger
               than maxrangevalue and this can be stored in a page */
            exceptiontable->positions[fillexceptionrangeidx++]
              = (uint32_t) (pos & exceptiontable->maxrangevalue);
            exceptiontable->mappositions[fillexceptionrangeidx-1]
              = mapposition;
            lastexceptionrangelength = 1UL;
          }
          else /* extend exception range */ {
            if (lastexceptionrangelength == exceptiontable->maxrangevalue) {
              gt_assert(fillexceptionrangeidx > 0);
              exceptiontable->rangelengths[fillexceptionrangeidx-1]
                = (uint32_t) exceptiontable->maxrangevalue;
              lastexceptionrangelength = 0;
            }
            else {
              lastexceptionrangelength++;
            }
          }
          bitpackarray_store_uint32(encseq->exceptions,
                                   (BitOffset) mapposition,
                                   (uint32_t) encseq->subsymbolmap[(int) orig]);
          mapposition++;
        }
      }
      bitwise <<= 2;
      if (GT_ISNOTSPECIAL(cc))
        bitwise |= (GtTwobitencoding) cc;
      else {
        gt_assert(cc == (GtUchar) GT_SEPARATOR);
        bitwise |= (GtTwobitencoding) encseq->leastprobablecharacter;
      }
      if (widthbuffer < (GtUword) (GT_UNITSIN2BITENC - 1))
        widthbuffer++;
      else {
        *twobitencodingptr++ = bitwise;
        widthbuffer = 0;
        bitwise = 0;
      }
    }
    else {
      if (retval < 0)
        return -1;
      gt_assert(retval == 0);

      if (encseq->has_exceptiontable && lastexceptionrangelength > 0) {
        /* note that we store one less than the length to prevent overflows */
        gt_assert(fillexceptionrangeidx > 0 &&
                  fillexceptionrangeidx <=
                  exceptiontable->numofpositionstostore);
        exceptiontable->rangelengths[fillexceptionrangeidx-1]
          = (uint32_t) (lastexceptionrangelength-1);
      }
      break;
    }
    if (encseq->has_exceptiontable && pos == nextcheckpos) {
      exceptiontable->endidxinpage[pagenumber] = fillexceptionrangeidx;
      pagenumber++;
      nextcheckpos += 1UL + exceptiontable->maxrangevalue;
    }
  }
  if (encseq->has_exceptiontable) {
    while (pagenumber < exceptiontable->numofpages) {
      exceptiontable->endidxinpage[pagenumber] = fillexceptionrangeidx;
      pagenumber++;
    }
  }
  UPDATESEQBUFFERFINAL(bitwise, twobitencodingptr); /* in fillViaequallength */
  return 0;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
movq %rcx, 0x70(%rsp)
movq %r8, 0x68(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $-0x1, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x88(%rsp), %rax
addq $0x2f8, %rax            # imm = 0x2F8
movq %rax, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x117be0
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x288(%rax)
movq 0x88(%rsp), %rax
movq 0x288(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4c6a9(%rip), %rsi     # 0x18565e
movl $0x9ed, %edx            # imm = 0x9ED
callq 0xd2e0
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x280(%rax)
movq 0x88(%rsp), %rax
movq 0x280(%rax), %rax
movq 0x88(%rsp), %rcx
movq 0x288(%rcx), %rcx
subq $0x1, %rcx
movq $0x0, (%rax,%rcx,8)
movq 0x88(%rsp), %rax
movq 0x280(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x13905f
movq 0x68(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x139027
jmp 0x13905f
movq 0x7afaa(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2502e(%rip), %rsi     # 0x15e066
leaq 0x25609(%rip), %rdx     # 0x15e648
leaq 0x51475(%rip), %rcx     # 0x18a4bb
leaq 0x4c611(%rip), %r8      # 0x18565e
movl $0x9ee, %r9d            # imm = 0x9EE
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x139061
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x13912b
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x4c5d4(%rip), %rsi     # 0x18565e
movl $0x9f2, %edx            # imm = 0x9F2
callq 0xd2e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x4c5ab(%rip), %rsi     # 0x18565e
movl $0x9f5, %edx            # imm = 0x9F5
callq 0xd2e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4c581(%rip), %rsi     # 0x18565e
movl $0x9f8, %edx            # imm = 0x9F8
callq 0xd2e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4c557(%rip), %rsi     # 0x18565e
movl $0x9fb, %edx            # imm = 0x9FB
callq 0xd2e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x13912d
movq 0x88(%rsp), %rax
testb $0x1, 0x1e8(%rax)
jne 0x139176
movq 0x7ae93(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24f17(%rip), %rsi     # 0x15e066
leaq 0x4dc3a(%rip), %rdx     # 0x186d90
leaq 0x5135e(%rip), %rcx     # 0x18a4bb
leaq 0x4c4fa(%rip), %r8      # 0x18565e
movl $0x9ff, %r9d            # imm = 0x9FF
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x139178
movq $0x0, 0x58(%rsp)
movq 0x70(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x68(%rsp), %r8
leaq 0x67(%rsp), %rdx
leaq 0x66(%rsp), %rcx
callq 0x9bf60
movl %eax, 0x2c(%rsp)
cmpl $0x1, 0x2c(%rsp)
jne 0x139430
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x13935d
movzbl 0x67(%rsp), %eax
cmpl $0xff, %eax
je 0x13935d
movsbl 0x66(%rsp), %eax
movq 0x88(%rsp), %rcx
movq 0x348(%rcx), %rcx
movzbl 0x67(%rsp), %edx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x13922d
cmpq $0x0, 0x30(%rsp)
jbe 0x139228
movq 0x30(%rsp), %rax
subq $0x1, %rax
movl %eax, %edx
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
movq $0x0, 0x30(%rsp)
jmp 0x13935b
cmpq $0x0, 0x30(%rsp)
jne 0x13928a
movq 0x58(%rsp), %rax
movq 0x20(%rsp), %rcx
andq 0x30(%rcx), %rax
movl %eax, %edx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x50(%rsp)
movl %edx, (%rax,%rcx,4)
movq 0x48(%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq $0x1, 0x30(%rsp)
jmp 0x139319
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x30(%rcx), %rax
jne 0x139309
jmp 0x13929c
cmpq $0x0, 0x50(%rsp)
ja 0x1392dc
movq 0x7ad2d(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24db1(%rip), %rsi     # 0x15e066
leaq 0x51496(%rip), %rdx     # 0x18a752
leaq 0x511f8(%rip), %rcx     # 0x18a4bb
leaq 0x4c394(%rip), %r8      # 0x18565e
movl $0xa19, %r9d            # imm = 0xA19
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x1392de
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
movq $0x0, 0x30(%rsp)
jmp 0x139317
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x139319
movq 0x88(%rsp), %rax
movq 0x330(%rax), %rdi
movq 0x48(%rsp), %rsi
movq 0x88(%rsp), %rax
movq 0x358(%rax), %rax
movsbl 0x66(%rsp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
callq 0x13ca80
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x13935d
movq 0x18(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x18(%rsp)
movzbl 0x67(%rsp), %eax
cmpl $0xfe, %eax
jge 0x139388
movzbl 0x67(%rsp), %eax
orq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x1393e8
jmp 0x13938a
movzbl 0x67(%rsp), %eax
cmpl $0xff, %eax
je 0x1393ce
movq 0x7ac3b(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24cbf(%rip), %rsi     # 0x15e066
leaq 0x515c2(%rip), %rdx     # 0x18a970
leaq 0x51106(%rip), %rcx     # 0x18a4bb
leaq 0x4c2a2(%rip), %r8      # 0x18565e
movl $0xa2c, %r9d            # imm = 0xA2C
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x1393d0
movq 0x88(%rsp), %rax
movl 0x170(%rax), %eax
orq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x1f, 0x10(%rsp)
jae 0x139400
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x13942b
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
jmp 0x139519
cmpl $0x0, 0x2c(%rsp)
jge 0x139447
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x13960d
jmp 0x139449
cmpl $0x0, 0x2c(%rsp)
je 0x139488
movq 0x7ab81(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24c05(%rip), %rsi     # 0x15e066
leaq 0x51304(%rip), %rdx     # 0x18a76c
leaq 0x5104c(%rip), %rcx     # 0x18a4bb
leaq 0x4c1e8(%rip), %r8      # 0x18565e
movl $0xa3a, %r9d            # imm = 0xA3A
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13948a
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x139517
cmpq $0x0, 0x30(%rsp)
jbe 0x139517
jmp 0x1394a5
cmpq $0x0, 0x50(%rsp)
jbe 0x1394bd
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x28(%rcx), %rax
jbe 0x1394f5
movq 0x7ab14(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24b98(%rip), %rsi     # 0x15e066
leaq 0x512a3(%rip), %rdx     # 0x18a778
leaq 0x50fdf(%rip), %rcx     # 0x18a4bb
leaq 0x4c17b(%rip), %r8      # 0x18565e
movl $0xa40, %r9d            # imm = 0xA40
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x1394f7
movq 0x30(%rsp), %rax
subq $0x1, %rax
movl %eax, %edx
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x139587
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x139572
movq 0x58(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x139572
movq 0x50(%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
addq $0x1, %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x139574
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x139181
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x1395d3
jmp 0x13959a
movq 0x38(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x1395d1
movq 0x50(%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x13959a
jmp 0x1395d3
cmpq $0x0, 0x10(%rsp)
jbe 0x139602
movl $0x20, %ecx
subq 0x10(%rsp), %rcx
shlq %rcx
movq 0x18(%rsp), %rax
shlq %cl, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nopl (%rax)