// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
callq 0x11af0
movq %rax, %r14
pushq $0x7
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x11150
movl %eax, %r15d
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11a80
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x11390
movl %eax, %ebp
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x11390
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
cmpl $0x1, %ebp
sbbl $0x0, %r12d
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x11390
cmpl $0x1, %eax
sbbl $-0x1, %r12d
addl $0xffffec00, %r15d      # imm = 0xFFFFEC00
cmpl $0xa, %r15d
ja 0x395af
addl $0x2, %r12d
leaq 0xe69e(%rip), %rax      # 0x47c20
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x396c6
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11af0
movb %al, (%rsp,%r13)
incq %r13
jmp 0x39591
leaq 0xd013(%rip), %rsi      # 0x465c9
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
cmpq %r13, %r15
je 0x395ee
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11af0
movl %eax, (%rsp,%r13,4)
incq %r13
jmp 0x395d4
movslq %r12d, %rax
leaq 0x1b9c8(%rip), %rcx     # 0x54fc0
jmp 0x39742
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x3961d
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11af0
movb %al, (%rsp,%r13)
incq %r13
jmp 0x39603
cmpl $0x4, %r12d
jne 0x39705
movq 0x1c8aa(%rip), %rax     # 0x55ed8
jmp 0x39747
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x39659
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rsp,%r13,4)
incq %r13
jmp 0x39639
movslq %r12d, %rax
leaq 0x1b8fd(%rip), %rcx     # 0x54f60
jmp 0x39742
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x3968a
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11a80
movsd %xmm0, (%rsp,%r13,8)
incq %r13
jmp 0x3966e
movslq %r12d, %rax
leaq 0x1b8ec(%rip), %rcx     # 0x54f80
jmp 0x39742
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x396ba
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11af0
movw %ax, (%rsp,%r13,2)
incq %r13
jmp 0x3969f
movslq %r12d, %rax
leaq 0x1b87c(%rip), %rcx     # 0x54f40
jmp 0x39742
cmpl $0x4, %r12d
jne 0x39705
movq 0x1c32d(%rip), %rax     # 0x55a00
jmp 0x39747
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x396f6
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11af0
movw %ax, (%rsp,%r13,2)
incq %r13
jmp 0x396db
cmpl $0x4, %r12d
jne 0x39705
movq 0x1bbbd(%rip), %rax     # 0x552c0
jmp 0x39747
leaq 0x1e72(%rip), %rsi      # 0x3b57e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x11ae0
jmp 0x39759
movl %r12d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x39738
leaq 0x3(%r13), %rsi
movq %rbx, %rdi
callq 0x11af0
movl %eax, (%rsp,%r13,4)
incq %r13
jmp 0x3971e
movslq %r12d, %rax
leaq 0x1b85e(%rip), %rcx     # 0x54fa0
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