// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: internalEntityProcessor
static enum XML_Error PTRCALL
internalEntityProcessor(XML_Parser parser,
                        const char *s,
                        const char *end,
                        const char **nextPtr)
{
  ENTITY *entity;
  const char *textStart, *textEnd;
  const char *next;
  enum XML_Error result;
  OPEN_INTERNAL_ENTITY *openEntity = openInternalEntities;
  if (!openEntity)
    return XML_ERROR_UNEXPECTED_STATE;

  entity = openEntity->entity;
  textStart = ((char *)entity->textPtr) + entity->processed;
  textEnd = (char *)(entity->textPtr + entity->textLen);

#ifdef XML_DTD
  if (entity->is_param) {
    int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
    result = doProlog(parser, internalEncoding, textStart, textEnd, tok, 
                      next, &next, XML_FALSE);
  }
  else
#endif /* XML_DTD */
    result = doContent(parser, openEntity->startTagLevel, internalEncoding, 
                       textStart, textEnd, &next, XML_FALSE);  

  if (result != XML_ERROR_NONE)
    return result;
  else if (textEnd != next && ps_parsing == XML_SUSPENDED) {
    entity->processed = (int)(next - (char *)entity->textPtr);
    return result;
  }
  else {
    entity->open = XML_FALSE;
    openInternalEntities = openEntity->next;
    /* put openEntity back in list of free instances */
    openEntity->next = freeInternalEntities;
    freeInternalEntities = openEntity;
  }

#ifdef XML_DTD
  if (entity->is_param) {
    int tok;
    processor = prologProcessor;
    tok = XmlPrologTok(encoding, s, end, &next);
    return doProlog(parser, encoding, s, end, tok, next, nextPtr, 
                    (XML_Bool)!ps_finalBuffer);
  }
  else
#endif /* XML_DTD */
  {
    processor = contentProcessor;
    /* see externalEntityContentProcessor vs contentProcessor */
    return doContent(parser, parentParser ? 1 : 0, encoding, s, end,
                     nextPtr, (XML_Bool)!ps_finalBuffer); 
  }  
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq 0x228(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x37fcae
movl $0x17, 0x64(%rsp)
jmp 0x37fe38
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
movslq 0x14(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
movslq 0x10(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x20(%rax), %esi
movq 0x58(%rsp), %rax
movq 0x1b8(%rax), %rdx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
leaq 0x20(%rsp), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x37b940
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x37fd3e
movl 0x1c(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x37fe38
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x37fd80
movq 0x58(%rsp), %rax
cmpl $0x3, 0x378(%rax)
jne 0x37fd80
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x14(%rax)
movl 0x1c(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x37fe38
movq 0x38(%rsp), %rax
movb $0x0, 0x38(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x228(%rax)
movq 0x58(%rsp), %rax
movq 0x230(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x230(%rax)
jmp 0x37fdc6
movq 0x58(%rsp), %rax
leaq -0x6172(%rip), %rcx     # 0x379c60
movq %rcx, 0x200(%rax)
movq 0x58(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x370(%rax), %rcx
xorl %esi, %esi
movl $0x1, %eax
cmpq $0x0, %rcx
cmovnel %eax, %esi
movq 0x58(%rsp), %rax
movq 0x120(%rax), %rdx
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x58(%rsp), %rax
cmpb $0x0, 0x37c(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x37b940
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)