// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: normal_prologTok
static int PTRCALL
PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
                  const char **nextTokPtr)
{
  int tok;
  if (ptr == end)
    return XML_TOK_NONE;
  if (MINBPC(enc) > 1) {
    size_t n = end - ptr;
    if (n & (MINBPC(enc) - 1)) {
      n &= ~(MINBPC(enc) - 1);
      if (n == 0)
        return XML_TOK_PARTIAL;
      end = ptr + n;
    }
  }
  switch (BYTE_TYPE(enc, ptr)) {
  case BT_QUOT:
    return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr);
  case BT_APOS:
    return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr);
  case BT_LT:
    {
      ptr += MINBPC(enc);
      if (ptr == end)
        return XML_TOK_PARTIAL;
      switch (BYTE_TYPE(enc, ptr)) {
      case BT_EXCL:
        return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr);
      case BT_QUEST:
        return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr);
      case BT_NMSTRT:
      case BT_HEX:
      case BT_NONASCII:
      case BT_LEAD2:
      case BT_LEAD3:
      case BT_LEAD4:
        *nextTokPtr = ptr - MINBPC(enc);
        return XML_TOK_INSTANCE_START;
      }
      *nextTokPtr = ptr;
      return XML_TOK_INVALID;
    }
  case BT_CR:
    if (ptr + MINBPC(enc) == end) {
      *nextTokPtr = end;
      /* indicate that this might be part of a CR/LF pair */
      return -XML_TOK_PROLOG_S;
    }
    /* fall through */
  case BT_S: case BT_LF:
    for (;;) {
      ptr += MINBPC(enc);
      if (ptr == end)
        break;
      switch (BYTE_TYPE(enc, ptr)) {
      case BT_S: case BT_LF:
        break;
      case BT_CR:
        /* don't split CR/LF pair */
        if (ptr + MINBPC(enc) != end)
          break;
        /* fall through */
      default:
        *nextTokPtr = ptr;
        return XML_TOK_PROLOG_S;
      }
    }
    *nextTokPtr = ptr;
    return XML_TOK_PROLOG_S;
  case BT_PERCNT:
    return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr);
  case BT_COMMA:
    *nextTokPtr = ptr + MINBPC(enc);
    return XML_TOK_COMMA;
  case BT_LSQB:
    *nextTokPtr = ptr + MINBPC(enc);
    return XML_TOK_OPEN_BRACKET;
  case BT_RSQB:
    ptr += MINBPC(enc);
    if (ptr == end)
      return -XML_TOK_CLOSE_BRACKET;
    if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) {
      if (ptr + MINBPC(enc) == end)
        return XML_TOK_PARTIAL;
      if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) {
        *nextTokPtr = ptr + 2*MINBPC(enc);
        return XML_TOK_COND_SECT_CLOSE;
      }
    }
    *nextTokPtr = ptr;
    return XML_TOK_CLOSE_BRACKET;
  case BT_LPAR:
    *nextTokPtr = ptr + MINBPC(enc);
    return XML_TOK_OPEN_PAREN;
  case BT_RPAR:
    ptr += MINBPC(enc);
    if (ptr == end)
      return -XML_TOK_CLOSE_PAREN;
    switch (BYTE_TYPE(enc, ptr)) {
    case BT_AST:
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_CLOSE_PAREN_ASTERISK;
    case BT_QUEST:
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_CLOSE_PAREN_QUESTION;
    case BT_PLUS:
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_CLOSE_PAREN_PLUS;
    case BT_CR: case BT_LF: case BT_S:
    case BT_GT: case BT_COMMA: case BT_VERBAR:
    case BT_RPAR:
      *nextTokPtr = ptr;
      return XML_TOK_CLOSE_PAREN;
    }
    *nextTokPtr = ptr;
    return XML_TOK_INVALID;
  case BT_VERBAR:
    *nextTokPtr = ptr + MINBPC(enc);
    return XML_TOK_OR;
  case BT_GT:
    *nextTokPtr = ptr + MINBPC(enc);
    return XML_TOK_DECL_CLOSE;
  case BT_NUM:
    return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr);
#define LEAD_CASE(n) \
  case BT_LEAD ## n: \
    if (end - ptr < n) \
      return XML_TOK_PARTIAL_CHAR; \
    if (IS_NMSTRT_CHAR(enc, ptr, n)) { \
      ptr += n; \
      tok = XML_TOK_NAME; \
      break; \
    } \
    if (IS_NAME_CHAR(enc, ptr, n)) { \
      ptr += n; \
      tok = XML_TOK_NMTOKEN; \
      break; \
    } \
    *nextTokPtr = ptr; \
    return XML_TOK_INVALID;
    LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
