// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, 0x50(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x176f9
jmp 0x17718
leaq 0x1f7d7(%rip), %rdi     # 0x36ed7
leaq 0x1ed29(%rip), %rsi     # 0x36430
movl $0x336, %edx            # imm = 0x336
leaq 0x1f7e0(%rip), %rcx     # 0x36ef3
callq 0x4100
movq -0x20(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
je 0x17724
jmp 0x17743
leaq 0x1f7f3(%rip), %rdi     # 0x36f1e
leaq 0x1ecfe(%rip), %rsi     # 0x36430
movl $0x337, %edx            # imm = 0x337
leaq 0x1f7b5(%rip), %rcx     # 0x36ef3
callq 0x4100
movq -0x20(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x177e7
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x40b0
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x177d7
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x4150
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x177d7
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x17890
movq -0x20(%rbp), %rax
movb $0x1, 0x50(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x17883
jmp 0x177d9
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x17756
movl $0x98, %edi
callq 0x17cf0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
callq 0x17940
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x10, %rsi
movq -0x40(%rbp), %rdx
addq $0x38, %rdx
movq -0x40(%rbp), %rcx
addq $0x50, %rcx
callq 0x17990
leaq 0x1c9c3(%rip), %rdi     # 0x341fb
callq 0x17da0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x28, %rsi
movq -0x40(%rbp), %rdx
addq $0x38, %rdx
movq -0x40(%rbp), %rcx
addq $0x50, %rcx
callq 0x17990
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x6a80
movq -0x10(%rbp), %rdi
callq 0x175a0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop