// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x4b, %esi
movl $0x1, %edx
callq 0x11160
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
addl $0xffffe100, %eax       # imm = 0xFFFFE100
subl $0x3, %eax
jb 0x36fb3
jmp 0x36f84
movl (%rsp), %eax
subl $0x1f03, %eax           # imm = 0x1F03
je 0x3705b
jmp 0x36f94
movl (%rsp), %eax
subl $0x8b8c, %eax           # imm = 0x8B8C
je 0x36fc6
jmp 0x36fa0
movl (%rsp), %eax
subl $0x9553, %eax           # imm = 0x9553
je 0x370c8
jmp 0x37132
movl 0x4(%rsp), %edi
callq 0x119b0
movq %rax, 0x8(%rsp)
jmp 0x37157
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x115c0
cmpl $0x0, %eax
je 0x37048
movq 0x18(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x11040
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x82e9, %esi           # imm = 0x82E9
callq 0x11a70
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x10(%rsp), %eax
jl 0x3702d
movq 0x18(%rsp), %rdi
movl $0x2, %esi
leaq 0x25a66(%rip), %rdx     # 0x5ca85
callq 0x11940
movl %eax, 0x24(%rsp)
jmp 0x371a5
movq 0x30884(%rip), %rax     # 0x678b8
movq (%rax), %rax
movl 0x4(%rsp), %edi
movl 0x14(%rsp), %esi
callq *%rax
movq %rax, 0x8(%rsp)
jmp 0x37056
movl 0x4(%rsp), %edi
callq 0x119b0
movq %rax, 0x8(%rsp)
jmp 0x37157
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x11af0
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x821d, %esi           # imm = 0x821D
callq 0x11a70
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x10(%rsp), %eax
jl 0x370aa
movq 0x18(%rsp), %rdi
movl $0x2, %esi
leaq 0x259e9(%rip), %rdx     # 0x5ca85
callq 0x11940
movl %eax, 0x24(%rsp)
jmp 0x371a5
movq 0x30807(%rip), %rax     # 0x678b8
movq (%rax), %rax
movl 0x4(%rsp), %edi
movl 0x14(%rsp), %esi
callq *%rax
movq %rax, 0x8(%rsp)
jmp 0x37157
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x11af0
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x9554, %esi           # imm = 0x9554
callq 0x11a70
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x10(%rsp), %eax
jl 0x37117
movq 0x18(%rsp), %rdi
movl $0x2, %esi
leaq 0x2597c(%rip), %rdx     # 0x5ca85
callq 0x11940
movl %eax, 0x24(%rsp)
jmp 0x371a5
movq 0x3079a(%rip), %rax     # 0x678b8
movq (%rax), %rax
movl 0x4(%rsp), %edi
movl 0x14(%rsp), %esi
callq *%rax
movq %rax, 0x8(%rsp)
jmp 0x37157
movq 0x18(%rsp), %rdi
leaq 0x1b147(%rip), %rsi     # 0x52285
leaq 0x2594d(%rip), %rdx     # 0x5ca92
movl $0x43, %ecx
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x24(%rsp)
jmp 0x371a5
movq 0x18(%rsp), %rdi
callq 0x11880
cmpq $0x0, 0x8(%rsp)
jne 0x3718e
movq 0x18(%rsp), %rdi
leaq 0x1b110(%rip), %rsi     # 0x52285
leaq 0x25916(%rip), %rdx     # 0x5ca92
movl $0x47, %ecx
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x24(%rsp)
jmp 0x371a5
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x110c0
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop