// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movq %rdx, 0xe8(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x290(%rax), %rax
movq %rax, 0xd0(%rsp)
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0xc8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x70(%rax), %rax
movq %rax, 0xc0(%rsp)
movq 0xe0(%rsp), %rax
movq 0x78(%rax), %rax
movq %rax, 0xb8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x80(%rax), %rax
movq %rax, 0xb0(%rsp)
movq 0xe0(%rsp), %rax
movq 0x88(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x90(%rax), %rax
movq %rax, 0xa0(%rsp)
movq 0xe0(%rsp), %rax
movq 0x98(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0xe0(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x90(%rsp)
movq 0xe0(%rsp), %rax
movq 0xb8(%rax), %rax
movq %rax, 0x88(%rsp)
movq 0xe0(%rsp), %rax
movq 0xc0(%rax), %rax
movq %rax, 0x80(%rsp)
movq 0xe0(%rsp), %rax
movq 0xc8(%rax), %rax
movq %rax, 0x78(%rsp)
movq 0xe0(%rsp), %rax
movq 0xd0(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0xe0(%rsp), %rax
movq 0xd8(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0xe0(%rsp), %rax
movq 0xe0(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0xe0(%rsp), %rax
movq 0xf0(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0xe0(%rsp), %rax
movq 0xf8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0xe0(%rsp), %rax
movq 0x100(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0xe0(%rsp), %rax
movq 0x108(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0xe0(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0xe0(%rsp), %rax
movq 0x118(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0xe0(%rsp), %rax
movq 0x278(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0xe0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0xe0(%rsp), %rax
movb 0x238(%rax), %al
movb %al, 0x17(%rsp)
movq 0xe0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0xe0(%rsp), %rax
movb 0x1c9(%rax), %al
movb %al, 0x7(%rsp)
movq 0xe0(%rsp), %rax
cmpb $0x0, 0x1c8(%rax)
je 0x3740c7
movq 0xe0(%rsp), %rax
movb 0x36c(%rax), %al
movb %al, 0x5(%rsp)
movq 0xe8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
addq $0x18, %rsi
leaq 0x5(%rsp), %rdx
movq 0xd8(%rsp), %rcx
callq 0x372930
movq %rax, 0xe0(%rsp)
jmp 0x3740f4
movq 0xe8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
addq $0x18, %rsi
movq 0xd8(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x372930
movq %rax, 0xe0(%rsp)
cmpq $0x0, 0xe0(%rsp)
jne 0x374110
movq $0x0, 0x100(%rsp)
jmp 0x3743f7
movq 0xc8(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0xc0(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x70(%rax)
movq 0xb8(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x78(%rax)
movq 0xb0(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x80(%rax)
movq 0xa8(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x88(%rax)
movq 0xa0(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x90(%rax)
movq 0x98(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x98(%rax)
movq 0x90(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xa0(%rax)
movq 0x88(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xb8(%rax)
movq 0x80(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xc0(%rax)
movq 0x78(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xc8(%rax)
movq 0x70(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xd0(%rax)
movq 0x68(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xd8(%rax)
movq 0x60(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xe0(%rax)
movq 0x58(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xf0(%rax)
movq 0x50(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xf8(%rax)
movq 0x48(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x100(%rax)
movq 0x40(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x108(%rax)
movq 0x38(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x110(%rax)
movq 0x30(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x118(%rax)
movq 0x28(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x278(%rax)
movq 0x20(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x3742fe
movq 0xe0(%rsp), %rax
movq (%rax), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x374312
movq 0xe0(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
cmpq 0xf8(%rsp), %rax
je 0x374335
movq 0x8(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0xe8(%rax)
movb 0x17(%rsp), %cl
movq 0xe0(%rsp), %rax
movb %cl, 0x238(%rax)
movb 0x7(%rsp), %cl
movq 0xe0(%rsp), %rax
movb %cl, 0x1c9(%rax)
movq 0xf8(%rsp), %rcx
movq 0xe0(%rsp), %rax
movq %rcx, 0x370(%rax)
movq 0xe0(%rsp), %rax
movq 0x290(%rax), %rdi
movq 0xd0(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq $0x18, %rdx
callq 0x374410
cmpl $0x0, %eax
je 0x3743b6
movq 0xe0(%rsp), %rdi
movq 0xf0(%rsp), %rsi
callq 0x372d40
cmpb $0x0, %al
jne 0x3743d1
movq 0xe0(%rsp), %rdi
callq 0x3731e0
movq $0x0, 0x100(%rsp)
jmp 0x3743f7
movq 0xe0(%rsp), %rax
leaq 0x630(%rip), %rcx       # 0x374a10
movq %rcx, 0x200(%rax)
movq 0xe0(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nopw (%rax,%rax)