// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: appendAttributeValue
static enum XML_Error
appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
                     const char *ptr, const char *end,
                     STRING_POOL *pool)
{
  DTD * const dtd = _dtd;  /* save one level of indirection */
  for (;;) {
    const char *next;
    int tok = XmlAttributeValueTok(enc, ptr, end, &next);
    switch (tok) {
    case XML_TOK_NONE:
      return XML_ERROR_NONE;
    case XML_TOK_INVALID:
      if (enc == encoding)
        eventPtr = next;
      return XML_ERROR_INVALID_TOKEN;
    case XML_TOK_PARTIAL:
      if (enc == encoding)
        eventPtr = ptr;
      return XML_ERROR_INVALID_TOKEN;
    case XML_TOK_CHAR_REF:
      {
        XML_Char buf[XML_ENCODE_MAX];
        int i;
        int n = XmlCharRefNumber(enc, ptr);
        if (n < 0) {
          if (enc == encoding)
            eventPtr = ptr;
          return XML_ERROR_BAD_CHAR_REF;
        }
        if (!isCdata
            && n == 0x20 /* space */
            && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
          break;
        n = XmlEncode(n, (ICHAR *)buf);
        if (!n) {
          if (enc == encoding)
            eventPtr = ptr;
          return XML_ERROR_BAD_CHAR_REF;
        }
        for (i = 0; i < n; i++) {
          if (!poolAppendChar(pool, buf[i]))
            return XML_ERROR_NO_MEMORY;
        }
      }
      break;
    case XML_TOK_DATA_CHARS:
      if (!poolAppend(pool, enc, ptr, next))
        return XML_ERROR_NO_MEMORY;
      break;
    case XML_TOK_TRAILING_CR:
      next = ptr + enc->minBytesPerChar;
      /* fall through */
    case XML_TOK_ATTRIBUTE_VALUE_S:
    case XML_TOK_DATA_NEWLINE:
      if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
        break;
      if (!poolAppendChar(pool, 0x20))
        return XML_ERROR_NO_MEMORY;
      break;
    case XML_TOK_ENTITY_REF:
      {
        const XML_Char *name;
        ENTITY *entity;
        char checkEntityDecl;
        XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc,
                                              ptr + enc->minBytesPerChar,
                                              next - enc->minBytesPerChar);
        if (ch) {
          if (!poolAppendChar(pool, ch))
                return XML_ERROR_NO_MEMORY;
          break;
        }
        name = poolStoreString(&temp2Pool, enc,
                               ptr + enc->minBytesPerChar,
                               next - enc->minBytesPerChar);
        if (!name)
          return XML_ERROR_NO_MEMORY;
        entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
        poolDiscard(&temp2Pool);
        /* First, determine if a check for an existing declaration is needed;
           if yes, check that the entity exists, and that it is internal.
        */
        if (pool == &dtd->pool)  /* are we called from prolog? */
          checkEntityDecl =
#ifdef XML_DTD
              prologState.documentEntity &&
#endif /* XML_DTD */
              (dtd->standalone
               ? !openInternalEntities
               : !dtd->hasParamEntityRefs);
        else /* if (pool == &tempPool): we are called from content */
          checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
        if (checkEntityDecl) {
          if (!entity)
            return XML_ERROR_UNDEFINED_ENTITY;
          else if (!entity->is_internal)
            return XML_ERROR_ENTITY_DECLARED_IN_PE;
        }
        else if (!entity) {
          /* Cannot report skipped entity here - see comments on
             skippedEntityHandler.
          if (skippedEntityHandler)
            skippedEntityHandler(handlerArg, name, 0);
          */
          /* Cannot call the default handler because this would be
             out of sync with the call to the startElementHandler.
          if ((pool == &tempPool) && defaultHandler)
            reportDefault(parser, enc, ptr, next);
          */
          break;
        }
        if (entity->open) {
          if (enc == encoding)
            eventPtr = ptr;
          return XML_ERROR_RECURSIVE_ENTITY_REF;
        }
        if (entity->notation) {
          if (enc == encoding)
            eventPtr = ptr;
          return XML_ERROR_BINARY_ENTITY_REF;
        }
        if (!entity->textPtr) {
          if (enc == encoding)
            eventPtr = ptr;
              return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
        }
        else {
          enum XML_Error result;
          const XML_Char *textEnd = entity->textPtr + entity->textLen;
          entity->open = XML_TRUE;
          result = appendAttributeValue(parser, internalEncoding, isCdata,
                                        (char *)entity->textPtr,
                                        (char *)textEnd, pool);
          entity->open = XML_FALSE;
          if (result)
            return result;
        }
      }
      break;
    default:
      if (enc == encoding)
        eventPtr = ptr;
      return XML_ERROR_UNEXPECTED_STATE;
    }
    ptr = next;
  }
  /* not reached */
}

// Assembly:
subq $0x88, %rsp
movb %dl, %al
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movb %al, 0x6f(%rsp)
movq %rcx, 0x60(%rsp)
movq %r8, 0x58(%rsp)
movq %r9, 0x50(%rsp)
movq 0x78(%rsp), %rax
movq 0x290(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
movq 0x18(%rdi), %rax
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq *%rax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
addl $0x4, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x2b, %eax
ja 0x380d0b
movq 0x8(%rsp), %rax
leaq 0x21de38(%rip), %rcx    # 0x59e520
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, 0x84(%rsp)
jmp 0x380d4b
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x380725
movq 0x40(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0x4, 0x84(%rsp)
jmp 0x380d4b
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x380759
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0x4, 0x84(%rsp)
jmp 0x380d4b
movq 0x70(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x70(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq *%rax
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
jge 0x3807bd
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x3807ad
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0xe, 0x84(%rsp)
jmp 0x380d4b
cmpb $0x0, 0x6f(%rsp)
jne 0x3807fd
cmpl $0x20, 0x30(%rsp)
jne 0x3807fd
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
movq 0x20(%rcx), %rcx
subq %rcx, %rax
cmpq $0x0, %rax
je 0x3807f8
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movsbl -0x1(%rax), %eax
cmpl $0x20, %eax
jne 0x3807fd
jmp 0x380d3c
movl 0x30(%rsp), %edi
leaq 0x38(%rsp), %rsi
callq 0x383b40
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
jne 0x38084a
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x38083a
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0xe, 0x84(%rsp)
jmp 0x380d4b
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x3808ca
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x380886
movq 0x50(%rsp), %rdi
callq 0x37a570
cmpb $0x0, %al
jne 0x380886
xorl %eax, %eax
testb $0x1, %al
jne 0x3808bb
jmp 0x3808ab
movslq 0x34(%rsp), %rax
movb 0x38(%rsp,%rax), %cl
movq 0x50(%rsp), %rdx
movq 0x18(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x18(%rdx)
movb %cl, (%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x3808bb
movl $0x1, 0x84(%rsp)
jmp 0x380d4b
jmp 0x3808bd
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x380852
jmp 0x380d3c
movq 0x50(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x37a2c0
cmpq $0x0, %rax
jne 0x3808fe
movl $0x1, 0x84(%rsp)
jmp 0x380d4b
jmp 0x380d3c
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x80(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
cmpb $0x0, 0x6f(%rsp)
jne 0x380955
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
movq 0x20(%rcx), %rcx
subq %rcx, %rax
cmpq $0x0, %rax
je 0x380950
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movsbl -0x1(%rax), %eax
cmpl $0x20, %eax
jne 0x380955
jmp 0x380d3c
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x38097f
movq 0x50(%rsp), %rdi
callq 0x37a570
cmpb $0x0, %al
jne 0x38097f
xorl %eax, %eax
testb $0x1, %al
jne 0x3809ac
jmp 0x38099c
movq 0x50(%rsp), %rcx
movq 0x18(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rcx)
movb $0x20, (%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x3809ac
movl $0x1, 0x84(%rsp)
jmp 0x380d4b
jmp 0x380d3c
movq 0x70(%rsp), %rax
movq 0x58(%rax), %rax
movq 0x70(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %rcx
movslq 0x80(%rcx), %rcx
addq %rcx, %rsi
movq 0x40(%rsp), %rdx
movq 0x70(%rsp), %rcx
movslq 0x80(%rcx), %r8
xorl %ecx, %ecx
subq %r8, %rcx
addq %rcx, %rdx
callq *%rax
movb %al, 0x1e(%rsp)
cmpb $0x0, 0x1e(%rsp)
je 0x380a58
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x380a23
movq 0x50(%rsp), %rdi
callq 0x37a570
cmpb $0x0, %al
jne 0x380a23
xorl %eax, %eax
testb $0x1, %al
jne 0x380a53
jmp 0x380a43
movb 0x1e(%rsp), %cl
movq 0x50(%rsp), %rdx
movq 0x18(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x18(%rdx)
movb %cl, (%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x380a53
movl $0x1, 0x84(%rsp)
jmp 0x380d4b
jmp 0x380d3c
movq 0x78(%rsp), %rdi
addq $0x330, %rdi            # imm = 0x330
movq 0x70(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x70(%rsp), %rax
movslq 0x80(%rax), %rax
addq %rax, %rdx
movq 0x40(%rsp), %rcx
movq 0x70(%rsp), %rax
movslq 0x80(%rax), %r8
xorl %eax, %eax
subq %r8, %rax
addq %rax, %rcx
callq 0x379ae0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x380ab8
movl $0x1, 0x84(%rsp)
jmp 0x380d4b
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x37ade0
movq %rax, 0x20(%rsp)
movq 0x78(%rsp), %rax
movq 0x350(%rax), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x348(%rax)
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
addq $0xa0, %rcx
cmpq %rcx, %rax
jne 0x380b50
movq 0x48(%rsp), %rax
movzbl 0x102(%rax), %eax
cmpl $0x0, %eax
je 0x380b2c
movq 0x78(%rsp), %rax
cmpq $0x0, 0x228(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
jmp 0x380b46
movq 0x48(%rsp), %rax
cmpb $0x0, 0x101(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movb %al, 0x1f(%rsp)
jmp 0x380b87
movq 0x48(%rsp), %rcx
movb $0x1, %al
cmpb $0x0, 0x101(%rcx)
movb %al, 0x3(%rsp)
je 0x380b7a
movq 0x48(%rsp), %rax
movzbl 0x102(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, 0x1f(%rsp)
cmpb $0x0, 0x1f(%rsp)
je 0x380bc5
cmpq $0x0, 0x20(%rsp)
jne 0x380ba6
movl $0xb, 0x84(%rsp)
jmp 0x380d4b
movq 0x20(%rsp), %rax
cmpb $0x0, 0x3a(%rax)
jne 0x380bc1
movl $0x18, 0x84(%rsp)
jmp 0x380d4b
jmp 0x380bc3
jmp 0x380bd4
cmpq $0x0, 0x20(%rsp)
jne 0x380bd2
jmp 0x380d3c
jmp 0x380bd4
movq 0x20(%rsp), %rax
cmpb $0x0, 0x38(%rax)
je 0x380c13
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x380c03
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0xc, 0x84(%rsp)
jmp 0x380d4b
movq 0x20(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x380c53
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x380c43
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0xf, 0x84(%rsp)
jmp 0x380d4b
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x380c93
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x380c83
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0x10, 0x84(%rsp)
jmp 0x380d4b
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
movslq 0x10(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movb $0x1, 0x38(%rax)
movq 0x78(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x1b8(%rax), %rsi
movb 0x6f(%rsp), %al
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%rsp), %r8
movq 0x50(%rsp), %r9
movzbl %al, %edx
callq 0x380670
movl %eax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movb $0x0, 0x38(%rax)
cmpl $0x0, 0x18(%rsp)
je 0x380d07
movl 0x18(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x380d4b
jmp 0x380d09
jmp 0x380d3c
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x380d2f
movq 0x60(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x210(%rax)
movl $0x17, 0x84(%rsp)
jmp 0x380d4b
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x3806a7
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq
nopw (%rax,%rax)