// File: /workspace/github_c_makefile_star2_O3/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_in_table_body
static bool handle_in_table_body(GumboParser* parser, GumboToken* token) {
  if (tag_is(token, kStartTag, GUMBO_TAG_TR)) {
    clear_stack_to_table_body_context(parser);
    insert_element_from_token(parser, token);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_ROW);
    return true;
  } else if (tag_in(token, kStartTag, &td_th_tags)) {
    parser_add_parse_error(parser, token);
    clear_stack_to_table_body_context(parser);
    insert_element_of_tag_type(parser, GUMBO_TAG_TR, GUMBO_INSERTION_IMPLIED);
    parser->_parser_state->_reprocess_current_token = true;
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_ROW);
    return false;
  } else if (
    tag_in(token, kEndTag, &(const TagSet){TAG(TBODY), TAG(TFOOT), TAG(THEAD)})
  ) {
    if (!has_an_element_in_table_scope(parser, token->v.end_tag)) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    clear_stack_to_table_body_context(parser);
    pop_current_node(parser);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TABLE);
    return true;
  } else if (
    tag_in(token, kStartTag, &(const TagSet) {
      TAG(CAPTION), TAG(COL), TAG(COLGROUP), TAG(TBODY), TAG(TFOOT),
      TAG(THEAD)
    })
    || tag_is(token, kEndTag, GUMBO_TAG_TABLE)
  ) {
    if (
      !(
        has_an_element_in_table_scope(parser, GUMBO_TAG_TBODY)
        || has_an_element_in_table_scope(parser, GUMBO_TAG_THEAD)
        || has_an_element_in_table_scope(parser, GUMBO_TAG_TFOOT)
      )
    ) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    clear_stack_to_table_body_context(parser);
    pop_current_node(parser);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TABLE);
    parser->_parser_state->_reprocess_current_token = true;
    return true;
  } else if (
    tag_in(token, kEndTag, &(const TagSet) {
      TAG(BODY), TAG(CAPTION), TAG(COL), TAG(TR), TAG(COLGROUP),
      TAG(HTML), TAG(TD), TAG(TH)
    })
  ) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else {
    return handle_in_table(parser, token);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x2, %eax
je 0x9bcd
cmpl $0x1, %eax
jne 0x9d2d
movl 0x30(%r14), %eax
cmpq $0x66, %rax
jne 0x9c27
movq %rbx, %rdi
callq 0xc580
movq %rbx, %rdi
movq %r14, %rsi
callq 0xade5
movq 0x18(%rbx), %rax
movl $0xd, (%rax)
jmp 0x9d29
movl 0x30(%r14), %eax
leaq 0x11648(%rip), %rcx     # 0x1b220
cmpb $0x0, (%rax,%rcx)
je 0x9c6c
movq 0x18(%rbx), %rdi
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x10eec(%rip), %r8      # 0x1aae0
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
movq %rbx, %rdi
testb %al, %al
je 0x9d44
callq 0xc580
movq %rbx, %rdi
callq 0xaffb
movq 0x18(%rbx), %rax
movl $0x8, (%rax)
jmp 0x9d29
leaq 0x114c2(%rip), %rcx     # 0x1b0f0
cmpb $0x0, (%rax,%rcx)
je 0x9c87
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
movq %rbx, %rdi
callq 0xc580
movq %rbx, %rdi
movl $0x66, %esi
movl $0x8, %edx
callq 0x80c5
movq 0x18(%rbx), %rax
movb $0x1, 0x50(%rax)
movl $0xd, (%rax)
jmp 0x9d6b
cmpl $0x5f, %eax
je 0x9c98
leaq 0x11340(%rip), %rcx     # 0x1afb8
cmpb $0x0, (%rax,%rcx)
jne 0x9d41
jmp 0x9d2d
leaq 0x11292(%rip), %rcx     # 0x1af20
cmpb $0x0, (%rax,%rcx)
je 0x9d2d
movq 0x18(%rbx), %r15
leaq 0xc(%rsp), %rdx
movl $0x63, (%rdx)
leaq 0x10e32(%rip), %r8      # 0x1aae0
movq %r15, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
jne 0x9d0b
leaq 0xc(%rsp), %rdx
movl $0x64, (%rdx)
leaq 0x10e0d(%rip), %r8      # 0x1aae0
movq %r15, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
jne 0x9d0b
leaq 0xc(%rsp), %rdx
movl $0x65, (%rdx)
leaq 0x10de8(%rip), %r8      # 0x1aae0
movq %r15, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0xb40a
testb %al, %al
je 0x9d41
movq %rbx, %rdi
callq 0xc580
movq %rbx, %rdi
callq 0xaffb
movq 0x18(%rbx), %rax
movl $0x8, (%rax)
movb $0x1, 0x50(%rax)
movb $0x1, %al
jmp 0x9d6d
movq %rbx, %rdi
movq %r14, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x942b
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 0x9d6b
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq