// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/tokenizer.c
// Function: handle_char_ref_in_attr_value_state
static StateResult handle_char_ref_in_attr_value_state (
  GumboParser* parser,
  GumboTokenizerState* tokenizer,
  int UNUSED_ARG(c),
  GumboToken* UNUSED_ARG(output)
) {
  OneOrTwoCodepoints char_ref;
  int allowed_char;
  bool is_unquoted = false;
  switch (tokenizer->_tag_state._attr_value_state) {
    case GUMBO_LEX_ATTR_VALUE_DOUBLE_QUOTED:
      allowed_char = '"';
      break;
    case GUMBO_LEX_ATTR_VALUE_SINGLE_QUOTED:
      allowed_char = '\'';
      break;
    case GUMBO_LEX_ATTR_VALUE_UNQUOTED:
      allowed_char = '>';
      is_unquoted = true;
      break;
    default:
      // -Wmaybe-uninitialized is a little overzealous here, and doesn't
      // get that the assert(0) means this codepath will never happen.
      allowed_char = ' ';
      assert(0);
  }

  // Ignore the status, since we don't have a convenient way of signalling that
  // a parser error has occurred when the error occurs in the middle of a
  // multi-state token. We'd need a flag inside the TokenizerState to do this,
  // but that's a low priority fix.
  gumbo_consume_char_ref (
    parser,
    &tokenizer->_input,
    allowed_char,
    true,
    &char_ref
  );
  if (char_ref.first != kGumboNoChar) {
    tokenizer->_reconsume_current_input = true;
    append_char_to_tag_buffer(parser, char_ref.first, is_unquoted);
    if (char_ref.second != kGumboNoChar) {
      append_char_to_tag_buffer(parser, char_ref.second, is_unquoted);
    }
  } else {
    append_char_to_tag_buffer(parser, '&', is_unquoted);
  }
  gumbo_tokenizer_set_state(parser, tokenizer->_tag_state._attr_value_state);
  return NEXT_CHAR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x2d(%rbp)
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
movl %eax, -0x34(%rbp)
subl $0x25, %eax
je 0x14983
jmp 0x1496f
movl -0x34(%rbp), %eax
subl $0x26, %eax
je 0x1498c
jmp 0x14979
movl -0x34(%rbp), %eax
subl $0x27, %eax
je 0x14995
jmp 0x149a2
movl $0x22, -0x2c(%rbp)
jmp 0x149c8
movl $0x27, -0x2c(%rbp)
jmp 0x149c8
movl $0x3e, -0x2c(%rbp)
movb $0x1, -0x2d(%rbp)
jmp 0x149c8
movl $0x20, -0x2c(%rbp)
leaq 0x2053f(%rip), %rdi     # 0x34eef
leaq 0x21a79(%rip), %rsi     # 0x36430
movl $0x849, %edx            # imm = 0x849
leaq 0x2257b(%rip), %rcx     # 0x36f3e
callq 0x4100
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xe8, %rsi
movl -0x2c(%rbp), %edx
movl $0x1, %ecx
leaq -0x28(%rbp), %r8
callq 0x17df0
movl -0x28(%rbp), %eax
leaq 0x24c2e(%rip), %rcx     # 0x39620
cmpl (%rcx), %eax
je 0x14a36
movq -0x10(%rbp), %rax
movb $0x1, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %esi
movb -0x2d(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x174b0
movl -0x24(%rbp), %eax
leaq 0x24c04(%rip), %rcx     # 0x39620
cmpl (%rcx), %eax
je 0x14a34
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movb -0x2d(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x174b0
jmp 0x14a4c
movq -0x8(%rbp), %rdi
movb -0x2d(%rbp), %al
movl $0x26, %esi
andb $0x1, %al
movzbl %al, %edx
callq 0x174b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %esi
callq 0x11a10
movl $0x2, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)