// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/getstring.c
// Function: GetString
static int GetString(lua_State *L)
    {
    GLsizei index;
    GLsizei num;
    const GLubyte *s;
    GLenum name = checkstringname(L, 1);
    switch(name)
        {
        case GL_RENDERER:
        case GL_VENDOR:
        case GL_VERSION:    
                    s = glGetString(name); break;
        case GL_SHADING_LANGUAGE_VERSION:
                    if(lua_isinteger(L, 2))
                        {
                        index = lua_tointeger(L, 2);
                        num = getSizei(L, GL_NUM_SHADING_LANGUAGE_VERSIONS);
                        if(index >= num)
                            return luaL_argerror(L, 2, "out of range");
                        s = glGetStringi(name, index);
                        }
                    else    
                        s = glGetString(name); 
                    break;
        case GL_EXTENSIONS:
                    index = luaL_checkinteger(L, 2);
                    num = getSizei(L, GL_NUM_EXTENSIONS);
                    if(index >= num)
                        return luaL_argerror(L, 2, "out of range");
                    s = glGetStringi(name, index);
                    break;
        case GL_SPIR_V_EXTENSIONS: //GL_VERSION_4_6
                    index = luaL_checkinteger(L, 2);
                    num = getSizei(L, GL_NUM_SPIR_V_EXTENSIONS);
                    if(index >= num)
                        return luaL_argerror(L, 2, "out of range");
                    s = glGetStringi(name, index);
                    break;
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    CheckError(L);
    if(s == NULL)
        return luaL_error(L, UNEXPECTED_ERROR);
    lua_pushstring(L, (char*)s);
    return 1;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4b, %esi
movl $0x1, %edx
callq 0x11150
cmpl $0x1f02, %eax           # imm = 0x1F02
jg 0x2e81e
leal -0x1f00(%rax), %ecx
cmpl $0x3, %ecx
jae 0x2e8a2
movl %eax, %edi
callq 0x119b0
jmp 0x2e907
cmpl $0x1f03, %eax           # imm = 0x1F03
je 0x2e86e
cmpl $0x8b8c, %eax           # imm = 0x8B8C
je 0x2e8bd
cmpl $0x9553, %eax           # imm = 0x9553
jne 0x2e8a2
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x9554, %esi           # imm = 0x9554
callq 0x11a70
cmpl %r14d, %eax
jle 0x2e953
movq 0x28144(%rip), %rax     # 0x569a8
movl $0x9553, %edi           # imm = 0x9553
jmp 0x2e902
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x821d, %esi           # imm = 0x821D
callq 0x11a70
cmpl %r14d, %eax
jle 0x2e953
movq 0x2810d(%rip), %rax     # 0x569a8
movl $0x1f03, %edi           # imm = 0x1F03
jmp 0x2e902
leaq 0x109dc(%rip), %rsi     # 0x3f285
leaq 0x1bb1b(%rip), %rdx     # 0x4a3cb
movq %rbx, %rdi
movl $0x43, %ecx
jmp 0x2e945
movq %rbx, %rdi
movl $0x2, %esi
callq 0x115b0
testl %eax, %eax
je 0x2e96e
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x11040
movq %rax, %r14
movq %rbx, %rdi
movl $0x82e9, %esi           # imm = 0x82E9
callq 0x11a70
cmpl %r14d, %eax
jle 0x2e953
movq 0x280ab(%rip), %rax     # 0x569a8
movl $0x8b8c, %edi           # imm = 0x8B8C
movl %r14d, %esi
callq *(%rax)
movq %rax, %r14
movq %rbx, %rdi
callq 0x11870
testq %r14, %r14
je 0x2e92f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x110c0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1094f(%rip), %rsi     # 0x3f285
leaq 0x1ba8e(%rip), %rdx     # 0x4a3cb
movq %rbx, %rdi
movl $0x47, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11ae0
leaq 0x1ba64(%rip), %rdx     # 0x4a3be
movq %rbx, %rdi
movl $0x2, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11930
movl $0x8b8c, %edi           # imm = 0x8B8C
jmp 0x2e814