// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %esi
callq 0x11af0
movq %rax, %rbx
movq %r14, %rdi
movl $0x4c, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, %ebp
movl $0x3, %r13d
movq %r14, %rdi
movl $0x3, %esi
callq 0x11860
testl %eax, %eax
jle 0x2f0a8
movl $0x3, %esi
leal 0x1(%rsi), %r13d
movq %r14, %rdi
callq 0x11af0
movq %r14, %rdi
movl %r13d, %esi
callq 0x11860
movl %r13d, %esi
testl %eax, %eax
jg 0x2f08a
cmpl $0x3, %r13d
jne 0x2f0d0
leaq 0x1b473(%rip), %rdx     # 0x4a528
movq %r14, %rdi
movl $0x3, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11940
movq %rbx, 0x8(%rsp)
leal -0x3(%r13), %eax
movl %eax, 0x4(%rsp)
movslq %r13d, %rax
leaq -0xc(,%rax,4), %rcx
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %rcx, %rsi
callq 0x11700
movq %rax, %r15
cmpl $0x4, %r13d
jl 0x2f123
movl 0x4(%rsp), %ebx
xorl %r12d, %r12d
leal 0x3(%r12), %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x11040
movl %eax, (%r15,%r12,4)
incq %r12
cmpq %r12, %rbx
jne 0x2f108
leal -0x8a37(%rbp), %eax
cmpl $0x7, %eax
ja 0x2f1a2
leaq 0x1b2bf(%rip), %rcx     # 0x4a3f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rsp), %rbp
movq 0x275ee(%rip), %rax     # 0x56738
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %ebx
movl %ebx, %esi
movq %r15, %rdx
movl $0x8a37, %ecx           # imm = 0x8A37
movq %rbp, %r8
callq *(%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x111e0
cmpl $0x4, %r13d
movl %ebx, %r13d
jb 0x2f290
movl %r13d, %ebx
xorl %r12d, %r12d
movl (%rbp,%r12,4), %edx
movq %r14, %rdi
movl $0xe, %esi
callq 0x11120
incq %r12
cmpq %r12, %rbx
jne 0x2f183
jmp 0x2f290
cmpl $0x92da, %ebp           # imm = 0x92DA
jne 0x2f31d
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x92da, %r8d           # imm = 0x92DA
jmp 0x2f306
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x8a3b, %r8d           # imm = 0x8A3B
jmp 0x2f306
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x8a39, %r8d           # imm = 0x8A39
jmp 0x2f306
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x8a3a, %r8d           # imm = 0x8A3A
jmp 0x2f306
movq 0x10(%rsp), %rbp
movq 0x274f2(%rip), %rax     # 0x56738
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %ebx
movl %ebx, %esi
movq %r15, %rdx
movl $0x8a3e, %ecx           # imm = 0x8A3E
movq %rbp, %r8
callq *(%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x111e0
cmpl $0x4, %r13d
movl %ebx, %r13d
jb 0x2f290
movl %r13d, %ebx
xorl %r12d, %r12d
movl (%rbp,%r12,4), %esi
movq %r14, %rdi
callq 0x117f0
incq %r12
cmpq %r12, %rbx
jne 0x2f27b
movq %r14, %rdi
movq %r15, %rsi
callq 0x11370
movq %r14, %rdi
movq %rbp, %rsi
callq 0x11370
jmp 0x2f30b
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x8a38, %r8d           # imm = 0x8A38
jmp 0x2f306
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x8a3c, %r8d           # imm = 0x8A3C
jmp 0x2f306
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movl $0x8a3d, %r8d           # imm = 0x8A3D
callq 0x2f673
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xff61(%rip), %rsi      # 0x3f285
leaq 0x1b1cd(%rip), %rdx     # 0x4a4f8
movq %r14, %rdi
movl $0xec, %ecx
xorl %eax, %eax
callq 0x11ae0
movl %eax, %r13d
jmp 0x2f30b