// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_after_body
static bool handle_after_body(GumboParser* parser, GumboToken* token) {
  if (
    token->type == GUMBO_TOKEN_WHITESPACE
    || tag_is(token, kStartTag, GUMBO_TAG_HTML)
  ) {
    return handle_in_body(parser, token);
  } else if (token->type == GUMBO_TOKEN_COMMENT) {
    GumboNode* html_node = parser->_output->root;
    assert(html_node != NULL);
    append_comment_node(parser, html_node, token);
    return true;
  } else if (token->type == GUMBO_TOKEN_DOCTYPE) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else if (tag_is(token, kEndTag, GUMBO_TAG_HTML)) {
    /* fragment case: ignore the closing HTML token */
    if (is_fragment_parser(parser)) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_AFTER_AFTER_BODY);
    GumboNode* html = parser->_parser_state->_open_elements.data[0];
    assert(node_html_tag_is(html, GUMBO_TAG_HTML));
    record_end_of_element (
      parser->_parser_state->_current_token,
      &html->v.element
    );
    return true;
  } else if (token->type == GUMBO_TOKEN_EOF) {
    return true;
  } else {
    parser_add_parse_error(parser, token);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_BODY);
    parser->_parser_state->_reprocess_current_token = true;
    return false;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rdx
movq %rdi, %r14
movl (%rsi), %eax
cmpq $0x8, %rax
ja 0xafa2
movb $0x1, %bl
leaq 0x10673(%rip), %rcx     # 0x1b5e4
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
cmpl $0x0, 0x30(%rdx)
je 0xafbd
cmpl $0x8, %eax
ja 0xafa2
movl %eax, %ecx
leaq 0x1067a(%rip), %rsi     # 0x1b608
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
cmpl $0x0, 0x30(%rdx)
je 0xafe8
cmpl $0x8, %eax
je 0xb01f
movq %r14, %rdi
movq %rdx, %rsi
callq 0x8171
movq 0x18(%r14), %rax
movl $0x6, (%rax)
movb $0x1, 0x50(%rax)
jmp 0xb01d
movq %r14, %rdi
movq %rdx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x4fa2
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
je 0xb078
movq %r14, %rdi
callq 0xb4a3
jmp 0xb01f
movq 0x18(%r14), %rax
cmpq $0x0, 0x48(%rax)
je 0xb027
movq %r14, %rdi
movq %rdx, %rsi
callq 0x8171
movq 0x18(%r14), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xd3c9
cmpl $0x1, (%rbx)
jne 0xb01d
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movl $0x15, (%rax)
movq 0x8(%rax), %rax
movq (%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8b69
testb %al, %al
je 0xb097
movq 0x18(%r14), %rax
movq 0x98(%rax), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x78(%r15)
movups 0x8(%rax), %xmm0
movups %xmm0, 0x68(%r15)
addq $0x40, %r15
cmpl $0x2, (%rax)
jne 0xb06f
movups 0x20(%rax), %xmm0
jmp 0xb072
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
jmp 0xb01f
leaq 0x14382(%rip), %rdi     # 0x1f401
leaq 0x1278a(%rip), %rsi     # 0x1d810
leaq 0x14386(%rip), %rcx     # 0x1f413
movl $0xf7b, %edx            # imm = 0xF7B
callq 0x4100
leaq 0x143aa(%rip), %rdi     # 0x1f448
leaq 0x1276b(%rip), %rsi     # 0x1d810
leaq 0x14367(%rip), %rcx     # 0x1f413
movl $0xf8b, %edx            # imm = 0xF8B
callq 0x4100