// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_token
static bool handle_token(GumboParser* parser, GumboToken* token) {
  if (
    parser->_parser_state->_ignore_next_linefeed
    && token->type == GUMBO_TOKEN_WHITESPACE && token->v.character == '\n'
  ) {
    parser->_parser_state->_ignore_next_linefeed = false;
    ignore_token(parser);
    return true;
  }
  // This needs to be reset both here and in the conditional above to catch both
  // the case where the next token is not whitespace (so we don't ignore
  // whitespace in the middle of <pre> tags) and where there are multiple
  // whitespace tokens (so we don't ignore the second one).
  parser->_parser_state->_ignore_next_linefeed = false;

  if (tag_is(token, kEndTag, GUMBO_TAG_BODY)) {
    parser->_parser_state->_closed_body_tag = true;
  }
  if (tag_is(token, kEndTag, GUMBO_TAG_HTML)) {
    parser->_parser_state->_closed_html_tag = true;
  }

  const GumboNode* current_node = get_adjusted_current_node(parser);
  assert (
    !current_node
    || current_node->type == GUMBO_NODE_ELEMENT
    || current_node->type == GUMBO_NODE_TEMPLATE
  );
  if (current_node) {
    gumbo_debug (
      "Current node: <%s>.\n",
      gumbo_normalized_tagname(current_node->v.element.tag)
    );
  }
  if (!current_node ||
      current_node->v.element.tag_namespace == GUMBO_NAMESPACE_HTML ||
      (is_mathml_integration_point(current_node) &&
          (token->type == GUMBO_TOKEN_CHARACTER ||
              token->type == GUMBO_TOKEN_WHITESPACE ||
              token->type == GUMBO_TOKEN_NULL ||
              (token->type == GUMBO_TOKEN_START_TAG &&
                  !tag_in(token, kStartTag,
                      &(const TagSet){TAG(MGLYPH), TAG(MALIGNMARK)})))) ||
      (current_node->v.element.tag_namespace == GUMBO_NAMESPACE_MATHML &&
          node_qualified_tag_is(
              current_node, GUMBO_NAMESPACE_MATHML, GUMBO_TAG_ANNOTATION_XML) &&
          tag_is(token, kStartTag, GUMBO_TAG_SVG)) ||
      (is_html_integration_point(current_node) &&
          (token->type == GUMBO_TOKEN_START_TAG ||
              token->type == GUMBO_TOKEN_CHARACTER ||
              token->type == GUMBO_TOKEN_NULL ||
              token->type == GUMBO_TOKEN_WHITESPACE)) ||
      token->type == GUMBO_TOKEN_EOF) {
    return handle_html_content(parser, token);
  } else {
    return handle_in_foreign_content(parser, token);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
testb $0x1, 0x53(%rax)
je 0x7682
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x7682
movq -0x18(%rbp), %rax
cmpl $0xa, 0x30(%rax)
jne 0x7682
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x0, 0x53(%rax)
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x1, -0x1(%rbp)
jmp 0x788b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x0, 0x53(%rax)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x8c40
testb $0x1, %al
jne 0x76a4
jmp 0x76b3
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x1, 0xa0(%rax)
movq -0x18(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x8c40
testb $0x1, %al
jne 0x76c6
jmp 0x76d5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x1, 0xa1(%rax)
movq -0x10(%rbp), %rdi
callq 0x8cb0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x76fb
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
je 0x76fb
movq -0x20(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x76fd
jmp 0x771c
leaq 0x2bd2f(%rip), %rdi     # 0x33433
leaq 0x2b769(%rip), %rsi     # 0x32e74
movl $0x10ef, %edx           # imm = 0x10EF
leaq 0x2bd83(%rip), %rcx     # 0x3349a
callq 0x4100
cmpq $0x0, -0x20(%rbp)
je 0x7740
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x5f80
movq %rax, %rsi
leaq 0x2bd91(%rip), %rdi     # 0x334ca
movb $0x0, %al
callq 0x7540
cmpq $0x0, -0x20(%rbp)
je 0x7865
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x7865
movq -0x20(%rbp), %rdi
callq 0x8d10
testb $0x1, %al
jne 0x776b
jmp 0x77ef
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x7, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x77ef
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4120
leaq -0xb8(%rbp), %rdi
leaq 0x290a9(%rip), %rsi     # 0x30870
movl $0x98, %edx
callq 0x41a0
movq -0xc0(%rbp), %rdi
movl $0x1, %esi
leaq -0xb8(%rbp), %rdx
callq 0x8d40
testb $0x1, %al
jne 0x77ef
jmp 0x7865
movq -0x20(%rbp), %rax
cmpl $0x2, 0x2c(%rax)
jne 0x7829
movq -0x20(%rbp), %rdi
movl $0x2, %esi
movl $0x5b, %edx
callq 0x8770
testb $0x1, %al
jne 0x7812
jmp 0x7829
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x5c, %edx
callq 0x8c40
testb $0x1, %al
jne 0x7865
movq -0x20(%rbp), %rdi
callq 0x8db0
testb $0x1, %al
jne 0x7838
jmp 0x785c
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x7, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
je 0x7865
movq -0x18(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x7879
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8e60
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x788b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8eb0
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)