// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_before_html
static bool handle_before_html(GumboParser* parser, GumboToken* token) {
  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_document_node(parser), token);
    return true;
  } else if (token->type == GUMBO_TOKEN_WHITESPACE) {
    ignore_token(parser);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_HTML)) {
    GumboNode* html_node = insert_element_from_token(parser, token);
    parser->_output->root = html_node;
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_BEFORE_HEAD);
    return true;
  } else if (
    token->type == GUMBO_TOKEN_END_TAG
    && !tag_in(token, false, &head_body_html_br_tags)
  ) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else {
    GumboNode* html_node = insert_element_of_tag_type (
      parser,
      GUMBO_TAG_HTML,
      GUMBO_INSERTION_IMPLIED
    );
    assert(html_node);
    parser->_output->root = html_node;
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_BEFORE_HEAD);
    parser->_parser_state->_reprocess_current_token = true;
    return true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x9688
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x0, -0x1(%rbp)
jmp 0x97c9
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x96bb
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8660
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0xe7b0
movb $0x1, -0x1(%rbp)
jmp 0x97c9
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x96d6
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x1, -0x1(%rbp)
jmp 0x97c9
movq -0x18(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x8c40
testb $0x1, %al
jne 0x96ec
jmp 0x9724
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xece0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x8b40
movb $0x1, -0x1(%rbp)
jmp 0x97c9
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x975f
movq -0x18(%rbp), %rdi
xorl %esi, %esi
leaq 0x27316(%rip), %rdx     # 0x30a50
callq 0x8d40
testb $0x1, %al
jne 0x975f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x0, -0x1(%rbp)
jmp 0x97c9
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x7ea0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x977c
jmp 0x979b
leaq 0x2a7de(%rip), %rdi     # 0x33f61
leaq 0x296ea(%rip), %rsi     # 0x32e74
movl $0x94c, %edx            # imm = 0x94C
leaq 0x2a7d5(%rip), %rcx     # 0x33f6b
callq 0x4100
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movl $0x2, %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 $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)