#undef LEAD_CASE
  case BT_NMSTRT:
  case BT_HEX:
    tok = XML_TOK_NAME;
    ptr += MINBPC(enc);
    break;
  case BT_DIGIT:
  case BT_NAME:
  case BT_MINUS:
#ifdef XML_NS
  case BT_COLON:
#endif
    tok = XML_TOK_NMTOKEN;
    ptr += MINBPC(enc);
    break;
  case BT_NONASCII:
    if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) {
      ptr += MINBPC(enc);
      tok = XML_TOK_NAME;
      break;
    }
    if (IS_NAME_CHAR_MINBPC(enc, ptr)) {
      ptr += MINBPC(enc);
      tok = XML_TOK_NMTOKEN;
      break;
    }
    /* fall through */
  default:
    *nextTokPtr = ptr;
    return XML_TOK_INVALID;
  }
  while (ptr != end) {
    switch (BYTE_TYPE(enc, ptr)) {
    CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
    case BT_GT: case BT_RPAR: case BT_COMMA:
    case BT_VERBAR: case BT_LSQB: case BT_PERCNT:
    case BT_S: case BT_CR: case BT_LF:
      *nextTokPtr = ptr;
      return tok;
#ifdef XML_NS
    case BT_COLON:
      ptr += MINBPC(enc);
      switch (tok) {
      case XML_TOK_NAME:
        if (ptr == end)
          return XML_TOK_PARTIAL;
        tok = XML_TOK_PREFIXED_NAME;
        switch (BYTE_TYPE(enc, ptr)) {
        CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
        default:
          tok = XML_TOK_NMTOKEN;
          break;
        }
        break;
      case XML_TOK_PREFIXED_NAME:
        tok = XML_TOK_NMTOKEN;
        break;
      }
      break;
#endif
    case BT_PLUS:
      if (tok == XML_TOK_NMTOKEN)  {
        *nextTokPtr = ptr;
        return XML_TOK_INVALID;
      }
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_NAME_PLUS;
    case BT_AST:
      if (tok == XML_TOK_NMTOKEN)  {
        *nextTokPtr = ptr;
        return XML_TOK_INVALID;
      }
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_NAME_ASTERISK;
    case BT_QUEST:
      if (tok == XML_TOK_NMTOKEN)  {
        *nextTokPtr = ptr;
        return XML_TOK_INVALID;
      }
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_NAME_QUESTION;
    default:
      *nextTokPtr = ptr;
      return XML_TOK_INVALID;
    }
  }
  return -tok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rdx, %rsi
