// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %ebp
testl %ebp, %ebp
je 0x98cb
cmpl $0x3, %ebp
je 0x97a9
cmpl $0x4, %ebp
jne 0x97c4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb82b
jmp 0x98c7
movq %rbx, %rdi
callq 0x8107
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xb4a3
jmp 0x98c7
movq 0x18(%rbx), %r12
cmpl $0x1, %ebp
jne 0x9847
cmpl $0x0, 0x30(%r14)
je 0x9800
cmpl $0x1, %ebp
jne 0x9847
cmpl $0xa, 0x30(%r14)
jne 0x981a
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb69f
movb $0x0, 0x52(%r12)
movq 0x18(%rbx), %rax
movl $0x6, (%rax)
jmp 0x98c7
movq %rbx, %rdi
movq %r14, %rsi
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4fa2
cmpl $0x1, %ebp
jne 0x9847
cmpl $0x81, 0x30(%r14)
jne 0x9907
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb69f
movq 0x18(%rbx), %rax
movl $0x13, (%rax)
jmp 0x98c7
leaq 0x13d7a(%rip), %rsi     # 0x1d5c8
leaq 0x8(%rsp), %rdi
movl $0x98, %edx
callq 0x4190
cmpl $0x2, %ebp
jne 0x9883
cmpl $0x9, 0x30(%r14)
jne 0x9883
movq %rbx, %rdi
movq %r14, %rsi
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x91d5
cmpl $0x1, %ebp
jne 0x988f
cmpl $0x1, 0x30(%r14)
je 0x98cb
cmpl $0x2, %ebp
jne 0x98a5
movl 0x30(%r14), %eax
leaq 0x123d1(%rip), %rcx     # 0x1bc70
cmpb $0x0, (%rax,%rcx)
je 0x98cb
movq %rbx, %rdi
movl $0xa, %esi
movl $0x8, %edx
callq 0x84b0
movq 0x18(%rbx), %rax
movl $0x6, (%rax)
movb $0x1, 0x50(%r12)
movb $0x1, %al
jmp 0x98f7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
movq 0x18(%rbx), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xd3c9
cmpl $0x1, (%rbx)
jne 0x98f5
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13cba(%rip), %rsi     # 0x1d5c8
leaq 0x8(%rsp), %rdi
movl $0x98, %edx
callq 0x4190
cmpl $0x1, %ebp
jne 0x985d
movl 0x30(%r14), %eax
cmpb $0x0, 0x8(%rsp,%rax)
je 0x985d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
cmpq $0x0, 0x38(%r12)
je 0x9983
movq %rbx, %rdi
callq 0x8740
movq 0x38(%r12), %rdi
leaq 0x8(%r12), %r15
movq %r15, %rsi
callq 0x7ef9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x91d5
movl %eax, %ebx
movq 0x38(%r12), %rdi
movq %r15, %rsi
callq 0x8058
movl %ebx, %eax
jmp 0x98f7
leaq 0x15221(%rip), %rdi     # 0x1ebab
leaq 0x13e7f(%rip), %rsi     # 0x1d810
leaq 0x15230(%rip), %rcx     # 0x1ebc8
movl $0xa2e, %edx            # imm = 0xA2E
callq 0x4100