// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: big2_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 %rbx
movq %rsi, %r10
cmpq %rdx, %rsi
je 0x2634ea
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 0x2634ef
movq %rdi, %rsi
movzbl (%r10), %edi
cmpl $0xdb, %edi
jg 0x2634f6
movb $0x7, %al
leal -0xd8(%rdi), %ecx
cmpl $0x4, %ecx
jb 0x26351a
testl %edi, %edi
jne 0x263518
movzbl 0x1(%r10), %eax
movb 0x88(%rsi,%rax), %al
jmp 0x26351a
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leal -0xdc(%rdi), %eax
cmpl $0x4, %eax
jae 0x263505
movb $0x8, %al
jmp 0x26351a
cmpl $0xff, %edi
jne 0x263518
cmpb $-0x3, 0x1(%r10)
jbe 0x263518
xorl %eax, %eax
jmp 0x26351a
movb $0x1d, %al
movzbl %al, %ecx
xorl %eax, %eax
addl $-0x2, %ecx
cmpl $0x22, %ecx
ja 0x263915
movl $0x12, %edx
leaq 0x172a09(%rip), %r11    # 0x3d5f40
movslq (%r11,%rcx,4), %rcx
addq %r11, %rcx
jmpq *%rcx
movl $0x13, %edx
movb $0x1, %al
leaq 0x2(%r10), %rcx
cmpq %r9, %rcx
je 0x26362d
movq %r9, %rcx
subq %r10, %rcx
addq $0x4, %r10
addq $-0x2, %rcx
leaq 0x172a63(%rip), %rdi    # 0x3d5fcc
leaq 0x1737e0(%rip), %r11    # 0x3d6d50
leaq 0x1731d9(%rip), %rbx    # 0x3d6750
movzbl -0x2(%r10), %r14d
cmpl $0xdb, %r14d
jg 0x2635a9
movb $0x7, %bpl
leal -0xd8(%r14), %r15d
cmpl $0x4, %r15d
jb 0x2635d1
testl %r14d, %r14d
jne 0x2635ce
movzbl -0x1(%r10), %r15d
movb 0x88(%rsi,%r15), %bpl
jmp 0x2635d1
leal -0xdc(%r14), %ebp
cmpl $0x4, %ebp
jae 0x2635ba
movb $0x8, %bpl
jmp 0x2635d1
cmpl $0xff, %r14d
jne 0x2635ce
cmpb $-0x3, -0x1(%r10)
jbe 0x2635ce
xorl %ebp, %ebp
jmp 0x2635d1
movb $0x1d, %bpl
movzbl %bpl, %r15d
addl $-0x5, %r15d
cmpl $0x1f, %r15d
ja 0x2639c7
movslq (%rdi,%r15,4), %r15
addq %rdi, %r15
jmpq *%r15
leaq 0x2(%r10), %r14
addq $-0x2, %rcx
cmpq %r9, %r10
movq %r14, %r10
jne 0x263577
jmp 0x26362d
movzbl (%r14,%r11), %ebp
movzbl -0x1(%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 0x2635ed
jmp 0x2639c7
negl %edx
jmp 0x263638
addq $-0x2, %r10
movq %r10, (%r8)
movl %edx, %eax
jmp 0x2634ef
leaq 0x17360a(%rip), %rcx    # 0x3d6c50
movzbl (%rdi,%rcx), %ebx
movzbl 0x1(%r10), %ecx
movl %ecx, %r11d
shrl $0x5, %r11d
shll $0x5, %ebx
leal (%rbx,%r11,4), %r14d
leaq 0x1730ec(%rip), %rbx    # 0x3d6750
movl (%r14,%rbx), %r14d
movl $0x1, %ebp
shll %cl, %ebp
btl %ecx, %r14d
jae 0x2638fa
xorl %eax, %eax
jmp 0x263547
leaq 0x2(%r10), %rax
cmpq %r9, %rax
je 0x26391d
movzbl (%rax), %edx
cmpl $0xdb, %edx
jg 0x26393e
movb $0x7, %cl
leal -0xd8(%rdx), %edi
cmpl $0x4, %edi
jb 0x2639ea
testl %edx, %edx
jne 0x2639e8
movzbl 0x3(%r10), %ecx
movb 0x88(%rsi,%rcx), %cl
jmp 0x2639ea
addq $0x2, %r10
movl $0xd, %edi
jmp 0x2638ba
addq $0x2, %r10
movq %r10, (%r8)
movl $0x15, %eax
jmp 0x2634ef
addq $0x2, %r10
movq %r10, (%r8)
movl $0x19, %eax
jmp 0x2634ef
subq %r10, %r9
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x2, %r9
jl 0x2634ef
jmp 0x2639cb
addq $0x2, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x265e42
addq $0x2, %r10
movq %r10, (%r8)
movl $0x26, %eax
jmp 0x2634ef
addq $0x2, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x265c20
leaq 0x2(%r10), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r9, %rcx
je 0x2634ef
movzbl (%rcx), %edx
cmpl $0xdb, %edx
jg 0x263954
movb $0x7, %al
leal -0xd8(%rdx), %edi
cmpl $0x4, %edi
jb 0x263a4b
testl %edx, %edx
jne 0x263a49
movzbl 0x3(%r10), %eax
movb 0x88(%rsi,%rax), %al
jmp 0x263a4b
leaq 0x2(%r10), %rcx
cmpq %r9, %rcx
je 0x263927
cmpb $0x0, (%rcx)
jne 0x2638ed
cmpb $0x5d, 0x3(%r10)
jne 0x2638ed
leaq 0x4(%r10), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r9, %rdx
je 0x2634ef
cmpb $0x0, (%rdx)
jne 0x2638ed
cmpb $0x3e, 0x5(%r10)
jne 0x2638ed
addq $0x6, %r10
movq %r10, (%r8)
movl $0x22, %eax
jmp 0x2634ef
leaq 0x2(%r10), %rax
cmpq %r9, %rax
je 0x263931
addq $0x2, %r10
cmpq %r9, %r10
je 0x263876
movzbl (%r10), %ecx
cmpl $0xdb, %ecx
jg 0x263838
movb $0x7, %al
leal -0xd8(%rcx), %edx
cmpl $0x4, %edx
jb 0x26385c
testl %ecx, %ecx
jne 0x26385a
movzbl 0x1(%r10), %eax
movb 0x88(%rsi,%rax), %al
jmp 0x26385c
leal -0xdc(%rcx), %eax
cmpl $0x4, %eax
jae 0x263847
movb $0x8, %al
jmp 0x26385c
cmpl $0xff, %ecx
jne 0x26385a
cmpb $-0x3, 0x1(%r10)
jbe 0x26385a
xorl %eax, %eax
jmp 0x26385c
movb $0x1d, %al
cmpb $0x15, %al
je 0x263804
movzbl %al, %eax
cmpl $0xa, %eax
je 0x263804
cmpl $0x9, %eax
jne 0x263876
leaq 0x2(%r10), %rax
cmpq %r9, %rax
jne 0x263804
movq %r10, (%r8)
movl $0xf, %eax
jmp 0x2634ef
subq %r10, %r9
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x3, %r9
jl 0x2634ef
jmp 0x2639cb
subq %r10, %r9
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x4, %r9
jl 0x2634ef
jmp 0x2639cb
addq $0x2, %r10
movl $0xc, %edi
movq %r10, %rdx
movq %r9, %rcx
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x26554a
addq $0x2, %r10
movq %r10, (%r8)
movl $0x11, %eax
jmp 0x2634ef
addq $0x2, %r10
movq %r10, (%r8)
movl $0x17, %eax
jmp 0x2634ef
movq %rcx, (%r8)
movl $0x1a, %eax
jmp 0x2634ef
leaq 0x17344f(%rip), %rcx    # 0x3d6d50
movzbl (%rdi,%rcx), %ecx
shll $0x5, %ecx
leal (%rcx,%r11,4), %ecx
testl %ebp, (%rcx,%rbx)
jne 0x263540
movq %r10, (%r8)
jmp 0x2634ef
movl $0xffffffe8, %eax       # imm = 0xFFFFFFE8
jmp 0x2634ef
movl $0xffffffe6, %eax       # imm = 0xFFFFFFE6
jmp 0x2634ef
movq %r9, (%r8)
movl $0xfffffff1, %eax       # imm = 0xFFFFFFF1
jmp 0x2634ef
leal -0xdc(%rdx), %ecx
cmpl $0x4, %ecx
jae 0x2639d5
movb $0x8, %cl
jmp 0x2639ea
leal -0xdc(%rdx), %eax
cmpl $0x4, %eax
jae 0x263a36
movb $0x8, %al
jmp 0x263a4b
testb %al, %al
jne 0x2639c7
movq %r10, (%r8)
movl $0x1f, %eax
jmp 0x2634ef
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x3, %rcx
jl 0x2634ef
jmp 0x2639c7
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x2, %rcx
jl 0x2634ef
jmp 0x2639c7
testb %al, %al
jne 0x2639c7
movq %r10, (%r8)
movl $0x20, %eax
jmp 0x2634ef
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x4, %rcx
jl 0x2634ef
jmp 0x2639c7
testb %al, %al
je 0x263a8a
addq $-0x2, %r10
movq %r10, (%r8)
xorl %eax, %eax
jmp 0x2634ef
cmpl $0xff, %edx
jne 0x2639e8
cmpb $-0x3, 0x3(%r10)
jbe 0x2639e8
xorl %ecx, %ecx
jmp 0x2639ea
movb $0x1d, %cl
movzbl %cl, %ecx
cmpl $0x1f, %ecx
jg 0x263a0d
leal -0x9(%rcx), %edx
cmpl $0x3, %edx
jb 0x263a29
cmpl $0xf, %ecx
je 0x263ae6
cmpl $0x15, %ecx
je 0x263a29
jmp 0x263ade
addl $-0x20, %ecx
cmpl $0x4, %ecx
ja 0x263ade
leaq 0x17262c(%rip), %rdx    # 0x3d604c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rax, (%r8)
movl $0x18, %eax
jmp 0x2634ef
cmpl $0xff, %edx
jne 0x263a49
cmpb $-0x3, 0x3(%r10)
jbe 0x263a49
xorl %eax, %eax
jmp 0x263a4b
movb $0x1d, %al
movzbl %al, %eax
leal -0xf(%rax), %edx
cmpl $0x9, %edx
jbe 0x263a65
leal -0x5(%rax), %edx
cmpl $0x3, %edx
jb 0x263a75
cmpl $0x1d, %eax
jne 0x263a82
jmp 0x263a75
leaq 0x1725f4(%rip), %rax    # 0x3d6060
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movq %r10, (%r8)
movl $0x1d, %eax
jmp 0x2634ef
movq %rcx, (%r8)
jmp 0x2639ce
movq %r10, (%r8)
movl $0x1e, %eax
jmp 0x2634ef
addq $0x4, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x265882
addq $0x4, %r10
movq %rsi, %rdi
movq %r10, %rsi
movq %r9, %rdx
movq %r8, %rcx
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2656cf
addq $0x4, %r10
movq %r10, (%r8)
movl $0x25, %eax
jmp 0x2634ef
movq %rax, (%r8)
jmp 0x2639ce
addq $0x4, %r10
movq %r10, (%r8)
movl $0x23, %eax
jmp 0x2634ef
addq $0x4, %r10
movq %r10, (%r8)
movl $0x24, %eax
jmp 0x2634ef