// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: fillViabytecompress
static int fillViabytecompress(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;
  unsigned int numofchars;
  GtUchar cc;
  char orig;
  GtSWtable_uint32 *exceptiontable = &(encseq->exceptiontable.st_uint32);
  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;
  }
  numofchars = gt_alphabet_num_of_chars(encseq->alpha);
  encseq->bitpackarray
    = bitpackarray_new(gt_alphabet_bits_per_symbol(encseq->alpha),
                       (BitOffset) encseq->totallength, true);
  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)) {
        if (cc == (GtUchar) GT_SEPARATOR) {
          ssptaboutinfo_processseppos(ssptaboutinfo, currentposition);
          cc = (GtUchar) (numofchars+1);
        }
        else {
          cc = (GtUchar) numofchars;
        }
      }
      else {
        gt_assert(cc < (GtUchar) numofchars);
      }
      gt_assert(currentposition < encseq->totallength);
      ssptaboutinfo_processanyposition(ssptaboutinfo, currentposition);
      bitpackarray_store_uint32(encseq->bitpackarray,
                                (BitOffset) currentposition,
                                (uint32_t) cc);
    }
    else {
      if (retval < 0) {
        bitpackarray_delete(encseq->bitpackarray);
        encseq->bitpackarray = NULL;
        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);
      break;
    }
    if (encseq->has_exceptiontable && currentposition == nextcheckpos) {
      exceptiontable->endidxinpage[pagenumber] = fillexceptionrangeidx;
      pagenumber++;
      nextcheckpos += 1UL + exceptiontable->maxrangevalue;
    }
  }
  if (encseq->has_exceptiontable) {
    while (pagenumber < exceptiontable->numofpages) {
      exceptiontable->endidxinpage[pagenumber] = fillexceptionrangeidx;
      pagenumber++;
    }
  }
  ssptaboutinfo_finalize(ssptaboutinfo);
  return 0;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $-0x1, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x68(%rsp), %rax
addq $0x2f8, %rax            # imm = 0x2F8
movq %rax, (%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x1386f9
movq 0x48(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x1386c1
jmp 0x1386f9
movq 0x7b910(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x25994(%rip), %rsi     # 0x15e066
leaq 0x25f6f(%rip), %rdx     # 0x15e648
leaq 0x51d32(%rip), %rcx     # 0x18a412
leaq 0x4cf77(%rip), %r8      # 0x18565e
movl $0x927, %r9d            # imm = 0x927
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x1386fb
movq 0x68(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x1387b9
movq (%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x4cf3e(%rip), %rsi     # 0x18565e
movl $0x92b, %edx            # imm = 0x92B
callq 0xd2e0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x4cf17(%rip), %rsi     # 0x18565e
movl $0x92e, %edx            # imm = 0x92E
callq 0xd2e0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
movq (%rsp), %rax
movq 0x20(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4ceef(%rip), %rsi     # 0x18565e
movl $0x931, %edx            # imm = 0x931
callq 0xd2e0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4cec7(%rip), %rsi     # 0x18565e
movl $0x934, %edx            # imm = 0x934
callq 0xd2e0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq 0x220(%rax), %rdi
callq 0x109da0
movl %eax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq 0x220(%rax), %rdi
callq 0x109f00
movl %eax, %edi
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rsi
movl $0x1, %edx
callq 0x12da90
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2a0(%rax)
movq $0x0, 0x40(%rsp)
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x48(%rsp), %r8
leaq 0xf(%rsp), %rdx
leaq 0xe(%rsp), %rcx
callq 0x9bf60
movl %eax, 0x14(%rsp)
cmpl $0x1, 0x14(%rsp)
jne 0x138ad9
movq 0x68(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x1389d2
movzbl 0xf(%rsp), %eax
cmpl $0xff, %eax
je 0x1389d2
movsbl 0xe(%rsp), %eax
movq 0x68(%rsp), %rcx
movq 0x348(%rcx), %rcx
movzbl 0xf(%rsp), %edx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x1388ae
cmpq $0x0, 0x18(%rsp)
jbe 0x1388a9
movq 0x18(%rsp), %rax
subq $0x1, %rax
movl %eax, %edx
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
movq $0x0, 0x18(%rsp)
jmp 0x1389d0
cmpq $0x0, 0x18(%rsp)
jne 0x138908
movq 0x40(%rsp), %rax
movq (%rsp), %rcx
andq 0x30(%rcx), %rax
movl %eax, %edx
movq (%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x38(%rsp)
movl %edx, (%rax,%rcx,4)
movq 0x30(%rsp), %rdx
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq $0x1, 0x18(%rsp)
jmp 0x138994
movq 0x18(%rsp), %rax
movq (%rsp), %rcx
cmpq 0x30(%rcx), %rax
jne 0x138984
jmp 0x138919
cmpq $0x0, 0x38(%rsp)
ja 0x138959
movq 0x7b6b0(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x25734(%rip), %rsi     # 0x15e066
leaq 0x51e19(%rip), %rdx     # 0x18a752
leaq 0x51ad2(%rip), %rcx     # 0x18a412
leaq 0x4cd17(%rip), %r8      # 0x18565e
movl $0x954, %r9d            # imm = 0x954
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13895b
movq (%rsp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
movq $0x0, 0x18(%rsp)
jmp 0x138992
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x138994
movq 0x68(%rsp), %rax
movq 0x330(%rax), %rdi
movq 0x30(%rsp), %rsi
movq 0x68(%rsp), %rax
movq 0x358(%rax), %rax
movsbl 0xe(%rsp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
callq 0x13ca80
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x1389d2
movzbl 0xf(%rsp), %eax
cmpl $0xfe, %eax
jl 0x138a10
movzbl 0xf(%rsp), %eax
cmpl $0xff, %eax
jne 0x138a06
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x11ba00
movl 0x10(%rsp), %eax
addl $0x1, %eax
movb %al, 0xf(%rsp)
jmp 0x138a0e
movl 0x10(%rsp), %eax
movb %al, 0xf(%rsp)
jmp 0x138a5e
jmp 0x138a12
movzbl 0xf(%rsp), %eax
movl 0x10(%rsp), %ecx
movzbl %cl, %ecx
cmpl %ecx, %eax
jl 0x138a5a
movq 0x7b5af(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x25633(%rip), %rsi     # 0x15e066
leaq 0x51ef6(%rip), %rdx     # 0x18a930
leaq 0x519d1(%rip), %rcx     # 0x18a412
leaq 0x4cc16(%rip), %r8      # 0x18565e
movl $0x96c, %r9d            # imm = 0x96C
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x138a5c
jmp 0x138a5e
jmp 0x138a60
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x30(%rcx), %rax
jb 0x138aa8
movq 0x7b561(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x255e5(%rip), %rsi     # 0x15e066
leaq 0x51ec2(%rip), %rdx     # 0x18a94a
leaq 0x51983(%rip), %rcx     # 0x18a412
leaq 0x4cbc8(%rip), %r8      # 0x18565e
movl $0x96e, %r9d            # imm = 0x96E
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x138aaa
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x11bb30
movq 0x68(%rsp), %rax
movq 0x2a0(%rax), %rdi
movq 0x40(%rsp), %rsi
movzbl 0xf(%rsp), %edx
callq 0x13ca80
jmp 0x138bdb
cmpl $0x0, 0x14(%rsp)
jge 0x138b0e
movq 0x68(%rsp), %rax
movq 0x2a0(%rax), %rdi
callq 0x118a70
movq 0x68(%rsp), %rax
movq $0x0, 0x2a0(%rax)
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x138c9d
movq 0x68(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x138b96
cmpq $0x0, 0x18(%rsp)
jbe 0x138b96
jmp 0x138b26
cmpq $0x0, 0x38(%rsp)
jbe 0x138b3d
movq 0x38(%rsp), %rax
movq (%rsp), %rcx
cmpq 0x28(%rcx), %rax
jbe 0x138b75
movq 0x7b494(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x25518(%rip), %rsi     # 0x15e066
leaq 0x51c23(%rip), %rdx     # 0x18a778
leaq 0x518b6(%rip), %rcx     # 0x18a412
leaq 0x4cafb(%rip), %r8      # 0x18565e
movl $0x97e, %r9d            # imm = 0x97E
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x138b77
movq 0x18(%rsp), %rax
subq $0x1, %rax
movl %eax, %edx
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x138b98
cmpl $0x0, 0x14(%rsp)
je 0x138bd7
movq 0x7b432(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x254b6(%rip), %rsi     # 0x15e066
leaq 0x51bb5(%rip), %rdx     # 0x18a76c
leaq 0x51854(%rip), %rcx     # 0x18a412
leaq 0x4ca99(%rip), %r8      # 0x18565e
movl $0x982, %r9d            # imm = 0x982
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x138bd9
jmp 0x138c44
movq 0x68(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x138c2f
movq 0x40(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x138c2f
movq 0x38(%rsp), %rdx
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq (%rsp), %rax
movq 0x30(%rax), %rax
addq $0x1, %rax
addq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x138c31
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x13880c
movq 0x68(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x138c8b
jmp 0x138c54
movq 0x20(%rsp), %rax
movq (%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x138c89
movq 0x38(%rsp), %rdx
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x138c54
jmp 0x138c8b
movq 0x58(%rsp), %rdi
callq 0x11bb80
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)