// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/bare-encseq.c
// Function: gt_bare_encseq_parse_new
GtBareEncseq *gt_bare_encseq_parse_new(GtUchar *filecontents,size_t numofbytes,
                                       const GtAlphabet *alphabet,
                                       GtError *err)
{
  GtUchar *writeptr = filecontents, *readptr = filecontents;
  const GtUchar *endptr = filecontents + numofbytes;
  bool firstline = true, haserr = false;
  GtUword lastspecialrange_length = 0;
  GtBareSpecialrange *srptr = NULL;
  GtBareEncseq *bare_encseq = gt_malloc(sizeof *bare_encseq);
  const GtUchar *smap = gt_alphabet_symbolmap(alphabet);

  bare_encseq->specialcharacters = 0;
  bare_encseq->numofchars = (GtUword) gt_alphabet_num_of_chars(alphabet);
  bare_encseq->charcount = gt_calloc((size_t) bare_encseq->numofchars,
                                     sizeof *bare_encseq->charcount);
  GT_INITARRAY(&bare_encseq->specialranges,GtBareSpecialrange);
  readptr = filecontents;
  while (!haserr && readptr < endptr)
  {
    if (*readptr == '>')
    {
      if (!firstline)
      {
        if (lastspecialrange_length == 0)
        {
          GT_GETNEXTFREEINARRAY(srptr,&bare_encseq->specialranges,
                                GtBareSpecialrange,128UL);
          srptr->start = (GtUword) (writeptr - filecontents);
        }
        lastspecialrange_length++;
        *writeptr++ = GT_SEPARATOR;
        bare_encseq->specialcharacters++;
      } else
      {
        firstline = false;
      }
      while (readptr < endptr && *readptr != '\n')
      {
        readptr++;
      }
      readptr++;
    } else
    {
      while (readptr < endptr && *readptr != '\n')
      {
        if (!isspace(*readptr))
        {
          GtUchar cc = smap[*readptr];
          if (cc == GT_UNDEFCHAR)
          {
            gt_error_set(err,"illegal input characters %c\n",*readptr);
            haserr = true;
            break;
          }
          if (GT_ISSPECIAL(cc))
          {
            if (lastspecialrange_length == 0)
            {
              GT_GETNEXTFREEINARRAY(srptr,&bare_encseq->specialranges,
                                    GtBareSpecialrange,128UL);
              srptr->start = (GtUword) (writeptr - filecontents);
            }
            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;
          }
          *writeptr++ = cc;
        }
        readptr++;
      }
      readptr++;
    }
  }
  if (lastspecialrange_length > 0)
  {
    gt_assert(srptr != NULL);
    srptr->length = lastspecialrange_length;
  }
  bare_encseq->sequence = filecontents;
  bare_encseq->totallength = (GtUword) (writeptr - filecontents);
  if (haserr)
  {
    gt_bare_encseq_delete(bare_encseq);
    return NULL;
  }
  return bare_encseq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x30(%rsp)
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r13
leaq 0x213827(%rip), %r15    # 0x39e11f
movl $0x40, %edi
movq %r15, %rsi
movl $0x6f, %edx
callq 0x104226
movq %rax, %r14
movq %rbp, %rdi
callq 0xd11ab
movq %rax, 0x28(%rsp)
xorl %ebx, %ebx
movq %rbx, 0x10(%r14)
movq %rbp, %rdi
callq 0xd11be
movl %eax, %edi
movq %rdi, 0x18(%r14)
movl $0x8, %esi
movq %r15, %rdx
movl $0x75, %ecx
callq 0x10436a
movq %r14, %rdi
movq %rax, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movq %rbx, 0x38(%r14)
testq %r12, %r12
jle 0x18abb6
addq %r13, %r12
movq %rdi, %rax
addq $0x28, %rax
movq %rax, 0x20(%rsp)
movb $0x1, %dl
xorl %esi, %esi
movq %r13, %r15
movq %r13, 0x18(%rsp)
xorl %r14d, %r14d
movq %rdi, 0x8(%rsp)
movb (%r13), %bl
cmpb $0x3e, %bl
jne 0x18a9b5
testb $0x1, %dl
jne 0x18ab49
testq %r14, %r14
jne 0x18ab3b
movq 0x30(%rdi), %rsi
cmpq %rsi, 0x38(%rdi)
jae 0x18aae3
movq 0x20(%rsp), %rax
movq (%rax), %rax
jmp 0x18ab12
cmpq %r12, %r13
setae %al
cmpb $0xa, %bl
sete %cl
orb %al, %cl
jne 0x18ab5c
movl %edx, 0x14(%rsp)
movq %rsi, %rbp
callq 0x17870
movq %rbp, %rsi
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %rdi
movq %rax, %rbp
incq %r13
movq %r13, %rax
movq %rax, %r13
movq (%rbp), %rax
movzbl %bl, %edx
testb $0x20, 0x1(%rax,%rdx,2)
jne 0x18aac7
movzbl (%r8,%rdx), %ebx
cmpq $0xfd, %rbx
je 0x18ab6c
cmpb $-0x2, %bl
jb 0x18aa34
testq %r14, %r14
jne 0x18aaba
movq 0x30(%rdi), %rsi
cmpq %rsi, 0x38(%rdi)
jae 0x18aa5d
movq 0x20(%rsp), %rax
movq (%rax), %rax
jmp 0x18aa91
cmpq %rbx, 0x18(%rdi)
jbe 0x18abd3
movq 0x20(%rdi), %rax
incq (%rax,%rbx,8)
testq %r14, %r14
je 0x18aa58
testq %rsi, %rsi
je 0x18abd8
movq %r14, 0x8(%rsi)
xorl %r14d, %r14d
jmp 0x18aac1
subq $-0x80, %rsi
movq %rsi, 0x30(%rdi)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x4, %rsi
leaq 0x2136a6(%rip), %rdx    # 0x39e11f
movl $0xa2, %ecx
callq 0x104461
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %rdi
movq %rax, 0x28(%rdi)
testq %rax, %rax
je 0x18abdd
movq 0x38(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%rdi)
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
movq %r15, %rdx
subq 0x18(%rsp), %rdx
movq %rdx, (%rax,%rcx)
incq %r14
incq 0x10(%rdi)
movb %bl, (%r15)
incq %r15
cmpq %r12, %r13
jae 0x18aadd
movb (%r13), %bl
leaq 0x1(%r13), %rax
cmpb $0xa, %bl
jne 0x18a9eb
movl 0x14(%rsp), %edx
jmp 0x18ab5c
subq $-0x80, %rsi
movq %rsi, 0x30(%rdi)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x4, %rsi
leaq 0x213620(%rip), %rdx    # 0x39e11f
movl $0x81, %ecx
callq 0x104461
movq 0x8(%rsp), %rdi
movq %rax, 0x28(%rdi)
testq %rax, %rax
je 0x18abe2
movq 0x38(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%rdi)
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
movq %r15, %rdx
subq 0x18(%rsp), %rdx
movq %rdx, (%rax,%rcx)
incq %r14
movb $-0x1, (%r15)
incq %r15
incq 0x10(%rdi)
cmpq %r12, %r13
jae 0x18ab5a
cmpb $0xa, (%r13)
je 0x18ab5a
incq %r13
jmp 0x18ab49
xorl %edx, %edx
incq %r13
cmpq %r12, %r13
jb 0x18a97f
xorl %eax, %eax
jmp 0x18ab8c
movq %rsi, %rbx
leaq 0x213661(%rip), %rsi    # 0x39e1d7
movq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
movq %rbx, %rsi
movq 0x8(%rsp), %rdi
movb $0x1, %al
testq %r14, %r14
movq 0x18(%rsp), %rcx
je 0x18ab9f
testq %rsi, %rsi
je 0x18abe7
movq %r14, 0x8(%rsi)
movq %rcx, (%rdi)
subq %rcx, %r15
movq %r15, 0x8(%rdi)
testb %al, %al
je 0x18abc1
callq 0x18a71c
xorl %edi, %edi
jmp 0x18abc1
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5b69a
callq 0x5b6d3
callq 0x5b70c
callq 0x5b745
callq 0x5b77e