// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_in_cell
static bool handle_in_cell(GumboParser* parser, GumboToken* token) {
  if (tag_in(token, kEndTag, &td_th_tags)) {
    GumboTag token_tag = token->v.end_tag;
    if (!has_an_element_in_table_scope(parser, token_tag)) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    return close_table_cell(parser, token, token_tag);
  } else if (
    tag_in(token, kStartTag, &(const TagSet) {
      TAG(CAPTION), TAG(COL), TAG(COLGROUP), TAG(TBODY), TAG(TD),
      TAG(TFOOT), TAG(TH), TAG(THEAD), TAG(TR)
    })
  ) {
    gumbo_debug("Handling <td> in cell.\n");
    if (
      !has_an_element_in_table_scope(parser, GUMBO_TAG_TH)
      && !has_an_element_in_table_scope(parser, GUMBO_TAG_TD)
    ) {
      gumbo_debug("Bailing out because there's no <td> or <th> in scope.\n");
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    parser->_parser_state->_reprocess_current_token = true;
    return close_current_cell(parser, token);
  } else if (
    tag_in(token, kEndTag, &(const TagSet) {
      TAG(BODY), TAG(CAPTION), TAG(COL), TAG(COLGROUP), TAG(HTML)
    })
  ) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else if (
    tag_in(token, kEndTag, &(const TagSet) {
      TAG(TABLE), TAG(TBODY), TAG(TFOOT), TAG(THEAD), TAG(TR)
    })
  ) {
    if (!has_an_element_in_table_scope(parser, token->v.end_tag)) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    parser->_parser_state->_reprocess_current_token = true;
    return close_current_cell(parser, token);
  } else {
    return handle_in_body(parser, token);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %ebp
cmpl $0x2, %ebp
jne 0xa6b9
movl 0x30(%r14), %eax
leaq 0x1295e(%rip), %rcx     # 0x1cfd0
cmpb $0x0, (%rax,%rcx)
je 0xa6b9
movl 0x30(%r14), %ebp
leaq 0x4(%rsp), %rdx
movl %ebp, (%rdx)
leaq 0x12336(%rip), %r8      # 0x1c9c0
movq %rbx, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xbc6a
testb %al, %al
je 0xa78c
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xd00a
cmpl $0x1, %ebp
jne 0xa701
movl 0x30(%r14), %eax
leaq 0x12bff(%rip), %rcx     # 0x1d2c8
cmpb $0x0, (%rax,%rcx)
je 0xa701
leaq 0x4(%rsp), %rdx
movl $0x68, (%rdx)
leaq 0x122df(%rip), %r8      # 0x1c9c0
movq %rbx, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xbc6a
testb %al, %al
jne 0xa76e
leaq 0x4(%rsp), %rdx
movl $0x67, (%rdx)
jmp 0xa754
cmpl $0x2, %ebp
jne 0xa7c4
movl 0x30(%r14), %eax
leaq 0x12c4b(%rip), %rcx     # 0x1d360
cmpb $0x0, (%rax,%rcx)
jne 0xa78c
leaq 0x12cd6(%rip), %rsi     # 0x1d3f8
leaq 0x8(%rsp), %rdi
movl $0x98, %edx
callq 0x4190
cmpl $0x2, %ebp
jne 0xa7da
movl 0x30(%r14), %eax
cmpb $0x0, 0x8(%rsp,%rax)
je 0xa7da
movl 0x30(%r14), %eax
leaq 0x4(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x12265(%rip), %r8      # 0x1c9c0
movq %rbx, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xbc6a
testb %al, %al
je 0xa78c
movq 0x18(%rbx), %rax
movb $0x1, 0x50(%rax)
movq %rbx, %rdi
movq %r14, %rsi
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xd09b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
movq 0x18(%rbx), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xd3c9
cmpl $0x1, (%rbx)
jne 0xa7b6
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x12c2d(%rip), %rsi     # 0x1d3f8
leaq 0x8(%rsp), %rdi
movl $0x98, %edx
callq 0x4190
movq %rbx, %rdi
movq %r14, %rsi
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4fa2