// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x11af0
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movl $0x7, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movl $0x3, %esi
callq 0x11a80
movl $0x1, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x4, %esi
callq 0x113a0
cmpl $0x0, %eax
je 0x4f04a
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x5, %esi
callq 0x113a0
cmpl $0x0, %eax
je 0x4f069
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x6, %esi
callq 0x113a0
cmpl $0x0, %eax
je 0x4f088
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl 0xc(%rsp), %eax
addl $0xffffec00, %eax       # imm = 0xFFFFEC00
movl %eax, %ecx
movq %rcx, (%rsp)
subl $0xa, %eax
ja 0x4f1a8
movq (%rsp), %rax
leaq 0xf2e5(%rip), %rcx      # 0x5e390
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x507c0
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50870
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50920
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50a30
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50ae0
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50bf0
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50d00
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl $0x3, %ecx
callq 0x50e10
movl %eax, 0x24(%rsp)
jmp 0x4f1bf
movq 0x18(%rsp), %rdi
leaq 0xdaa1(%rip), %rsi      # 0x5cc55
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)