// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
callq 0x11af0
movq %rax, 0x8(%rsp)
pushq $0x7
popq %r12
pushq $0x2
popq %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x11150
movl %eax, %r15d
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11500
movl %eax, %ebp
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x11af0
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x115b0
movl %eax, %r13d
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x115b0
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
cmpl $0x1, %r13d
sbbl $0x0, %r14d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x115b0
cmpl $0x1, %eax
sbbl $-0x1, %r14d
leal -0x1400(%r15), %eax
cmpl $0xc, %eax
ja 0x399c5
movl $0x1c7f, %ecx           # imm = 0x1C7F
btl %eax, %ecx
jae 0x399c5
leaq 0xcc1c(%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
cmpl $0x8368, %r15d          # imm = 0x8368
je 0x399e0
cmpl $0x8c3b, %r15d          # imm = 0x8C3B
je 0x399e0
cmpl $0x8d9f, %r15d          # imm = 0x8D9F
jne 0x39a42
addl $0x2, %r14d
movl %r14d, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x39a07
leaq 0x4(%r13), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x11040
movl %eax, 0x10(%rsp,%r13,4)
incq %r13
jmp 0x399ea
movslq %r14d, %rax
leaq 0x1b5cf(%rip), %rcx     # 0x54fe0
movq -0x8(%rcx,%rax,8), %rax
movzbl %bpl, %edx
leaq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdi
movl %r15d, %esi
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
leaq 0x183c(%rip), %rsi      # 0x3b285
leaq 0xe3f4(%rip), %rdx      # 0x47e44
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