// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_Parse
enum XML_Status XMLCALL
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
{
  switch (ps_parsing) {
  case XML_SUSPENDED:
    errorCode = XML_ERROR_SUSPENDED;
    return XML_STATUS_ERROR;
  case XML_FINISHED:
    errorCode = XML_ERROR_FINISHED;
    return XML_STATUS_ERROR;
  default:
    ps_parsing = XML_PARSING;
  }

  if (len == 0) {
    ps_finalBuffer = (XML_Bool)isFinal;
    if (!isFinal)
      return XML_STATUS_OK;
    positionPtr = bufferPtr;
    parseEndPtr = bufferEnd;

    /* If data are left over from last buffer, and we now know that these
       data are the final chunk of input, then we have to check them again
       to detect errors based on that fact.
    */
    errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);

    if (errorCode == XML_ERROR_NONE) {
      switch (ps_parsing) {
      case XML_SUSPENDED:
        XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
        positionPtr = bufferPtr;
        return XML_STATUS_SUSPENDED;
      case XML_INITIALIZED: 
      case XML_PARSING:
        ps_parsing = XML_FINISHED;
        /* fall through */
      default:
        return XML_STATUS_OK;
      }
    }
    eventEndPtr = eventPtr;
    processor = errorProcessor;
    return XML_STATUS_ERROR;
  }
#ifndef XML_CONTEXT_BYTES
  else if (bufferPtr == bufferEnd) {
    const char *end;
    int nLeftOver;
    enum XML_Status result = 0;
    parseEndByteIndex += len;
    positionPtr = s;
    ps_finalBuffer = (XML_Bool)isFinal;

    errorCode = processor(parser, s, parseEndPtr = s + len, &end);

    if (errorCode != XML_ERROR_NONE) {
      eventEndPtr = eventPtr;
      processor = errorProcessor;
      return XML_STATUS_ERROR;
    }
    else {
      switch (ps_parsing) {
      case XML_SUSPENDED:
        result = XML_STATUS_SUSPENDED;
        break;
      case XML_INITIALIZED:
      case XML_PARSING:
        result = XML_STATUS_OK;
        if (isFinal) {
          ps_parsing = XML_FINISHED;
          return result;
        }
      case XML_FINISHED:
        break;
      }
    }

    XmlUpdatePosition(encoding, positionPtr, end, &position);
    nLeftOver = s + len - end;
    if (nLeftOver) {
      if (buffer == NULL || nLeftOver > bufferLim - buffer) {
        /* FIXME avoid integer overflow */
        char *temp;
        temp = (buffer == NULL
                ? (char *)MALLOC(len * 2)
                : (char *)REALLOC(buffer, len * 2));
        if (temp == NULL) {
          errorCode = XML_ERROR_NO_MEMORY;
          return XML_STATUS_ERROR;
        }
        buffer = temp;
        if (!buffer) {
          errorCode = XML_ERROR_NO_MEMORY;
          eventPtr = eventEndPtr = NULL;
          processor = errorProcessor;
          return XML_STATUS_ERROR;
        }
        bufferLim = buffer + len * 2;
      }
      memcpy(buffer, end, nLeftOver);
    }
    bufferPtr = buffer;
    bufferEnd = buffer + nLeftOver;
    positionPtr = bufferPtr;
    parseEndPtr = bufferEnd;
    eventPtr = bufferPtr;
    eventEndPtr = bufferPtr;
    return result;
  }
