// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x4b
popq %rsi
pushq $0x1
popq %rdx
callq 0x11150
leal -0x1f00(%rax), %ecx
cmpl $0x3, %ecx
jb 0x2c2c2
cmpl $0x1f03, %eax           # imm = 0x1F03
je 0x2c30e
cmpl $0x8b8c, %eax           # imm = 0x8B8C
je 0x2c2cb
cmpl $0x9553, %eax           # imm = 0x9553
jne 0x2c390
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x9554, %esi           # imm = 0x9554
callq 0x11a70
cmpl %r14d, %eax
jle 0x2c377
movq 0x296ed(%rip), %rax     # 0x559a8
movl $0x9553, %edi           # imm = 0x9553
jmp 0x2c33a
movl %eax, %edi
callq 0x119b0
jmp 0x2c33f
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x115b0
testl %eax, %eax
je 0x2c3b2
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x11040
movq %rax, %r14
movq %rbx, %rdi
movl $0x82e9, %esi           # imm = 0x82E9
callq 0x11a70
cmpl %r14d, %eax
jle 0x2c377
movq 0x296a1(%rip), %rax     # 0x559a8
movl $0x8b8c, %edi           # imm = 0x8B8C
jmp 0x2c33a
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x821d, %esi           # imm = 0x821D
callq 0x11a70
cmpl %r14d, %eax
jle 0x2c377
movq 0x29673(%rip), %rax     # 0x559a8
movl $0x1f03, %edi           # imm = 0x1F03
movl %r14d, %esi
callq *(%rax)
movq %rax, %r14
movq %rbx, %rdi
callq 0x11870
testq %r14, %r14
je 0x2c365
movq %rbx, %rdi
movq %r14, %rsi
callq 0x110c0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xef19(%rip), %rsi      # 0x3b285
leaq 0x1a054(%rip), %rdx     # 0x463c7
pushq $0x47
jmp 0x2c3a0
leaq 0x1a03c(%rip), %rdx     # 0x463ba
pushq $0x2
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11930
leaq 0xeeee(%rip), %rsi      # 0x3b285
leaq 0x1a029(%rip), %rdx     # 0x463c7
pushq $0x43
popq %rcx
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11ae0
movl $0x8b8c, %edi           # imm = 0x8B8C
jmp 0x2c2c4