// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %r14, %rdi
movl $0x4c, %esi
movl $0x2, %edx
callq 0x11150
movl %eax, %r13d
movq %r14, %rdi
movl $0x3, %esi
callq 0x11850
testl %eax, %eax
jle 0x2f273
xorl %r15d, %r15d
xorl %ebx, %ebx
leal 0x3(%rbx), %esi
leal 0x4(%rbx), %ebp
movq %r14, %rdi
callq 0x11af0
movq %r14, %rdi
movl %ebp, %esi
callq 0x11850
incq %rbx
addq $0x4, %r15
testl %eax, %eax
jg 0x2f187
testl %ebx, %ebx
je 0x2f273
movq %r12, %rbp
leaq 0x2(%rbx), %r12
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rcx
callq 0x116f0
movq %rax, %r15
movq %r12, 0x10(%rsp)
cmpl $0x3, %r12d
jb 0x2f1f8
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 0x2f1dd
leal -0x8a37(%r13), %eax
cmpl $0x7, %eax
ja 0x2f295
leaq 0x1b1e5(%rip), %rcx     # 0x4a3f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %r13
movq 0x27514(%rip), %rax     # 0x56738
movl %ebp, %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
cmpl $0x3, 0x10(%rsp)
jb 0x2f354
movq %r13, %r12
movq %rbx, %rbp
movl (%r12), %edx
movq %r14, %rdi
movl $0xe, %esi
callq 0x11110
addq $0x4, %r12
decq %rbp
jne 0x2f254
jmp 0x2f354
leaq 0x1b2ae(%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 0x11930
cmpl $0x92da, %r13d          # imm = 0x92DA
jne 0x2f3c5
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x92da, %r8d           # imm = 0x92DA
jmp 0x2f3af
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3b, %r8d           # imm = 0x8A3B
jmp 0x2f3af
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a39, %r8d           # imm = 0x8A39
jmp 0x2f3af
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3a, %r8d           # imm = 0x8A3A
jmp 0x2f3af
movq 0x8(%rsp), %r13
movq 0x27422(%rip), %rax     # 0x56738
movl %ebp, %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
cmpl $0x3, 0x10(%rsp)
jb 0x2f354
xorl %r12d, %r12d
movl (%r13,%r12,4), %esi
movq %r14, %rdi
callq 0x117e0
incq %r12
cmpq %r12, %rbx
jne 0x2f33f
movq %r14, %rdi
movq %r15, %rsi
callq 0x11360
movq %r14, %rdi
movq %r13, %rsi
callq 0x11360
jmp 0x2f3b4
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a38, %r8d           # imm = 0x8A38
jmp 0x2f3af
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3c, %r8d           # imm = 0x8A3C
jmp 0x2f3af
movq 0x8(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %rcx
movl $0x8a3d, %r8d           # imm = 0x8A3D
callq 0x2f71a
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfeb9(%rip), %rsi      # 0x3f285
leaq 0x1b125(%rip), %rdx     # 0x4a4f8
movq %r14, %rdi
movl $0xec, %ecx
xorl %eax, %eax
callq 0x11ae0
movl %eax, %ebx
jmp 0x2f3b4