// File: /workspace/github_c_makefile_star2_O1/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, %rbp
movq %rdi, %r14
leaq 0x214846(%rip), %rbx    # 0x3a7617
movl $0x40, %edi
movq %rbx, %rsi
movl $0x39, %edx
callq 0x1092b2
movq %rax, %r15
xorl %r13d, %r13d
movq %r13, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x8, %esi
movq %r12, %rdi
movq %rbx, %rdx
movl $0x41, %ecx
callq 0x1093ef
movq %rax, 0x20(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r15)
movq %r13, 0x38(%r15)
testq %rbp, %rbp
movq %rbp, (%rsp)
jle 0x192edc
movq %r15, %rdi
addq $0x28, %rdi
leaq (%r14,%rbp), %r12
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movzbl (%r14,%rbx), %eax
cmpq $0xfe, %rax
jb 0x192ea9
testq %rbp, %rbp
jne 0x192ea0
movq 0x30(%r15), %rsi
cmpq %rsi, 0x38(%r15)
jb 0x192e7c
subq $-0x80, %rsi
movq %rsi, 0x30(%r15)
movq %rdi, %r13
movq 0x28(%r15), %rdi
shlq $0x4, %rsi
leaq 0x2147ac(%rip), %rdx    # 0x3a7617
movl $0x4b, %ecx
callq 0x1094e6
movq %r13, %rdi
movq %rax, 0x28(%r15)
movq (%rdi), %rax
testq %rax, %rax
je 0x192f13
movq 0x38(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%r15)
shlq $0x4, %rcx
leaq (%rax,%rcx), %r13
movq %rbx, (%rax,%rcx)
incq %rbp
incq 0x10(%r15)
jmp 0x192ec7
cmpq %rax, 0x18(%r15)
jbe 0x192f09
movq 0x20(%r15), %rcx
incq (%rcx,%rax,8)
testq %rbp, %rbp
je 0x192ec5
testq %r13, %r13
je 0x192f0e
movq %rbp, 0x8(%r13)
xorl %ebp, %ebp
leaq (%r14,%rbx), %rax
incq %rax
incq %rbx
cmpq %r12, %rax
jb 0x192e35
jmp 0x192ede
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x192eec
testq %r13, %r13
je 0x192f18
movq %rbp, 0x8(%r13)
movq %r14, (%r15)
movq (%rsp), %rax
movq %rax, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5c8dc
callq 0x5c913
callq 0x5c981
callq 0x5c94a