// File: /workspace/github_c_makefile_star2_O1/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
movl %r9d, %r15d
movq %r8, 0x18(%rsp)
movq %rcx, 0x30(%rsp)
movq %rsi, %r13
movq %rdi, %rbp
movq %rdx, 0x28(%rsp)
movq (%rdx), %rax
movq %rax, (%rsp)
cmpq %rsi, 0x120(%rdi)
je 0x25a4c7
movq 0x228(%rbp), %r12
leaq 0x8(%r12), %r14
jmp 0x25a4dc
leaq 0x210(%rbp), %r12
movq %rax, 0x210(%rbp)
leaq 0x218(%rbp), %r14
movq %rax, (%r12)
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
movl %r15d, 0x14(%rsp)
movq (%rsp), %rsi
movq %r13, %rdi
movq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq *0x10(%r13)
movq 0x8(%rsp), %rcx
movq %rcx, (%r14)
leal 0x4(%rax), %edx
cmpl $0xb, %edx
ja 0x25a537
leaq 0x17a10f(%rip), %rsi    # 0x3d462c
movslq (%rsi,%rdx,4), %rax
addq %rsi, %rax
jmpq *%rax
xorl %ebx, %ebx
testb %r15b, %r15b
jne 0x25a570
movl $0x14, %ebx
jmp 0x25a683
cmpl $0x28, %eax
jne 0x25a557
movq 0x98(%rbp), %rax
testq %rax, %rax
je 0x25a6a4
movq 0x8(%rbp), %rdi
callq *%rax
jmp 0x25a6bd
movq %rcx, (%r12)
movl $0x17, %ebx
jmp 0x25a683
xorl %ebx, %ebx
testb %r15b, %r15b
je 0x25a62e
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x25a683
movq 0x78(%rbp), %rax
testq %rax, %rax
je 0x25a635
movb $0xa, 0x20(%rsp)
movq 0x8(%rbp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x1, %edx
callq *%rax
jmp 0x25a64e
movq %rcx, (%r12)
movl $0x4, %ebx
jmp 0x25a683
movq 0x78(%rbp), %r15
testq %r15, %r15
je 0x25a693
cmpb $0x0, 0x84(%r13)
je 0x25a5e2
movq 0x8(%rbp), %rdi
movq (%rsp), %rsi
subl %esi, %ecx
movl %ecx, %edx
callq *%r15
jmp 0x25a627
movq %rax, (%r12)
movq 0x58(%rbp), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rdx
movq 0x60(%rbp), %r8
movq %r13, %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rcx
callq *0x70(%r13)
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movq 0x8(%rbp), %rdi
movq 0x58(%rbp), %rsi
movl 0x20(%rsp), %edx
subl %esi, %edx
callq *%r15
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x25a5de
movl 0x14(%rsp), %r15d
jmp 0x25a64e
movl $0x6, %ebx
jmp 0x25a683
cmpq $0x0, 0xa0(%rbp)
je 0x25a64e
movq (%rsp), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2550af
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq %rax, (%r12)
movl 0x378(%rbp), %eax
cmpl $0x2, %eax
je 0x25a67e
cmpl $0x3, %eax
jne 0x25a68f
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
xorl %ebx, %ebx
jmp 0x25a685
movl $0x23, %ebx
xorl %eax, %eax
testb %al, %al
jne 0x25a4f1
jmp 0x25a6ea
movb $0x1, %al
jmp 0x25a685
cmpq $0x0, 0xa0(%rbp)
movl 0x14(%rsp), %r15d
jne 0x25a63f
jmp 0x25a64e
cmpq $0x0, 0xa0(%rbp)
je 0x25a6bd
movq (%rsp), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2550af
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
cmpl $0x2, 0x378(%rbp)
movl $0x0, %ebx
movl $0x23, %ecx
cmovel %ecx, %ebx
jmp 0x25a685
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq