// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok.c
// Function: doParseXmlDecl
static int
doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *,
                                                 const char *,
                                                 const char *),
               int isGeneralTextEntity,
               const ENCODING *enc,
               const char *ptr,
               const char *end,
               const char **badPtr,
               const char **versionPtr,
               const char **versionEndPtr,
               const char **encodingName,
               const ENCODING **encoding,
               int *standalone)
{
  const char *val = NULL;
  const char *name = NULL;
  const char *nameEnd = NULL;
  ptr += 5 * enc->minBytesPerChar;
  end -= 2 * enc->minBytesPerChar;
  if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)
      || !name) {
    *badPtr = ptr;
    return 0;
  }
  if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_version)) {
    if (!isGeneralTextEntity) {
      *badPtr = name;
      return 0;
    }
  }
  else {
    if (versionPtr)
      *versionPtr = val;
    if (versionEndPtr)
      *versionEndPtr = ptr;
    if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) {
      *badPtr = ptr;
      return 0;
    }
    if (!name) {
      if (isGeneralTextEntity) {
        /* a TextDecl must have an EncodingDecl */
        *badPtr = ptr;
        return 0;
      }
      return 1;
    }
  }
  if (XmlNameMatchesAscii(enc, name, nameEnd, KW_encoding)) {
    int c = toAscii(enc, val, end);
    if (!(ASCII_a <= c && c <= ASCII_z) && !(ASCII_A <= c && c <= ASCII_Z)) {
      *badPtr = val;
      return 0;
    }
    if (encodingName)
      *encodingName = val;
    if (encoding)
      *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar);
    if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) {
      *badPtr = ptr;
      return 0;
    }
    if (!name)
      return 1;
  }
  if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone)
      || isGeneralTextEntity) {
    *badPtr = name;
    return 0;
  }
  if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_yes)) {
    if (standalone)
      *standalone = 1;
  }
  else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_no)) {
    if (standalone)
      *standalone = 0;
  }
  else {
    *badPtr = val;
    return 0;
  }
  while (isSpace(toAscii(enc, ptr, end)))
    ptr += enc->minBytesPerChar;
  if (ptr != end) {
    *badPtr = ptr;
    return 0;
  }
  return 1;
}

// Assembly:
subq $0x68, %rsp
movq 0x90(%rsp), %rax
movq 0x88(%rsp), %rax
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rax
movq %rdi, 0x58(%rsp)
movl %esi, 0x54(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %rax
imull $0x5, 0x80(%rax), %ecx
movq 0x40(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl 0x80(%rax), %ecx
shll %ecx
movq 0x38(%rsp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x28(%rsp), %r9
leaq 0x40(%rsp), %rax
movq %rax, (%rsp)
callq 0x3984f0
cmpl $0x0, %eax
je 0x384b75
cmpq $0x0, 0x20(%rsp)
jne 0x384b8f
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x21cf01(%rip), %rcx    # 0x5a1aaf
callq *%rax
cmpl $0x0, %eax
jne 0x384bdb
cmpl $0x0, 0x54(%rsp)
jne 0x384bd6
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
jmp 0x384c88
cmpq $0x0, 0x70(%rsp)
je 0x384bf0
movq 0x28(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x78(%rsp)
je 0x384c05
movq 0x40(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x28(%rsp), %r9
leaq 0x40(%rsp), %rax
movq %rax, (%rsp)
callq 0x3984f0
cmpl $0x0, %eax
jne 0x384c50
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
cmpq $0x0, 0x20(%rsp)
jne 0x384c86
cmpl $0x0, 0x54(%rsp)
je 0x384c79
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
movl $0x1, 0x64(%rsp)
jmp 0x384f3c
jmp 0x384c88
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x21ce10(%rip), %rcx    # 0x5a1ab7
callq *%rax
cmpl $0x0, %eax
je 0x384dc8
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x3988b0
movl %eax, 0x14(%rsp)
movl $0x61, %eax
cmpl 0x14(%rsp), %eax
jg 0x384cdc
cmpl $0x7a, 0x14(%rsp)
jle 0x384d08
movl $0x41, %eax
cmpl 0x14(%rsp), %eax
jg 0x384cee
cmpl $0x5a, 0x14(%rsp)
jle 0x384d08
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
cmpq $0x0, 0x80(%rsp)
je 0x384d23
movq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x88(%rsp)
je 0x384d66
movq 0x58(%rsp), %rax
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movslq 0x80(%rcx), %r8
xorl %ecx, %ecx
subq %r8, %rcx
addq %rcx, %rdx
callq *%rax
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x28(%rsp), %r9
leaq 0x40(%rsp), %rax
movq %rax, (%rsp)
callq 0x3984f0
cmpl $0x0, %eax
jne 0x384db1
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
cmpq $0x0, 0x20(%rsp)
jne 0x384dc6
movl $0x1, 0x64(%rsp)
jmp 0x384f3c
jmp 0x384dc8
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x21ccd9(%rip), %rcx    # 0x5a1ac0
callq *%rax
cmpl $0x0, %eax
je 0x384df5
cmpl $0x0, 0x54(%rsp)
je 0x384e0f
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movslq 0x80(%rcx), %r8
xorl %ecx, %ecx
subq %r8, %rcx
addq %rcx, %rdx
leaq 0x21cc89(%rip), %rcx    # 0x5a1acb
callq *%rax
cmpl $0x0, %eax
je 0x384e64
cmpq $0x0, 0x90(%rsp)
je 0x384e62
movq 0x90(%rsp), %rax
movl $0x1, (%rax)
jmp 0x384ed2
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movslq 0x80(%rcx), %r8
xorl %ecx, %ecx
subq %r8, %rcx
addq %rcx, %rdx
leaq 0x21cc38(%rip), %rcx    # 0x5a1acf
callq *%rax
cmpl $0x0, %eax
je 0x384eb9
cmpq $0x0, 0x90(%rsp)
je 0x384eb7
movq 0x90(%rsp), %rax
movl $0x0, (%rax)
jmp 0x384ed0
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
jmp 0x384ed2
jmp 0x384ed4
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x3988b0
movl %eax, %edi
callq 0x398920
cmpl $0x0, %eax
je 0x384f11
movq 0x48(%rsp), %rax
movl 0x80(%rax), %ecx
movq 0x40(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
jmp 0x384ed4
movq 0x40(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x384f34
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x64(%rsp)
jmp 0x384f3c
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)