// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: little2_charRefNumber
PREFIX(charRefNumber)(__attribute__ ((unused)) const ENCODING *enc, const char *ptr)
{
  int result = 0;
  /* skip &# */
  ptr += 2*MINBPC(enc);
  if (CHAR_MATCHES(enc, ptr, ASCII_x)) {
    for (ptr += MINBPC(enc);
         !CHAR_MATCHES(enc, ptr, ASCII_SEMI);
         ptr += MINBPC(enc)) {
      int c = BYTE_TO_ASCII(enc, ptr);
      switch (c) {
      case ASCII_0: case ASCII_1: case ASCII_2: case ASCII_3: case ASCII_4:
      case ASCII_5: case ASCII_6: case ASCII_7: case ASCII_8: case ASCII_9:
        result <<= 4;
        result |= (c - ASCII_0);
        break;
      case ASCII_A: case ASCII_B: case ASCII_C:
      case ASCII_D: case ASCII_E: case ASCII_F:
        result <<= 4;
        result += 10 + (c - ASCII_A);
        break;
      case ASCII_a: case ASCII_b: case ASCII_c:
      case ASCII_d: case ASCII_e: case ASCII_f:
        result <<= 4;
        result += 10 + (c - ASCII_a);
        break;
      }
      if (result >= 0x110000)
        return -1;
    }
  }
  else {
    for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) {
      int c = BYTE_TO_ASCII(enc, ptr);
      result *= 10;
      result += (c - ASCII_0);
      if (result >= 0x110000)
        return -1;
    }
  }
  return checkCharRefNumber(result);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38d9b0
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x78, %eax
jne 0x38d9b0
movq 0x20(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x13(%rsp)
jne 0x38d8bb
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
sete %al
movb %al, 0x13(%rsp)
movb 0x13(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x38d8ca
jmp 0x38d9ab
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38d8e6
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0x38d8f1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc(%rsp)
jmp 0x38d8f1
movl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rsp)
addl $-0x30, %eax
subl $0xa, %eax
jb 0x38d927
jmp 0x38d90b
movl 0x8(%rsp), %eax
addl $-0x41, %eax
subl $0x6, %eax
jb 0x38d943
jmp 0x38d919
movl 0x8(%rsp), %eax
addl $-0x61, %eax
subl $0x6, %eax
jb 0x38d962
jmp 0x38d97f
movl 0x1c(%rsp), %eax
shll $0x4, %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
subl $0x30, %eax
orl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x38d97f
movl 0x1c(%rsp), %eax
shll $0x4, %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
subl $0x41, %eax
addl $0xa, %eax
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x38d97f
movl 0x1c(%rsp), %eax
shll $0x4, %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
subl $0x61, %eax
addl $0xa, %eax
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x110000, 0x1c(%rsp)   # imm = 0x110000
jl 0x38d996
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x38da60
jmp 0x38d998
movq 0x20(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x20(%rsp)
jmp 0x38d895
jmp 0x38da53
jmp 0x38d9b2
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x7(%rsp)
jne 0x38d9d8
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
sete %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x38d9e4
jmp 0x38da51
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38d9ff
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
movl %eax, (%rsp)
jmp 0x38da09
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rsp)
jmp 0x38da09
movl (%rsp), %eax
movl %eax, 0x14(%rsp)
imull $0xa, 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x14(%rsp), %eax
subl $0x30, %eax
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x110000, 0x1c(%rsp)   # imm = 0x110000
jl 0x38da3c
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x38da60
jmp 0x38da3e
movq 0x20(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x20(%rsp)
jmp 0x38d9b2
jmp 0x38da53
movl 0x1c(%rsp), %edi
callq 0x3842b0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)