// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
leaq 0x20(%rsp), %r10
andq $0x0, (%r10)
leaq 0x18(%rsp), %r9
andq $0x0, (%r9)
leaq 0x4(%rsp), %r11
orl $-0x1, (%r11)
movl %esi, %ebp
movq %rdi, %rbx
movq 0x120(%rdi), %rsi
leaq 0x210(%rdi), %r14
leaq 0x10(%rsp), %r13
movl %ebp, %edi
movq %r14, %r8
pushq %r11
pushq %r10
pushq %rax
pushq %r13
callq 0x2038f3
addq $0x20, %rsp
testl %eax, %eax
je 0x1fea9b
testl %ebp, %ebp
jne 0x1fea3c
cmpl $0x1, 0x4(%rsp)
jne 0x1fea3c
movq 0x290(%rbx), %rax
movb $0x1, 0x102(%rax)
cmpq $0x0, 0x118(%rbx)
pushq $0x1
popq %rbp
je 0x1feaa9
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0x1feacf
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 0x1fec0c
testq %rax, %rax
je 0x1febfb
movq %rax, %r15
movq 0x348(%rbx), %rax
movq %rax, 0x350(%rbx)
jmp 0x1fead2
cmpl $0x1, %ebp
pushq $0x1f
popq %rbp
sbbl $0x0, %ebp
jmp 0x1febfb
cmpq $0x0, 0xa0(%rbx)
je 0x1feac8
movq 0x120(%rbx), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1fd08b
xorl %r15d, %r15d
xorl %eax, %eax
jmp 0x1feb28
xorl %r15d, %r15d
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x1feb0b
leaq 0x330(%rbx), %rdi
movq 0x120(%rbx), %rsi
movq 0x10(%rsp), %rcx
movslq 0x80(%rsi), %rax
subq %rax, %rcx
callq 0x1fec0c
movq %rax, %r12
testq %rax, %rax
jne 0x1feb0e
jmp 0x1febfb
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
movl 0x4(%rsp), %ecx
movq %r12, %rsi
movq %r15, %rdx
callq *0x118(%rbx)
testq %r12, %r12
setne %al
cmpq $0x0, 0x1c0(%rbx)
je 0x1feb58
testq %r15, %r15
sete %cl
xorb $0x1, %al
xorl %ebp, %ebp
testb %al, %cl
jne 0x1febfb
addq $0x330, %rbx            # imm = 0x330
movq %rbx, %rdi
callq 0x1fbde4
jmp 0x1febfb
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
je 0x1feb80
movl 0x80(%rcx), %edx
movq 0x120(%rbx), %rsi
cmpl 0x80(%rsi), %edx
jne 0x1febf0
movq %rcx, 0x120(%rbx)
jmp 0x1feb32
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0x1feb32
testq %r15, %r15
jne 0x1febc3
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 0x1fec0c
movq %rax, %r15
testq %rax, %rax
je 0x1febfb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fe8c8
movl %eax, %ebp
addq $0x330, %rbx            # imm = 0x330
movq %rbx, %rdi
callq 0x1fbde4
cmpl $0x12, %ebp
jne 0x1febfb
movq 0x8(%rsp), %rax
movq %rax, (%r14)
pushq $0x12
jmp 0x1febfa
movq 0x8(%rsp), %rax
movq %rax, (%r14)
pushq $0x13
popq %rbp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq