// File: /workspace/github_c_makefile_star2_O1/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 0x11160
cmpl $0x1f02, %eax           # imm = 0x1F02
jg 0x2e6b2
leal -0x1f00(%rax), %ecx
cmpl $0x3, %ecx
jae 0x2e736
movl %eax, %edi
callq 0x119b0
jmp 0x2e79b
cmpl $0x1f03, %eax           # imm = 0x1F03
je 0x2e702
cmpl $0x8b8c, %eax           # imm = 0x8B8C
je 0x2e751
cmpl $0x9553, %eax           # imm = 0x9553
jne 0x2e736
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 0x2e7e7
movq 0x282b0(%rip), %rax     # 0x569a8
movl $0x9553, %edi           # imm = 0x9553
jmp 0x2e796
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 0x2e7e7
movq 0x28279(%rip), %rax     # 0x569a8
movl $0x1f03, %edi           # imm = 0x1F03
jmp 0x2e796
leaq 0x10b48(%rip), %rsi     # 0x3f285
leaq 0x1bc87(%rip), %rdx     # 0x4a3cb
movq %rbx, %rdi
movl $0x43, %ecx
jmp 0x2e7d9
movq %rbx, %rdi
movl $0x2, %esi
callq 0x115c0
testl %eax, %eax
je 0x2e802
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 0x2e7e7
movq 0x28217(%rip), %rax     # 0x569a8
movl $0x8b8c, %edi           # imm = 0x8B8C
movl %r14d, %esi
callq *(%rax)
movq %rax, %r14
movq %rbx, %rdi
callq 0x11880
testq %r14, %r14
je 0x2e7c3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x110c0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x10abb(%rip), %rsi     # 0x3f285
leaq 0x1bbfa(%rip), %rdx     # 0x4a3cb
movq %rbx, %rdi
movl $0x47, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11ae0
leaq 0x1bbd0(%rip), %rdx     # 0x4a3be
movq %rbx, %rdi
movl $0x2, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11940
movl $0x8b8c, %edi           # imm = 0x8B8C
jmp 0x2e6a8