// File: /workspace/github_c_makefile_star2_O3/craigbarnes[P]lua-gumbo/lib/tokenizer.c
// Function: handle_attr_name_state
static StateResult handle_attr_name_state (
  GumboParser* parser,
  GumboTokenizerState* UNUSED_ARG(tokenizer),
  int c,
  GumboToken* output
) {
  switch (c) {
    case '\t':
    case '\n':
    case '\f':
    case ' ':
      finish_attribute_name(parser);
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_AFTER_ATTR_NAME);
      return NEXT_CHAR;
    case '/':
      finish_attribute_name(parser);
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_SELF_CLOSING_START_TAG);
      return NEXT_CHAR;
    case '=':
      finish_attribute_name(parser);
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_BEFORE_ATTR_VALUE);
      return NEXT_CHAR;
    case '>':
      finish_attribute_name(parser);
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_DATA);
      return emit_current_tag(parser, output);
    case '\0':
      tokenizer_add_parse_error(parser, GUMBO_ERR_UTF8_NULL);
      append_char_to_tag_buffer(parser, UNICODE_REPLACEMENT_CHAR, true);
      return NEXT_CHAR;
    case -1:
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_DATA);
      abandon_current_tag(parser);
      tokenizer_add_parse_error(parser, GUMBO_ERR_ATTR_NAME_EOF);
      return NEXT_CHAR;
    case '"':
    case '\'':
    case '<':
      tokenizer_add_parse_error(parser, GUMBO_ERR_ATTR_NAME_INVALID);
    // Fall through.
    default:
      append_char_to_tag_buffer(parser, ensure_lowercase(c), true);
      return NEXT_CHAR;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
cmpl $0x21, %edx
jg 0xe38b
cmpl $0x8, %r14d
jle 0xe45e
leal -0x9(%r14), %eax
cmpl $0x2, %eax
jb 0xe374
cmpl $0xc, %r14d
je 0xe374
cmpl $0x20, %r14d
jne 0xe407
movq %rbx, %rdi
callq 0x10f68
movq 0x10(%rbx), %rax
movl $0x23, (%rax)
jmp 0xe4f0
cmpl $0x3b, %r14d
jg 0xe3ba
cmpl $0x22, %r14d
je 0xe3fa
cmpl $0x27, %r14d
je 0xe3fa
cmpl $0x2f, %r14d
jne 0xe407
movq %rbx, %rdi
callq 0x10f68
movq 0x10(%rbx), %rax
movl $0x2a, (%rax)
jmp 0xe4f0
cmpl $0x3c, %r14d
je 0xe3fa
cmpl $0x3d, %r14d
je 0xe4c0
cmpl $0x3e, %r14d
jne 0xe407
movq %rcx, %r15
movq %rbx, %rdi
callq 0x10f68
movq 0x10(%rbx), %rax
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10d4a
movl $0x1, %ebp
jmp 0xe4f5
movq %rbx, %rdi
movl $0x10, %esi
callq 0x10a60
movzbl %r14b, %eax
leaq 0x9d3e(%rip), %rcx      # 0x18150
movzbl (%rcx,%rax), %edi
andl $0x20, %edi
orl %eax, %edi
movq 0x10(%rbx), %rsi
cmpq $0x0, 0x70(%rsi)
jne 0xe450
movq 0x120(%rsi), %rax
movq %rax, 0xa0(%rsi)
movups 0x110(%rsi), %xmm0
movups %xmm0, 0x90(%rsi)
movq 0xe8(%rsi), %rax
movq %rax, 0x80(%rsi)
addq $0x68, %rsi
callq 0x4322
jmp 0xe4f0
cmpl $-0x1, %r14d
je 0xe4d4
testl %r14d, %r14d
jne 0xe407
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x10a60
movq 0x10(%rbx), %rsi
cmpq $0x0, 0x70(%rsi)
jne 0xe4b0
movq 0x120(%rsi), %rax
movq %rax, 0xa0(%rsi)
movups 0x110(%rsi), %xmm0
movups %xmm0, 0x90(%rsi)
movq 0xe8(%rsi), %rax
movq %rax, 0x80(%rsi)
addq $0x68, %rsi
movl $0xfffd, %edi           # imm = 0xFFFD
callq 0x4322
jmp 0xe4f5
movq %rbx, %rdi
callq 0x10f68
movq 0x10(%rbx), %rax
movl $0x24, (%rax)
jmp 0xe4f0
movq 0x10(%rbx), %rdi
movl $0x0, (%rdi)
callq 0x10eb9
movq %rbx, %rdi
movl $0xf, %esi
callq 0x10a60
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq