// File: /workspace/github_c_makefile_star2_O2/stetre[P]moongl/src/getuniform.c
// Function: GetActiveUniforms
static int GetActiveUniforms(lua_State *L)
/* get_active_uniforms(program, pname, uniform1, uniform2, ...) */
    {
    int arg;
    GLsizei count, i;
    GLuint *indices;
    GLint *params;
    GLuint program = luaL_checkinteger(L, 1);
    GLenum pname = checkuniformpname(L, 2);
    arg = 3;
    while(!lua_isnoneornil(L, arg))
        luaL_checkinteger(L, arg++);
    if(arg==3)
        return luaL_argerror(L, 3, "integer expected");
    count = arg - 3;
    indices = (GLuint*)Malloc2(L, count*sizeof(GLuint), (void**)&params, count*sizeof(GLint));
    for(i=0; i<count; i++)
        indices[i] = lua_tointeger(L, i+3);
    switch(pname)
        {
        case GL_UNIFORM_TYPE: return GetType(L,program,count,indices,pname,params);
        case GL_UNIFORM_SIZE: return GetInt(L,program,count,indices,pname,params);
        case GL_UNIFORM_NAME_LENGTH: return GetInt(L,program,count,indices,pname,params);
        case GL_UNIFORM_BLOCK_INDEX: return GetInt(L,program,count,indices,pname,params);
        case GL_UNIFORM_OFFSET: return GetInt(L,program,count,indices,pname,params);
        case GL_UNIFORM_ARRAY_STRIDE: return GetInt(L,program,count,indices,pname,params);
        case GL_UNIFORM_MATRIX_STRIDE: return GetInt(L,program,count,indices,pname,params);
        case GL_UNIFORM_IS_ROW_MAJOR: return GetBoolean(L,program,count,indices,pname,params);
        case GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX: 
                            return GetInt(L,program,count,indices,pname,params);
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
pushq $0x1
popq %rsi
callq 0x11af0
movq %rax, %r12
pushq $0x4c
popq %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x11150
movl %eax, %r13d
xorl %r15d, %r15d
xorl %ebx, %ebx
leaq 0x3(%rbx), %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x11850
testl %eax, %eax
jle 0x2cb67
movq %r14, %rdi
movl %ebp, %esi
callq 0x11af0
incq %rbx
addq $0x4, %r15
jmp 0x2cb42
testl %ebx, %ebx
je 0x2cc17
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rcx
callq 0x116f0
movq %rax, %r15
xorl %ebp, %ebp
cmpq %rbp, %rbx
je 0x2cba2
leal 0x3(%rbp), %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x11040
movl %eax, (%r15,%rbp,4)
incq %rbp
jmp 0x2cb87
leal -0x8a37(%r13), %eax
cmpl $0x7, %eax
ja 0x2cc37
leaq 0x19837(%rip), %rcx     # 0x463f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %r13
movq 0x28b6a(%rip), %rax     # 0x55738
movl %r12d, %edi
movl %ebx, %esi
movq %r15, %rdx
movl $0x8a37, %ecx           # imm = 0x8A37
movq %r13, %r8
callq *(%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x111d0
pushq $0xe
popq %rbp
movq %rbx, %r12
movq %r13, 0x10(%rsp)
subq $0x1, %r12
jb 0x2cd21
movl (%r13), %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x11110
addq $0x4, %r13
jmp 0x2cbf9
leaq 0x19906(%rip), %rdx     # 0x46524
pushq $0x3
popq %rsi
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11930
cmpl $0x92da, %r13d          # imm = 0x92DA
jne 0x2cd7f
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x92da, %r8d           # imm = 0x92DA
jmp 0x2cd69
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3b, %r8d           # imm = 0x8A3B
jmp 0x2cd69
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a39, %r8d           # imm = 0x8A39
jmp 0x2cd69
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3a, %r8d           # imm = 0x8A3A
jmp 0x2cd69
movq 0x8(%rsp), %r13
movq 0x28a7c(%rip), %rax     # 0x55738
movl %r12d, %edi
movl %ebx, %esi
movq %r15, %rdx
movl $0x8a3e, %ecx           # imm = 0x8A3E
movq %r13, %r8
callq *(%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x111d0
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x2ccf6
movl (%r13,%r12,4), %esi
movq %r14, %rdi
callq 0x117e0
incq %r12
jmp 0x2ccdf
movq %r14, %rdi
movq %r15, %rsi
callq 0x11360
movq %r14, %rdi
movq %r13, %rsi
jmp 0x2cd34
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a38, %r8d           # imm = 0x8A38
jmp 0x2cd69
movq %r14, %rdi
movq %r15, %rsi
callq 0x11360
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x11360
jmp 0x2cd6e
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3c, %r8d           # imm = 0x8A3C
jmp 0x2cd69
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3d, %r8d           # imm = 0x8A3D
callq 0x2d0d5
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe4ff(%rip), %rsi      # 0x3b285
leaq 0x19767(%rip), %rdx     # 0x464f4
movq %r14, %rdi
movl $0xec, %ecx
xorl %eax, %eax
callq 0x11ae0
movl %eax, %ebx
jmp 0x2cd6e