// File: /workspace/github_c_makefile_star2_O1/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 0x262d3e
movzbl 0x1(%rsi), %r9d
cmpl $0xdb, %r9d
jg 0x262a5c
movb $0x7, %r8b
leal -0xd8(%r9), %r10d
cmpl $0x4, %r10d
jb 0x262a84
testl %r9d, %r9d
jne 0x262a81
movzbl (%rsi), %r8d
movb 0x88(%rdi,%r8), %r8b
jmp 0x262a84
leal -0xdc(%r9), %r8d
cmpl $0x4, %r8d
jae 0x262a6e
movb $0x8, %r8b
jmp 0x262a84
cmpl $0xff, %r9d
jne 0x262a81
cmpb $-0x3, (%rsi)
jbe 0x262a81
xorl %r8d, %r8d
jmp 0x262a84
movb $0x1d, %r8b
movzbl %r8b, %r10d
xorl %r8d, %r8d
cmpl $0x12, %r10d
jle 0x262ab0
cmpl $0x17, %r10d
jg 0x262ae5
cmpl $0x13, %r10d
je 0x262c20
cmpl $0x16, %r10d
je 0x262b2c
jmp 0x262d38
cmpl $0x5, %r10d
je 0x262c09
cmpl $0x6, %r10d
je 0x262c3b
cmpl $0x7, %r10d
jne 0x262d38
subq %rsi, %rdx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x4, %rdx
jge 0x262d38
jmp 0x262d3e
cmpl $0x18, %r10d
je 0x262b2c
cmpl $0x1d, %r10d
jne 0x262d38
leaq 0x174154(%rip), %r10    # 0x3d6c50
movzbl (%r9,%r10), %r9d
movzbl (%rsi), %r10d
shll $0x5, %r9d
movl %r10d, %r11d
shrl $0x3, %r11d
andl $0x1c, %r11d
orl %r9d, %r11d
leaq 0x173c32(%rip), %r9     # 0x3d6750
movl (%r11,%r9), %r9d
btl %r10d, %r9d
jae 0x262d38
leaq 0x2(%rsi), %r14
cmpq %rdx, %r14
je 0x262d3e
movq %rdx, %r9
subq %rsi, %r9
addq $-0x2, %r9
leaq 0x1732a6(%rip), %r10    # 0x3d5df0
leaq 0x1741ff(%rip), %r11    # 0x3d6d50
leaq 0x173bf8(%rip), %rbx    # 0x3d6750
movq %r14, %rsi
movzbl 0x1(%rsi), %r14d
cmpl $0xdb, %r14d
jg 0x262b8c
movb $0x7, %bpl
leal -0xd8(%r14), %r15d
cmpl $0x4, %r15d
jb 0x262bb2
testl %r14d, %r14d
jne 0x262baf
movzbl (%rsi), %r15d
movb 0x88(%rdi,%r15), %bpl
jmp 0x262bb2
leal -0xdc(%r14), %ebp
cmpl $0x4, %ebp
jae 0x262b9d
movb $0x8, %bpl
jmp 0x262bb2
cmpl $0xff, %r14d
jne 0x262baf
cmpb $-0x3, (%rsi)
jbe 0x262baf
xorl %ebp, %ebp
jmp 0x262bb2
movb $0x1d, %bpl
movzbl %bpl, %r15d
addl $-0x5, %r15d
cmpl $0x18, %r15d
ja 0x262d38
movslq (%r10,%r15,4), %r15
addq %r10, %r15
jmpq *%r15
addq $0x2, %rsi
addq $-0x2, %r9
cmpq %rdx, %rsi
jne 0x262b5b
jmp 0x262d3e
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
jb 0x262bce
jmp 0x262d38
subq %rsi, %rdx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x2, %rdx
jge 0x262d38
jmp 0x262d3e
leaq 0x2(%rsi), %r9
cmpq %rdx, %r9
je 0x262d3e
cmpb $0x0, 0x3(%rsi)
je 0x262c52
movq %r9, %rsi
jmp 0x262d38
subq %rsi, %rdx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x3, %rdx
jge 0x262d38
jmp 0x262d3e
movzbl (%r9), %r10d
cmpq $0x78, %r10
jne 0x262d45
leaq 0x4(%rsi), %r9
cmpq %rdx, %r9
je 0x262d3e
cmpb $0x0, 0x5(%rsi)
jne 0x262c33
movzbl (%r9), %r10d
movb 0x88(%rdi,%r10), %r10b
andb $-0x2, %r10b
cmpb $0x18, %r10b
jne 0x262c33
addq $0x6, %rsi
cmpq %rdx, %rsi
je 0x262d3e
movzbl 0x1(%rsi), %r10d
cmpl $0xdb, %r10d
jg 0x262cc7
movb $0x7, %r9b
leal -0xd8(%r10), %r11d
cmpl $0x4, %r11d
jb 0x262cef
testl %r10d, %r10d
jne 0x262cec
movzbl (%rsi), %r9d
movb 0x88(%rdi,%r9), %r9b
jmp 0x262cef
leal -0xdc(%r10), %r9d
cmpl $0x4, %r9d
jae 0x262cd9
movb $0x8, %r9b
jmp 0x262cef
cmpl $0xff, %r10d
jne 0x262cec
cmpb $-0x3, (%rsi)
jbe 0x262cec
xorl %r9d, %r9d
jmp 0x262cef
movb $0x1d, %r9b
movzbl %r9b, %r9d
leal -0x18(%r9), %r10d
cmpl $0x2, %r10d
jae 0x262dda
addq $0x2, %rsi
jmp 0x262c8d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x4, %r9
jge 0x262d38
jmp 0x262d3e
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x2, %r9
jge 0x262d38
jmp 0x262d3e
addq $0x2, %rsi
movl $0x9, %r8d
jmp 0x262d38
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq $0x3, %r9
jl 0x262d3e
movq %rsi, (%rcx)
movl %r8d, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x19, 0x88(%rdi,%r10)
jne 0x262c33
movq %r9, %rsi
addq $0x2, %r9
cmpq %rdx, %r9
je 0x262d3e
movzbl 0x3(%rsi), %r10d
cmpl $0xdb, %r10d
jg 0x262d91
movb $0x7, %sil
leal -0xd8(%r10), %r11d
cmpl $0x4, %r11d
jb 0x262db8
testl %r10d, %r10d
jne 0x262db5
movzbl (%r9), %esi
movb 0x88(%rdi,%rsi), %sil
jmp 0x262db8
leal -0xdc(%r10), %esi
cmpl $0x4, %esi
jae 0x262da2
movb $0x8, %sil
jmp 0x262db8
cmpl $0xff, %r10d
jne 0x262db5
cmpb $-0x3, (%r9)
jbe 0x262db5
xorl %esi, %esi
jmp 0x262db8
movb $0x1d, %sil
cmpb $0x19, %sil
je 0x262d54
movzbl %sil, %eax
cmpl $0x12, %eax
jne 0x262c33
addq $0x2, %r9
movl $0xa, %r8d
jmp 0x262c33
cmpl $0x12, %r9d
jne 0x262d38
addq $0x2, %rsi
movl $0xa, %r8d
jmp 0x262d38