// File: /workspace/github_c_makefile_star2_O2/stetre[P]moongl/src/shader.c
// Function: SpecializeShader
static int SpecializeShader(lua_State *L) //GL_VERSION_4_6
    {
#define max_constants 256
    GLuint i, n = 0;
    GLuint *indices = NULL;
    GLuint *values = NULL;
    GLuint index[max_constants];
    GLuint value[max_constants];
    GLuint name = luaL_checkinteger(L, 1);
    const char *entrypoint = luaL_checkstring(L, 2);
    if(!lua_isnoneornil(L, 3))
        {
        if(lua_type(L, 3) != LUA_TTABLE)
            return luaL_argerror(L, 1, "table expected");
        if(lua_type(L, 4) != LUA_TTABLE)
            return luaL_argerror(L, 1, "table expected");
        n = luaL_len(L, 3);
        if(n > max_constants)
            return luaL_argerror(L, 1, "too many constants");
        if(n != luaL_len(L, 4))
            return luaL_argerror(L, 1, "mismatch between number of indices and of values");
        if(n>0)
            {
            for(i=0; i <n; i++)
                {
                lua_geti(L, 3, i+1);
                index[i] = luaL_checkinteger(L, -1);
                lua_pop(L, 1);
                lua_geti(L, 4, i+1);
                value[i] = luaL_checkinteger(L, -1);
                lua_pop(L, 1);
                }
            indices = index;
            values = value;
            }
        }
    glSpecializeShader(name, (GLchar*)entrypoint, n, indices, values);
    CheckError(L);
    return 0;
#undef max_constants
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x11af0
movq %rax, %r15
xorl %r12d, %r12d
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x11440
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11850
movl $0x0, %r13d
movl $0x0, %ebp
testl %eax, %eax
jle 0x32cca
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11850
cmpl $0x5, %eax
jne 0x32bb9
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x11850
cmpl $0x5, %eax
jne 0x32bb9
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11220
movq %rax, %r12
cmpl $0x101, %r12d           # imm = 0x101
jb 0x32bdc
leaq 0x1472a(%rip), %rdx     # 0x472e1
jmp 0x32bc0
leaq 0x13cc6(%rip), %rdx     # 0x46886
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11930
movq %r14, (%rsp)
movl %r12d, %r14d
andl $0x1ff, %r14d           # imm = 0x1FF
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x11220
cmpq %rax, %r14
jne 0x32ca2
testl %r12d, %r12d
je 0x32cbe
movq %r15, 0x10(%rsp)
movq %r12, 0x8(%rsp)
movl %r12d, %eax
andl $0x1ff, %eax            # imm = 0x1FF
negq %rax
movq %rax, 0x18(%rsp)
pushq $0x1
popq %r14
leaq 0x20(%rsp), %rbp
leaq 0x420(%rsp), %r13
pushq $-0x1
popq %r15
pushq $-0x2
popq %r12
movq 0x18(%rsp), %rax
addq %r14, %rax
cmpq $0x1, %rax
je 0x32cae
movq %rbx, %rdi
pushq $0x3
popq %rsi
movq %r14, %rdx
callq 0x11810
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11af0
movl %eax, 0x41c(%rsp,%r14,4)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x116b0
movq %rbx, %rdi
pushq $0x4
popq %rsi
movq %r14, %rdx
callq 0x11810
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11af0
movl %eax, 0x1c(%rsp,%r14,4)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x116b0
incq %r14
jmp 0x32c3a
leaq 0x1464b(%rip), %rdx     # 0x472f4
jmp 0x32bc0
movq 0x10(%rsp), %r15
movq (%rsp), %r14
movq 0x8(%rsp), %r12
jmp 0x32cca
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%rsp), %r14
movq 0x229df(%rip), %rax     # 0x556b0
movl %r15d, %edi
movq %r14, %rsi
movl %r12d, %edx
movq %r13, %rcx
movq %rbp, %r8
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq