// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/texture.c
// Function: GetTextureLevelParameter
static int GetTextureLevelParameter(lua_State *L)
    {
    GLenum target;
    GLuint texture = checktargetorname(L, 1, &target, DOMAIN_TEXTURE_TARGET);
    GLint level = luaL_checkinteger(L, 2);
    GLenum pname = checklevelpname(L, 3);
    switch(pname)
        {
        case GL_TEXTURE_COMPRESSED:
        case GL_TEXTURE_FIXED_SAMPLE_LOCATIONS:  return LGetBoolean(L,texture,target,level,pname);
        case GL_TEXTURE_WIDTH:
        case GL_TEXTURE_HEIGHT:
        case GL_TEXTURE_DEPTH:
        case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
        case GL_TEXTURE_SAMPLES:
        case GL_TEXTURE_SHARED_SIZE:
        case GL_TEXTURE_BUFFER_OFFSET:
        case GL_TEXTURE_BUFFER_SIZE:
        case GL_TEXTURE_RED_SIZE:
        case GL_TEXTURE_GREEN_SIZE:
        case GL_TEXTURE_BLUE_SIZE:
        case GL_TEXTURE_ALPHA_SIZE:
        case GL_TEXTURE_DEPTH_SIZE: return LGetInt(L,texture,target,level,pname);
        case GL_TEXTURE_RED_TYPE:
        case GL_TEXTURE_GREEN_TYPE:
        case GL_TEXTURE_BLUE_TYPE:
        case GL_TEXTURE_ALPHA_TYPE:
        case GL_TEXTURE_DEPTH_TYPE: 
                return LGetEnum(L, texture, target, level, pname, DOMAIN_COMPONENT_TYPE);
        case GL_TEXTURE_INTERNAL_FORMAT:  
                    return LGetEnum(L, texture, target, level, pname, DOMAIN_INTERNAL_FORMAT);
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    return 0;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x14(%rsp), %rdx
movl $0x13, %ecx
callq 0x11430
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x11af0
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1d, %esi
movl $0x3, %edx
callq 0x11160
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
addl $0xfffff000, %eax       # imm = 0xFFFFF000
subl $0x2, %eax
jb 0x49267
jmp 0x49179
movl 0x4(%rsp), %eax
subl $0x1003, %eax           # imm = 0x1003
je 0x492b2
jmp 0x4918a
movl 0x4(%rsp), %eax
addl $0xffff7fa4, %eax       # imm = 0xFFFF7FA4
subl $0x4, %eax
jb 0x49267
jmp 0x4919e
movl 0x4(%rsp), %eax
subl $0x8071, %eax           # imm = 0x8071
je 0x49267
jmp 0x491af
movl 0x4(%rsp), %eax
subl $0x86a0, %eax           # imm = 0x86A0
je 0x49267
jmp 0x491c0
movl 0x4(%rsp), %eax
subl $0x86a1, %eax           # imm = 0x86A1
je 0x4923d
jmp 0x491cd
movl 0x4(%rsp), %eax
subl $0x884a, %eax           # imm = 0x884A
je 0x49267
jmp 0x491de
movl 0x4(%rsp), %eax
addl $0xffff73f0, %eax       # imm = 0xFFFF73F0
subl $0x4, %eax
jb 0x4928b
jmp 0x491f2
movl 0x4(%rsp), %eax
subl $0x8c16, %eax           # imm = 0x8C16
je 0x4928b
jmp 0x49203
movl 0x4(%rsp), %eax
subl $0x8c3f, %eax           # imm = 0x8C3F
je 0x49267
jmp 0x49210
movl 0x4(%rsp), %eax
subl $0x9106, %eax           # imm = 0x9106
je 0x49267
jmp 0x4921d
movl 0x4(%rsp), %eax
subl $0x9107, %eax           # imm = 0x9107
je 0x4923d
jmp 0x4922a
movl 0x4(%rsp), %eax
addl $0xffff6e63, %eax       # imm = 0xFFFF6E63
subl $0x2, %eax
jb 0x49267
jmp 0x492d9
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x1, %r9d
callq 0x498b0
movl %eax, 0x24(%rsp)
jmp 0x492fc
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
xorl %r9d, %r9d
callq 0x498b0
movl %eax, 0x24(%rsp)
jmp 0x492fc
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x2a, %r9d
callq 0x49950
movl %eax, 0x24(%rsp)
jmp 0x492fc
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x11, %r9d
callq 0x49950
movl %eax, 0x24(%rsp)
jmp 0x492fc
movq 0x18(%rsp), %rdi
leaq 0x8fa0(%rip), %rsi      # 0x52285
leaq 0x14bfa(%rip), %rdx     # 0x5dee6
movl $0x152, %ecx            # imm = 0x152
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)