// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: little2_scanPi
static int PTRCALL
PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
               const char *end, const char **nextTokPtr)
{
  int tok;
  const char *target = ptr;
  if (ptr == end)
    return XML_TOK_PARTIAL;
  switch (BYTE_TYPE(enc, ptr)) {
  CHECK_NMSTRT_CASES(enc, ptr, 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_S: case BT_CR: case BT_LF:
      if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) {
        *nextTokPtr = ptr;
        return XML_TOK_INVALID;
      }
      ptr += MINBPC(enc);
      while (ptr != end) {
        switch (BYTE_TYPE(enc, ptr)) {
        INVALID_CASES(ptr, nextTokPtr)
        case BT_QUEST:
          ptr += MINBPC(enc);
          if (ptr == end)
            return XML_TOK_PARTIAL;
          if (CHAR_MATCHES(enc, ptr, ASCII_GT)) {
            *nextTokPtr = ptr + MINBPC(enc);
            return tok;
          }
          break;
        default:
          ptr += MINBPC(enc);
          break;
        }
      }
      return XML_TOK_PARTIAL;
    case BT_QUEST:
      if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) {
        *nextTokPtr = ptr;
        return XML_TOK_INVALID;
      }
      ptr += MINBPC(enc);
      if (ptr == end)
        return XML_TOK_PARTIAL;
      if (CHAR_MATCHES(enc, ptr, ASCII_GT)) {
        *nextTokPtr = ptr + MINBPC(enc);
        return tok;
      }
      /* fall through */
    default:
      *nextTokPtr = ptr;
      return XML_TOK_INVALID;
    }
  }
  return XML_TOK_PARTIAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbx
