// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/getuniform.c
// Function: GetUniform
static int GetUniform(lua_State *L)
/* get_uniform(program, location, type, size) */
    {
    GLuint program = luaL_checkinteger(L, 1);
    GLint location = luaL_checkinteger(L, 2);
    GLenum type = checkuniformtype(L, 3);
    GLsizei size = luaL_checkinteger(L, 4); 
    if((size < 1) || (size>16))
        return luaL_argerror(L, 4, "out of range");
    switch(type)
        {
        case NONGL_BOOLEAN: return GetUniform_b(L, program, location, size);
        case GL_INT: return GetUniform_i(L, program, location, size);
        case GL_UNSIGNED_INT: return GetUniform_ui(L, program, location, size);
        case GL_FLOAT:  return GetUniform_f(L, program, location, size);
        case GL_DOUBLE: return GetUniform_d(L, program, location, size);
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }

    CheckError(L);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movl $0x1, %esi
callq 0x11af0
movq %rax, %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, %r12
movq %rbx, %rdi
movl $0x34, %esi
movl $0x3, %edx
callq 0x11150
movl %eax, %r13d
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11af0
movq %rax, %r14
addl $-0x11, %eax
cmpl $-0x11, %eax
ja 0x2ebef
leaq 0x1b7ec(%rip), %rdx     # 0x4a3be
movq %rbx, %rdi
movl $0x4, %esi
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x11930
leal -0x1404(%r13), %eax
cmpl $0x6, %eax
ja 0x2ec44
leaq 0x1b7d6(%rip), %rcx     # 0x4a3d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28386(%rip), %rax     # 0x56f98
movq %rsp, %rdx
movl %r15d, %edi
movl %r12d, %esi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl %r14d, %r15d
xorl %r12d, %r12d
movslq (%rsp,%r12,4), %rsi
movq %rbx, %rdi
callq 0x113b0
incq %r12
cmpq %r12, %r15
jne 0x2ec2b
jmp 0x2ed56
testl %r13d, %r13d
jne 0x2ec82
movq 0x28348(%rip), %rax     # 0x56f98
movq %rsp, %rdx
movl %r15d, %edi
movl %r12d, %esi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl %r14d, %r15d
xorl %r12d, %r12d
movl (%rsp,%r12,4), %esi
movq %rbx, %rdi
callq 0x117e0
incq %r12
cmpq %r12, %r15
jne 0x2ec69
jmp 0x2ed56
leaq 0x105fc(%rip), %rsi     # 0x3f285
leaq 0x1b868(%rip), %rdx     # 0x4a4f8
movq %rbx, %rdi
movl $0x51, %ecx
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x11ae0
movq 0x27d7a(%rip), %rax     # 0x56a30
movq %rsp, %rdx
movl %r15d, %edi
movl %r12d, %esi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl %r14d, %r15d
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtss2sd (%rsp,%r12,4), %xmm0
movq %rbx, %rdi
callq 0x11370
incq %r12
cmpq %r12, %r15
jne 0x2eccf
jmp 0x2ed56
movq 0x27657(%rip), %rax     # 0x56348
movq %rsp, %rdx
movl %r15d, %edi
movl %r12d, %esi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl %r14d, %r15d
xorl %r12d, %r12d
movsd (%rsp,%r12,8), %xmm0
movq %rbx, %rdi
callq 0x11370
incq %r12
cmpq %r12, %r15
jne 0x2ed0a
jmp 0x2ed56
movq 0x27b3f(%rip), %rax     # 0x56868
movq %rsp, %rdx
movl %r15d, %edi
movl %r12d, %esi
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl %r14d, %r15d
xorl %r12d, %r12d
movl (%rsp,%r12,4), %esi
movq %rbx, %rdi
callq 0x113b0
incq %r12
cmpq %r12, %r15
jne 0x2ed42
movl %r14d, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq