// File: /workspace/github_c_makefile_star2_O1/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 0x7e13
movq %r14, %rdi
callq 0x43e4
movl 0x18(%r14), %eax
movq $-0x1, (%rbx)
cmpl %r12d, %eax
jne 0x11ef9
movq %r14, %rdi
callq 0x7e2b
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
jmp 0x11f18
incl %eax
cmpl $0x3d, %eax
ja 0x11f7b
movabsq $0x2000008200002c01, %rcx # imm = 0x2000008200002C01
btq %rax, %rcx
jae 0x11f2d
movq %r14, %rdi
callq 0x7e2b
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 0x11f7b
movq %r14, %rdi
callq 0x43e4
movl 0x18(%r14), %eax
movl %eax, %r12d
andl $-0x21, %r12d
cmpl $0x58, %r12d
jne 0x11f58
movq %r14, %rdi
callq 0x43e4
movl 0x18(%r14), %eax
leal -0x30(%rax), %r13d
cmpl $0xa, %r13d
jb 0x11fb6
cmpl $0x58, %r12d
setne %cl
leal -0x61(%rax), %edx
cmpl $0x6, %edx
setae %dl
orb %cl, %dl
jne 0x11f9b
addl $-0x57, %eax
jmp 0x11fb3
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 0x12177
leal -0x41(%rax), %ecx
addl $-0x37, %eax
cmpl $0x6, %ecx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovael %ecx, %eax
cmpl $0x58, %r12d
cmovnel %ecx, %eax
movl %eax, %r13d
cmpl $-0x1, %r13d
je 0x12044
movq %r15, (%rsp)
cmpl $0x58, %r12d
movl $0x10, %eax
movl $0xa, %r15d
cmovel %eax, %r15d
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x43e4
movl 0x18(%r14), %eax
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x1201e
cmpl $0x58, %r12d
setne %cl
leal -0x61(%rax), %edx
cmpl $0x6, %edx
setae %dl
orb %cl, %dl
jne 0x12006
leal -0x57(%rax), %ecx
jmp 0x1201e
leal -0x41(%rax), %edx
leal -0x37(%rax), %ecx
cmpl $0x6, %edx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmovael %edx, %ecx
cmpl $0x58, %r12d
cmovnel %edx, %ecx
imull %r15d, %ebp
addl %r13d, %ebp
movl %ecx, %r13d
cmpl $-0x1, %ecx
jne 0x11fd9
cmpl $0x3b, %eax
sete %r12b
jne 0x12079
movq %r14, %rdi
callq 0x43e4
movq (%rsp), %r15
jmp 0x120a4
movq %r15, %rdi
callq 0x72a4
testq %rax, %rax
je 0x12066
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7e47
movl $0x3, (%r15)
movq %r14, %rdi
callq 0x7e2b
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
jmp 0x12134
movq (%rsp), %r15
movq %r15, %rdi
callq 0x72a4
testq %rax, %rax
je 0x120a4
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
callq 0x7e47
movl $0x4, (%r13)
movl %ebp, 0x28(%r13)
xorl %r13d, %r13d
cmpl $0x9f, %ebp
ja 0x120bc
movl %ebp, %eax
leaq 0x10778(%rip), %rcx     # 0x22830
movl (%rcx,%rax,4), %r13d
testl %r13d, %r13d
je 0x120ec
movq %r15, %rdi
callq 0x72a4
testq %rax, %rax
je 0x120e7
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7e47
movl $0x5, (%r15)
movl %ebp, 0x28(%r15)
movl %r13d, (%rbx)
jmp 0x12134
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 0x1213c
movq %r15, %rdi
callq 0x72a4
testq %rax, %rax
je 0x1212e
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7e47
movl $0x5, (%r15)
movl %ebp, 0x28(%r15)
movl $0xfffd, (%rbx)         # imm = 0xFFFD
xorl %r12d, %r12d
jmp 0x11f1b
movl %ebp, %edi
callq 0x7b80
testb %al, %al
je 0x12170
movq %r15, %rdi
callq 0x72a4
testq %rax, %rax
je 0x1216d
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x7e47
movl $0x5, (%r15)
movl %ebp, 0x28(%r15)
xorl %r12d, %r12d
movl %ebp, (%rbx)
jmp 0x11f1b