// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x1, %eax
je 0x9fa5
cmpl $0x2, %eax
jne 0xa0a8
movl 0x30(%r14), %r15d
leaq 0x11196(%rip), %rax     # 0x1b0f0
cmpb $0x0, (%r15,%rax)
je 0xa023
movq 0x18(%rbx), %rdi
leaq 0x4(%rsp), %rdx
movl %r15d, (%rdx)
leaq 0x10b68(%rip), %r8      # 0x1aae0
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
je 0xa031
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc61a
movl 0x30(%r14), %eax
leaq 0x11438(%rip), %rcx     # 0x1b3e8
cmpb $0x0, (%rax,%rcx)
je 0xa0a8
movq 0x18(%rbx), %r15
leaq 0x4(%rsp), %rdx
movl $0x68, (%rdx)
leaq 0x10b10(%rip), %r8      # 0x1aae0
movq %r15, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
jne 0xa008
leaq 0x4(%rsp), %rdx
movl $0x67, (%rdx)
leaq 0x10aeb(%rip), %r8      # 0x1aae0
movq %r15, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
je 0xa031
movb $0x1, 0x50(%r15)
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc6ab
leaq 0x11456(%rip), %rax     # 0x1b480
cmpb $0x0, (%r15,%rax)
je 0xa069
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
movq 0x18(%rbx), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xc990
cmpl $0x1, (%rbx)
jne 0xa05b
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x114a8(%rip), %rax     # 0x1b518
cmpb $0x0, (%r15,%rax)
je 0xa0a8
movq 0x18(%rbx), %r12
leaq 0x4(%rsp), %rdx
movl %r15d, (%rdx)
leaq 0x10a56(%rip), %r8      # 0x1aae0
movq %r12, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
je 0xa031
movb $0x1, 0x50(%r12)
jmp 0xa00d
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4ece