#endif  /* not defined XML_CONTEXT_BYTES */
  else {
    void *buff = XML_GetBuffer(parser, len);
    if (buff == NULL)
      return XML_STATUS_ERROR;
    else {
      memcpy(buff, s, len);
      return XML_ParseBuffer(parser, len, isFinal);
    }
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movl %ecx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movl 0x378(%rax), %eax
movl %eax, 0x14(%rsp)
subl $0x2, %eax
je 0x375343
jmp 0x37531c
movl 0x14(%rsp), %eax
subl $0x3, %eax
jne 0x37535f
jmp 0x375327
movq 0x48(%rsp), %rax
movl $0x21, 0x208(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movl $0x24, 0x208(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movl $0x1, 0x378(%rax)
cmpl $0x0, 0x3c(%rsp)
jne 0x3754e8
movl 0x38(%rsp), %eax
movb %al, %cl
movq 0x48(%rsp), %rax
movb %cl, 0x37c(%rax)
cmpl $0x0, 0x38(%rsp)
jne 0x37539e
movl $0x1, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x220(%rax)
movq 0x48(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x48(%rsp), %rax
movq 0x200(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x48(%rsp), %rcx
movq 0x30(%rcx), %rsi
movq 0x48(%rsp), %rcx
movq 0x50(%rcx), %rdx
movq 0x48(%rsp), %rcx
addq $0x30, %rcx
callq *%rax
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x208(%rax)
movq 0x48(%rsp), %rax
cmpl $0x0, 0x208(%rax)
jne 0x3754b0
movq 0x48(%rsp), %rax
movl 0x378(%rax), %eax
movl %eax, 0x10(%rsp)
subl $0x2, %eax
jb 0x375494
jmp 0x375428
movl 0x10(%rsp), %eax
subl $0x3, %eax
jne 0x3754a3
jmp 0x375433
movq 0x48(%rsp), %rax
movq 0x120(%rax), %rax
movq 0x60(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x120(%rcx), %rdi
movq 0x48(%rsp), %rcx
movq 0x220(%rcx), %rsi
movq 0x48(%rsp), %rcx
movq 0x30(%rcx), %rdx
movq 0x48(%rsp), %rcx
addq $0x2f0, %rcx            # imm = 0x2F0
callq *%rax
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x220(%rax)
movl $0x2, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movl $0x2, 0x378(%rax)
movl $0x1, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movq 0x210(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x218(%rax)
movq 0x48(%rsp), %rax
leaq 0x3dc(%rip), %rcx       # 0x3758b0
movq %rcx, 0x200(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x375850
movl $0x0, 0x28(%rsp)
movslq 0x3c(%rsp), %rcx
movq 0x48(%rsp), %rax
addq 0x48(%rax), %rcx
movq %rcx, 0x48(%rax)
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x220(%rax)
movl 0x38(%rsp), %eax
movb %al, %cl
movq 0x48(%rsp), %rax
movb %cl, 0x37c(%rax)
movq 0x48(%rsp), %rax
movq 0x200(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x40(%rsp), %rdx
movslq 0x3c(%rsp), %rcx
addq %rcx, %rdx
movq 0x48(%rsp), %rcx
movq %rdx, 0x50(%rcx)
leaq 0x30(%rsp), %rcx
callq *%rax
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x208(%rax)
movq 0x48(%rsp), %rax
cmpl $0x0, 0x208(%rax)
je 0x3755c2
movq 0x48(%rsp), %rax
movq 0x210(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x218(%rax)
movq 0x48(%rsp), %rax
leaq 0x302(%rip), %rcx       # 0x3758b0
movq %rcx, 0x200(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movl 0x378(%rax), %eax
movl %eax, 0xc(%rsp)
subl $0x2, %eax
jb 0x3755f8
jmp 0x3755d8
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x375625
jmp 0x3755e3
movl 0xc(%rsp), %eax
subl $0x3, %eax
jne 0x375627
jmp 0x3755ee
movl $0x2, 0x28(%rsp)
jmp 0x375627
movl $0x1, 0x28(%rsp)
cmpl $0x0, 0x38(%rsp)
je 0x375623
movq 0x48(%rsp), %rax
movl $0x2, 0x378(%rax)
movl 0x28(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x37589f
jmp 0x375625
jmp 0x375627
jmp 0x375629
movq 0x48(%rsp), %rax
movq 0x120(%rax), %rax
movq 0x60(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x120(%rcx), %rdi
movq 0x48(%rsp), %rcx
movq 0x220(%rcx), %rsi
movq 0x30(%rsp), %rdx
movq 0x48(%rsp), %rcx
addq $0x2f0, %rcx            # imm = 0x2F0
callq *%rax
movq 0x40(%rsp), %rax
movslq 0x3c(%rsp), %rcx
addq %rcx, %rax
movq 0x30(%rsp), %rcx
subq %rcx, %rax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
je 0x3757c9
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3756b7
movslq 0x2c(%rsp), %rax
movq 0x48(%rsp), %rcx
movq 0x40(%rcx), %rcx
movq 0x48(%rsp), %rdx
movq 0x10(%rdx), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jle 0x3757b1
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x3756dd
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x3c(%rsp), %ecx
shll %ecx
movslq %ecx, %rdi
callq *%rax
movq %rax, (%rsp)
jmp 0x3756fe
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rdi
movl 0x3c(%rsp), %ecx
shll %ecx
movslq %ecx, %rsi
callq *%rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x37572b
movq 0x48(%rsp), %rax
movl $0x1, 0x208(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x20(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x375794
movq 0x48(%rsp), %rax
movl $0x1, 0x208(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x218(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x210(%rax)
movq 0x48(%rsp), %rax
leaq 0x130(%rip), %rcx       # 0x3758b0
movq %rcx, 0x200(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rcx
movl 0x3c(%rsp), %eax
shll %eax
cltq
addq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x30(%rsp), %rsi
movslq 0x2c(%rsp), %rdx
callq 0x19610
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rcx
movslq 0x2c(%rsp), %rax
addq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x220(%rax)
movq 0x48(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x210(%rax)
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x218(%rax)
movl 0x28(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x37589f
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x3758d0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x375875
movl $0x0, 0x54(%rsp)
jmp 0x37589f
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
movslq 0x3c(%rsp), %rdx
callq 0x19610
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
callq 0x375b40
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax,%rax)