// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r12
leaq 0x68(%r12), %r15
cmpb $0x1, 0xc4(%r12)
jne 0x1181a
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 0x1187b
movl $0x2, (%rbx)
movl 0x88(%r12), %eax
movl %eax, 0x30(%rbx)
cmpl $0x0, 0xb0(%r12)
je 0x1185a
xorl %r13d, %r13d
movq 0xa8(%r12), %rax
movq (%rax,%r13,8), %rdi
callq 0x7284
incq %r13
movl 0xb0(%r12), %eax
cmpq %rax, %r13
jb 0x11839
movq 0xa8(%r12), %rdi
callq 0x11e7c
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%r12)
movl 0x88(%r12), %edi
callq 0x7a30
movq %r15, %rdi
callq 0x7a27
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd443
movq 0x28(%rbx), %rax
cmpq $0x1, %rax
jbe 0x118b7
movq 0x20(%rbx), %rcx
cmpb $0x3c, (%rcx)
jne 0x118d6
cmpb $0x3e, -0x1(%rcx,%rax)
jne 0x118f5
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xe20b(%rip), %rdi      # 0x1fac9
leaq 0xde7f(%rip), %rsi      # 0x1f744
leaq 0xe21f(%rip), %rcx      # 0x1faeb
movl $0x23f, %edx            # imm = 0x23F
callq 0x4100
leaq 0xe248(%rip), %rdi      # 0x1fb25
leaq 0xde60(%rip), %rsi      # 0x1f744
leaq 0xe200(%rip), %rcx      # 0x1faeb
movl $0x240, %edx            # imm = 0x240
callq 0x4100
leaq 0xe24e(%rip), %rdi      # 0x1fb4a
leaq 0xde41(%rip), %rsi      # 0x1f744
leaq 0xe1e1(%rip), %rcx      # 0x1faeb
movl $0x241, %edx            # imm = 0x241
callq 0x4100