// File: /workspace/github_c_makefile_star2_O1/stetre[P]moongl/src/vertex_array.c
// Function: VertexAttribP
static int VertexAttribP(lua_State *L)
/* gl.vertex_attrib_p(index, type, normalized, val1 , val2, val3, val4) */
    {
    int i, n, arg;
    GLuint values[4];
    GLuint index = luaL_checkinteger(L, 1);
    GLenum type = checktype(L, 2);
    GLboolean normalized = checkboolean(L, 3);
    luaL_checkinteger(L, 4); n=1;
    if(lua_isinteger(L, 5)) n++;
    if(lua_isinteger(L, 6)) n++;
    if(lua_isinteger(L, 7)) n++;
    switch(type)
        {
        case GL_INT_2_10_10_10_REV: break;
        case GL_UNSIGNED_INT_2_10_10_10_REV: break;
        case GL_UNSIGNED_INT_10F_11F_11F_REV: break;
        case GL_BYTE:
        case GL_UNSIGNED_BYTE:
        case GL_SHORT:
        case GL_UNSIGNED_SHORT:
        case GL_INT:
        case GL_UNSIGNED_INT:
        case GL_FLOAT:
        case GL_DOUBLE:
        case GL_HALF_FLOAT:
        case GL_FIXED:
            return luaL_error(L, "type not supported by this operation");
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    i = 0; arg = 4;
    while(i < n)
        values[i++] = lua_tointeger(L, arg++);
    switch(n)
        {
        case 1: glVertexAttribP1uiv(index, type, normalized, values); break;
        case 2: glVertexAttribP2uiv(index, type, normalized, values); break;
        case 3: glVertexAttribP3uiv(index, type, normalized, values); break;
        case 4: glVertexAttribP4uiv(index, type, normalized, values); break;
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    CheckError(L);
    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, %ebp
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11510
movl %eax, %r15d
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11af0
movq %rbx, %rdi
movl $0x5, %esi
callq 0x115c0
movl %eax, %r12d
movq %rbx, %rdi
movl $0x6, %esi
callq 0x115c0
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
cmpl $0x1, %r12d
sbbl $0x0, %r13d
movq %rbx, %rdi
movl $0x7, %esi
callq 0x115c0
cmpl $0x1, %eax
sbbl $-0x1, %r13d
cmpl $0x8367, %ebp           # imm = 0x8367
jg 0x3cd3f
addl $0xffffec00, %ebp       # imm = 0xFFFFEC00
cmpl $0xc, %ebp
ja 0x3cdc3
movl $0x1c7f, %eax           # imm = 0x1C7F
btl %ebp, %eax
jae 0x3cdc3
leaq 0xd8a6(%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
cmpl $0x8368, %ebp           # imm = 0x8368
je 0x3cd57
cmpl $0x8c3b, %ebp           # imm = 0x8C3B
je 0x3cd57
cmpl $0x8d9f, %ebp           # imm = 0x8D9F
jne 0x3cdc3
movq %r14, 0x8(%rsp)
addl $0x2, %r13d
cmpl $0x1, %r13d
movl %r13d, %r12d
adcl $0x0, %r12d
xorl %r14d, %r14d
leal 0x4(%r14), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x11040
movl %eax, 0x10(%rsp,%r14,4)
incq %r14
cmpq %r14, %r12
jne 0x3cd6e
movslq %r13d, %rax
leaq 0x1924d(%rip), %rcx     # 0x55fe0
movq -0x8(%rcx,%rax,8), %rax
movzbl %r15b, %edx
leaq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdi
movl %ebp, %esi
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
leaq 0x24bb(%rip), %rsi      # 0x3f285
leaq 0xf04b(%rip), %rdx      # 0x4be1c
movq %rbx, %rdi
movl $0xdd, %ecx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0