// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/lib/tokenizer.c
// Function: finish_attribute_name
static bool finish_attribute_name(GumboParser* parser) {
  GumboTokenizerState* tokenizer = parser->_tokenizer_state;
  GumboTagState* tag_state = &tokenizer->_tag_state;
  // May've been set by a previous attribute without a value; reset it here.
  tag_state->_drop_next_attr_value = false;
  assert(tag_state->_attributes.data);
  assert(tag_state->_attributes.capacity);

  GumboVector* /* GumboAttribute* */ attributes = &tag_state->_attributes;
  for (unsigned int i = 0; i < attributes->length; ++i) {
    GumboAttribute* attr = attributes->data[i];
    if (
      strlen(attr->name) == tag_state->_buffer.length
      && 0 == memcmp (
        attr->name,
        tag_state->_buffer.data,
        tag_state->_buffer.length
      )
    ) {
      // Identical attribute; bail.
      add_duplicate_attr_error(parser, i, attributes->length);
      tag_state->_drop_next_attr_value = true;
      return false;
    }
  }

  GumboAttribute* attr = gumbo_alloc(sizeof(GumboAttribute));
  attr->attr_namespace = GUMBO_ATTR_NAMESPACE_NONE;
  copy_over_tag_buffer(parser, &attr->name);
  copy_over_original_tag_text (
    parser,
    &attr->original_name,
    &attr->name_start,
    &attr->name_end
  );
  attr->value = gumbo_strdup("");
  copy_over_original_tag_text (
    parser,
    &attr->original_value,
    &attr->name_start,
    &attr->name_end
  );
  gumbo_vector_add(attr, attributes);
  reinitialize_tag_buffer(parser);
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %r12
movb $0x0, 0xb8(%r12)
movq 0xa8(%r12), %r14
testq %r14, %r14
je 0xf489
cmpl $0x0, 0xb4(%r12)
je 0xf4a8
movq %rdi, %rbx
leaq 0xa8(%r12), %rax
movq %rax, (%rsp)
movl 0xb0(%r12), %r13d
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xf3a1
movq (%r14,%rbp,8), %rax
movq 0x8(%rax), %r15
movq %r15, %rdi
callq 0x40b0
cmpq 0x70(%r12), %rax
jne 0xf39c
movq 0x68(%r12), %rsi
movq %r15, %rdi
movq %rax, %rdx
callq 0x4200
testl %eax, %eax
je 0xf41b
incq %rbp
jmp 0xf36c
movl $0x98, %edi
callq 0xf6a4
movq %rax, %r15
andl $0x0, (%rax)
leaq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0xf4c7
leaq 0x10(%r15), %rsi
leaq 0x38(%r15), %r12
leaq 0x50(%r15), %r13
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0xf4dd
leaq 0x727a(%rip), %rdi      # 0x16658
callq 0xf6e5
movq %rax, 0x20(%r15)
leaq 0x28(%r15), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0xf4dd
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x7726
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf287
movq %rbx, %rdi
callq 0x6bcc
testq %rax, %rax
je 0xf471
movq 0x10(%rbx), %rcx
movl $0x18, (%rax)
movups 0x90(%rcx), %xmm0
movups %xmm0, 0x8(%rax)
movq 0xa0(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x80(%rcx), %rcx
movq %rcx, 0x20(%rax)
movq %rax, %rsi
addq $0x28, %rsi
movl %ebp, 0x30(%rax)
movl %r13d, 0x34(%rax)
movq %rbx, %rdi
callq 0xf4c7
movq %rbx, %rdi
callq 0xf287
movb $0x1, 0xb8(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcce1(%rip), %rdi      # 0x1c171
leaq 0xc33d(%rip), %rsi      # 0x1b7d4
leaq 0xccef(%rip), %rcx      # 0x1c18d
movl $0x336, %edx            # imm = 0x336
callq 0x4100
leaq 0xcd09(%rip), %rdi      # 0x1c1b8
leaq 0xc31e(%rip), %rsi      # 0x1b7d4
leaq 0xccd0(%rip), %rcx      # 0x1c18d
movl $0x337, %edx            # imm = 0x337
callq 0x4100