// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x68, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x5c(%rax)
je 0x17351
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rdx
movq %rdx, 0x38(%rax)
movq 0x48(%rcx), %rcx
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
movb 0x5d(%rax), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x48(%rax)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x18(%rbp), %rdi
callq 0x11a30
movq -0x18(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x5f80
movq %rax, %rsi
leaq 0x1f4ed(%rip), %rdi     # 0x36835
movb $0x0, %al
callq 0x11c40
jmp 0x173ce
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jae 0x1739b
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x51a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x17370
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x17d80
movq -0x18(%rbp), %rdi
callq 0x11a30
movq -0x18(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x5f80
movq %rax, %rsi
leaq 0x1f485(%rip), %rdi     # 0x3684c
movb $0x0, %al
callq 0x11c40
movq -0x18(%rbp), %rdi
callq 0x5f60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x120e0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %esi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x1f464(%rip), %rdi     # 0x36861
movb $0x0, %al
callq 0x11c40
movq -0x10(%rbp), %rax
cmpq $0x2, 0x28(%rax)
jb 0x17411
jmp 0x17430
leaq 0x1f460(%rip), %rdi     # 0x36878
leaq 0x1f011(%rip), %rsi     # 0x36430
movl $0x23f, %edx            # imm = 0x23F
leaq 0x1f46f(%rip), %rcx     # 0x3689a
callq 0x4100
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
jne 0x17442
jmp 0x17461
leaq 0x1f48b(%rip), %rdi     # 0x368d4
leaq 0x1efe0(%rip), %rsi     # 0x36430
movl $0x240, %edx            # imm = 0x240
leaq 0x1f43e(%rip), %rcx     # 0x3689a
callq 0x4100
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3e, %eax
jne 0x17480
jmp 0x1749f
leaq 0x1f472(%rip), %rdi     # 0x368f9
leaq 0x1efa2(%rip), %rsi     # 0x36430
movl $0x241, %edx            # imm = 0x241
leaq 0x1f400(%rip), %rcx     # 0x3689a
callq 0x4100
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)