cmpq %rdx, %rsi
je 0x208c8d
movq %rcx, %r14
movq %rdx, %r15
movzbl 0x1(%rsi), %eax
leal -0xd8(%rax), %ecx
cmpl $0x4, %ecx
jb 0x208c5b
leal -0xdc(%rax), %ecx
cmpl $0x4, %ecx
jb 0x208c88
movq %rdi, %r12
testl %eax, %eax
je 0x208b39
cmpl $0xff, %eax
jne 0x208b73
cmpb $-0x3, (%rsi)
jbe 0x208b73
jmp 0x208c88
movzbl (%rsi), %ecx
movzbl 0x88(%r12,%rcx), %ecx
cmpl $0x5, %ecx
je 0x208c7f
cmpl $0x6, %ecx
je 0x208c74
cmpl $0x7, %ecx
je 0x208c5b
cmpl $0x16, %ecx
je 0x208ba1
cmpl $0x18, %ecx
je 0x208ba1
cmpl $0x1d, %ecx
jne 0x208c88
leaq 0x164da6(%rip), %rcx    # 0x36d920
movzbl (%rax,%rcx), %eax
movzbl (%rsi), %ecx
shll $0x5, %eax
movl %ecx, %edx
shrl $0x3, %edx
andl $0x1c, %edx
orl %eax, %edx
leaq 0x16488b(%rip), %rax    # 0x36d420
movl (%rdx,%rax), %eax
btl %ecx, %eax
jae 0x208c88
leaq 0x4(%rsi), %rbp
movq %r15, %rax
subq %rsi, %rax
addq $-0x2, %rax
leaq 0x163e76(%rip), %rcx    # 0x36ca2c
leaq 0x164e63(%rip), %rdx    # 0x36da20
leaq 0x16485c(%rip), %rdi    # 0x36d420
leaq -0x2(%rbp), %r8
cmpq %r15, %r8
je 0x208c8d
movzbl -0x1(%rbp), %r9d
testl %r9d, %r9d
je 0x208c2d
cmpl $0xff, %r9d
je 0x208c00
leal -0xd8(%r9), %r10d
cmpl $0x4, %r10d
jb 0x208c69
leal -0xdc(%r9), %r10d
cmpl $0x4, %r10d
jae 0x208c06
jmp 0x208c6f
cmpb $-0x3, (%r8)
ja 0x208c6f
movzbl (%r9,%rdx), %r9d
movzbl (%r8), %r10d
shll $0x5, %r9d
movl %r10d, %r11d
shrl $0x3, %r11d
andl $0x1c, %r11d
orl %r9d, %r11d
movl (%r11,%rdi), %r9d
btl %r10d, %r9d
jb 0x208c4e
jmp 0x208c6f
movzbl (%r8), %r10d
movzbl 0x88(%r12,%r10), %r10d
addl $-0x5, %r10d
cmpl $0x18, %r10d
ja 0x208c6f
movslq (%rcx,%r10,4), %r10
addq %rcx, %r10
jmpq *%r10
addq $0x2, %rbp
addq $-0x2, %rax
jmp 0x208bc4
subq %rsi, %r15
cmpq $0x4, %r15
jge 0x208c88
pushq $-0x2
popq %rbx
jmp 0x208c8d
cmpq $0x4, %rax
jl 0x208c64
movq %r8, (%r14)
jmp 0x208c8b
subq %rsi, %r15
cmpq $0x3, %r15
jl 0x208c64
jmp 0x208c88
subq %rsi, %r15
cmpq $0x2, %r15
jl 0x208c64
movq %rsi, (%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x2(%rbp), %r13
leaq 0x4(%rsp), %rdx
movq %rsi, %rdi
movq %r13, %rsi
callq 0x209134
testl %eax, %eax
je 0x208d8c
pushq $-0x2
popq %rax
leaq 0x163dcc(%rip), %rcx    # 0x36ca90
cmpq %r15, %rbp
je 0x208c8d
movq %rbp, %rdx
movzbl 0x1(%rbp), %esi
leal -0xd8(%rsi), %edi
cmpl $0x4, %edi
jae 0x208cf4
movq %r15, %rsi
subq %rdx, %rsi
cmpq $0x4, %rsi
jl 0x208dfb
addq $0x4, %rdx
movq %rdx, %rbp
jmp 0x208cc4
testl %esi, %esi
je 0x208d22
cmpl $0xff, %esi
je 0x208d10
addl $0xffffff24, %esi       # imm = 0xFFFFFF24
cmpl $0x4, %esi
jae 0x208d19
jmp 0x208df3
cmpb $-0x3, (%rdx)
ja 0x208df3
addq $0x2, %rdx
movq %rdx, %rbp
jmp 0x208cc4
movzbl (%rdx), %esi
movzbl 0x88(%r12,%rsi), %esi
cmpq $0xf, %rsi
ja 0x208d19
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
movq %r15, %rsi
subq %rdx, %rsi
cmpq $0x2, %rsi
jge 0x208d19
jmp 0x208dfb
leaq 0x2(%rdx), %rbp
cmpq %r15, %rbp
je 0x208c8d
cmpb $0x0, 0x3(%rdx)
jne 0x208cc4
cmpb $0x3e, (%rbp)
jne 0x208cc4
jmp 0x208e12
movq %r15, %rsi
subq %rdx, %rsi
cmpq $0x3, %rsi
jl 0x208dfb
addq $0x3, %rdx
movq %rdx, %rbp
jmp 0x208cc4
movq %r13, (%r14)
jmp 0x208c8b
cmpq $0x3, %rax
jl 0x208c64
jmp 0x208de7
leaq -0x2(%rbp), %r12
leaq 0x4(%rsp), %rdx
movq %rsi, %rdi
movq %r12, %rsi
callq 0x209134
testl %eax, %eax
je 0x208e02
cmpq %r15, %rbp
je 0x208c8d
cmpb $0x0, 0x1(%rbp)
jne 0x208e0a
cmpb $0x3e, (%rbp)
jne 0x208e0a
addq $0x2, %rbp
movq %rbp, (%r14)
movl 0x4(%rsp), %ebx
jmp 0x208c8d
cmpq $0x2, %rax
jl 0x208c64
addq $-0x2, %rbp
movq %rbp, (%r14)
jmp 0x208c8b
movq %rdx, (%r14)
jmp 0x208c8b
movl %eax, %ebx
jmp 0x208c8d
movq %r12, (%r14)
jmp 0x208c8b
movq %rbp, %r8
jmp 0x208c6f
addq $0x4, %rdx
movq %rdx, (%r14)
jmp 0x208dd4