// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_ExternalEntityParserCreate
XML_Parser XMLCALL
XML_ExternalEntityParserCreate(XML_Parser oldParser,
                               const XML_Char *context,
                               const XML_Char *encodingName)
{
  XML_Parser parser = oldParser;
  DTD *newDtd = NULL;
  DTD *oldDtd = _dtd;
  XML_StartElementHandler oldStartElementHandler = startElementHandler;
  XML_EndElementHandler oldEndElementHandler = endElementHandler;
  XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler;
  XML_ProcessingInstructionHandler oldProcessingInstructionHandler
      = processingInstructionHandler;
  XML_CommentHandler oldCommentHandler = commentHandler;
  XML_StartCdataSectionHandler oldStartCdataSectionHandler
      = startCdataSectionHandler;
  XML_EndCdataSectionHandler oldEndCdataSectionHandler
      = endCdataSectionHandler;
  XML_DefaultHandler oldDefaultHandler = defaultHandler;
  XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler
      = unparsedEntityDeclHandler;
  XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler;
  XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler
      = startNamespaceDeclHandler;
  XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler
      = endNamespaceDeclHandler;
  XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler;
  XML_ExternalEntityRefHandler oldExternalEntityRefHandler
      = externalEntityRefHandler;
  XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler;
  XML_UnknownEncodingHandler oldUnknownEncodingHandler
      = unknownEncodingHandler;
  XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler;
  XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler;
  XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler;
  XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler;
  ELEMENT_TYPE * oldDeclElementType = declElementType;

  void *oldUserData = userData;
  void *oldHandlerArg = handlerArg;
  XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
  XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
#ifdef XML_DTD
  enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
  int oldInEntityValue = prologState.inEntityValue;
#endif
  XML_Bool oldns_triplets = ns_triplets;

#ifdef XML_DTD
  if (!context)
    newDtd = oldDtd;
#endif /* XML_DTD */

  /* Note that the magical uses of the pre-processor to make field
     access look more like C++ require that `parser' be overwritten
     here.  This makes this function more painful to follow than it
     would be otherwise.
  */
  if (ns) {
    XML_Char tmp[2];
    *tmp = namespaceSeparator;
    parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
  }
  else {
    parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
  }

  if (!parser)
    return NULL;

  startElementHandler = oldStartElementHandler;
  endElementHandler = oldEndElementHandler;
  characterDataHandler = oldCharacterDataHandler;
  processingInstructionHandler = oldProcessingInstructionHandler;
  commentHandler = oldCommentHandler;
  startCdataSectionHandler = oldStartCdataSectionHandler;
  endCdataSectionHandler = oldEndCdataSectionHandler;
  defaultHandler = oldDefaultHandler;
  unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
  notationDeclHandler = oldNotationDeclHandler;
  startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
  endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
  notStandaloneHandler = oldNotStandaloneHandler;
  externalEntityRefHandler = oldExternalEntityRefHandler;
  skippedEntityHandler = oldSkippedEntityHandler;
  unknownEncodingHandler = oldUnknownEncodingHandler;
  elementDeclHandler = oldElementDeclHandler;
  attlistDeclHandler = oldAttlistDeclHandler;
  entityDeclHandler = oldEntityDeclHandler;
  xmlDeclHandler = oldXmlDeclHandler;
  declElementType = oldDeclElementType;
  userData = oldUserData;
  if (oldUserData == oldHandlerArg)
    handlerArg = userData;
  else
    handlerArg = parser;
  if (oldExternalEntityRefHandlerArg != oldParser)
    externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
  defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
  ns_triplets = oldns_triplets;
  parentParser = oldParser;
#ifdef XML_DTD
  paramEntityParsing = oldParamEntityParsing;
  prologState.inEntityValue = oldInEntityValue;
  if (context) {
#endif /* XML_DTD */
    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
      || !setContext(parser, context)) {
      XML_ParserFree(parser);
      return NULL;
    }
    processor = externalEntityInitProcessor;
#ifdef XML_DTD
  }
  else {
    /* The DTD instance referenced by _dtd is shared between the document's
       root parser and external PE parsers, therefore one does not need to
       call setContext. In addition, one also *must* not call setContext,
       because this would overwrite existing prefix->binding pointers in
       _dtd with ones that get destroyed with the external PE parser.
       This would leave those prefixes with dangling pointers.
    */
    isParamEntity = XML_TRUE;
    XmlPrologStateInitExternalEntity(&prologState);
    processor = externalParEntInitProcessor;
  }
#endif /* XML_DTD */
  return parser;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, %rax
movq %rsi, 0x78(%rsp)
movq %rdi, %rbx
movq 0x290(%rdi), %rcx
movq %rcx, 0x28(%rsp)
movups 0x68(%rdi), %xmm0
movaps %xmm0, 0x40(%rsp)
movups 0x78(%rdi), %xmm0
movaps %xmm0, 0x10(%rsp)
movups 0x88(%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups 0x98(%rdi), %xmm0
movaps %xmm0, 0x60(%rsp)
movups 0xb8(%rdi), %xmm0
movaps %xmm0, 0xd0(%rsp)
movups 0xc8(%rdi), %xmm0
movaps %xmm0, 0xc0(%rsp)
movups 0xd8(%rdi), %xmm0
movaps %xmm0, 0xb0(%rsp)
movups 0xf0(%rdi), %xmm0
movaps %xmm0, 0xa0(%rsp)
movups 0x100(%rdi), %xmm0
movaps %xmm0, 0x90(%rsp)
movups 0x110(%rdi), %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x278(%rdi), %rbp
movq (%rdi), %r13
movq 0x8(%rdi), %r15
movb 0x238(%rdi), %cl
movb %cl, (%rsp)
movq 0xe8(%rdi), %r12
movb 0x1c9(%rdi), %cl
movb %cl, 0x8(%rsp)
cmpb $0x0, 0x1c8(%rdi)
je 0x24c642
movb 0x36c(%rbx), %cl
leaq 0x5e(%rsp), %rdx
movb %cl, (%rdx)
leaq 0x18(%rbx), %rsi
movq %rax, %rdi
jmp 0x24c64b
leaq 0x18(%rbx), %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x24b854
movq %rax, %r14
testq %rax, %rax
je 0x24cc8a
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x68(%r14)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x78(%r14)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x88(%r14)
movaps 0x60(%rsp), %xmm0
movups %xmm0, 0x98(%r14)
movaps 0xd0(%rsp), %xmm0
movups %xmm0, 0xb8(%r14)
movaps 0xc0(%rsp), %xmm0
movups %xmm0, 0xc8(%r14)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, 0xd8(%r14)
movaps 0xa0(%rsp), %xmm0
movups %xmm0, 0xf0(%r14)
movaps 0x90(%rsp), %xmm0
movups %xmm0, 0x100(%r14)
movaps 0x80(%rsp), %xmm0
movups %xmm0, 0x110(%r14)
movq %rbp, 0x278(%r14)
movq %r13, (%r14)
cmpq %r15, %r13
cmovneq %r14, %r13
movq %r13, 0x8(%r14)
cmpq %rbx, %r12
je 0x24c70b
movq %r12, 0xe8(%r14)
movb (%rsp), %al
movb %al, 0x238(%r14)
movb 0x8(%rsp), %al
movb %al, 0x1c9(%r14)
movq %rbx, 0x370(%r14)
movq 0x290(%r14), %rcx
movq 0x28(%rsp), %rax
movq 0x78(%rax), %rbx
movq 0x88(%rax), %r15
leaq 0xa0(%rcx), %rax
movq %rax, (%rsp)
movq %rcx, 0x10(%rsp)
leaq 0x78(%rcx), %rax
movq %rax, 0x8(%rsp)
shlq $0x3, %r15
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x24c7a2
movq (%rbx,%r12), %rax
testq %rax, %rax
je 0x24c79c
movq (%rax), %rsi
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
movl $0x10, %edx
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x24f9cf
testq %rax, %rax
je 0x24cc82
addq $0x8, %r12
jmp 0x24c75e
movq 0x28(%rsp), %rax
movq 0x50(%rax), %r15
movq 0x60(%rax), %r13
movq 0x10(%rsp), %rcx
leaq 0x50(%rcx), %rdx
movq %rdx, 0x40(%rsp)
movl $0x108, %edx            # imm = 0x108
addq %rdx, %rax
movq %rax, 0x60(%rsp)
addq %rcx, %rdx
movq %rdx, 0x30(%rsp)
shlq $0x3, %r13
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x24c8a3
movq (%r15,%r12), %rbp
testq %rbp, %rbp
je 0x24c89a
movq 0x10(%rsp), %rdx
movq 0xb8(%rdx), %rax
cmpq 0xb0(%rdx), %rax
jne 0x24c821
movq (%rsp), %rdi
callq 0x24f7dc
testb %al, %al
je 0x24cc82
movq 0x10(%rsp), %rdx
movq 0xb8(%rdx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rdx)
movb $0x0, (%rax)
movq (%rbp), %rsi
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
incq %rax
movl $0x18, %edx
movq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x24f9cf
testq %rax, %rax
je 0x24cc82
movq %rax, %rbx
movb 0x10(%rbp), %al
movb %al, 0x10(%rbx)
movq 0x8(%rbp), %rcx
testq %rcx, %rcx
je 0x24c89a
movb 0x11(%rbp), %al
movb %al, 0x11(%rbx)
movq 0x30(%rsp), %rax
cmpq 0x60(%rsp), %rcx
je 0x24c896
movq (%rcx), %rsi
movq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x24f9cf
movq %rax, 0x8(%rbx)
addq $0x8, %r12
jmp 0x24c7d9
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rbp
movq 0x38(%rax), %rax
leaq (,%rax,8), %rax
addq %rbp, %rax
movq %rax, 0x30(%rsp)
movq 0x10(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x60(%rsp)
cmpq 0x30(%rsp), %rbp
je 0x24c9ff
movq (%rbp), %r15
addq $0x8, %rbp
testq %r15, %r15
je 0x24c8ce
movq (%r15), %rsi
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
movl $0x28, %edx
movq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x24f9cf
testq %rax, %rax
je 0x24cc82
movq %rax, %rbx
movslq 0x18(%r15), %rax
testq %rax, %rax
je 0x24c93b
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq *0x18(%r14)
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x24cc7b
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x24c957
movq (%rax), %rsi
movq 0x40(%rsp), %rdi
xorl %edx, %edx
callq 0x24f9cf
movq %rax, 0x10(%rbx)
movl 0x18(%r15), %eax
movl %eax, 0x18(%rbx)
movl %eax, 0x1c(%rbx)
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x24c980
movq (%rcx), %rsi
movq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x24f9cf
movq %rax, 0x8(%rbx)
movl 0x18(%rbx), %eax
testl %eax, %eax
jle 0x24c8ce
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x20(%r15), %rax
movq (%rax,%r12), %rax
movq (%rax), %rsi
movq 0x40(%rsp), %rdi
xorl %edx, %edx
callq 0x24f9cf
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r12)
movq 0x20(%r15), %rax
movb 0x8(%rax,%r12), %dl
movb %dl, 0x8(%rcx,%r12)
movq 0x10(%rax,%r12), %rsi
testq %rsi, %rsi
je 0x24c9e1
movq (%rsp), %rdi
callq 0x24c4fc
movq 0x20(%rbx), %rcx
movq %rax, 0x10(%rcx,%r12)
testq %rax, %rax
jne 0x24c9ea
jmp 0x24cc82
movq $0x0, 0x10(%rcx,%r12)
incq %r13
movslq 0x18(%rbx), %rax
addq $0x18, %r12
cmpq %rax, %r13
jl 0x24c98e
jmp 0x24c8ce
movq 0x28(%rsp), %rax
movq (%rax), %r13
movq 0x10(%rax), %rax
leaq (,%rax,8), %rbp
addq %r13, %rbp
movq $0x0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x10(%rsp), %rdx
cmpq %rbp, %r13
je 0x24cbef
movq (%r13), %rbx
addq $0x8, %r13
testq %rbx, %rbx
je 0x24ca2d
movq (%rbx), %rsi
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
movl $0x40, %edx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x24f9cf
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x24cc82
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x24cb0a
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
movq 0x8(%rsp), %rcx
movq %rax, 0x18(%rcx)
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x24cadd
cmpq 0x40(%rsp), %r15
je 0x24cacf
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x24c4fc
movq %r15, 0x40(%rsp)
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x24cc82
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rax, 0x20(%rcx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x24cbb5
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
movq 0x8(%rsp), %rcx
movq %rax, 0x28(%rcx)
jmp 0x24cbb5
movq 0x8(%rbx), %r15
movl 0x10(%rbx), %r12d
movq 0x10(%rsp), %rax
cmpq $0x0, 0xb8(%rax)
jne 0x24cb32
movq (%rsp), %rdi
callq 0x24f7dc
testb %al, %al
je 0x24cc82
testl %r12d, %r12d
movq 0x10(%rsp), %rsi
jle 0x24cb88
incl %r12d
movq 0xb8(%rsi), %rax
cmpq 0xb0(%rsi), %rax
jne 0x24cb6c
movq (%rsp), %rdi
callq 0x24f7dc
testb %al, %al
je 0x24cc82
movq 0x10(%rsp), %rsi
movq 0xb8(%rsi), %rax
movb (%r15), %cl
leaq 0x1(%rax), %rdx
movq %rdx, 0xb8(%rsi)
movb %cl, (%rax)
incq %r15
decl %r12d
cmpl $0x1, %r12d
jg 0x24cb3f
movq 0xb8(%rsi), %rcx
movq 0xc0(%rsi), %rax
movq %rcx, 0xc0(%rsi)
testq %rax, %rax
je 0x24cc82
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
movl 0x10(%rbx), %eax
movl %eax, 0x10(%rcx)
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x24cbd9
movq (%rsp), %rdi
callq 0x24c4fc
testq %rax, %rax
je 0x24cc82
movq 0x8(%rsp), %rcx
movq %rax, 0x30(%rcx)
movb 0x39(%rbx), %al
movq 0x8(%rsp), %rcx
movb %al, 0x39(%rcx)
movb 0x3a(%rbx), %al
movb %al, 0x3a(%rcx)
jmp 0x24ca28
movq 0x28(%rsp), %rcx
movb 0x100(%rcx), %al
movb %al, 0x100(%rdx)
movb 0x101(%rcx), %al
movb %al, 0x101(%rdx)
movb 0x102(%rcx), %al
movb %al, 0x102(%rdx)
movb 0x118(%rcx), %al
movb %al, 0x118(%rdx)
movq 0x120(%rcx), %rax
movq %rax, 0x120(%rdx)
movq 0x128(%rcx), %rax
movq %rax, 0x128(%rdx)
movl 0x134(%rcx), %eax
movl %eax, 0x134(%rdx)
movq 0x138(%rcx), %rax
movq %rax, 0x138(%rdx)
movq %r14, %rdi
movq 0x78(%rsp), %rsi
callq 0x24baee
testb %al, %al
je 0x24cc82
leaq 0x30(%rip), %rax        # 0x24cca2
movq %rax, 0x200(%r14)
jmp 0x24cc8d
movq %rbx, %rdi
callq *0x28(%r14)
movq %r14, %rdi
callq 0x24bd74
xorl %r14d, %r14d
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq