// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/tokenizer.c
// Function: handle_doctype_name_state
static StateResult handle_doctype_name_state (
  GumboParser* parser,
  GumboTokenizerState* tokenizer,
  int c,
  GumboToken* output
) {
  switch (c) {
    case '\t':
    case '\n':
    case '\f':
    case ' ':
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_AFTER_DOCTYPE_NAME);
      gumbo_free((void*) tokenizer->_doc_type_state.name);
      finish_temporary_buffer(parser, &tokenizer->_doc_type_state.name);
      return NEXT_CHAR;
    case '>':
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_DATA);
      gumbo_free((void*) tokenizer->_doc_type_state.name);
      finish_temporary_buffer(parser, &tokenizer->_doc_type_state.name);
      emit_doctype(parser, output);
      return RETURN_SUCCESS;
    case '\0':
      tokenizer_add_parse_error(parser, GUMBO_ERR_UTF8_NULL);
      append_char_to_temporary_buffer(parser, UNICODE_REPLACEMENT_CHAR);
      return NEXT_CHAR;
    case -1:
      tokenizer_add_parse_error(parser, GUMBO_ERR_DOCTYPE_EOF);
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_DATA);
      tokenizer->_doc_type_state.force_quirks = true;
      gumbo_free((void*) tokenizer->_doc_type_state.name);
      finish_temporary_buffer(parser, &tokenizer->_doc_type_state.name);
      emit_doctype(parser, output);
      return RETURN_ERROR;
    default:
      gumbo_tokenizer_set_state(parser, GUMBO_LEX_DOCTYPE_NAME);
      tokenizer->_doc_type_state.force_quirks = false;
      append_char_to_temporary_buffer(parser, ensure_lowercase(c));
      return NEXT_CHAR;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl -0x1c(%rbp), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3f, %eax
ja 0x1593b
movq -0x30(%rbp), %rax
leaq 0x203d2(%rip), %rcx     # 0x35bf8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movl $0x36, %esi
callq 0x11a10
movq -0x18(%rbp), %rax
movq 0xc8(%rax), %rdi
callq 0x17d80
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0xc8, %rsi
callq 0x17b70
movl $0x2, -0x4(%rbp)
jmp 0x15976
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x11a10
movq -0x18(%rbp), %rax
movq 0xc8(%rax), %rdi
callq 0x17d80
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0xc8, %rsi
callq 0x17b70
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x17bc0
movl $0x1, -0x4(%rbp)
jmp 0x15976
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x16c60
movq -0x10(%rbp), %rdi
movl $0xfffd, %esi           # imm = 0xFFFD
callq 0x16c30
movl $0x2, -0x4(%rbp)
jmp 0x15976
movq -0x10(%rbp), %rdi
movl $0x22, %esi
callq 0x16c60
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x11a10
movq -0x18(%rbp), %rax
movb $0x1, 0xe0(%rax)
movq -0x18(%rbp), %rax
movq 0xc8(%rax), %rdi
callq 0x17d80
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0xc8, %rsi
callq 0x17b70
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x17bc0
movl $0x0, -0x4(%rbp)
jmp 0x15976
movq -0x10(%rbp), %rdi
movl $0x35, %esi
callq 0x11a10
movq -0x18(%rbp), %rax
movb $0x0, 0xe0(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %edi
callq 0x17170
movq -0x38(%rbp), %rdi
movl %eax, %esi
callq 0x16c30
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop