// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: little2_scanRef
static int PTRCALL
PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
                const char **nextTokPtr)
{
  if (ptr == end)
    return XML_TOK_PARTIAL;
  switch (BYTE_TYPE(enc, ptr)) {
  CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
  case BT_NUM:
    return PREFIX(scanCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
  default:
    *nextTokPtr = ptr;
    return XML_TOK_INVALID;
  }
  while (ptr != end) {
    switch (BYTE_TYPE(enc, ptr)) {
    CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
    case BT_SEMI:
      *nextTokPtr = ptr + MINBPC(enc);
      return XML_TOK_ENTITY_REF;
    default:
      *nextTokPtr = ptr;
      return XML_TOK_INVALID;
    }
  }
  return XML_TOK_PARTIAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rdx, %rsi
je 0x259cbf
movzbl 0x1(%rsi), %r9d
xorl %r8d, %r8d
cmpl $0xdb, %r9d
jg 0x259cac
leal -0xd8(%r9), %r10d
cmpl $0x4, %r10d
jae 0x259cc6
subq %rsi, %rdx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x4, %rdx
jge 0x259cb9
jmp 0x259cbf
leal -0xdc(%r9), %r10d
cmpl $0x4, %r10d
jae 0x259cfe
movq %rsi, (%rcx)
movl %r8d, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %r9d, %r9d
jne 0x259d0c
movzbl (%rsi), %r10d
movzbl 0x88(%rdi,%r10), %r10d
cmpl $0x12, %r10d
jle 0x259e1c
cmpl $0x17, %r10d
jg 0x259e37
cmpl $0x13, %r10d
je 0x259e7b
cmpl $0x16, %r10d
je 0x259d43
jmp 0x259cb9
cmpl $0xff, %r9d
jne 0x259d0c
cmpb $-0x3, (%rsi)
ja 0x259cb9
leaq 0x1737fd(%rip), %r10    # 0x3cd510
movzbl (%r9,%r10), %r9d
movzbl (%rsi), %r10d
shll $0x5, %r9d
movl %r10d, %r11d
shrl $0x3, %r11d
andl $0x1c, %r11d
orl %r9d, %r11d
leaq 0x1732db(%rip), %r9     # 0x3cd010
movl (%r11,%r9), %r9d
btl %r10d, %r9d
jae 0x259cb9
leaq 0x2(%rsi), %r14
cmpq %rdx, %r14
je 0x259cbf
movq %rdx, %r9
subq %rsi, %r9
addq $-0x2, %r9
leaq 0x17294b(%rip), %r10    # 0x3cc6ac
leaq 0x1738a8(%rip), %r11    # 0x3cd610
leaq 0x1732a1(%rip), %rbx    # 0x3cd010
movq %r14, %rsi
movzbl 0x1(%rsi), %r14d
cmpl $0xdb, %r14d
jg 0x259daa
testl %r14d, %r14d
jne 0x259dbd
movzbl (%rsi), %r15d
movzbl 0x88(%rdi,%r15), %r15d
addl $-0x5, %r15d
cmpl $0x18, %r15d
ja 0x259cb9
movslq (%r10,%r15,4), %r15
addq %r10, %r15
jmpq *%r15
cmpl $0xff, %r14d
jne 0x259dce
cmpb $-0x3, (%rsi)
jbe 0x259dde
jmp 0x259cb9
leal -0xd8(%r14), %ebp
cmpl $0x4, %ebp
jae 0x259dde
jmp 0x259e50
leal -0xdc(%r14), %ebp
cmpl $0x4, %ebp
jb 0x259cb9
movzbl (%r14,%r11), %ebp
movzbl (%rsi), %r14d
shll $0x5, %ebp
movl %r14d, %r15d
shrl $0x3, %r15d
andl $0x1c, %r15d
orl %ebp, %r15d
movl (%r15,%rbx), %ebp
btl %r14d, %ebp
jae 0x259cb9
addq $0x2, %rsi
addq $-0x2, %r9
cmpq %rdx, %rsi
jne 0x259d72
jmp 0x259cbf
cmpl $0x5, %r10d
je 0x259e64
cmpl $0x6, %r10d
je 0x259e96
cmpl $0x7, %r10d
je 0x259c9c
jmp 0x259cb9
cmpl $0x18, %r10d
je 0x259d43
cmpl $0x1d, %r10d
je 0x259d0c
jmp 0x259cb9
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x4, %r9
jge 0x259cb9
jmp 0x259cbf
subq %rsi, %rdx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x2, %rdx
jge 0x259cb9
jmp 0x259cbf
leaq 0x2(%rsi), %r9
cmpq %rdx, %r9
je 0x259cbf
cmpb $0x0, 0x3(%rsi)
je 0x259ead
movq %r9, %rsi
jmp 0x259cb9
subq %rsi, %rdx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x3, %rdx
jge 0x259cb9
jmp 0x259cbf
movzbl (%r9), %r10d
cmpq $0x78, %r10
jne 0x259f18
leaq 0x4(%rsi), %r9
cmpq %rdx, %r9
je 0x259cbf
cmpb $0x0, 0x5(%rsi)
jne 0x259e8e
movzbl (%r9), %r10d
movb 0x88(%rdi,%r10), %r10b
andb $-0x2, %r10b
cmpb $0x18, %r10b
jne 0x259e8e
addq $0x6, %rsi
cmpq %rdx, %rsi
je 0x259cbf
cmpb $0x0, 0x1(%rsi)
jne 0x259cb9
movzbl (%rsi), %r9d
movzbl 0x88(%rdi,%r9), %r9d
leal -0x18(%r9), %r10d
cmpl $0x2, %r10d
jae 0x259fa8
addq $0x2, %rsi
jmp 0x259ee4
cmpb $0x19, 0x88(%rdi,%r10)
jne 0x259e8e
addq $0x4, %rsi
movq %rsi, %r9
cmpq %rdx, %r9
je 0x259cbf
movq %r9, %rsi
cmpb $0x0, 0x1(%r9)
jne 0x259cb9
movzbl (%rsi), %r9d
movzbl 0x88(%rdi,%r9), %r10d
leaq 0x2(%rsi), %r9
cmpl $0x19, %r10d
je 0x259f2e
cmpl $0x12, %r10d
jne 0x259cb9
movl $0xa, %r8d
jmp 0x259e8e
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x3, %r9
jge 0x259cb9
jmp 0x259cbf
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x2, %r9
jge 0x259cb9
jmp 0x259cbf
addq $0x2, %rsi
movl $0x9, %r8d
jmp 0x259cb9
cmpl $0x12, %r9d
jne 0x259cb9
addq $0x2, %rsi
movl $0xa, %r8d
jmp 0x259cb9