// File: /workspace/github_c_makefile_star2_O3/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), %r14
movb $0x0, 0xb8(%r14)
movq 0xa8(%r14), %rbx
testq %rbx, %rbx
je 0x111d1
movq %rdi, (%rsp)
cmpl $0x0, 0xb4(%r14)
je 0x111f0
movl 0xb0(%r14), %r13d
testq %r13, %r13
je 0x10fe7
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 0x10fdf
movq 0x68(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x4200
testl %eax, %eax
je 0x11114
incq %rbp
cmpq %rbp, %r13
jne 0x10fb3
movl $0x98, %edi
callq 0x113d4
movq %rax, %r12
movq %rax, %r15
movl $0x0, (%rax)
movq (%rsp), %r13
movq 0x10(%r13), %rdi
addq $0x68, %rdi
callq 0x7648
movq %rax, 0x8(%r12)
movq 0x10(%r13), %rax
movq 0x80(%rax), %rcx
movq %rcx, 0x10(%r12)
movq 0xe8(%rax), %rax
subq %rcx, %rax
movq %rax, 0x18(%r12)
je 0x11042
cmpb $0xd, -0x1(%rcx,%rax)
jne 0x11042
decq %rax
movq %rax, 0x18(%r15)
addq $0xa8, %r14
leaq 0x38(%r12), %rbx
addq $0x50, %r12
leaq 0x75ff(%rip), %rdi      # 0x18658
callq 0x113fd
movq %rax, 0x20(%r15)
movq 0x10(%r13), %rax
movq 0x80(%rax), %rdx
movq %rdx, 0x28(%r15)
movq 0xe8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x30(%r15)
je 0x1108f
cmpb $0xd, -0x1(%rdx,%rcx)
jne 0x1108f
decq %rcx
movq %rcx, 0x30(%r15)
movq 0xa0(%rax), %rcx
movq %rcx, 0x10(%rbx)
movups 0x90(%rax), %xmm0
movups %xmm0, (%rbx)
movq 0x120(%rax), %rcx
movq %rcx, 0x10(%r12)
movups 0x110(%rax), %xmm0
movups %xmm0, (%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x7b25
movq 0x10(%r13), %rax
movq 0x68(%rax), %rdi
callq 0x113f8
movq 0x10(%r13), %rdi
addq $0x68, %rdi
callq 0x7470
movq 0x10(%r13), %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 0x111c2
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x6f1c
testq %rax, %rax
je 0x111ba
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 0x7648
movq %rax, 0x28(%r15)
movq 0x10(%rbx), %rax
movq 0x68(%rax), %rdi
callq 0x113f8
movq 0x10(%rbx), %rdi
addq $0x68, %rdi
callq 0x7470
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 0xd027(%rip), %rdi      # 0x1e1ff
leaq 0xc685(%rip), %rsi      # 0x1d864
leaq 0xd035(%rip), %rcx      # 0x1e21b
movl $0x336, %edx            # imm = 0x336
callq 0x4100
leaq 0xd04f(%rip), %rdi      # 0x1e246
leaq 0xc666(%rip), %rsi      # 0x1d864
leaq 0xd016(%rip), %rcx      # 0x1e21b
movl $0x337, %edx            # imm = 0x337
callq 0x4100