// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movb %r9b, %al
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movq %r8, 0x58(%rsp)
movb %al, 0x57(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x37f7b6
movq 0x78(%rsp), %rax
addq $0x210, %rax            # imm = 0x210
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x78(%rsp), %rax
addq $0x218, %rax            # imm = 0x218
movq %rax, 0x38(%rsp)
jmp 0x37f7dc
movq 0x78(%rsp), %rax
movq 0x228(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x78(%rsp), %rax
movq 0x228(%rax), %rax
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq $0x0, (%rax)
movq 0x70(%rsp), %rdi
movq 0x10(%rdi), %rax
movq 0x48(%rsp), %rsi
movq 0x60(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq *%rax
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movl 0x2c(%rsp), %eax
addl $0x4, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x2c, %eax
ja 0x37fadc
movq 0x10(%rsp), %rax
leaq 0x21ec29(%rip), %rcx    # 0x59e46c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x78(%rsp), %rax
cmpq $0x0, 0x98(%rax)
je 0x37f874
movq 0x78(%rsp), %rax
movq 0x98(%rax), %rax
movq 0x78(%rsp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
jmp 0x37f89e
movq 0x78(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x37f89c
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x30(%rsp), %rcx
callq 0x376350
jmp 0x37f89e
movq 0x30(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movq 0x78(%rsp), %rax
cmpl $0x2, 0x378(%rax)
jne 0x37f8d6
movl $0x23, 0x84(%rsp)
jmp 0x37fb57
movl $0x0, 0x84(%rsp)
jmp 0x37fb57
movq 0x78(%rsp), %rax
cmpq $0x0, 0x78(%rax)
je 0x37f917
movb $0xa, 0x2b(%rsp)
movq 0x78(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x78(%rsp), %rcx
movq 0x8(%rcx), %rdi
leaq 0x2b(%rsp), %rsi
movl $0x1, %edx
callq *%rax
jmp 0x37f941
movq 0x78(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x37f93f
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x30(%rsp), %rcx
callq 0x376350
jmp 0x37f941
jmp 0x37faf6
movq 0x78(%rsp), %rax
movq 0x78(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x37fa2b
movq 0x70(%rsp), %rax
cmpb $0x0, 0x84(%rax)
jne 0x37fa05
jmp 0x37f974
movq 0x78(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x70(%rsp), %rdi
movq 0x30(%rsp), %rdx
movq 0x78(%rsp), %rcx
movq 0x60(%rcx), %r8
leaq 0x48(%rsp), %rsi
leaq 0x18(%rsp), %rcx
callq *%rax
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x8(%rcx), %rdi
movq 0x78(%rsp), %rcx
movq 0x58(%rcx), %rsi
movq 0x18(%rsp), %rcx
movq 0x78(%rsp), %rdx
movq 0x58(%rdx), %rdx
subq %rdx, %rcx
movl %ecx, %edx
callq *%rax
movq 0x48(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x37f9f1
jmp 0x37fa03
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
jmp 0x37f974
jmp 0x37fa29
movq 0x20(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x8(%rcx), %rdi
movq 0x48(%rsp), %rsi
movq 0x30(%rsp), %rcx
movq 0x48(%rsp), %rdx
subq %rdx, %rcx
movl %ecx, %edx
callq *%rax
jmp 0x37fa55
movq 0x78(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x37fa53
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x30(%rsp), %rcx
callq 0x376350
jmp 0x37fa55
jmp 0x37faf6
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movl $0x4, 0x84(%rsp)
jmp 0x37fb57
cmpb $0x0, 0x57(%rsp)
je 0x37fa9b
movq 0x48(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x84(%rsp)
jmp 0x37fb57
movl $0x6, 0x84(%rsp)
jmp 0x37fb57
cmpb $0x0, 0x57(%rsp)
je 0x37facf
movq 0x48(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x84(%rsp)
jmp 0x37fb57
movl $0x14, 0x84(%rsp)
jmp 0x37fb57
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movl $0x17, 0x84(%rsp)
jmp 0x37fb57
movq 0x30(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x78(%rsp), %rax
movl 0x378(%rax), %eax
movl %eax, 0xc(%rsp)
subl $0x2, %eax
je 0x37fb43
jmp 0x37fb1e
movl 0xc(%rsp), %eax
subl $0x3, %eax
jne 0x37fb50
jmp 0x37fb29
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x84(%rsp)
jmp 0x37fb57
movl $0x23, 0x84(%rsp)
jmp 0x37fb57
jmp 0x37fb52
jmp 0x37f7f5
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)