// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0x11af0
movl %eax, 0x1c(%rsp)
movq 0x48(%rsp), %rdi
movl $0x7, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
movl $0x3, %esi
callq 0x11510
movb %al, 0x17(%rsp)
movq 0x48(%rsp), %rdi
movl $0x4, %esi
callq 0x11af0
movl $0x1, 0x40(%rsp)
movq 0x48(%rsp), %rdi
movl $0x5, %esi
callq 0x115c0
cmpl $0x0, %eax
je 0x4f42d
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
movl $0x6, %esi
callq 0x115c0
cmpl $0x0, %eax
je 0x4f44c
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
movl $0x7, %esi
callq 0x115c0
cmpl $0x0, %eax
je 0x4f46b
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x10(%rsp)
addl $0xffffec00, %eax       # imm = 0xFFFFEC00
subl $0x7, %eax
jb 0x4f4bc
jmp 0x4f47f
movl 0x10(%rsp), %eax
addl $0xffffebf6, %eax       # imm = 0xFFFFEBF6
subl $0x3, %eax
jb 0x4f4bc
jmp 0x4f48f
movl 0x10(%rsp), %eax
subl $0x8368, %eax           # imm = 0x8368
je 0x4f4b8
jmp 0x4f49c
movl 0x10(%rsp), %eax
subl $0x8c3b, %eax           # imm = 0x8C3B
je 0x4f4ba
jmp 0x4f4a9
movl 0x10(%rsp), %eax
subl $0x8d9f, %eax           # imm = 0x8D9F
jne 0x4f4d8
jmp 0x4f4b6
jmp 0x4f500
jmp 0x4f500
jmp 0x4f500
movq 0x48(%rsp), %rdi
leaq 0xd78d(%rip), %rsi      # 0x5cc55
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x54(%rsp)
jmp 0x4f639
movq 0x48(%rsp), %rdi
leaq 0x2da1(%rip), %rsi      # 0x52285
leaq 0xf0f5(%rip), %rdx      # 0x5e5e0
movl $0xdd, %ecx
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x54(%rsp)
jmp 0x4f639
movl $0x0, 0x44(%rsp)
movl $0x4, 0x3c(%rsp)
movl 0x44(%rsp), %eax
cmpl 0x40(%rsp), %eax
jge 0x4f54c
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
xorl %eax, %eax
movl %eax, %edx
callq 0x11040
movl %eax, %ecx
movl 0x44(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x44(%rsp)
cltq
movl %ecx, 0x20(%rsp,%rax,4)
jmp 0x4f510
movl 0x40(%rsp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x3, %eax
ja 0x4f602
movq 0x8(%rsp), %rax
leaq 0xee4e(%rip), %rcx      # 0x5e3bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x17b8a(%rip), %rax     # 0x67108
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movb 0x17(%rsp), %dl
leaq 0x20(%rsp), %rcx
movzbl %dl, %edx
callq *%rax
jmp 0x4f627
movq 0x180a5(%rip), %rax     # 0x67648
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movb 0x17(%rsp), %dl
leaq 0x20(%rsp), %rcx
movzbl %dl, %edx
callq *%rax
jmp 0x4f627
movq 0x1868b(%rip), %rax     # 0x67c50
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movb 0x17(%rsp), %dl
leaq 0x20(%rsp), %rcx
movzbl %dl, %edx
callq *%rax
jmp 0x4f627
movq 0x18789(%rip), %rax     # 0x67d70
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movb 0x17(%rsp), %dl
leaq 0x20(%rsp), %rcx
movzbl %dl, %edx
callq *%rax
jmp 0x4f627
movq 0x48(%rsp), %rdi
leaq 0x2c77(%rip), %rsi      # 0x52285
leaq 0xefcb(%rip), %rdx      # 0x5e5e0
movl $0xe9, %ecx
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x54(%rsp)
jmp 0x4f639
movq 0x48(%rsp), %rdi
callq 0x11880
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)