// File: /workspace/github_c_makefile_star2_O1/stetre[P]moongl/src/vertex_array.c
// Function: VertexAttrib
static int VertexAttrib(lua_State *L)
/* gl.vertex_attrib(index, type, val1 [, val2, val3, val4]) */
    {
    int n;
    GLuint index = luaL_checkinteger(L, 1);
    GLenum type = checktype(L, 2);
    luaL_checknumber(L, 3); n=1;
    if(lua_isnumber(L, 4)) n++;
    if(lua_isnumber(L, 5)) n++;
    if(lua_isnumber(L, 6)) n++;

    switch(type)
        {
#define arg_first 3
        case GL_BYTE: return VertexAttrib_GLbyte(L, index, n, arg_first);
        case GL_UNSIGNED_BYTE: return VertexAttrib_GLubyte(L, index, n, arg_first);
        case GL_SHORT: return VertexAttrib_GLshort(L, index, n, arg_first);
        case GL_UNSIGNED_SHORT: return VertexAttrib_GLushort(L, index, n, arg_first);
        case GL_FLOAT: return VertexAttrib_GLfloat(L, index, n, arg_first);
        case GL_DOUBLE: return VertexAttrib_GLdouble(L, index, n, arg_first);
        case GL_INT: return VertexAttrib_GLint(L, index, n, arg_first);
        case GL_UNSIGNED_INT: return VertexAttrib_GLuint(L, index, n, arg_first);
        default:
            return luaL_error(L, "type not supported by this operation");
#undef arg_first
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x1, %esi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x7, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, %r15d
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
movq %rbx, %rdi
movl $0x4, %esi
callq 0x113a0
movl %eax, %ebp
movq %rbx, %rdi
movl $0x5, %esi
callq 0x113a0
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
cmpl $0x1, %ebp
sbbl $0x0, %r12d
movq %rbx, %rdi
movl $0x6, %esi
callq 0x113a0
cmpl $0x1, %eax
sbbl $-0x1, %r12d
addl $0xffffec00, %r15d      # imm = 0xFFFFEC00
cmpl $0xa, %r15d
ja 0x3c92d
addl $0x2, %r12d
leaq 0xf308(%rip), %rax      # 0x4bbf8
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11af0
movb %al, (%rsp,%r13)
incq %r13
cmpq %r13, %r15
jne 0x3c8ff
cmpl $0x4, %r12d
jne 0x3ca68
movq 0x1a0d8(%rip), %rax     # 0x56a00
jmp 0x3caa8
leaq 0xdc99(%rip), %rsi      # 0x4a5cd
movq %rbx, %rdi
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11af0
movl %eax, (%rsp,%r13,4)
incq %r13
cmpq %r13, %r15
jne 0x3c952
movslq %r12d, %rax
leaq 0x1964c(%rip), %rcx     # 0x55fc0
jmp 0x3caa3
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11af0
movb %al, (%rsp,%r13)
incq %r13
cmpq %r13, %r15
jne 0x3c97f
cmpl $0x4, %r12d
jne 0x3ca68
movq 0x1a530(%rip), %rax     # 0x56ed8
jmp 0x3caa8
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rsp,%r13,4)
incq %r13
cmpq %r13, %r15
jne 0x3c9b3
movslq %r12d, %rax
leaq 0x19585(%rip), %rcx     # 0x55f60
jmp 0x3caa3
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11a80
movsd %xmm0, (%rsp,%r13,8)
incq %r13
cmpq %r13, %r15
jne 0x3c9e6
movslq %r12d, %rax
leaq 0x19576(%rip), %rcx     # 0x55f80
jmp 0x3caa3
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11af0
movw %ax, (%rsp,%r13,2)
incq %r13
cmpq %r13, %r15
jne 0x3ca15
movslq %r12d, %rax
leaq 0x19508(%rip), %rcx     # 0x55f40
jmp 0x3caa3
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11af0
movw %ax, (%rsp,%r13,2)
incq %r13
cmpq %r13, %r15
jne 0x3ca40
cmpl $0x4, %r12d
jne 0x3ca68
movq 0x1985a(%rip), %rax     # 0x562c0
jmp 0x3caa8
leaq 0x2b0f(%rip), %rsi      # 0x3f57e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x11ae0
jmp 0x3caba
movl %r12d, %r15d
xorl %r13d, %r13d
leal 0x3(%r13), %esi
movq %rbx, %rdi
callq 0x11af0
movl %eax, (%rsp,%r13,4)
incq %r13
cmpq %r13, %r15
jne 0x3ca81
movslq %r12d, %rax
leaq 0x194fd(%rip), %rcx     # 0x55fa0
movq -0x8(%rcx,%rax,8), %rax
movq %rsp, %rsi
movl %r14d, %edi
callq *(%rax)
movq %rbx, %rdi
callq 0x11880
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq