// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: processXmlDecl
static enum XML_Error
processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
               const char *s, const char *next)
{
  const char *encodingName = NULL;
  const XML_Char *storedEncName = NULL;
  const ENCODING *newEncoding = NULL;
  const char *version = NULL;
  const char *versionend;
  const XML_Char *storedversion = NULL;
  int standalone = -1;
  if (!(ns
        ? XmlParseXmlDeclNS
        : XmlParseXmlDecl)(isGeneralTextEntity,
                           encoding,
                           s,
                           next,
                           &eventPtr,
                           &version,
                           &versionend,
                           &encodingName,
                           &newEncoding,
                           &standalone)) {
    if (isGeneralTextEntity)
      return XML_ERROR_TEXT_DECL;
    else
      return XML_ERROR_XML_DECL;
  }
  if (!isGeneralTextEntity && standalone == 1) {
    _dtd->standalone = XML_TRUE;
#ifdef XML_DTD
    if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE)
      paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
#endif /* XML_DTD */
  }
  if (xmlDeclHandler) {
    if (encodingName != NULL) {
      storedEncName = poolStoreString(&temp2Pool,
                                      encoding,
                                      encodingName,
                                      encodingName
                                      + XmlNameLength(encoding, encodingName));
      if (!storedEncName)
              return XML_ERROR_NO_MEMORY;
      poolFinish(&temp2Pool);
    }
    if (version) {
      storedversion = poolStoreString(&temp2Pool,
                                      encoding,
                                      version,
                                      versionend - encoding->minBytesPerChar);
      if (!storedversion)
        return XML_ERROR_NO_MEMORY;
    }
    xmlDeclHandler(handlerArg, storedversion, storedEncName, standalone);
  }
  else if (defaultHandler)
    reportDefault(parser, encoding, s, next);
  if (protocolEncodingName == NULL) {
    if (newEncoding) {
      if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) {
        eventPtr = encodingName;
        return XML_ERROR_INCORRECT_ENCODING;
      }
      encoding = newEncoding;
    }
    else if (encodingName) {
      enum XML_Error result;
      if (!storedEncName) {
        storedEncName = poolStoreString(
          &temp2Pool, encoding, encodingName,
          encodingName + XmlNameLength(encoding, encodingName));
        if (!storedEncName)
          return XML_ERROR_NO_MEMORY;
      }
      result = handleUnknownEncoding(parser, storedEncName);
      poolClear(&temp2Pool);
      if (result == XML_ERROR_UNKNOWN_ENCODING)
        eventPtr = encodingName;
      return result;
    }
  }

  if (storedEncName || storedversion)
    poolClear(&temp2Pool);

  return XML_ERROR_NONE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x8(%rsp), %r10
movq %rax, (%r10)
leaq 0x20(%rsp), %r11
movq %rax, (%r11)
leaq 0x18(%rsp), %r9
movq %rax, (%r9)
leaq 0x4(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x120(%rdi), %rsi
leaq 0x210(%rdi), %r14
leaq 0x10(%rsp), %r13
movl %ebp, %edi
movq %r14, %r8
pushq %rax
pushq %r11
pushq %r10
pushq %r13
callq 0x2543e9
addq $0x20, %rsp
testl %eax, %eax
je 0x24f0ee
testl %ebp, %ebp
jne 0x24f092
cmpl $0x1, 0x4(%rsp)
jne 0x24f092
movq 0x290(%rbx), %rax
movb $0x1, 0x102(%rax)
cmpq $0x0, 0x118(%rbx)
je 0x24f0fe
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0x24f124
leaq 0x330(%rbx), %r12
movq 0x120(%rbx), %r13
movq %r13, %rdi
movq %r15, %rsi
callq *0x38(%r13)
movslq %eax, %rcx
addq %r15, %rcx
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x24f2f4
testq %rax, %rax
je 0x24f15b
movq %rax, %r15
movq 0x348(%rbx), %rax
movq %rax, 0x350(%rbx)
jmp 0x24f127
cmpl $0x1, %ebp
movl $0x1f, %eax
sbbl $0x0, %eax
jmp 0x24f2e5
cmpq $0x0, 0xa0(%rbx)
je 0x24f11d
movq 0x120(%rbx), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x24d5ee
xorl %r15d, %r15d
xorl %ecx, %ecx
jmp 0x24f182
xorl %r15d, %r15d
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x24f165
leaq 0x330(%rbx), %rdi
movq 0x120(%rbx), %rsi
movq 0x10(%rsp), %rcx
movslq 0x80(%rsi), %rax
subq %rax, %rcx
callq 0x24f2f4
movq %rax, %r12
testq %rax, %rax
jne 0x24f168
movl $0x1, %eax
jmp 0x24f2e5
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
movl 0x4(%rsp), %ecx
movq %r12, %rsi
movq %r15, %rdx
callq *0x118(%rbx)
testq %r12, %r12
setne %cl
cmpq $0x0, 0x1c0(%rbx)
je 0x24f1ca
testq %r15, %r15
sete %dl
xorb $0x1, %cl
xorl %eax, %eax
testb %cl, %dl
jne 0x24f2e5
movq 0x330(%rbx), %rax
movq 0x338(%rbx), %rcx
testq %rcx, %rcx
je 0x24f1f6
testq %rax, %rax
je 0x24f200
movq %rax, %rdx
movq (%rax), %rax
movq %rcx, (%rdx)
movq %rdx, %rcx
testq %rax, %rax
jne 0x24f1b7
jmp 0x24f1f9
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x24f21f
movl 0x80(%rax), %edx
movq 0x120(%rbx), %rsi
cmpl 0x80(%rsi), %edx
jne 0x24f2a0
movq %rax, 0x120(%rbx)
jmp 0x24f18c
movq %rax, %rdx
movq %rdx, 0x338(%rbx)
xorl %eax, %eax
movq %rax, 0x330(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x340(%rbx)
movq %rax, 0x350(%rbx)
jmp 0x24f2e5
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0x24f18c
testq %r15, %r15
jne 0x24f26a
leaq 0x330(%rbx), %r15
movq 0x120(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq *0x38(%r13)
movslq %eax, %rcx
addq %r12, %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x24f2f4
movq %rax, %r15
testq %rax, %rax
je 0x24f15b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x24ef04
movq 0x330(%rbx), %rcx
movq 0x338(%rbx), %rdx
testq %rdx, %rdx
je 0x24f2af
testq %rcx, %rcx
je 0x24f2b9
movq %rcx, %rsi
movq (%rcx), %rcx
movq %rdx, (%rsi)
movq %rsi, %rdx
testq %rcx, %rcx
jne 0x24f28d
jmp 0x24f2b2
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movl $0x13, %eax
jmp 0x24f2e5
movq %rcx, %rsi
movq %rsi, 0x338(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x330(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x340(%rbx)
movq %rcx, 0x350(%rbx)
cmpl $0x12, %eax
jne 0x24f2e5
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movl $0x12, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq