// File: /workspace/github_c_makefile_star2_O1/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 0xed48
cmpl $0x8, %r14d
jle 0xee1b
leal -0x9(%r14), %eax
cmpl $0x2, %eax
jb 0xed31
cmpl $0xc, %r14d
je 0xed31
cmpl $0x20, %r14d
jne 0xedc4
movq %rbx, %rdi
callq 0x119c4
movq 0x10(%rbx), %rax
movl $0x23, (%rax)
jmp 0xeeb0
cmpl $0x3b, %r14d
jg 0xed77
cmpl $0x22, %r14d
je 0xedb7
cmpl $0x27, %r14d
je 0xedb7
cmpl $0x2f, %r14d
jne 0xedc4
movq %rbx, %rdi
callq 0x119c4
movq 0x10(%rbx), %rax
movl $0x2a, (%rax)
jmp 0xeeb0
cmpl $0x3c, %r14d
je 0xedb7
cmpl $0x3d, %r14d
je 0xee7d
cmpl $0x3e, %r14d
jne 0xedc4
movq %rcx, %r15
movq %rbx, %rdi
callq 0x119c4
movq 0x10(%rbx), %rax
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x117b0
movl $0x1, %ebp
jmp 0xeeb5
movq %rbx, %rdi
movl $0x10, %esi
callq 0x11412
movzbl %r14b, %eax
leaq 0xb381(%rip), %rcx      # 0x1a150
movzbl (%rcx,%rax), %edi
andl $0x20, %edi
orl %eax, %edi
movq 0x10(%rbx), %rsi
cmpq $0x0, 0x70(%rsi)
jne 0xee0d
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 0xeeb0
cmpl $-0x1, %r14d
je 0xee91
testl %r14d, %r14d
jne 0xedc4
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11412
movq 0x10(%rbx), %rsi
cmpq $0x0, 0x70(%rsi)
jne 0xee6d
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 0xeeb5
movq %rbx, %rdi
callq 0x119c4
movq 0x10(%rbx), %rax
movl $0x24, (%rax)
jmp 0xeeb0
movq 0x10(%rbx), %rax
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x11914
movq %rbx, %rdi
movl $0xf, %esi
callq 0x11412
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq