// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: little2_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 %r12
pushq %rbx
movq %rsi, %r10
cmpq %rdx, %rsi
je 0x2067bc
movq %rcx, %r8
movq %rdx, %rcx
subq %r10, %rcx
movq %rcx, %rax
andq $-0x2, %rax
leaq (%r10,%rax), %r9
testq %rax, %rax
cmoveq %rdx, %r9
testb $0x1, %cl
cmoveq %rdx, %r9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x1, %rcx
je 0x206912
movq %rdi, %rsi
movzbl 0x1(%r10), %edi
leal -0xd8(%rdi), %ecx
cmpl $0x4, %ecx
jb 0x206817
leal -0xdc(%rdi), %ecx
cmpl $0x4, %ecx
jb 0x20690d
movl $0x12, %edx
testl %edi, %edi
je 0x2067c6
cmpl $0xff, %edi
jne 0x206781
cmpb $-0x3, (%r10)
ja 0x20690d
leaq 0x167198(%rip), %rax    # 0x36d920
movzbl (%rdi,%rax), %r11d
movzbl (%r10), %ecx
movl %ecx, %eax
shrl $0x5, %eax
shll $0x5, %r11d
leal (%r11,%rax,4), %ebx
leaq 0x166c7b(%rip), %r11    # 0x36d420
movl (%rbx,%r11), %ebp
movl $0x1, %ebx
shll %cl, %ebx
btl %ecx, %ebp
jae 0x20682e
xorl %eax, %eax
jmp 0x206850
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x206912
movzbl (%r10), %ecx
movzbl 0x88(%rsi,%rcx), %ecx
addl $-0x2, %ecx
cmpl $0x22, %ecx
ja 0x20690d
leaq 0x165c1f(%rip), %r11    # 0x36c404
movslq (%r11,%rcx,4), %rcx
addq %r11, %rcx
jmpq *%rcx
leaq 0x2(%r10), %rcx
cmpq %r9, %rcx
je 0x206912
movzbl 0x3(%r10), %edx
leal -0xdc(%rdx), %edi
cmpl $0x4, %edi
jae 0x206b8c
movq %rcx, (%r8)
jmp 0x206910
subq %r10, %r9
cmpq $0x4, %r9
jge 0x20690d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x206912
leaq 0x1671eb(%rip), %rcx    # 0x36da20
movzbl (%rdi,%rcx), %ecx
shll $0x5, %ecx
leal (%rcx,%rax,4), %eax
testl %ebx, (%rax,%r11)
je 0x20690d
movl $0x13, %edx
movb $0x1, %al
movq %r9, %rcx
subq %r10, %rcx
addq $0x2, %r10
addq $-0x2, %rcx
leaq 0x165d2f(%rip), %rdi    # 0x36c594
leaq 0x1671b4(%rip), %r11    # 0x36da20
leaq 0x166bad(%rip), %rbx    # 0x36d420
cmpq %r9, %r10
je 0x20691b
movzbl 0x1(%r10), %r14d
testl %r14d, %r14d
je 0x2068d5
cmpl $0xff, %r14d
je 0x2068a9
leal -0xd8(%r14), %ebp
cmpl $0x4, %ebp
jb 0x206903
leal -0xdc(%r14), %ebp
cmpl $0x4, %ebp
jae 0x2068af
jmp 0x20690d
cmpb $-0x3, (%r10)
ja 0x20690d
movzbl (%r14,%r11), %ebp
movzbl (%r10), %r14d
shll $0x5, %ebp
movl %r14d, %r15d
shrl $0x3, %r15d
andl $0x1c, %r15d
orl %ebp, %r15d
movl (%r15,%rbx), %ebp
btl %r14d, %ebp
jb 0x2068f6
jmp 0x20690d
movzbl (%r10), %r15d
movzbl 0x88(%rsi,%r15), %r15d
addl $-0x5, %r15d
cmpl $0x1f, %r15d
ja 0x20690d
movslq (%rdi,%r15,4), %r15
addq %rdi, %r15
jmpq *%r15
addq $0x2, %r10
addq $-0x2, %rcx
jmp 0x206873
cmpq $0x4, %rcx
jl 0x206824
movq %r10, (%r8)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
negl %edx
jmp 0x206922
movq %r10, (%r8)
movl %edx, %eax
jmp 0x206912
leaq 0x2(%r10), %rax
cmpq %r9, %rax
je 0x206b02
cmpb $0x0, 0x3(%r10)
je 0x206baa
movq %rax, (%r8)
jmp 0x206910
addq $0x2, %r10
movl $0xd, %edi
jmp 0x206ac0
addq $0x2, %r10
movq %r10, (%r8)
movl $0x15, %eax
jmp 0x206912
addq $0x2, %r10
movq %r10, (%r8)
movl $0x19, %eax
jmp 0x206912
leaq 0x2(%r10), %rcx
cmpq %r9, %rcx
je 0x206b0c
cmpb $0x0, 0x3(%r10)
jne 0x206af5
cmpb $0x5d, (%rcx)
jne 0x206af5
leaq 0x4(%r10), %rdx
cmpq %r9, %rdx
je 0x206912
cmpb $0x0, 0x5(%r10)
jne 0x206af5
cmpb $0x3e, (%rdx)
jne 0x206af5
addq $0x6, %r10
movq %r10, (%r8)
movl $0x22, %eax
jmp 0x206912
leaq 0x2(%r10), %rdx
cmpq %r9, %rdx
je 0x206912
movzbl 0x3(%r10), %eax
xorl %ecx, %ecx
leal -0xd8(%rax), %edi
cmpl $0x4, %edi
jb 0x206c64
leal -0xdc(%rax), %edi
cmpl $0x4, %edi
jb 0x206ea7
testl %eax, %eax
je 0x206c27
cmpl $0xff, %eax
jne 0x206c76
movb (%rdx), %dil
cmpb $-0x3, %dil
jbe 0x206c79
jmp 0x206ea7
addq $0x2, %r10
movq %r10, (%r8)
movl $0x26, %eax
jmp 0x206912
addq $0x2, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x208e1b
leaq 0x2(%r10), %rax
cmpq %r9, %rax
je 0x206b16
addq $0x2, %r10
cmpq %r9, %r10
je 0x206a86
cmpb $0x0, 0x1(%r10)
jne 0x206a86
movzbl (%r10), %eax
movzbl 0x88(%rsi,%rax), %eax
cmpl $0x15, %eax
je 0x206a52
cmpl $0xa, %eax
je 0x206a52
cmpl $0x9, %eax
jne 0x206a86
leaq 0x2(%r10), %rax
cmpq %r9, %rax
jne 0x206a52
movq %r10, (%r8)
movl $0xf, %eax
jmp 0x206912
subq %r10, %r9
cmpq $0x2, %r9
jl 0x206824
jmp 0x20690d
subq %r10, %r9
cmpq $0x3, %r9
jl 0x206824
jmp 0x20690d
addq $0x2, %r10
movl $0xc, %edi
movq %r10, %rdx
movq %r9, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2089eb
addq $0x2, %r10
movq %r10, (%r8)
movl $0x11, %eax
jmp 0x206912
addq $0x2, %r10
movq %r10, (%r8)
movl $0x17, %eax
jmp 0x206912
movq %rcx, (%r8)
movl $0x1a, %eax
jmp 0x206912
movl $0xffffffe8, %eax       # imm = 0xFFFFFFE8
jmp 0x206912
movl $0xffffffe6, %eax       # imm = 0xFFFFFFE6
jmp 0x206912
movq %r9, (%r8)
movl $0xfffffff1, %eax       # imm = 0xFFFFFFF1
jmp 0x206912
testb %al, %al
jne 0x20690d
addq $0x2, %r10
movq %r10, (%r8)
movl $0x20, %eax
jmp 0x206912
cmpq $0x3, %rcx
jl 0x206824
jmp 0x20690d
cmpq $0x2, %rcx
jl 0x206824
jmp 0x20690d
testb %al, %al
jne 0x20690d
addq $0x2, %r10
movq %r10, (%r8)
movl $0x1e, %eax
jmp 0x206912
testb %al, %al
jne 0x20690d
addq $0x2, %r10
movq %r10, (%r8)
movl $0x1f, %eax
jmp 0x206912
testl %edx, %edx
je 0x206bf6
cmpl $0xff, %edx
jne 0x206d93
cmpb $-0x3, (%rcx)
ja 0x20680f
jmp 0x206d93
movzbl (%rax), %ecx
movzbl 0x88(%rsi,%rcx), %ecx
leal -0x20(%rcx), %edx
cmpl $0x4, %edx
jbe 0x206bd9
leal -0x9(%rcx), %edx
cmpl $0x3, %edx
jb 0x206be9
cmpl $0xf, %ecx
je 0x206db1
cmpl $0x15, %ecx
jne 0x20693e
jmp 0x206be9
leaq 0x165930(%rip), %rcx    # 0x36c510
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rax, (%r8)
movl $0x18, %eax
jmp 0x206912
movzbl (%rcx), %edx
movzbl 0x88(%rsi,%rdx), %edx
leal -0xf(%rdx), %edi
cmpl $0x9, %edi
jbe 0x206d83
leal -0x5(%rdx), %eax
cmpl $0x3, %eax
jb 0x206d93
cmpl $0x1d, %edx
jne 0x20680f
jmp 0x206d93
movzbl (%rdx), %edi
movzbl 0x88(%rsi,%rdi), %r11d
cmpl $0x5, %r11d
je 0x206e93
cmpl $0x6, %r11d
je 0x206e84
cmpl $0x7, %r11d
je 0x206c64
cmpl $0x16, %r11d
je 0x206cad
cmpl $0x18, %r11d
je 0x206cad
cmpl $0x1d, %r11d
je 0x206c79
jmp 0x206ea7
subq %rdx, %r9
cmpq $0x4, %r9
jl 0x206824
jmp 0x206ea7
movb (%rdx), %dil
leaq 0x166ca0(%rip), %r11    # 0x36d920
movzbl (%rax,%r11), %eax
movzbl %dil, %r11d
shrb $0x3, %dil
shll $0x5, %eax
movzbl %dil, %edi
andl $0x1c, %edi
orl %eax, %edi
leaq 0x166780(%rip), %rax    # 0x36d420
movl (%rdi,%rax), %eax
btl %r11d, %eax
jae 0x206ea7
movq %r9, %rdi
subq %r10, %rdi
addq $0x4, %r10
addq $-0x4, %rdi
movl $0xffffffec, %eax       # imm = 0xFFFFFFEC
leaq 0x1657c9(%rip), %r11    # 0x36c490
leaq 0x166d52(%rip), %rbx    # 0x36da20
leaq 0x16674b(%rip), %r14    # 0x36d420
movq %r10, %rdx
cmpq %r9, %rdx
je 0x206912
movzbl 0x1(%rdx), %r10d
testl %r10d, %r10d
je 0x206d51
cmpl $0xff, %r10d
je 0x206d19
leal -0xd8(%r10), %ebp
cmpl $0x4, %ebp
jb 0x206dd3
leal -0xdc(%r10), %ebp
cmpl $0x4, %ebp
jb 0x206ea7
movb (%rdx), %r15b
jmp 0x206d26
movb (%rdx), %r15b
cmpb $-0x3, %r15b
ja 0x206ea7
movzbl (%r10,%rbx), %r10d
movzbl %r15b, %ebp
shrb $0x3, %r15b
shll $0x5, %r10d
movzbl %r15b, %r15d
andl $0x1c, %r15d
orl %r10d, %r15d
movl (%r15,%r14), %r10d
btl %ebp, %r10d
jb 0x206d76
jmp 0x206ea7
movzbl (%rdx), %r15d
movzbl 0x88(%rsi,%r15), %r12d
addl $-0x5, %r12d
cmpl $0x1f, %r12d
ja 0x206ea7
movslq (%r11,%r12,4), %r12
addq %r11, %r12
jmpq *%r12
addq $0x2, %rdx
addq $-0x2, %rdi
jmp 0x206cd8
leaq 0x16579a(%rip), %rdx    # 0x36c524
movslq (%rdx,%rdi,4), %rdi
addq %rdx, %rdi
jmpq *%rdi
movq %r10, (%r8)
movl $0x1d, %eax
jmp 0x206912
addq $0x4, %r10
movq %r10, (%r8)
movl $0x25, %eax
jmp 0x206912
addq $0x4, %r10
movq %r10, (%r8)
movl $0x23, %eax
jmp 0x206912
addq $0x4, %r10
movq %r10, (%r8)
movl $0x24, %eax
jmp 0x206912
cmpq $0x4, %rdi
jl 0x206824
jmp 0x206ea7
addq $0x4, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x208ae2
leaq 0x4(%r10), %rcx
cmpq %r9, %rcx
je 0x206912
cmpb $0x0, 0x5(%r10)
jne 0x20680f
movzbl (%rcx), %edx
movzbl 0x88(%rsi,%rdx), %edx
addl $-0x14, %edx
cmpl $0x7, %edx
ja 0x20680f
leaq 0x165717(%rip), %rdi    # 0x36c54c
movslq (%rdi,%rdx,4), %rdx
addq %rdi, %rdx
jmpq *%rdx
addq $0x6, %r10
leaq 0x165723(%rip), %rcx    # 0x36c56c
cmpq %r9, %r10
je 0x206912
cmpb $0x0, 0x1(%r10)
jne 0x20690d
movzbl (%r10), %edx
movzbl 0x88(%rsi,%rdx), %edx
leal -0x15(%rdx), %edi
cmpl $0x9, %edi
ja 0x206ef7
movslq (%rcx,%rdi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
addq $0x2, %r10
jmp 0x206e49
subq %rdx, %r9
cmpq $0x3, %r9
jl 0x206824
jmp 0x206ea7
subq %rdx, %r9
cmpq $0x2, %r9
jl 0x206824
jmp 0x206ea7
movl $0x14, %ecx
movq %rdx, (%r8)
movl %ecx, %eax
jmp 0x206912
cmpq $0x2, %rdi
jl 0x206824
jmp 0x206ea7
cmpq $0x3, %rdi
jl 0x206824
jmp 0x206ea7
addq $0x6, %r10
movq %r10, (%r8)
movl $0x21, %eax
jmp 0x206912
addq $0x6, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x209009
addl $-0x9, %edx
cmpl $0x2, %edx
jae 0x20690d
movq %r10, (%r8)
movl $0x10, %eax
jmp 0x206912
leaq 0x2(%r10), %rcx
cmpq %r9, %rcx
je 0x206912
cmpb $0x0, 0x3(%r10)
jne 0x206f03
movzbl (%rcx), %eax
movzbl 0x88(%rsi,%rax), %eax
cmpl $0x1e, %eax
ja 0x206f03
movl $0x40200600, %ecx       # imm = 0x40200600
btl %eax, %ecx
jb 0x20690d
jmp 0x206f03