// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: create_element_from_token
static GumboNode* create_element_from_token (
  GumboToken* token,
  GumboNamespaceEnum tag_namespace
) {
  assert(token->type == GUMBO_TOKEN_START_TAG);
  GumboTokenStartTag* start_tag = &token->v.start_tag;

  GumboNodeType type =
    (
      tag_namespace == GUMBO_NAMESPACE_HTML
      && start_tag->tag == GUMBO_TAG_TEMPLATE
    )
    ? GUMBO_NODE_TEMPLATE
    : GUMBO_NODE_ELEMENT
  ;

  GumboNode* node = create_node(type);
  GumboElement* element = &node->v.element;
  gumbo_vector_init(1, &element->children);
  element->attributes = start_tag->attributes;
  element->tag = start_tag->tag;
  element->tag_namespace = tag_namespace;

  assert(token->original_text.length >= 2);
  assert(token->original_text.data[0] == '<');
  assert(token->original_text.data[token->original_text.length - 1] == '>');
  element->original_tag = token->original_text;
  element->start_pos = token->position;
  element->original_end_tag = STRING_PIECE_INIT;
  element->end_pos = kGumboEmptySourcePosition;

  // The element takes ownership of the attributes from the token, so any
  // allocated-memory fields should be nulled out.
  start_tag->attributes = GUMBO_VECTOR_INIT;
  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xed5a
jmp 0xed79
leaq 0x2526a(%rip), %rdi     # 0x33fcb
leaq 0x2410c(%rip), %rsi     # 0x32e74
movl $0x426, %edx            # imm = 0x426
leaq 0x2527c(%rip), %rcx     # 0x33ff0
callq 0x4100
movq -0x8(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x51(%rbp)
jne 0xed9d
movq -0x18(%rbp), %rax
cmpl $0x9, (%rax)
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %dl
movl $0x1, %eax
movl $0x6, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x7d10
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
movl $0x1, %edi
callq 0x69f0
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rdx
movq %rdx, 0x68(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x70(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
cmpq $0x2, 0x28(%rax)
jb 0xee15
jmp 0xee34
leaq 0x2521b(%rip), %rdi     # 0x34037
leaq 0x24051(%rip), %rsi     # 0x32e74
movl $0x439, %edx            # imm = 0x439
leaq 0x251c1(%rip), %rcx     # 0x33ff0
callq 0x4100
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
jne 0xee46
jmp 0xee65
leaq 0x2520b(%rip), %rdi     # 0x34058
leaq 0x24020(%rip), %rsi     # 0x32e74
movl $0x43a, %edx            # imm = 0x43A
leaq 0x25190(%rip), %rcx     # 0x33ff0
callq 0x4100
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3e, %eax
jne 0xee84
jmp 0xeea3
leaq 0x251f1(%rip), %rdi     # 0x3407c
leaq 0x23fe2(%rip), %rsi     # 0x32e74
movl $0x43b, %edx            # imm = 0x43B
leaq 0x25152(%rip), %rcx     # 0x33ff0
callq 0x4100
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x28(%rcx), %rcx
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdx
movq %rdx, 0x38(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x40(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rax
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
movq 0x218b6(%rip), %rcx     # 0x307c0
movq %rcx, 0x50(%rax)
movq 0x218b3(%rip), %rcx     # 0x307c8
movq %rcx, 0x58(%rax)
movq 0x218b0(%rip), %rcx     # 0x307d0
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
movq $0x0, -0x50(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)