je 0x25484e
movq %rcx, %r8
movq %rsi, %r14
movq %rdi, %r12
movzbl (%rsi), %eax
movzbl 0x88(%rdi,%rax), %eax
xorl %ebp, %ebp
addl $-0x2, %eax
cmpl $0x22, %eax
ja 0x254f02
movq %rdx, %r15
movl $0x12, %r13d
movl $0x1, %ebx
leaq 0x176f99(%rip), %rcx    # 0x3cb7d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x13, %r13d
movb $0x1, %bpl
jmp 0x254c05
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x254f05
incq %r14
movq %r14, (%r8)
movl $0x26, %ebp
jmp 0x254f05
incq %r14
movl $0xd, %edi
jmp 0x25487a
incq %r14
movl $0xc, %edi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x256122
incq %r14
movq %r14, (%r8)
movl $0x15, %ebp
jmp 0x254f05
incq %r14
movq %r14, (%r8)
movl $0x17, %ebp
jmp 0x254f05
leaq 0x1(%r14), %rax
cmpq %r15, %rax
je 0x254b34
incq %r14
cmpq %r15, %r14
je 0x2548fb
movzbl (%r14), %eax
movzbl 0x88(%r12,%rax), %eax
cmpl $0x15, %eax
je 0x2548f0
cmpl $0xa, %eax
je 0x2548f0
cmpl $0x9, %eax
jne 0x2548fb
leaq 0x1(%r14), %rax
cmpq %r15, %rax
je 0x2548fb
incq %r14
cmpq %r15, %r14
jne 0x2548cb
movq %r15, %r14
movq %r14, (%r8)
movl $0xf, %ebp
jmp 0x254f05
movq %r15, %rax
subq %r14, %rax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x4, %rax
jl 0x254f05
movq %r8, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq *0x1b0(%r12)
movl $0x4, %ebx
testl %eax, %eax
jne 0x254a56
movq %r12, %rdi
movq %r14, %rsi
callq *0x198(%r12)
jmp 0x254bf0
leaq 0x1(%r14), %rax
cmpq %r15, %rax
je 0x254b1d
movzbl (%rax), %ecx
movzbl 0x88(%r12,%rcx), %ecx
leal -0xf(%rcx), %edx
cmpl $0x9, %edx
jbe 0x254b55
leal -0x5(%rcx), %edx
cmpl $0x3, %edx
jb 0x254b65
cmpl $0x1d, %ecx
jne 0x254d34
jmp 0x254b65
movq %r15, %rax
subq %r14, %rax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x2, %rax
jl 0x254f05
movq %r8, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq *0x1a0(%r12)
movl $0x2, %ebx
testl %eax, %eax
jne 0x254a56
movq %r12, %rdi
movq %r14, %rsi
callq *0x188(%r12)
jmp 0x254bf0
incq %r14
movq %r14, (%r8)
movl $0x19, %ebp
jmp 0x254f05
leaq 0x1(%r14), %rax
cmpq %r15, %rax
je 0x254b41
cmpb $0x5d, (%rax)
jne 0x254b27
leaq 0x2(%r14), %rcx
cmpq %r15, %rcx
je 0x254b1d
cmpb $0x3e, (%rcx)
jne 0x254b27
addq $0x3, %r14
movq %r14, (%r8)
movl $0x22, %ebp
jmp 0x254f05
movq %r15, %rax
subq %r14, %rax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x3, %rax
jl 0x254f05
movq %r8, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq *0x1a8(%r12)
movl $0x3, %ebx
testl %eax, %eax
je 0x254be2
xorl %ebp, %ebp
jmp 0x254c01
incq %r14
movq %r14, (%r8)
movl $0x11, %ebp
jmp 0x254f05
incq %r14
cmpq %r15, %r14
je 0x254b1d
movzbl (%r14), %eax
movzbl 0x88(%r12,%rax), %eax
xorl %ebp, %ebp
cmpl $0x6, %eax
jle 0x254b9b
cmpl $0x7, %eax
je 0x254d39
movl $0x1, %ecx
cmpl $0x16, %eax
je 0x254da3
cmpl $0x18, %eax
je 0x254da3
jmp 0x254f02
leaq 0x1(%r14), %rax
cmpq %r15, %rax
je 0x254b4b
movzbl (%rax), %ecx
movzbl 0x88(%r12,%rcx), %ecx
cmpl $0x1f, %ecx
jg 0x254b72
leal -0x9(%rcx), %edx
cmpl $0x3, %edx
jb 0x254b8e
cmpl $0xf, %ecx
je 0x254ee4
cmpl $0x15, %ecx
je 0x254b8e
jmp 0x254d34
incq %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r8, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x25660e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x254f05
movq %rax, (%r8)
movl $0x1a, %ebp
jmp 0x254f05
movq %r15, (%r8)
movl $0xfffffff1, %ebp       # imm = 0xFFFFFFF1
jmp 0x254f05
movl $0xffffffe6, %ebp       # imm = 0xFFFFFFE6
jmp 0x254f05
movl $0xffffffe8, %ebp       # imm = 0xFFFFFFE8
jmp 0x254f05
leaq 0x176e14(%rip), %rcx    # 0x3cb970
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %r14, (%r8)
movl $0x1d, %ebp
jmp 0x254f05
addl $-0x20, %ecx
cmpl $0x4, %ecx
ja 0x254d34
leaq 0x176dd7(%rip), %rdx    # 0x3cb95c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rax, (%r8)
movl $0x18, %ebp
jmp 0x254f05
cmpl $0x5, %eax
je 0x254d6b
cmpl $0x6, %eax
jne 0x254f02
movq %r15, %rax
subq %r14, %rax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x3, %rax
jl 0x254f05
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %rbx
callq *0x1a8(%r12)
movq %rbx, %r8
xorl %ebp, %ebp
movl $0x3, %ecx
jmp 0x254d9b
movq %r12, %rdi
movq %r14, %rsi
callq *0x190(%r12)
testl %eax, %eax
je 0x254cee
movl $0x13, %r13d
movb $0x1, %bpl
movq (%rsp), %r8
addq %rbx, %r14
cmpq %r15, %r14
je 0x254cde
leaq 0x176c44(%rip), %rbx    # 0x3cb85c
movl %r13d, (%rsp)
movzbl (%r14), %eax
movzbl 0x88(%r12,%rax), %eax
addl $-0x5, %eax
cmpl $0x1f, %eax
ja 0x254d2a
movl $0x1, %ecx
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq %r15, %rax
subq %r14, %rax
cmpq $0x2, %rax
jl 0x254e72
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %r13
callq *0x188(%r12)
movq %r13, %r8
movl (%rsp), %r13d
movl $0x2, %ecx
jmp 0x254cce
movq %r15, %rax
subq %r14, %rax
cmpq $0x3, %rax
jl 0x254e72
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %r13
callq *0x190(%r12)
movq %r13, %r8
movl (%rsp), %r13d
movl $0x3, %ecx
jmp 0x254cce
movq %r15, %rax
subq %r14, %rax
cmpq $0x4, %rax
jl 0x254e72
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %r13
callq *0x198(%r12)
movq %r13, %r8
movl (%rsp), %r13d
movl $0x4, %ecx
testl %eax, %eax
je 0x254d2a
addq %rcx, %r14
cmpq %r15, %r14
jne 0x254c1c
negl %r13d
jmp 0x254ce6
movq %r14, (%r8)
movl %r13d, %ebp
jmp 0x254f05
movq (%rsp), %rax
movq %r14, (%rax)
jmp 0x254d2d
testb %bpl, %bpl
jne 0x254d2a
incq %r14
movq %r14, (%r8)
movl $0x1f, %ebp
jmp 0x254f05
testb %bpl, %bpl
jne 0x254d2a
incq %r14
movq %r14, (%r8)
movl $0x20, %ebp
jmp 0x254f05
testb %bpl, %bpl
je 0x254ec2
movq %r14, (%r8)
xorl %ebp, %ebp
jmp 0x254f05
movq %rax, (%r8)
jmp 0x254d2d
movq %r15, %rax
subq %r14, %rax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x4, %rax
jl 0x254f05
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %rbx
callq *0x1b0(%r12)
movq %rbx, %r8
xorl %ebp, %ebp
movl $0x4, %ecx
jmp 0x254d9b
movq %r15, %rax
subq %r14, %rax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x2, %rax
jl 0x254f05
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %rbx
callq *0x1a0(%r12)
movq %rbx, %r8
xorl %ebp, %ebp
movl $0x2, %ecx
testl %eax, %eax
je 0x254f02
addq %rcx, %r14
movl $0xffffffec, %ebp       # imm = 0xFFFFFFEC
cmpq %r15, %r14
je 0x254f05
leaq 0x176b21(%rip), %rbx    # 0x3cb8dc
movzbl (%r14), %eax
movzbl 0x88(%r12,%rax), %eax
addl $-0x5, %eax
cmpl $0x1f, %eax
ja 0x254f00
movl $0x1, %ecx
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq %r15, %rax
subq %r14, %rax
cmpq $0x2, %rax
jl 0x254e72
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %r13
callq *0x188(%r12)
movq %r13, %r8
movl $0x2, %ecx
jmp 0x254e59
movq %r15, %rax
subq %r14, %rax
cmpq $0x3, %rax
jl 0x254e72
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %r13
callq *0x190(%r12)
movq %r13, %r8
movl $0x3, %ecx
jmp 0x254e59
movq %r15, %rax
subq %r14, %rax
cmpq $0x4, %rax
jl 0x254e72
movq %r12, %rdi
movq %r14, %rsi
movq %r8, %r13
callq *0x198(%r12)
movq %r13, %r8
movl $0x4, %ecx
testl %eax, %eax
je 0x254f00
addq %rcx, %r14
cmpq %r15, %r14
jne 0x254dbb
jmp 0x254f05
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x254f05
addq $0x2, %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r8, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x256319
addq $0x2, %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r8, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x25624e
incq %r14
movq %r14, (%r8)
movl $0x1e, %ebp
jmp 0x254f05
movl $0x14, %ebp
jmp 0x254f02
addq $0x2, %r14
movq %r14, (%r8)
movl $0x25, %ebp
jmp 0x254f05
addq $0x2, %r14
movq %r14, (%r8)
movl $0x23, %ebp
jmp 0x254f05
addq $0x2, %r14
movq %r14, (%r8)
movl $0x24, %ebp
jmp 0x254f05
xorl %ebp, %ebp
movq %r14, (%r8)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq