// File: /workspace/github_c_makefile_star2_O3/craigbarnes[P]lua-gumbo/lib/tokenizer.c
// Function: emit_current_tag
static StateResult emit_current_tag(GumboParser* parser, GumboToken* output) {
  GumboTagState* tag_state = &parser->_tokenizer_state->_tag_state;
  if (tag_state->_is_start_tag) {
    output->type = GUMBO_TOKEN_START_TAG;
    output->v.start_tag.tag = tag_state->_tag;
    output->v.start_tag.attributes = tag_state->_attributes;
    output->v.start_tag.is_self_closing = tag_state->_is_self_closing;
    tag_state->_last_start_tag = tag_state->_tag;
    mark_tag_state_as_empty(tag_state);
    gumbo_debug(
        "Emitted start tag %s.\n", gumbo_normalized_tagname(tag_state->_tag));
  } else {
    output->type = GUMBO_TOKEN_END_TAG;
    output->v.end_tag = tag_state->_tag;
    // In end tags, ownership of the attributes vector is not transferred to the
    // token, but it's still initialized as normal, so it must be manually
    // deallocated. There may also be attributes to destroy, in certain broken
    // cases like </div</th> (the "th" is an attribute there).
    for (unsigned int i = 0; i < tag_state->_attributes.length; ++i) {
      gumbo_destroy_attribute(tag_state->_attributes.data[i]);
    }
    gumbo_free(tag_state->_attributes.data);
    mark_tag_state_as_empty(tag_state);
    gumbo_debug(
        "Emitted end tag %s.\n", gumbo_normalized_tagname(tag_state->_tag));
  }
  gumbo_string_buffer_destroy(&tag_state->_buffer);
  finish_token(parser, output);
  gumbo_debug (
    "Original text = %.*s.\n",
    (int) output->original_text.length,
    output->original_text.data
  );
  assert(output->original_text.length >= 2);
  assert(output->original_text.data[0] == '<');
  assert(output->original_text.data[output->original_text.length - 1] == '>');
  return RETURN_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r12
leaq 0x68(%r12), %r15
cmpb $0x1, 0xc4(%r12)
jne 0x10db6
movl $0x1, (%rbx)
movl 0x88(%r12), %eax
movl %eax, 0x30(%rbx)
movups 0xa8(%r12), %xmm0
movups %xmm0, 0x38(%rbx)
movb 0xc5(%r12), %al
movb %al, 0x48(%rbx)
movl 0x88(%r12), %edi
movl %edi, 0xc0(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%r12)
jmp 0x10e1a
movl $0x2, (%rbx)
movl 0x88(%r12), %eax
movl %eax, 0x30(%rbx)
leaq 0xa8(%r12), %r13
cmpl $0x0, 0xb0(%r12)
je 0x10dfd
xorl %ebp, %ebp
movq 0xa8(%r12), %rax
movq (%rax,%rbp,8), %rdi
callq 0x6efa
incq %rbp
movl 0xb0(%r12), %eax
cmpq %rax, %rbp
jb 0x10ddc
movq 0xa8(%r12), %rdi
callq 0x113f8
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movl 0x88(%r12), %edi
callq 0x7694
movq %r15, %rdi
callq 0x7689
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0xca0d
movq 0x28(%rbx), %rax
cmpq $0x1, %rax
jbe 0x10e5c
movq 0x20(%rbx), %rcx
cmpb $0x3c, (%rcx)
jne 0x10e7b
cmpb $0x3e, -0x1(%rcx,%rax)
jne 0x10e9a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcd86(%rip), %rdi      # 0x1dbe9
leaq 0xc9fa(%rip), %rsi      # 0x1d864
leaq 0xcd9a(%rip), %rcx      # 0x1dc0b
movl $0x23f, %edx            # imm = 0x23F
callq 0x4100
leaq 0xcdc3(%rip), %rdi      # 0x1dc45
leaq 0xc9db(%rip), %rsi      # 0x1d864
leaq 0xcd7b(%rip), %rcx      # 0x1dc0b
movl $0x240, %edx            # imm = 0x240
callq 0x4100
leaq 0xcdc9(%rip), %rdi      # 0x1dc6a
leaq 0xc9bc(%rip), %rsi      # 0x1d864
leaq 0xcd5c(%rip), %rcx      # 0x1dc0b
movl $0x241, %edx            # imm = 0x241
callq 0x4100