// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/lib/char_ref.c
// Function: gumbo_consume_char_ref
bool gumbo_consume_char_ref (
  struct GumboParser* parser,
  struct GumboUtf8Iterator* input,
  int additional_allowed_char,
  bool is_in_attribute,
  OneOrTwoCodepoints* output
) {
  utf8iterator_mark(input);
  utf8iterator_next(input);
  int c = utf8iterator_current(input);
  output->first = kGumboNoChar;
  output->second = kGumboNoChar;
  if (c == additional_allowed_char) {
    utf8iterator_reset(input);
    output->first = kGumboNoChar;
    return true;
  }
  switch (utf8iterator_current(input)) {
    case '\t':
    case '\n':
    case '\f':
    case ' ':
    case '<':
    case '&':
    case -1:
      utf8iterator_reset(input);
      return true;
    case '#':
      return consume_numeric_ref(parser, input, &output->first);
    default:
      return consume_named_ref(parser, input, is_in_attribute, output);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r13
movq %rsi, %rdi
callq 0x7650
movq %r14, %rdi
callq 0x4337
movl 0x18(%r14), %eax
orq $-0x1, (%rbx)
cmpl %r12d, %eax
jne 0xf75a
movq %r14, %rdi
callq 0x7668
orl $-0x1, (%rbx)
jmp 0xf77d
incl %eax
cmpl $0x3d, %eax
ja 0xf83c
movabsq $0x2000008200002c01, %rcx # imm = 0x2000008200002C01
btq %rax, %rcx
jae 0xf792
movq %r14, %rdi
callq 0x7668
movb $0x1, %r12b
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x24, %rax
jne 0xf83c
movq %r14, %rdi
callq 0x4337
movl 0x18(%r14), %edi
movl %edi, %r15d
andl $-0x21, %r15d
cmpl $0x58, %r15d
jne 0xf7c1
movq %r14, %rdi
callq 0x4337
movl 0x18(%r14), %edi
xorl %esi, %esi
cmpl $0x58, %r15d
sete %sil
callq 0x15204
cmpl $-0x1, %eax
je 0xf85c
movq %r13, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
cmpl $0x58, %r15d
pushq $0x10
popq %rcx
pushq $0xa
popq %rbx
cmovel %ecx, %ebx
xorl %ebp, %ebp
xorl %r13d, %r13d
cmpl $0x58, %r15d
sete %r13b
imull %ebx, %ebp
addl %eax, %ebp
movq %r14, %rdi
callq 0x4337
movl 0x18(%r14), %r12d
movl %r12d, %edi
movl %r13d, %esi
callq 0x15204
cmpl $-0x1, %eax
jne 0xf7f2
cmpl $0x3b, %r12d
sete %r12b
jne 0xf88c
movq %r14, %rdi
callq 0x4337
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r13
jmp 0xf8a6
movzbl %bpl, %edx
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf932
movq %r13, %rdi
callq 0x6bcc
testq %rax, %rax
je 0xf87e
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7684
movl $0x3, (%r15)
movq %r14, %rdi
callq 0x7668
pushq $-0x1
popq %r15
jmp 0xf904
pushq $0x4
popq %rdx
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x1523b
movq 0x10(%rsp), %rbx
cmpl $0x9f, %ebp
ja 0xf8d2
movl %ebp, %eax
leaq 0xf019(%rip), %rcx      # 0x1e8d0
movl (%rcx,%rax,4), %r15d
testl %r15d, %r15d
je 0xf8d2
pushq $0x5
popq %rdx
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x1523b
jmp 0xf904
movl %ebp, %eax
andl $0xfffff800, %eax       # imm = 0xFFFFF800
cmpl $0xd800, %eax           # imm = 0xD800
setne %al
cmpl $0x110000, %ebp         # imm = 0x110000
setb %cl
testb %al, %cl
jne 0xf909
pushq $0x5
popq %rdx
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x1523b
movl $0xfffd, %r15d          # imm = 0xFFFD
xorl %r12d, %r12d
jmp 0xf92a
movl %ebp, %edi
callq 0x7458
testb %al, %al
je 0xf927
pushq $0x5
popq %rdx
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x1523b
xorl %r12d, %r12d
movl %ebp, %r15d
movl %r15d, (%rbx)
jmp 0xf780