// File: /workspace/github_c_makefile_star2_O3/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 0x251eaf
movq 0x228(%r14), %rbx
leaq 0x8(%rbx), %r13
jmp 0x251ec4
leaq 0x210(%r14), %rbx
movq %rsi, 0x210(%r14)
leaq 0x218(%r14), %r13
movq %rsi, (%rbx)
movq %rdx, 0x30(%rsp)
movq $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 0x252013
leaq 0x179003(%rip), %rsi    # 0x3caf0c
movslq (%rsi,%rdx,4), %rax
addq %rsi, %rax
jmpq *%rax
movq 0x78(%r14), %rbp
testq %rbp, %rbp
je 0x251fa7
cmpb $0x0, 0x84(%r12)
je 0x251f3d
movq 0x8(%r14), %rdi
movq (%rsp), %rsi
subl %esi, %ecx
movl %ecx, %edx
callq *%rbp
jmp 0x251f82
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 0x251f3a
movq 0x20(%rsp), %rbp
jmp 0x251fc5
movq 0x78(%r14), %rax
testq %rax, %rax
je 0x251fe8
movb $0xa, 0x28(%rsp)
movq 0x8(%r14), %rdi
movq %r15, %rsi
movl $0x1, %edx
callq *%rax
jmp 0x251fc5
cmpq $0x0, 0xa0(%r14)
movq 0x20(%rsp), %rbp
je 0x251fc5
movq (%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x24d5ee
movq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq %rsi, (%rbx)
movl 0x378(%r14), %eax
cmpl $0x2, %eax
je 0x25200c
cmpl $0x3, %eax
jne 0x251edd
jmp 0x252002
cmpq $0x0, 0xa0(%r14)
jne 0x251fb6
jmp 0x251fc5
cmpb $0x0, 0x1c(%rsp)
jne 0x25204c
movl $0x14, %eax
jmp 0x25205a
movq 0x8(%rsp), %rax
movq %rsi, (%rax)
jmp 0x252058
movl $0x23, %eax
jmp 0x25205a
cmpl $0x28, %eax
jne 0x252031
movq 0x98(%r14), %rax
testq %rax, %rax
je 0x252070
movq 0x8(%r14), %rdi
callq *%rax
movq 0x8(%rsp), %rbx
jmp 0x25208e
movq %rcx, (%rbx)
movl $0x17, %eax
jmp 0x25205a
movq %rcx, (%rbx)
movl $0x4, %eax
jmp 0x25205a
cmpb $0x0, 0x1c(%rsp)
je 0x252069
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x6, %eax
jmp 0x25205a
cmpq $0x0, 0xa0(%r14)
movq 0x8(%rsp), %rbx
je 0x25208e
movq (%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x24d5ee
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, (%rbx)
xorl %ecx, %ecx
cmpl $0x2, 0x378(%r14)
movl $0x23, %eax
cmovnel %ecx, %eax
jmp 0x25205a