// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x7a40
movq %r14, %rdi
callq 0x43e3
movl 0x18(%r14), %eax
movq $-0x1, (%rbx)
cmpl %r12d, %eax
jne 0x11475
movq %r14, %rdi
callq 0x7a58
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
jmp 0x11494
incl %eax
cmpl $0x3d, %eax
ja 0x114f7
movabsq $0x2000008200002c01, %rcx # imm = 0x2000008200002C01
btq %rax, %rcx
jae 0x114a9
movq %r14, %rdi
callq 0x7a58
movb $0x1, %r12b
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x24, %rax
jne 0x114f7
movq %r14, %rdi
callq 0x43e3
movl 0x18(%r14), %eax
movl %eax, %r12d
andl $-0x21, %r12d
cmpl $0x58, %r12d
jne 0x114d4
movq %r14, %rdi
callq 0x43e3
movl 0x18(%r14), %eax
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x11542
cmpl $0x58, %r12d
setne %cl
leal -0x61(%rax), %edx
cmpl $0x6, %edx
setae %dl
orb %cl, %dl
jne 0x11517
addl $-0x57, %eax
movl %eax, %ecx
jmp 0x11542
movzbl %bpl, %edx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x116c0
cmpl $0x58, %r12d
sete %cl
leal -0x41(%rax), %edx
cmpl $0x6, %edx
setb %dl
andb %cl, %dl
addl $-0x37, %eax
cmpl $-0x1, %eax
setne %sil
andb %dl, %sil
movl %eax, %ecx
cmpb $0x1, %sil
jne 0x11685
cmpl $0x58, %r12d
movl $0x10, %eax
movl $0xa, %r13d
cmovel %eax, %r13d
xorl %ebp, %ebp
imull %r13d, %ebp
addl %ecx, %ebp
movq %r14, %rdi
callq 0x43e3
movl 0x18(%r14), %eax
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x1159b
cmpl $0x58, %r12d
setne %cl
leal -0x61(%rax), %edx
cmpl $0x6, %edx
setae %dl
orb %cl, %dl
jne 0x1158a
leal -0x57(%rax), %ecx
jmp 0x1159b
cmpl $0x58, %r12d
jne 0x115a0
leal -0x41(%rax), %ecx
cmpl $0x5, %ecx
ja 0x115a0
leal -0x37(%rax), %ecx
cmpl $-0x1, %ecx
jne 0x11557
cmpl $0x3b, %eax
sete %r12b
jne 0x115b3
movq %r14, %rdi
callq 0x43e3
jmp 0x115da
movq %r15, %rdi
callq 0x6f1c
testq %rax, %rax
je 0x115da
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
callq 0x7a74
movl $0x4, (%r13)
movl %ebp, 0x28(%r13)
cmpl $0x9f, %ebp
ja 0x115fe
movl %ebp, %eax
leaq 0xf365(%rip), %rcx      # 0x20950
movl (%rcx,%rax,4), %r13d
testl %r13d, %r13d
je 0x115fe
movq %r15, %rdi
callq 0x6f1c
jmp 0x11628
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 0x1164c
movq %r15, %rdi
callq 0x6f1c
movl $0xfffd, %r13d          # imm = 0xFFFD
testq %rax, %rax
je 0x116b5
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7a74
movl $0x5, (%r15)
movl %ebp, 0x28(%r15)
jmp 0x116b5
movl %ebp, %edi
callq 0x77e4
testb %al, %al
je 0x11680
movq %r15, %rdi
callq 0x6f1c
testq %rax, %rax
je 0x1167d
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7a74
movl $0x5, (%r15)
movl %ebp, 0x28(%r15)
xorl %r12d, %r12d
movl %ebp, %r13d
jmp 0x116b8
movq %r15, %rdi
callq 0x6f1c
testq %rax, %rax
je 0x116a7
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7a74
movl $0x3, (%r15)
movq %r14, %rdi
callq 0x7a58
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl %r13d, (%rbx)
jmp 0x11497