// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rcx, 0x38(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x2146d7(%rip), %rbp    # 0x3a7617
movl $0x40, %edi
movq %rbp, %rsi
movl $0x6f, %edx
callq 0x1092b2
movq %rax, %rbx
movq %r14, %rdi
callq 0xd3700
movq %rax, 0x40(%rsp)
xorl %r13d, %r13d
movq %r13, 0x10(%rbx)
movq %r14, %rdi
callq 0xd3713
movl %eax, %edi
movq %rdi, 0x18(%rbx)
movl $0x8, %esi
movq %rbp, %rdx
movl $0x75, %ecx
callq 0x1093ef
movq %rax, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movq %r13, 0x38(%rbx)
testq %r12, %r12
movq %rbx, 0x8(%rsp)
movq %r15, 0x28(%rsp)
jle 0x1931dd
addq %r15, %r12
addq $0x28, %rbx
movq %rbx, 0x30(%rsp)
movb $0x1, %al
movl %eax, 0x1c(%rsp)
movq %r15, %rbp
movq $0x0, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
cmpb $0x3e, (%r15)
jne 0x192ff3
testb $0x1, 0x1c(%rsp)
je 0x19312c
movl $0x0, 0x1c(%rsp)
jmp 0x1931b8
cmpq %r12, %r15
jae 0x1931c8
movzbl (%r15), %r14d
cmpl $0xa, %r14d
je 0x1931c8
callq 0x17870
movq (%rax), %rcx
movl %r14d, %eax
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x193124
movq 0x40(%rsp), %rcx
movzbl (%rcx,%rax), %ebx
cmpq $0xfd, %rbx
jne 0x193054
movq 0x38(%rsp), %rdi
leaq 0x214691(%rip), %rsi    # 0x3a76cf
movl %r14d, %edx
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x19311b
cmpb $-0x2, %bl
jb 0x1930e4
testq %r13, %r13
jne 0x1930d6
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rsi
cmpq %rsi, 0x38(%rax)
jb 0x19309b
subq $-0x80, %rsi
movq 0x8(%rsp), %r14
movq %rsi, 0x30(%r14)
movq 0x28(%r14), %rdi
shlq $0x4, %rsi
leaq 0x21458a(%rip), %rdx    # 0x3a7617
movl $0xa2, %ecx
callq 0x1094e6
movq %rax, 0x28(%r14)
movq 0x30(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x193246
movq 0x8(%rsp), %rsi
movq 0x38(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%rsi)
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq %rbp, %rdx
subq 0x28(%rsp), %rdx
movq %rdx, (%rax,%rcx)
incq %r13
movq 0x8(%rsp), %rax
incq 0x10(%rax)
jmp 0x193115
movq 0x8(%rsp), %rax
cmpq %rbx, 0x18(%rax)
jbe 0x19323c
movq 0x20(%rax), %rax
incq (%rax,%rbx,8)
testq %r13, %r13
je 0x193112
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x193241
movq %r13, 0x8(%rax)
xorl %r13d, %r13d
movb %bl, (%rbp)
incq %rbp
cmpb $-0x3, %bl
je 0x1931c8
incq %r15
jmp 0x192ff3
testq %r13, %r13
jne 0x1931a5
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rsi
cmpq %rsi, 0x38(%rax)
jb 0x19316a
subq $-0x80, %rsi
movq 0x8(%rsp), %rbx
movq %rsi, 0x30(%rbx)
movq 0x28(%rbx), %rdi
shlq $0x4, %rsi
leaq 0x2144bb(%rip), %rdx    # 0x3a7617
movl $0x81, %ecx
callq 0x1094e6
movq %rax, 0x28(%rbx)
movq 0x30(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x19324b
movq 0x8(%rsp), %rsi
movq 0x38(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%rsi)
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq %rbp, %rdx
subq 0x28(%rsp), %rdx
movq %rdx, (%rax,%rcx)
incq %r13
movb $-0x1, (%rbp)
incq %rbp
movq 0x8(%rsp), %rax
incq 0x10(%rax)
cmpq %r12, %r15
jae 0x1931c8
cmpb $0xa, (%r15)
je 0x1931c8
incq %r15
jmp 0x1931b8
testb $0x1, 0x20(%rsp)
jne 0x1931f5
incq %r15
cmpq %r12, %r15
jb 0x192fd5
jmp 0x1931f5
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq %r15, %rbp
movq $0x0, 0x20(%rsp)
testq %r13, %r13
movq 0x28(%rsp), %rcx
je 0x19320d
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x193250
movq %r13, 0x8(%rax)
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
subq %rcx, %rbp
movq %rbp, 0x8(%rax)
testb $0x1, 0x20(%rsp)
je 0x19322d
movq %rax, %rdi
callq 0x192d4c
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5c9b8
callq 0x5c9f1
callq 0x5ca2a
callq 0x5ca63
callq 0x5ca9c