// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/bare-encseq.c
// Function: gt_bare_encseq_new
GtBareEncseq *gt_bare_encseq_new(GtUchar *sequence,GtUword len,
                                 GtUword numofchars)
{
  GtBareEncseq *bare_encseq = gt_malloc(sizeof *bare_encseq);
  const GtUchar *readptr;
  GtBareSpecialrange *srptr = NULL;
  GtUword lastspecialrange_length = 0;

  bare_encseq->specialcharacters = 0;
  bare_encseq->numofchars = numofchars;
  bare_encseq->charcount = gt_calloc((size_t) bare_encseq->numofchars,
                                     sizeof *bare_encseq->charcount);
  GT_INITARRAY(&bare_encseq->specialranges,GtBareSpecialrange);
  for (readptr = sequence; readptr < sequence + len; readptr++)
  {
    GtUchar cc = *readptr;
    if (GT_ISSPECIAL(cc))
    {
      if (lastspecialrange_length == 0)
      {
        GT_GETNEXTFREEINARRAY(srptr,&bare_encseq->specialranges,
                              GtBareSpecialrange,128UL);
        srptr->start = (GtUword) (readptr - sequence);
      }
      lastspecialrange_length++;
      bare_encseq->specialcharacters++;
    } else
    {
      gt_assert((GtUword) cc < bare_encseq->numofchars);
      bare_encseq->charcount[(int) cc]++;
      if (lastspecialrange_length > 0)
      {
        gt_assert(srptr != NULL);
        srptr->length = lastspecialrange_length;
      }
      lastspecialrange_length = 0;
    }
  }
  if (lastspecialrange_length > 0)
  {
    gt_assert(srptr != NULL);
    srptr->length = lastspecialrange_length;
  }
  bare_encseq->sequence = sequence;
  bare_encseq->totallength = len;
  return bare_encseq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x21397e(%rip), %r13    # 0x39e11f
movl $0x40, %edi
movq %r13, %rsi
movl $0x39, %edx
callq 0x104226
movq %rax, %r15
xorl %ebp, %ebp
movq %rbp, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x8, %esi
movq %r12, %rdi
movq %r13, %rdx
movl $0x41, %ecx
callq 0x10436a
movq %rax, 0x20(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r15)
movq %rbp, 0x38(%r15)
testq %rbx, %rbx
jle 0x18a8a8
leaq (%r14,%rbx), %r13
xorl %ebp, %ebp
xorl %eax, %eax
xorl %edi, %edi
xorl %ecx, %ecx
xorl %r12d, %r12d
movzbl (%r14,%rbp), %edx
cmpq $0xfe, %rdx
jb 0x18a868
testq %r12, %r12
jne 0x18a85f
movq 0x30(%r15), %rsi
cmpq %rsi, 0x38(%r15)
jb 0x18a83b
subq $-0x80, %rsi
movq %rsi, 0x30(%r15)
shlq $0x4, %rsi
leaq 0x2138f2(%rip), %rdx    # 0x39e11f
movl $0x4b, %ecx
callq 0x104461
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x18a8cb
movq 0x38(%r15), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, 0x38(%r15)
shlq $0x4, %rdx
leaq (%rax,%rdx), %rcx
movq %rbp, (%rax,%rdx)
movq %rax, %rdi
incq %r12
incq 0x10(%r15)
jmp 0x18a887
cmpq %rdx, 0x18(%r15)
jbe 0x18a8c1
movq 0x20(%r15), %rsi
incq (%rsi,%rdx,8)
testq %r12, %r12
je 0x18a884
testq %rcx, %rcx
je 0x18a8c6
movq %r12, 0x8(%rcx)
xorl %r12d, %r12d
leaq (%r14,%rbp), %rdx
incq %rdx
incq %rbp
cmpq %r13, %rdx
jb 0x18a7fd
testq %r12, %r12
je 0x18a8a8
testq %rcx, %rcx
je 0x18a8d0
movq %r12, 0x8(%rcx)
movq %r14, (%r15)
movq %rbx, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5b5be
callq 0x5b5f5
callq 0x5b663
callq 0x5b62c