// File: /workspace/github_c_makefile_star2_O1/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 %rdi, (%rsp)
movq 0x10(%rdi), %r14
movb $0x0, 0xb8(%r14)
movq 0xa8(%r14), %rbx
testq %rbx, %rbx
je 0x11c57
cmpl $0x0, 0xb4(%r14)
je 0x11c76
movl 0xb0(%r14), %r13d
testq %r13, %r13
je 0x11a43
movq 0x70(%r14), %r15
xorl %ebp, %ebp
movq (%rbx,%rbp,8), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
callq 0x40b0
cmpq %r15, %rax
jne 0x11a3b
movq 0x68(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x4200
testl %eax, %eax
je 0x11b9a
incq %rbp
cmpq %rbp, %r13
jne 0x11a0f
movl $0x98, %edi
callq 0x11e58
movq %rax, %r15
movl $0x0, (%rax)
movq (%rsp), %rbx
movq 0x10(%rbx), %rdi
addq $0x68, %rdi
callq 0x79e6
movq %rax, 0x8(%r15)
leaq 0x38(%r15), %r13
leaq 0x50(%r15), %r12
movq 0x10(%rbx), %rax
movq 0x80(%rax), %rdx
movq %rdx, 0x10(%r15)
movq 0xe8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%r15)
je 0x11aa0
cmpb $0xd, -0x1(%rdx,%rcx)
jne 0x11aa0
decq %rcx
movq %rcx, 0x18(%r15)
addq $0xa8, %r14
movq 0xa0(%rax), %rcx
movq %rcx, 0x10(%r13)
movups 0x90(%rax), %xmm0
movups %xmm0, (%r13)
movq 0x120(%rax), %rcx
movq %rcx, 0x10(%r12)
movups 0x110(%rax), %xmm0
movups %xmm0, (%r12)
leaq 0x8b96(%rip), %rdi      # 0x1a673
callq 0x11e81
movq %rax, 0x20(%r15)
movq 0x10(%rbx), %rax
movq 0x80(%rax), %rdx
movq %rdx, 0x28(%r15)
movq 0xe8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x30(%r15)
je 0x11b13
cmpb $0xd, -0x1(%rdx,%rcx)
jne 0x11b13
decq %rcx
movq %rcx, 0x30(%r15)
movq 0xa0(%rax), %rcx
movq %rcx, 0x10(%r13)
movups 0x90(%rax), %xmm0
movups %xmm0, (%r13)
movq 0x120(%rax), %rcx
movq %rcx, 0x10(%r12)
movups 0x110(%rax), %xmm0
movups %xmm0, (%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x7ef9
movq 0x10(%rbx), %rax
movq 0x68(%rax), %rdi
callq 0x11e7c
movq 0x10(%rbx), %rdi
addq $0x68, %rdi
callq 0x780c
movq 0x10(%rbx), %rax
movq 0x120(%rax), %rcx
movq %rcx, 0xa0(%rax)
movups 0x110(%rax), %xmm0
movups %xmm0, 0x90(%rax)
movq 0xe8(%rax), %rcx
movq %rcx, 0x80(%rax)
jmp 0x11c48
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x72a4
testq %rax, %rax
je 0x11c40
movq %rax, %r15
movq 0x10(%rbx), %rax
movl $0x18, (%r15)
movups 0x90(%rax), %xmm0
movups %xmm0, 0x8(%r15)
movq 0xa0(%rax), %rcx
movq %rcx, 0x18(%r15)
movq 0x80(%rax), %rax
movq %rax, 0x20(%r15)
movl %ebp, 0x30(%r15)
movl %r13d, 0x34(%r15)
movq 0x10(%rbx), %rdi
addq $0x68, %rdi
callq 0x79e6
movq %rax, 0x28(%r15)
movq 0x10(%rbx), %rax
movq 0x68(%rax), %rdi
callq 0x11e7c
movq 0x10(%rbx), %rdi
addq $0x68, %rdi
callq 0x780c
movq 0x10(%rbx), %rax
movq 0x120(%rax), %rcx
movq %rcx, 0xa0(%rax)
movups 0x110(%rax), %xmm0
movups %xmm0, 0x90(%rax)
movq 0xe8(%rax), %rcx
movq %rcx, 0x80(%rax)
movb $0x1, 0xb8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe481(%rip), %rdi      # 0x200df
leaq 0xdadf(%rip), %rsi      # 0x1f744
leaq 0xe48f(%rip), %rcx      # 0x200fb
movl $0x336, %edx            # imm = 0x336
callq 0x4100
leaq 0xe4a9(%rip), %rdi      # 0x20126
leaq 0xdac0(%rip), %rsi      # 0x1f744
leaq 0xe470(%rip), %rcx      # 0x200fb
movl $0x337, %edx            # imm = 0x337
callq 0x4100