// File: /workspace/github_c_makefile_star2_O2/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 0xf0f9
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 0xf14c
movl $0x2, (%rbx)
movl 0x88(%r12), %eax
movl %eax, 0x30(%rbx)
leaq 0xa8(%r12), %r13
xorl %ebp, %ebp
movl 0xb0(%r12), %eax
movq 0xa8(%r12), %rdi
cmpq %rax, %rbp
jae 0xf137
movq (%rdi,%rbp,8), %rdi
callq 0x6bab
incq %rbp
jmp 0xf114
callq 0xf6e0
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movl 0x88(%r12), %edi
callq 0x730c
movq %r15, %rdi
callq 0x7301
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbe0e
movq 0x28(%rbx), %rax
cmpq $0x1, %rax
jbe 0xf18d
movq 0x20(%rbx), %rcx
cmpb $0x3c, (%rcx)
jne 0xf1ac
cmpb $0x3e, -0x1(%rcx,%rax)
jne 0xf1cb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc9c7(%rip), %rdi      # 0x1bb5b
leaq 0xc639(%rip), %rsi      # 0x1b7d4
leaq 0xc9db(%rip), %rcx      # 0x1bb7d
movl $0x23f, %edx            # imm = 0x23F
callq 0x4100
leaq 0xca04(%rip), %rdi      # 0x1bbb7
leaq 0xc61a(%rip), %rsi      # 0x1b7d4
leaq 0xc9bc(%rip), %rcx      # 0x1bb7d
movl $0x240, %edx            # imm = 0x240
callq 0x4100
leaq 0xca0a(%rip), %rdi      # 0x1bbdc
leaq 0xc5fb(%rip), %rsi      # 0x1b7d4
leaq 0xc99d(%rip), %rcx      # 0x1bb7d
movl $0x241, %edx            # imm = 0x241
callq 0x4100