// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %r12d
cmpq $0x7, %r12
ja 0xa82b
leaq 0x10daf(%rip), %rax     # 0x1b5c4
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb82b
jmp 0xa897
cmpl $0x1, %r12d
jne 0xa8e3
cmpl $0x0, 0x30(%r14)
je 0xaba9
cmpl $0x1, %r12d
jne 0xa8e3
cmpl $0x72, 0x30(%r14)
jne 0xa89f
movq %rbx, %rdi
callq 0x8107
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8b69
testb %al, %al
je 0xa874
movq %rbx, %rdi
callq 0xb8b5
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb69f
jmp 0xa897
movq %rbx, %rdi
callq 0x8107
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xb4a3
movb $0x1, %bpl
jmp 0xabef
cmpl $0x1, %r12d
jne 0xa8e3
cmpl $0x71, 0x30(%r14)
jne 0xa8e3
movq %rbx, %rdi
callq 0x8107
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8b69
testb %al, %al
je 0xa8cf
movq %rbx, %rdi
callq 0xb8b5
movq %rbx, %rdi
callq 0x8107
movq %rax, %rdi
xorl %esi, %esi
movl $0x71, %edx
jmp 0xa863
cmpl $0x2, %r12d
jne 0xaa1a
cmpl $0x71, 0x30(%r14)
jne 0xa964
movq 0x18(%rbx), %r15
movq %rbx, %rdi
callq 0x8107
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8b69
testb %al, %al
je 0xa93a
movq 0x8(%r15), %rax
movl 0x10(%r15), %ecx
addl $-0x2, %ecx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
movl $0x71, %edx
callq 0x8b69
testb %al, %al
je 0xa93a
movq %rbx, %rdi
callq 0xb8b5
movq %rbx, %rdi
callq 0x8107
movq %rax, %rdi
xorl %esi, %esi
movl $0x71, %edx
callq 0x8b69
movl %eax, %ebp
testb %al, %al
je 0xa9a1
movq %rbx, %rdi
callq 0xb8b5
jmp 0xabef
cmpl $0x2, %r12d
jne 0xaa1a
cmpl $0x72, 0x30(%r14)
jne 0xa9d4
movq %rbx, %rdi
callq 0x8107
movq %rax, %rdi
xorl %esi, %esi
movl $0x72, %edx
callq 0x8b69
testb %al, %al
je 0xabc3
movq %rbx, %rdi
callq 0xb8b5
jmp 0xa897
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 0xabef
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
jmp 0xabef
cmpl $0x2, %r12d
jne 0xaa1a
cmpl $0x6f, 0x30(%r14)
jne 0xaa1a
leaq 0xc(%rsp), %rdx
movl $0x6f, (%rdx)
leaq 0x1191d(%rip), %r8      # 0x1c310
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %ecx
callq 0xbc6a
testb %al, %al
je 0xabc3
movq %rbx, %rdi
callq 0xd16e
jmp 0xa897
cmpl $0x1, %r12d
jne 0xaa90
cmpl $0x6f, 0x30(%r14)
jne 0xaae5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
movq 0x18(%rbx), %rax
movq 0x98(%rax), %r14
movq %r14, %rdi
callq 0xd3c9
cmpl $0x1, (%r14)
jne 0xaa57
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r14)
leaq 0xc(%rsp), %rdx
movl $0x6f, (%rdx)
leaq 0x118a7(%rip), %r8      # 0x1c310
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %ecx
callq 0xbc6a
testb %al, %al
je 0xabed
movq %rbx, %rdi
callq 0xd16e
jmp 0xabed
leaq 0x129f9(%rip), %rsi     # 0x1d490
leaq 0xa8(%rsp), %rdi
movl $0x98, %edx
callq 0x4190
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)
cmpl $0x1, %r12d
jne 0xab7c
movl 0x30(%r14), %eax
cmpb $0x0, 0x10(%rsp,%rax)
jne 0xab89
jmp 0xab7c
leaq 0x129a4(%rip), %rsi     # 0x1d490
leaq 0xa8(%rsp), %rdi
movl $0x98, %edx
callq 0x4190
cmpl $0x1, %r12d
jne 0xab5e
movl 0x30(%r14), %eax
cmpb $0x0, 0xa8(%rsp,%rax)
je 0xaaa9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
leaq 0xc(%rsp), %rdx
movl $0x6f, (%rdx)
leaq 0x117e1(%rip), %r8      # 0x1c310
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %ecx
callq 0xbc6a
testb %al, %al
je 0xabce
movq %rbx, %rdi
callq 0xd16e
movq 0x18(%rbx), %rax
movb $0x1, 0x50(%rax)
jmp 0xabed
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)
cmpl $0x2, %r12d
jne 0xaba3
cmpl $0x9, 0x30(%r14)
jne 0xaba3
movq %rbx, %rdi
movq %r14, %rsi
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x91d5
cmpl $0x8, %r12d
jne 0xabc3
movq %rbx, %rdi
movq %r14, %rsi
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4fa2
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 0xabed
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq