// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_after_head
static bool handle_after_head(GumboParser* parser, GumboToken* token) {
  GumboParserState* state = parser->_parser_state;
  if (token->type == GUMBO_TOKEN_WHITESPACE) {
    insert_text_token(parser, token);
    return true;
  } else if (token->type == GUMBO_TOKEN_DOCTYPE) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else if (token->type == GUMBO_TOKEN_COMMENT) {
    append_comment_node(parser, get_current_node(parser), token);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_HTML)) {
    return handle_in_body(parser, token);
  } else if (tag_is(token, kStartTag, GUMBO_TAG_BODY)) {
    insert_element_from_token(parser, token);
    state->_frameset_ok = false;
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_BODY);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_FRAMESET)) {
    insert_element_from_token(parser, token);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_FRAMESET);
    return true;
  } else if (
    tag_in(token, kStartTag, &(const TagSet) {
      TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(LINK), TAG(META),
      TAG(NOFRAMES), TAG(SCRIPT), TAG(STYLE), TAG(TEMPLATE), TAG(TITLE)
    })
  ) {
    parser_add_parse_error(parser, token);
    assert(state->_head_element != NULL);
    // This must be flushed before we push the head element on, as there may be
    // pending character tokens that should be attached to the root.
    maybe_flush_text_node_buffer(parser);
    gumbo_vector_add(state->_head_element, &state->_open_elements);
    bool result = handle_in_head(parser, token);
    gumbo_vector_remove(state->_head_element, &state->_open_elements);
    return result;
  } else if (tag_is(token, kEndTag, GUMBO_TAG_TEMPLATE)) {
    return handle_in_head(parser, token);
  } else if (
    tag_is(token, kStartTag, GUMBO_TAG_HEAD)
    || (
      token->type == GUMBO_TOKEN_END_TAG
      && !tag_in(token, kEndTag, &(const TagSet){TAG(BODY), TAG(HTML), TAG(BR)})
    )
  ) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else {
    insert_element_of_tag_type(parser, GUMBO_TAG_BODY, GUMBO_INSERTION_IMPLIED);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_BODY);
    state->_reprocess_current_token = true;
    return true;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r12
movl (%rsi), %eax
cmpq $0x4, %rax
ja 0x8de0
movq %rsi, %r14
leaq 0xe873(%rip), %rcx      # 0x175a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r14, %rsi
callq 0x797d
movq %rbx, %rdi
callq 0x83cf
xorl %eax, %eax
jmp 0x8e00
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa59b
jmp 0x8dfe
movl 0x30(%r14), %eax
cmpq $0x9, %rax
jne 0x8dcf
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8893
movq %rbx, %rdi
callq 0x7913
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xa2ca
jmp 0x8dfe
movl 0x30(%r14), %eax
cmpq $0x81, %rax
je 0x8e29
cmpl $0xa, %eax
je 0x8e0c
testl %eax, %eax
jne 0x8e40
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4d63
leaq 0xef2a(%rip), %rcx      # 0x17d00
cmpb $0x0, (%rax,%rcx)
je 0x8d3e
pushq $0xa
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x7c99
movq 0x18(%rbx), %rax
movl $0x6, (%rax)
movb $0x1, 0x50(%r12)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa439
movb $0x0, 0x52(%r12)
movq 0x18(%rbx), %rax
movl $0x6, (%rax)
jmp 0x8dfe
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa439
movq 0x18(%rbx), %rax
movl $0x13, (%rax)
jmp 0x8dfe
leaq 0x10811(%rip), %rcx     # 0x19658
cmpb $0x0, (%rax,%rcx)
je 0x8e9b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x797d
cmpq $0x0, 0x38(%r12)
je 0x8ea9
movq %rbx, %rdi
callq 0x7ec1
movq 0x38(%r12), %rdi
leaq 0x8(%r12), %r15
movq %r15, %rsi
callq 0x7726
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8893
movl %eax, %ebx
movq 0x38(%r12), %rdi
movq %r15, %rsi
callq 0x7874
movl %ebx, %eax
jmp 0x8e00
cmpl $0x1, %eax
je 0x8d3e
jmp 0x8de0
leaq 0x11d8b(%rip), %rdi     # 0x1ac3b
leaq 0x109e9(%rip), %rsi     # 0x198a0
leaq 0x11d9a(%rip), %rcx     # 0x1ac58
movl $0xa2e, %edx            # imm = 0xA2E
callq 0x4100