// File: /workspace/github_c_makefile_star2_O2/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 0x209380
movzbl 0x1(%rsi), %r9d
xorl %r8d, %r8d
leal -0xd8(%r9), %r10d
cmpl $0x4, %r10d
jb 0x20933a
leal -0xdc(%r9), %r10d
cmpl $0x4, %r10d
jb 0x20937a
testl %r9d, %r9d
je 0x2092f5
cmpl $0xff, %r9d
jne 0x2091fa
cmpb $-0x3, (%rsi)
ja 0x20937a
leaq 0x16471f(%rip), %r10    # 0x36d920
movzbl (%r9,%r10), %r9d
movzbl (%rsi), %r10d
shll $0x5, %r9d
movl %r10d, %r11d
shrl $0x3, %r11d
andl $0x1c, %r11d
orl %r9d, %r11d
leaq 0x1641fd(%rip), %r9     # 0x36d420
movl (%r11,%r9), %r9d
btl %r10d, %r9d
jae 0x20937a
movq %rdx, %r9
subq %rsi, %r9
addq $0x2, %rsi
addq $-0x2, %r9
leaq 0x163962(%rip), %r10    # 0x36cba8
leaq 0x1647d3(%rip), %r11    # 0x36da20
leaq 0x1641cc(%rip), %rbx    # 0x36d420
cmpq %rdx, %rsi
je 0x209380
movzbl 0x1(%rsi), %r14d
testl %r14d, %r14d
je 0x2092c3
cmpl $0xff, %r14d
je 0x209291
leal -0xd8(%r14), %ebp
cmpl $0x4, %ebp
jb 0x20934a
leal -0xdc(%r14), %ebp
cmpl $0x4, %ebp
jae 0x20929a
jmp 0x20937a
cmpb $-0x3, (%rsi)
ja 0x20937a
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 0x2092e8
jmp 0x20937a
movzbl (%rsi), %r15d
movzbl 0x88(%rdi,%r15), %r15d
addl $-0x5, %r15d
cmpl $0x18, %r15d
ja 0x20937a
movslq (%r10,%r15,4), %r15
addq %r10, %r15
jmpq *%r15
addq $0x2, %rsi
addq $-0x2, %r9
jmp 0x209254
movzbl (%rsi), %r10d
movzbl 0x88(%rdi,%r10), %r10d
cmpl $0x5, %r10d
je 0x209366
cmpl $0x6, %r10d
je 0x209371
cmpl $0x7, %r10d
je 0x20933a
cmpl $0x13, %r10d
je 0x209352
cmpl $0x16, %r10d
je 0x209231
cmpl $0x18, %r10d
je 0x209231
cmpl $0x1d, %r10d
je 0x2091fa
jmp 0x20937a
subq %rsi, %rdx
cmpq $0x4, %rdx
jge 0x20937a
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x209380
cmpq $0x4, %r9
jl 0x209343
jmp 0x20937a
leaq 0x2(%rsi), %r9
cmpq %rdx, %r9
je 0x209380
cmpb $0x0, 0x3(%rsi)
je 0x209387
movq %r9, %rsi
jmp 0x20937a
subq %rsi, %rdx
cmpq $0x2, %rdx
jl 0x209343
jmp 0x20937a
subq %rsi, %rdx
cmpq $0x3, %rdx
jl 0x209343
movq %rsi, (%rcx)
movl %r8d, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzbl (%r9), %r10d
cmpq $0x78, %r10
jne 0x2093e6
leaq 0x4(%rsi), %r9
cmpq %rdx, %r9
je 0x209380
cmpb $0x0, 0x5(%rsi)
jne 0x209361
movzbl (%r9), %r10d
movb 0x88(%rdi,%r10), %r10b
andb $-0x2, %r10b
cmpb $0x18, %r10b
jne 0x209361
addq $0x6, %rsi
cmpq %rdx, %rsi
je 0x209380
cmpb $0x0, 0x1(%rsi)
jne 0x20937a
movzbl (%rsi), %r9d
movzbl 0x88(%rdi,%r9), %r9d
leal -0x18(%r9), %r10d
cmpl $0x2, %r10d
jae 0x20946c
addq $0x2, %rsi
jmp 0x2093ba
cmpb $0x19, 0x88(%rdi,%r10)
jne 0x209361
addq $0x4, %rsi
movq %rsi, %r9
cmpq %rdx, %r9
je 0x209380
movq %r9, %rsi
cmpb $0x0, 0x1(%r9)
jne 0x20937a
movzbl (%rsi), %r9d
movzbl 0x88(%rdi,%r9), %r10d
leaq 0x2(%rsi), %r9
cmpl $0x19, %r10d
je 0x2093fc
cmpl $0x12, %r10d
jne 0x20937a
movl $0xa, %r8d
jmp 0x209361
cmpq $0x3, %r9
jl 0x209343
jmp 0x20937a
addq $0x2, %rsi
movl $0x9, %r8d
jmp 0x20937a
cmpq $0x2, %r9
jl 0x209343
jmp 0x20937a
cmpl $0x12, %r9d
jne 0x20937a
addq $0x2, %rsi
movl $0xa, %r8d
jmp 0x20937a