// File: /workspace/github_c_makefile_star2_O3/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 0x933f
movq %rsi, %r14
leaq 0x10387(%rip), %rcx     # 0x19600
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
movq 0x18(%rbx), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xc990
cmpl $0x1, (%rbx)
jne 0x92ac
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %eax, %eax
jmp 0x9363
movq %rbx, %rdi
movq %r14, %rsi
callq 0xaf71
jmp 0x9361
movl 0x30(%r14), %eax
cmpq $0x9, %rax
jne 0x932e
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8de1
movq %rbx, %rdi
callq 0x7d33
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xac3d
jmp 0x9361
movl 0x30(%r14), %eax
cmpq $0x81, %rax
je 0x938c
cmpl $0xa, %eax
je 0x936f
testl %eax, %eax
jne 0x93a3
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4ece
leaq 0x10a5b(%rip), %rcx     # 0x19d90
cmpb $0x0, (%rax,%rcx)
je 0x9282
movq %rbx, %rdi
movl $0xa, %esi
movl $0x8, %edx
callq 0x80c5
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 0xade5
movb $0x0, 0x52(%r12)
movq 0x18(%rbx), %rax
movl $0x6, (%rax)
jmp 0x9361
movq %rbx, %rdi
movq %r14, %rsi
callq 0xade5
movq 0x18(%rbx), %rax
movl $0x13, (%rax)
jmp 0x9361
leaq 0x1233e(%rip), %rcx     # 0x1b6e8
cmpb $0x0, (%rax,%rcx)
je 0x93fe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
cmpq $0x0, 0x38(%r12)
je 0x940c
movq %rbx, %rdi
callq 0x8313
movq 0x38(%r12), %rdi
leaq 0x8(%r12), %r15
movq %r15, %rsi
callq 0x7b25
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8de1
movl %eax, %ebx
movq 0x38(%r12), %rdi
movq %r15, %rsi
callq 0x7c85
movl %ebx, %eax
jmp 0x9363
cmpl $0x1, %eax
je 0x9282
jmp 0x933f
leaq 0x138b8(%rip), %rdi     # 0x1cccb
leaq 0x12516(%rip), %rsi     # 0x1b930
leaq 0x138c7(%rip), %rcx     # 0x1cce8
movl $0xa2e, %edx            # imm = 0xA2E
callq 0x4100