// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: set_attributes
static void set_attributes(lua_State *L, const GumboVector *attrs)
{
    static const char attrnsmap[][6] = {"none", "xlink", "xml", "xmlns"};
    const unsigned int length = attrs->length;
    if (length > 0) {
        lua_createtable(L, length, length);
        for (unsigned int i = 0; i < length; i++) {
            const GumboAttribute *attr = (const GumboAttribute *)attrs->data[i];
            if (attr->attr_namespace == GUMBO_ATTR_NAMESPACE_NONE) {
                lua_createtable(L, 0, 5);
            } else {
                lua_createtable(L, 0, 6);
                set_string(L, "prefix", attrnsmap[attr->attr_namespace]);
            }
            set_string(L, "name", attr->name);
            set_string(L, "value", attr->value);
            set_sourcepos(L, attr->name_start);
            lua_pushvalue(L, -1);
            lua_setfield(L, -3, attr->name);
            setmetatable(L, Attribute);
            lua_rawseti(L, -2, i + 1);
        }
        setmetatable(L, AttributeList);
        lua_setfield(L, -2, "attributes");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jbe 0x4f01
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x40a0
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x4ede
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x18(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x4db3
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x40a0
jmp 0x4dfe
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x40a0
movq -0x8(%rbp), %rdi
leaq 0x2a35d(%rip), %rsi     # 0x2f12b
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
leaq 0x2a23c(%rip), %rsi     # 0x2f020
imulq $0x6, %rax, %rax
addq %rax, %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
leaq 0x2a6d4(%rip), %rsi     # 0x2f4dd
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
leaq 0x2e13f(%rip), %rsi     # 0x32f77
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
addq $0x38, %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4c90
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4160
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x4110
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x47e0
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4190
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4d7a
movq -0x8(%rbp), %rdi
movl $0x9, %esi
callq 0x47e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x2a236(%rip), %rdx     # 0x2f132
callq 0x4110
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)