// File: /workspace/github_c_makefile_star2_O3/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 0x11150
movl %eax, %r15d
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11390
movl %eax, %ebp
movq %rbx, %rdi
movl $0x5, %esi
callq 0x11390
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
cmpl $0x1, %ebp
sbbl $0x0, %r12d
movq %rbx, %rdi
movl $0x6, %esi
callq 0x11390
cmpl $0x1, %eax
sbbl $-0x1, %r12d
addl $0xffffec00, %r15d      # imm = 0xFFFFEC00
cmpl $0xa, %r15d
ja 0x3ca45
addl $0x2, %r12d
leaq 0xf1f0(%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 0x3ca17
cmpl $0x4, %r12d
jne 0x3cb80
movq 0x19fc0(%rip), %rax     # 0x56a00
jmp 0x3cbc0
leaq 0xdb81(%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 0x3ca6a
movslq %r12d, %rax
leaq 0x19534(%rip), %rcx     # 0x55fc0
jmp 0x3cbbb
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 0x3ca97
cmpl $0x4, %r12d
jne 0x3cb80
movq 0x1a418(%rip), %rax     # 0x56ed8
jmp 0x3cbc0
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 0x3cacb
movslq %r12d, %rax
leaq 0x1946d(%rip), %rcx     # 0x55f60
jmp 0x3cbbb
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 0x3cafe
movslq %r12d, %rax
leaq 0x1945e(%rip), %rcx     # 0x55f80
jmp 0x3cbbb
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 0x3cb2d
movslq %r12d, %rax
leaq 0x193f0(%rip), %rcx     # 0x55f40
jmp 0x3cbbb
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 0x3cb58
cmpl $0x4, %r12d
jne 0x3cb80
movq 0x19742(%rip), %rax     # 0x562c0
jmp 0x3cbc0
leaq 0x29f7(%rip), %rsi      # 0x3f57e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x11ae0
jmp 0x3cbd2
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 0x3cb99
movslq %r12d, %rax
leaq 0x193e5(%rip), %rcx     # 0x55fa0
movq -0x8(%rcx,%rax,8), %rax
movq %rsp, %rsi
movl %r14d, %edi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq