// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x848, %rsp            # imm = 0x848
movq %rdi, 0x838(%rsp)
movl $0x0, 0x830(%rsp)
movq $0x0, 0x828(%rsp)
movq $0x0, 0x820(%rsp)
movq 0x838(%rsp), %rdi
movl $0x1, %esi
callq 0x11af0
movl %eax, 0x1c(%rsp)
movq 0x838(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x11450
movq %rax, 0x10(%rsp)
movq 0x838(%rsp), %rdi
movl $0x3, %esi
callq 0x11860
cmpl $0x0, %eax
jle 0x42af8
movq 0x838(%rsp), %rdi
movl $0x3, %esi
callq 0x11860
cmpl $0x5, %eax
je 0x4291a
movq 0x838(%rsp), %rdi
movl $0x1, %esi
leaq 0x1a59e(%rip), %rdx     # 0x5cea7
callq 0x11940
movl %eax, 0x844(%rsp)
jmp 0x42b3c
movq 0x838(%rsp), %rdi
movl $0x4, %esi
callq 0x11860
cmpl $0x5, %eax
je 0x42956
movq 0x838(%rsp), %rdi
movl $0x1, %esi
leaq 0x1a562(%rip), %rdx     # 0x5cea7
callq 0x11940
movl %eax, 0x844(%rsp)
jmp 0x42b3c
movq 0x838(%rsp), %rdi
movl $0x3, %esi
callq 0x11230
movl %eax, 0x830(%rsp)
cmpl $0x100, 0x830(%rsp) # imm = 0x100
jbe 0x429a1
movq 0x838(%rsp), %rdi
movl $0x1, %esi
leaq 0x1afa2(%rip), %rdx     # 0x5d932
callq 0x11940
movl %eax, 0x844(%rsp)
jmp 0x42b3c
movl 0x830(%rsp), %eax
movq %rax, 0x8(%rsp)
movq 0x838(%rsp), %rdi
movl $0x4, %esi
callq 0x11230
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
je 0x429f1
movq 0x838(%rsp), %rdi
movl $0x1, %esi
leaq 0x1af65(%rip), %rdx     # 0x5d945
callq 0x11940
movl %eax, 0x844(%rsp)
jmp 0x42b3c
cmpl $0x0, 0x830(%rsp)
jbe 0x42af6
movl $0x0, 0x834(%rsp)
movl 0x834(%rsp), %eax
cmpl 0x830(%rsp), %eax
jae 0x42ad9
movq 0x838(%rsp), %rdi
movl 0x834(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0x3, %esi
callq 0x11820
movq 0x838(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x11af0
movl %eax, %ecx
movl 0x834(%rsp), %eax
movl %ecx, 0x420(%rsp,%rax,4)
movq 0x838(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x116c0
movq 0x838(%rsp), %rdi
movl 0x834(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0x4, %esi
callq 0x11820
movq 0x838(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x11af0
movl %eax, %ecx
movl 0x834(%rsp), %eax
movl %ecx, 0x20(%rsp,%rax,4)
movq 0x838(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x116c0
movl 0x834(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x834(%rsp)
jmp 0x42a0a
leaq 0x420(%rsp), %rax
movq %rax, 0x828(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x820(%rsp)
jmp 0x42af8
movq 0x24a51(%rip), %rax     # 0x67550
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movq 0x10(%rsp), %rsi
movl 0x830(%rsp), %edx
movq 0x828(%rsp), %rcx
movq 0x820(%rsp), %r8
callq *%rax
movq 0x838(%rsp), %rdi
callq 0x11880
movl $0x0, 0x844(%rsp)
movl 0x844(%rsp), %eax
addq $0x848, %rsp            # imm = 0x848
retq
nopl (%rax,%rax)