// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_in_head
static bool handle_in_head(GumboParser* parser, GumboToken* token) {
  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_in(token, kStartTag, &(const TagSet) {
      TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(LINK)
    })
  ) {
    insert_element_from_token(parser, token);
    pop_current_node(parser);
    acknowledge_self_closing_tag(parser);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_META)) {
    insert_element_from_token(parser, token);
    pop_current_node(parser);
    acknowledge_self_closing_tag(parser);
    // NOTE(jdtang): Gumbo handles only UTF-8, so the encoding clause of the
    // spec doesn't apply. If clients want to handle meta-tag re-encoding, they
    // should specifically look for that string in the document and re-encode it
    // before passing to Gumbo.
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_TITLE)) {
    run_generic_parsing_algorithm(parser, token, GUMBO_LEX_RCDATA);
    return true;
  } else if (
    tag_in(token, kStartTag, &(const TagSet){TAG(NOFRAMES), TAG(STYLE)})
  ) {
    run_generic_parsing_algorithm(parser, token, GUMBO_LEX_RAWTEXT);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_NOSCRIPT)) {
    insert_element_from_token(parser, token);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_HEAD_NOSCRIPT);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_SCRIPT)) {
    run_generic_parsing_algorithm(parser, token, GUMBO_LEX_SCRIPT);
    return true;
  } else if (tag_is(token, kEndTag, GUMBO_TAG_HEAD)) {
    GumboNode* head = pop_current_node(parser);
    UNUSED_IF_NDEBUG(head);
    assert(node_html_tag_is(head, GUMBO_TAG_HEAD));
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_AFTER_HEAD);
    return true;
  } else if (
    tag_in(token, kEndTag, &(const TagSet){TAG(BODY), TAG(HTML), TAG(BR)})
  ) {
    pop_current_node(parser);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_AFTER_HEAD);
    parser->_parser_state->_reprocess_current_token = true;
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_TEMPLATE)) {
    insert_element_from_token(parser, token);
    add_formatting_element(parser, &kActiveFormattingScopeMarker);
    parser->_parser_state->_frameset_ok = false;
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TEMPLATE);
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TEMPLATE);
    return true;
  } else if (tag_is(token, kEndTag, GUMBO_TAG_TEMPLATE)) {
    if (!has_open_element(parser, GUMBO_TAG_TEMPLATE)) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    generate_all_implied_end_tags_thoroughly(parser);
    bool success = true;
    if (!node_html_tag_is(get_current_node(parser), GUMBO_TAG_TEMPLATE)) {
      parser_add_parse_error(parser, token);
      success = false;
    }
    while (!node_html_tag_is(pop_current_node(parser), GUMBO_TAG_TEMPLATE)) {
      ;
    }
    clear_active_formatting_elements(parser);
    pop_template_insertion_mode(parser);
    reset_insertion_mode_appropriately(parser);
    return success;
  } else if (
    tag_is(token, kStartTag, GUMBO_TAG_HEAD)
    || (token->type == GUMBO_TOKEN_END_TAG)
  ) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else {
    pop_current_node(parser);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_AFTER_HEAD);
    parser->_parser_state->_reprocess_current_token = true;
    return true;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x9972
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xef60
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x999a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x0, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x99d3
movq -0x10(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7550
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0xe7b0
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x8c40
testb $0x1, %al
jne 0x99e9
jmp 0x9a00
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa3f0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4120
leaq -0xb0(%rbp), %rdi
leaq 0x270bc(%rip), %rsi     # 0x30ae8
movl $0x98, %edx
callq 0x41a0
movq -0x200(%rbp), %rdi
movl $0x1, %esi
leaq -0xb0(%rbp), %rdx
callq 0x8d40
testb $0x1, %al
jne 0x9a54
jmp 0x9a7c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xece0
movq -0x10(%rbp), %rdi
callq 0xf060
movq -0x10(%rbp), %rdi
callq 0xf240
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9a95
jmp 0x9abd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xece0
movq -0x10(%rbp), %rdi
callq 0xf060
movq -0x10(%rbp), %rdi
callq 0xf240
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9ad6
jmp 0x9af1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x2, %edx
callq 0xf260
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rax
movq %rax, -0x208(%rbp)
leaq -0x148(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4120
leaq -0x148(%rbp), %rdi
leaq 0x27063(%rip), %rsi     # 0x30b80
movl $0x98, %edx
callq 0x41a0
movq -0x208(%rbp), %rdi
movl $0x1, %esi
leaq -0x148(%rbp), %rdx
callq 0x8d40
testb $0x1, %al
jne 0x9b45
jmp 0x9b60
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x4, %edx
callq 0xf260
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9b79
jmp 0x9b9d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xece0
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x8b40
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x7, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9bb6
jmp 0x9bd1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x5, %edx
callq 0xf260
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9be7
jmp 0x9c46
movq -0x10(%rbp), %rdi
callq 0xf060
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rdi
movl $0x1, %esi
callq 0x8700
testb $0x1, %al
jne 0x9c0e
jmp 0x9c10
jmp 0x9c2f
leaq 0x2a4a7(%rip), %rdi     # 0x340be
leaq 0x29256(%rip), %rsi     # 0x32e74
movl $0x9b0, %edx            # imm = 0x9B0
leaq 0x2a4bb(%rip), %rcx     # 0x340e5
callq 0x4100
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x8b40
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x1e8(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4120
leaq -0x1e8(%rbp), %rdi
leaq 0x26fa6(%rip), %rsi     # 0x30c18
movl $0x98, %edx
callq 0x41a0
movq -0x210(%rbp), %rdi
xorl %esi, %esi
leaq -0x1e8(%rbp), %rdx
callq 0x8d40
testb $0x1, %al
jne 0x9c97
jmp 0x9cc3
movq -0x10(%rbp), %rdi
callq 0xf060
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x8b40
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x9, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9cdc
jmp 0x9d2a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xece0
movq -0x10(%rbp), %rdi
leaq 0x26fbc(%rip), %rsi     # 0x30cb0
callq 0xf2c0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x0, 0x52(%rax)
movq -0x10(%rbp), %rdi
movl $0x11, %esi
callq 0x8b40
movq -0x10(%rbp), %rdi
movl $0x11, %esi
callq 0x7f10
movb $0x1, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0x8c40
testb $0x1, %al
jne 0x9d43
jmp 0x9dfc
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0xf3a0
testb $0x1, %al
jne 0x9d74
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x0, -0x1(%rbp)
jmp 0x9e5c
movq -0x10(%rbp), %rdi
callq 0xf3e0
movb $0x1, -0x1e9(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7550
movq %rax, %rdi
movl $0x9, %esi
callq 0x8700
testb $0x1, %al
jne 0x9db2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movb $0x0, -0x1e9(%rbp)
jmp 0x9db4
movq -0x10(%rbp), %rdi
callq 0xf060
movq %rax, %rdi
movl $0x9, %esi
callq 0x8700
xorb $-0x1, %al
testb $0x1, %al
jne 0x9dd2
jmp 0x9dd4
jmp 0x9db4
movq -0x10(%rbp), %rdi
callq 0xf420
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
callq 0x7f40
movb -0x1e9(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x9e5c
movq -0x18(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x8c40
testb $0x1, %al
jne 0x9e19
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x9e35
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x0, -0x1(%rbp)
jmp 0x9e5c
movq -0x10(%rbp), %rdi
callq 0xf060
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x8b40
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopw (%rax,%rax)