// File: /workspace/github_c_makefile_star2_O3/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_in_select
static bool handle_in_select(GumboParser* parser, GumboToken* token) {
  if (token->type == GUMBO_TOKEN_NULL) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else if (
    token->type == GUMBO_TOKEN_CHARACTER
    || token->type == GUMBO_TOKEN_WHITESPACE
  ) {
    insert_text_token(parser, token);
    return true;
  } else if (token->type == GUMBO_TOKEN_DOCTYPE) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  } else if (token->type == GUMBO_TOKEN_COMMENT) {
    append_comment_node(parser, get_current_node(parser), token);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_HTML)) {
    return handle_in_body(parser, token);
  } else if (tag_is(token, kStartTag, GUMBO_TAG_OPTION)) {
    if (node_html_tag_is(get_current_node(parser), GUMBO_TAG_OPTION)) {
      pop_current_node(parser);
    }
    insert_element_from_token(parser, token);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_OPTGROUP)) {
    if (node_html_tag_is(get_current_node(parser), GUMBO_TAG_OPTION)) {
      pop_current_node(parser);
    }
    if (node_html_tag_is(get_current_node(parser), GUMBO_TAG_OPTGROUP)) {
      pop_current_node(parser);
    }
    insert_element_from_token(parser, token);
    return true;
  } else if (tag_is(token, kEndTag, GUMBO_TAG_OPTGROUP)) {
    GumboVector* open_elements = &parser->_parser_state->_open_elements;
    if (
      node_html_tag_is(get_current_node(parser), GUMBO_TAG_OPTION)
      && node_html_tag_is (
        open_elements->data[open_elements->length - 2],
        GUMBO_TAG_OPTGROUP
      )
    ) {
      pop_current_node(parser);
    }
    if (node_html_tag_is(get_current_node(parser), GUMBO_TAG_OPTGROUP)) {
      pop_current_node(parser);
      return true;
    } else {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
  } else if (tag_is(token, kEndTag, GUMBO_TAG_OPTION)) {
    if (node_html_tag_is(get_current_node(parser), GUMBO_TAG_OPTION)) {
      pop_current_node(parser);
      return true;
    } else {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
  } else if (tag_is(token, kEndTag, GUMBO_TAG_SELECT)) {
    if (!has_an_element_in_select_scope(parser, GUMBO_TAG_SELECT)) {
      parser_add_parse_error(parser, token);
      ignore_token(parser);
      return false;
    }
    close_current_select(parser);
    return true;
  } else if (tag_is(token, kStartTag, GUMBO_TAG_SELECT)) {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    if (has_an_element_in_select_scope(parser, GUMBO_TAG_SELECT)) {
      close_current_select(parser);
    }
    return false;
  } else if (
    tag_in(token, kStartTag, &(const TagSet) {TAG(INPUT), TAG(KEYGEN), TAG(TEXTAREA)})
  ) {
    parser_add_parse_error(parser, token);
    if (!has_an_element_in_select_scope(parser, GUMBO_TAG_SELECT)) {
      ignore_token(parser);
    } else {
      close_current_select(parser);
      parser->_parser_state->_reprocess_current_token = true;
    }
    return false;
  } else if (
    tag_in(token, kStartTag, &(const TagSet){TAG(SCRIPT), TAG(TEMPLATE)})
    || tag_is(token, kEndTag, GUMBO_TAG_TEMPLATE)
  ) {
    return handle_in_head(parser, token);
  } else if (token->type == GUMBO_TOKEN_EOF) {
    return handle_in_body(parser, token);
  } else {
    parser_add_parse_error(parser, token);
    ignore_token(parser);
    return false;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
cmpq $0x8, %rax
ja 0xa0ea
leaq 0xf58f(%rip), %rcx      # 0x19670
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
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 0xa114
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %eax, %eax
jmp 0xa3af
movq %rbx, %rdi
movq %r14, %rsi
callq 0xaf71
jmp 0xa3ad
movq %rbx, %rdi
callq 0x7d33
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xac3d
jmp 0xa3ad
movl 0x30(%r14), %r12d
cmpl $0x70, %r12d
jg 0xa237
testl %r12d, %r12d
je 0xa1c9
cmpl $0x6f, %r12d
jne 0xa2d1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
movq 0x18(%rbx), %rax
movq 0x98(%rax), %r14
movq %r14, %rdi
callq 0xc990
cmpl $0x1, (%r14)
jne 0xa18f
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r14)
movq 0x18(%rbx), %rdi
leaq 0xc(%rsp), %rdx
movl $0x6f, (%rdx)
leaq 0x1028b(%rip), %r8      # 0x1a430
movl $0x1, %esi
movl $0x1, %ecx
callq 0xb40a
testb %al, %al
je 0xa114
movq %rbx, %rdi
callq 0xc789
jmp 0xa114
movq %rbx, %rdi
movq %r14, %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4ece
movl 0x30(%r14), %eax
cmpl $0x70, %eax
jg 0xa262
cmpl $0x9, %eax
je 0xa3e8
cmpl $0x6f, %eax
jne 0xa0ea
movq 0x18(%rbx), %rdi
leaq 0xc(%rsp), %rdx
movl $0x6f, (%rdx)
leaq 0x1021d(%rip), %r8      # 0x1a430
movl $0x1, %esi
movl $0x1, %ecx
callq 0xb40a
testb %al, %al
je 0xa0ea
movq %rbx, %rdi
callq 0xc789
jmp 0xa3ad
cmpl $0x71, %r12d
je 0xa333
cmpl $0x72, %r12d
jne 0xa2d1
movq %rbx, %rdi
callq 0x7d33
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
jmp 0xa368
cmpl $0x72, %eax
je 0xa386
cmpl $0x71, %eax
jne 0xa0ea
movq 0x18(%rbx), %r15
movq %rbx, %rdi
callq 0x7d33
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8739
testb %al, %al
je 0xa2ba
movq 0x8(%r15), %rax
movl 0x10(%r15), %ecx
addl $-0x2, %ecx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
movl $0x71, %edx
callq 0x8739
testb %al, %al
je 0xa2ba
movq %rbx, %rdi
callq 0xaffb
movq %rbx, %rdi
callq 0x7d33
movq %rax, %rdi
xorl %esi, %esi
movl $0x71, %edx
jmp 0xa398
leaq 0x112d8(%rip), %rax     # 0x1b5b0
cmpb $0x0, (%r12,%rax)
je 0xa3be
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
movq 0x18(%rbx), %r14
leaq 0xc(%rsp), %rdx
movl $0x6f, (%rdx)
leaq 0x1012c(%rip), %r8      # 0x1a430
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %ecx
callq 0xb40a
testb %al, %al
je 0xa401
movq %rbx, %rdi
callq 0xc789
movq 0x18(%rbx), %rax
movb $0x1, 0x50(%rax)
jmp 0xa114
movq %rbx, %rdi
callq 0x7d33
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8739
testb %al, %al
je 0xa356
movq %rbx, %rdi
callq 0xaffb
movq %rbx, %rdi
callq 0x7d33
movq %rax, %rdi
xorl %esi, %esi
movl $0x71, %edx
callq 0x8739
testb %al, %al
je 0xa379
movq %rbx, %rdi
callq 0xaffb
movq %rbx, %rdi
movq %r14, %rsi
callq 0xade5
jmp 0xa3ad
movq %rbx, %rdi
callq 0x7d33
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8739
testb %al, %al
je 0xa0ea
movq %rbx, %rdi
callq 0xaffb
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x10(%rsp), %r15
movl $0x98, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x4120
movb $0x1, %al
movb %al, 0x7(%r15)
movb %al, 0x9(%r15)
cmpb $0x0, 0x10(%rsp,%r12)
je 0xa0ea
movq %rbx, %rdi
movq %r14, %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8de1
movq 0x98(%r14), %rbx
jmp 0xa100