// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: fillViabitaccess
static int fillViabitaccess(GtEncseq *encseq,
                            GtDustMasker *dust_masker, /* NULL if not used */
                            Gtssptaboutinfo *ssptaboutinfo,
                            GtSequenceBuffer *fb, GtError *err)
{
   GtUword currentposition,
                fillexceptionrangeidx = 0,
                mapposition = 0,
                nextcheckpos = GT_UNDEF_UWORD,
                pagenumber = 0,
                lastexceptionrangelength = 0;
  int retval;
  GtUchar cc;
  char orig;
  GtSWtable_uint32 *exceptiontable = &(encseq->exceptiontable.st_uint32);
  DECLARESEQBUFFER(encseq->twobitencoding); /* in fillViabitaccess */
  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_INITBITTAB(encseq->specialbits, encseq->totallength + GT_INTWORDSIZE);
  for (currentposition = encseq->totallength;
       currentposition < encseq->totallength + GT_INTWORDSIZE;
       currentposition++) {
    GT_SETIBIT(encseq->specialbits, currentposition);
  }
  for (currentposition=0; /* Nothing */; currentposition++) {
    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) (currentposition & 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++;
        }
      }
      if (GT_ISSPECIAL(cc)) {
        GT_SETIBIT(encseq->specialbits, currentposition);
        if (cc == (GtUchar) GT_SEPARATOR)
          ssptaboutinfo_processseppos(ssptaboutinfo, currentposition);
      }
      ssptaboutinfo_processanyposition(ssptaboutinfo, currentposition);
      bitwise <<= 2;
      if (GT_ISNOTSPECIAL(cc))
        bitwise |= (GtTwobitencoding) cc;
      else {
        if (cc == (GtUchar) GT_SEPARATOR)
          bitwise |= (GtTwobitencoding) GT_TWOBITS_FOR_SEPARATOR;
      }
      if (widthbuffer < (GtUword) (GT_UNITSIN2BITENC - 1))
        widthbuffer++;
      else {
        *twobitencodingptr++ = bitwise;
        widthbuffer = 0;
        bitwise = 0;
      }
    }
    else {
      if (retval < 0)
        return -1;
      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);
      }
      gt_assert(retval == 0);
      if (encseq->has_exceptiontable && currentposition == nextcheckpos) {
        exceptiontable->endidxinpage[pagenumber] = fillexceptionrangeidx;
        pagenumber++;
      }
      break;
    }
  }
  if (encseq->has_exceptiontable) {
    while (pagenumber < exceptiontable->numofpages) {
      exceptiontable->endidxinpage[pagenumber] = fillexceptionrangeidx;
      pagenumber++;
    }
  }
  UPDATESEQBUFFERFINAL(bitwise, twobitencodingptr); /* in fillViabitaccess */
  ssptaboutinfo_finalize(ssptaboutinfo);
  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, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq $-0x1, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x88(%rsp), %rax
addq $0x2f8, %rax            # imm = 0x2F8
movq %rax, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%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 0x4bc29(%rip), %rsi     # 0x18565e
movl $0xac7, %edx            # imm = 0xAC7
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, 0x10(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x139adf
movq 0x68(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x139aa7
jmp 0x139adf
movq 0x7a52a(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x245ae(%rip), %rsi     # 0x15e066
leaq 0x24b89(%rip), %rdx     # 0x15e648
leaq 0x50a62(%rip), %rcx     # 0x18a528
leaq 0x4bb91(%rip), %r8      # 0x18565e
movl $0xac8, %r9d            # imm = 0xAC8
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x139ae1
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x139bab
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x4bb54(%rip), %rsi     # 0x18565e
movl $0xacc, %edx            # imm = 0xACC
callq 0xd2e0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x4bb2b(%rip), %rsi     # 0x18565e
movl $0xacf, %edx            # imm = 0xACF
callq 0xd2e0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4bb01(%rip), %rsi     # 0x18565e
movl $0xad2, %edx            # imm = 0xAD2
callq 0xd2e0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4bad7(%rip), %rsi     # 0x18565e
movl $0xad5, %edx            # imm = 0xAD5
callq 0xd2e0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rax
addq $0x40, %rax
shrq $0x6, %rax
cmpq $0x0, %rax
jne 0x139bd0
movl $0x1, %eax
movq %rax, (%rsp)
jmp 0x139bf0
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rax
addq $0x40, %rax
subq $0x1, %rax
shrq $0x6, %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
shlq $0x3, %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0x4ba51(%rip), %rdx     # 0x18565e
movl $0xada, %ecx            # imm = 0xADA
callq 0xd730
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x2b0(%rax)
movq 0x88(%rsp), %rax
movq 0x2b0(%rax), %rdi
movq 0x8(%rsp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0xb2d0
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x88(%rsp), %rcx
movq 0x30(%rcx), %rcx
addq $0x40, %rcx
cmpq %rcx, %rax
jae 0x139cb9
movq 0x60(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x88(%rsp), %rax
movq 0x2b0(%rax), %rax
movq 0x60(%rsp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x139c59
movq $0x0, 0x60(%rsp)
movq 0x70(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x68(%rsp), %r8
leaq 0x33(%rsp), %rdx
leaq 0x32(%rsp), %rcx
callq 0x9bf60
movl %eax, 0x34(%rsp)
cmpl $0x1, 0x34(%rsp)
jne 0x139f9b
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x139e9e
movzbl 0x33(%rsp), %eax
cmpl $0xff, %eax
je 0x139e9e
movsbl 0x32(%rsp), %eax
movq 0x88(%rsp), %rcx
movq 0x348(%rcx), %rcx
movzbl 0x33(%rsp), %edx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x139d6e
cmpq $0x0, 0x38(%rsp)
jbe 0x139d69
movq 0x38(%rsp), %rax
subq $0x1, %rax
movl %eax, %edx
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
movq $0x0, 0x38(%rsp)
jmp 0x139e9c
cmpq $0x0, 0x38(%rsp)
jne 0x139dcb
movq 0x60(%rsp), %rax
movq 0x28(%rsp), %rcx
andq 0x30(%rcx), %rax
movl %eax, %edx
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x58(%rsp)
movl %edx, (%rax,%rcx,4)
movq 0x50(%rsp), %rdx
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq $0x1, 0x38(%rsp)
jmp 0x139e5a
movq 0x38(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq 0x30(%rcx), %rax
jne 0x139e4a
jmp 0x139ddd
cmpq $0x0, 0x58(%rsp)
ja 0x139e1d
movq 0x7a1ec(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24270(%rip), %rsi     # 0x15e066
leaq 0x50955(%rip), %rdx     # 0x18a752
leaq 0x50724(%rip), %rcx     # 0x18a528
leaq 0x4b853(%rip), %r8      # 0x18565e
movl $0xaf9, %r9d            # imm = 0xAF9
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x139e1f
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
movq $0x0, 0x38(%rsp)
jmp 0x139e58
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x139e5a
movq 0x88(%rsp), %rax
movq 0x330(%rax), %rdi
movq 0x50(%rsp), %rsi
movq 0x88(%rsp), %rax
movq 0x358(%rax), %rax
movsbl 0x32(%rsp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
callq 0x13ca80
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x139e9e
movzbl 0x33(%rsp), %eax
cmpl $0xfe, %eax
jl 0x139efd
movq 0x60(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x88(%rsp), %rax
movq 0x2b0(%rax), %rax
movq 0x60(%rsp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movzbl 0x33(%rsp), %eax
cmpl $0xff, %eax
jne 0x139efb
movq 0x78(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x11ba00
jmp 0x139efd
movq 0x78(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x11bb30
movq 0x20(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x20(%rsp)
movzbl 0x33(%rsp), %eax
cmpl $0xfe, %eax
jge 0x139f37
movzbl 0x33(%rsp), %eax
orq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x139f53
movzbl 0x33(%rsp), %eax
cmpl $0xff, %eax
jne 0x139f51
movq 0x20(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x139f53
cmpq $0x1f, 0x18(%rsp)
jae 0x139f6b
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x139f96
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
jmp 0x13a0c6
cmpl $0x0, 0x34(%rsp)
jge 0x139fb2
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x13a16b
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x13a03f
cmpq $0x0, 0x38(%rsp)
jbe 0x13a03f
jmp 0x139fcd
cmpq $0x0, 0x58(%rsp)
jbe 0x139fe5
movq 0x58(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq 0x28(%rcx), %rax
jbe 0x13a01d
movq 0x79fec(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x24070(%rip), %rsi     # 0x15e066
leaq 0x5077b(%rip), %rdx     # 0x18a778
leaq 0x50524(%rip), %rcx     # 0x18a528
leaq 0x4b653(%rip), %r8      # 0x18565e
movl $0xb24, %r9d            # imm = 0xB24
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13a01f
movq 0x38(%rsp), %rax
subq $0x1, %rax
movl %eax, %edx
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x13a041
cmpl $0x0, 0x34(%rsp)
je 0x13a080
movq 0x79f89(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2400d(%rip), %rsi     # 0x15e066
leaq 0x5070c(%rip), %rdx     # 0x18a76c
leaq 0x504c1(%rip), %rcx     # 0x18a528
leaq 0x4b5f0(%rip), %r8      # 0x18565e
movl $0xb28, %r9d            # imm = 0xB28
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13a082
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x13a0c4
movq 0x60(%rsp), %rax
cmpq 0x48(%rsp), %rax
jne 0x13a0c4
movq 0x58(%rsp), %rdx
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x13a0db
jmp 0x13a0c8
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x139cc2
movq 0x88(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x13a127
jmp 0x13a0ee
movq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x13a125
movq 0x58(%rsp), %rdx
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x13a0ee
jmp 0x13a127
cmpq $0x0, 0x18(%rsp)
jbe 0x13a156
movl $0x20, %ecx
subq 0x18(%rsp), %rcx
shlq %rcx
movq 0x20(%rsp), %rax
shlq %cl, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x78(%rsp), %rdi
callq 0x11bb80
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nopw (%rax,%rax)