// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_in_template
static bool handle_in_template(GumboParser* parser, GumboToken* token) {
  GumboParserState* state = parser->_parser_state;
  switch (token->type) {
    case GUMBO_TOKEN_WHITESPACE:
    case GUMBO_TOKEN_CHARACTER:
    case GUMBO_TOKEN_COMMENT:
    case GUMBO_TOKEN_NULL:
    case GUMBO_TOKEN_DOCTYPE:
      return handle_in_body(parser, token);
    default:
      break;
  }
  if (
    tag_in(token, kStartTag, &(const TagSet) {
      TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(LINK), TAG(META),
      TAG(NOFRAMES), TAG(SCRIPT), TAG(STYLE), TAG(TEMPLATE), TAG(TITLE)
    })
    || tag_is(token, kEndTag, GUMBO_TAG_TEMPLATE)
  ) {
    return handle_in_head(parser, token);
  } else if (
    tag_in(token, kStartTag, &(const TagSet) {
      TAG(CAPTION), TAG(COLGROUP), TAG(TBODY), TAG(TFOOT), TAG(THEAD)
    })
  ) {
    pop_template_insertion_mode(parser);
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TABLE);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TABLE);
    state->_reprocess_current_token = true;
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_COL)) {
    pop_template_insertion_mode(parser);
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_COLUMN_GROUP);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_COLUMN_GROUP);
    state->_reprocess_current_token = true;
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_TR)) {
    pop_template_insertion_mode(parser);
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TABLE_BODY);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TABLE_BODY);
    state->_reprocess_current_token = true;
    return true;
  } else if (tag_in(token, kStartTag, &td_th_tags)) {
    pop_template_insertion_mode(parser);
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_ROW);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_ROW);
    state->_reprocess_current_token = true;
    return true;
  } else if (token->type == GUMBO_TOKEN_START_TAG) {
    pop_template_insertion_mode(parser);
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_BODY);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_BODY);
    state->_reprocess_current_token = true;
    return true;
  } else if (token->type == GUMBO_TOKEN_END_TAG) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else if (token->type == GUMBO_TOKEN_EOF) {
    if (!has_open_element(parser, GUMBO_TAG_TEMPLATE)) {
      // Stop parsing.
      return true;
    }
    parser_add_parse_error(parser, token);
    while (!node_html_tag_is(pop_current_node(parser), GUMBO_TAG_TEMPLATE)) {
      ;
    }
    clear_active_formatting_elements(parser);
    pop_template_insertion_mode(parser);
    reset_insertion_mode_appropriately(parser);
    state->_reprocess_current_token = true;
    return false;
  } else {
    assert(0);
    return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x154(%rbp)
testl %eax, %eax
je 0xdd1e
jmp 0xdd01
movl -0x154(%rbp), %eax
addl $-0x3, %eax
subl $0x3, %eax
jb 0xdd1e
jmp 0xdd11
movl -0x154(%rbp), %eax
subl $0x7, %eax
jne 0xdd35
jmp 0xdd1e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa3f0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xe02c
jmp 0xdd37
movq -0x18(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4120
leaq -0xb8(%rbp), %rdi
leaq 0x24e95(%rip), %rsi     # 0x32bf8
movl $0x98, %edx
callq 0x41a0
movq -0x160(%rbp), %rdi
movl $0x1, %esi
leaq -0xb8(%rbp), %rdx
callq 0x8d40
testb $0x1, %al
jne 0xdd9f
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0x8c40
testb $0x1, %al
jne 0xdd9f
jmp 0xddb6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9940
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4120
leaq -0x150(%rbp), %rdi
leaq 0x24eae(%rip), %rsi     # 0x32c90
movl $0x98, %edx
callq 0x41a0
movq -0x168(%rbp), %rdi
movl $0x1, %esi
leaq -0x150(%rbp), %rdx
callq 0x8d40
testb $0x1, %al
jne 0xde0a
jmp 0xde40
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x7f10
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x8b40
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x62, %edx
callq 0x8c40
testb $0x1, %al
jne 0xde59
jmp 0xde8f
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
movl $0xb, %esi
callq 0x7f10
movq -0x10(%rbp), %rdi
movl $0xb, %esi
callq 0x8b40
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x66, %edx
callq 0x8c40
testb $0x1, %al
jne 0xdea8
jmp 0xdede
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
movl $0xc, %esi
callq 0x7f10
movq -0x10(%rbp), %rdi
movl $0xc, %esi
callq 0x8b40
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
leaq 0x24672(%rip), %rdx     # 0x32560
callq 0x8d40
testb $0x1, %al
jne 0xdef9
jmp 0xdf2f
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
movl $0xd, %esi
callq 0x7f10
movq -0x10(%rbp), %rdi
movl $0xd, %esi
callq 0x8b40
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xdf6e
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq 0x7f10
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq 0x8b40
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x1, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xdf96
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0x8bd0
movb $0x0, -0x1(%rbp)
jmp 0xe02c
movq -0x18(%rbp), %rax
cmpl $0x8, (%rax)
jne 0xe00d
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0xf3a0
testb $0x1, %al
jne 0xdfb7
movb $0x1, -0x1(%rbp)
jmp 0xe02c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x78a0
movq -0x10(%rbp), %rdi
callq 0xf060
movq %rax, %rdi
movl $0x9, %esi
callq 0x8700
xorb $-0x1, %al
testb $0x1, %al
jne 0xdfe2
jmp 0xdfe4
jmp 0xdfc4
movq -0x10(%rbp), %rdi
callq 0xf420
movq -0x10(%rbp), %rdi
callq 0xf4a0
movq -0x10(%rbp), %rdi
callq 0x7f40
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x0, -0x1(%rbp)
jmp 0xe02c
leaq 0x26edb(%rip), %rdi     # 0x34eef
leaq 0x24e59(%rip), %rsi     # 0x32e74
movl $0xf6d, %edx            # imm = 0xF6D
leaq 0x26fbd(%rip), %rcx     # 0x34fe4
callq 0x4100
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)