// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: doCdataSection
static enum XML_Error
doCdataSection(XML_Parser parser,
               const ENCODING *enc,
               const char **startPtr,
               const char *end,
               const char **nextPtr,
               XML_Bool haveMore)
{
  const char *s = *startPtr;
  const char **eventPP;
  const char **eventEndPP;
  if (enc == encoding) {
    eventPP = &eventPtr;
    *eventPP = s;
    eventEndPP = &eventEndPtr;
  }
  else {
    eventPP = &(openInternalEntities->internalEventPtr);
    eventEndPP = &(openInternalEntities->internalEventEndPtr);
  }
  *eventPP = s;
  *startPtr = NULL;

  for (;;) {
    const char *next;
    int tok = XmlCdataSectionTok(enc, s, end, &next);
    *eventEndPP = next;
    switch (tok) {
    case XML_TOK_CDATA_SECT_CLOSE:
      if (endCdataSectionHandler)
        endCdataSectionHandler(handlerArg);
#if 0
      /* see comment under XML_TOK_CDATA_SECT_OPEN */
      else if (characterDataHandler)
        characterDataHandler(handlerArg, dataBuf, 0);
#endif
      else if (defaultHandler)
        reportDefault(parser, enc, s, next);
      *startPtr = next;
      *nextPtr = next;
      if (ps_parsing == XML_FINISHED)
        return XML_ERROR_ABORTED;
      else
        return XML_ERROR_NONE;
    case XML_TOK_DATA_NEWLINE:
      if (characterDataHandler) {
        XML_Char c = 0xA;
        characterDataHandler(handlerArg, &c, 1);
      }
      else if (defaultHandler)
        reportDefault(parser, enc, s, next);
      break;
    case XML_TOK_DATA_CHARS:
      {
        XML_CharacterDataHandler charDataHandler = characterDataHandler;
        if (charDataHandler) {
          if (MUST_CONVERT(enc, s)) {
            for (;;) {
              ICHAR *dataPtr = (ICHAR *)dataBuf;
              XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
              *eventEndPP = next;
              charDataHandler(handlerArg, dataBuf,
                              (int)(dataPtr - (ICHAR *)dataBuf));
              if (s == next)
                break;
              *eventPP = s;
            }
          }
          else
            charDataHandler(handlerArg,
                            (XML_Char *)s,
                            (int)((XML_Char *)next - (XML_Char *)s));
        }
        else if (defaultHandler)
          reportDefault(parser, enc, s, next);
      }
      break;
    case XML_TOK_INVALID:
      *eventPP = next;
      return XML_ERROR_INVALID_TOKEN;
    case XML_TOK_PARTIAL_CHAR:
      if (haveMore) {
        *nextPtr = s;
        return XML_ERROR_NONE;
      }
      return XML_ERROR_PARTIAL_CHAR;
    case XML_TOK_PARTIAL:
    case XML_TOK_NONE:
      if (haveMore) {
        *nextPtr = s;
        return XML_ERROR_NONE;
      }
      return XML_ERROR_UNCLOSED_CDATA_SECTION;
    default:
      *eventPP = next;
      return XML_ERROR_UNEXPECTED_STATE;
    }

    *eventPP = s = next;
    switch (ps_parsing) {
    case XML_SUSPENDED:
      *nextPtr = next;
      return XML_ERROR_NONE;
    case XML_FINISHED:
      return XML_ERROR_ABORTED;
    default: ;
    }
  }
  /* not reached */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movq (%rdx), %rsi
movq %rsi, (%rsp)
cmpq %r12, 0x120(%rdi)
movq %r8, 0x8(%rsp)
movl %r9d, 0x1c(%rsp)
je 0x2014fa
movq 0x228(%r14), %rbx
leaq 0x8(%rbx), %r13
jmp 0x20150f
leaq 0x210(%r14), %rbx
movq %rsi, 0x210(%r14)
leaq 0x218(%r14), %r13
movq %rsi, (%rbx)
movq %rdx, 0x30(%rsp)
andq $0x0, (%rdx)
leaq 0x28(%rsp), %r15
movq %rbp, 0x20(%rsp)
movq %r12, %rdi
movq %rbp, %rdx
leaq 0x10(%rsp), %rcx
callq *0x10(%r12)
movq 0x10(%rsp), %rcx
movq %rcx, (%r13)
leal 0x4(%rax), %edx
cmpl $0xb, %edx
ja 0x201653
leaq 0x169dcb(%rip), %rsi    # 0x36b31c
movslq (%rsi,%rdx,4), %rax
addq %rsi, %rax
jmpq *%rax
movq 0x78(%r14), %rbp
testq %rbp, %rbp
je 0x2015ed
cmpb $0x0, 0x84(%r12)
je 0x201585
movq 0x8(%r14), %rdi
movq (%rsp), %rsi
subl %esi, %ecx
movl %ecx, %edx
callq *%rbp
jmp 0x2015ca
movq %rax, (%rbx)
movq 0x58(%r14), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%r14), %r8
movq %r12, %rdi
movq %rsp, %rsi
movq %rcx, %rdx
movq %r15, %rcx
callq *0x70(%r12)
movq 0x10(%rsp), %rax
movq %rax, (%r13)
movq 0x8(%r14), %rdi
movq 0x58(%r14), %rsi
movl 0x28(%rsp), %edx
subl %esi, %edx
callq *%rbp
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x201582
movq 0x20(%rsp), %rbp
jmp 0x20160b
movq 0x78(%r14), %rax
testq %rax, %rax
je 0x20162e
movb $0xa, 0x28(%rsp)
movq 0x8(%r14), %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq *%rax
jmp 0x20160b
cmpq $0x0, 0xa0(%r14)
movq 0x20(%rsp), %rbp
je 0x20160b
movq (%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x1fd08b
movq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq %rsi, (%rbx)
movl 0x378(%r14), %eax
cmpl $0x2, %eax
je 0x20164f
cmpl $0x3, %eax
jne 0x201525
jmp 0x201645
cmpq $0x0, 0xa0(%r14)
jne 0x2015fc
jmp 0x20160b
cmpb $0x0, 0x1c(%rsp)
jne 0x201686
pushq $0x14
jmp 0x201698
movq 0x8(%rsp), %rax
movq %rsi, (%rax)
jmp 0x201692
pushq $0x23
jmp 0x201698
cmpl $0x28, %eax
jne 0x201671
movq 0x98(%r14), %rax
testq %rax, %rax
je 0x2016a8
movq 0x8(%r14), %rdi
callq *%rax
movq 0x8(%rsp), %rbx
jmp 0x2016c6
movq %rcx, (%rbx)
pushq $0x17
jmp 0x201698
movq %rcx, (%rbx)
pushq $0x4
jmp 0x201698
cmpb $0x0, 0x1c(%rsp)
je 0x201696
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
jmp 0x201699
pushq $0x6
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0xa0(%r14)
movq 0x8(%rsp), %rbx
je 0x2016c6
movq (%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x1fd08b
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, (%rbx)
xorl %ecx, %ecx
cmpl $0x2, 0x378(%r14)
pushq $0x23
popq %rax
cmovnel %ecx, %eax
jmp 0x201699