// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: little2_entityValueTok
static int PTRCALL
PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr,
                       const char *end, const char **nextTokPtr)
{
  const char *start;
  if (ptr == end)
    return XML_TOK_NONE;
  start = ptr;
  while (ptr != end) {
    switch (BYTE_TYPE(enc, ptr)) {
#define LEAD_CASE(n) \
    case BT_LEAD ## n: ptr += n; break;
    LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
#undef LEAD_CASE
    case BT_AMP:
      if (ptr == start)
        return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
      *nextTokPtr = ptr;
      return XML_TOK_DATA_CHARS;
    case BT_PERCNT:
      if (ptr == start) {
        int tok =  PREFIX(scanPercent)(enc, ptr + MINBPC(enc),
                                       end, nextTokPtr);
        return (tok == XML_TOK_PERCENT) ? XML_TOK_INVALID : tok;
      }
      *nextTokPtr = ptr;
      return XML_TOK_DATA_CHARS;
    case BT_LF:
      if (ptr == start) {
        *nextTokPtr = ptr + MINBPC(enc);
        return XML_TOK_DATA_NEWLINE;
      }
      *nextTokPtr = ptr;
      return XML_TOK_DATA_CHARS;
    case BT_CR:
      if (ptr == start) {
        ptr += MINBPC(enc);
        if (ptr == end)
          return XML_TOK_TRAILING_CR;
        if (BYTE_TYPE(enc, ptr) == BT_LF)
          ptr += MINBPC(enc);
        *nextTokPtr = ptr;
        return XML_TOK_DATA_NEWLINE;
      }
      *nextTokPtr = ptr;
      return XML_TOK_DATA_CHARS;
    default:
      ptr += MINBPC(enc);
      break;
    }
  }
  *nextTokPtr = ptr;
  return XML_TOK_DATA_CHARS;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x38cc11
movl $0xfffffffc, 0x44(%rsp) # imm = 0xFFFFFFFC
jmp 0x38ceb6
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x38cea1
movq 0x30(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38cc54
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl (%rcx), %ecx
movzbl 0x88(%rax,%rcx), %eax
movl %eax, 0x10(%rsp)
jmp 0x38cc70
movq 0x30(%rsp), %rax
movb 0x1(%rax), %cl
movq 0x30(%rsp), %rax
movsbl %cl, %edi
movsbl (%rax), %esi
callq 0x38e510
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
addl $-0x3, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x1b, %eax
ja 0x38ce8e
movq 0x8(%rsp), %rax
leaq 0x21321d(%rip), %rcx    # 0x59feb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x30(%rsp)
jmp 0x38ce9c
movq 0x30(%rsp), %rax
addq $0x3, %rax
movq %rax, 0x30(%rsp)
jmp 0x38ce9c
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
jmp 0x38ce9c
movq 0x30(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x38cd07
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x2, %rsi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x390460
movl %eax, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x6, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x38cd72
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x2, %rsi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x38f0e0
movl %eax, 0x14(%rsp)
cmpl $0x16, 0x14(%rsp)
jne 0x38cd5d
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x38cd65
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x6, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x38cdb6
movq 0x30(%rsp), %rcx
addq $0x2, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x7, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x6, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x38ce77
movq 0x30(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x38ce07
movl $0xfffffffd, 0x44(%rsp) # imm = 0xFFFFFFFD
jmp 0x38ceb6
movq 0x30(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38ce2f
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl (%rcx), %ecx
movzbl 0x88(%rax,%rcx), %eax
movl %eax, (%rsp)
jmp 0x38ce4a
movq 0x30(%rsp), %rax
movb 0x1(%rax), %cl
movq 0x30(%rsp), %rax
movsbl %cl, %edi
movsbl (%rax), %esi
callq 0x38e510
movl %eax, (%rsp)
movl (%rsp), %eax
cmpl $0xa, %eax
jne 0x38ce60
movq 0x30(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x7, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x6, 0x44(%rsp)
jmp 0x38ceb6
movq 0x30(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x30(%rsp)
jmp 0x38cc1b
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x6, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop