// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x4(%rsp), %rdx
pushq $0x13
popq %rcx
movl %ebx, %esi
callq 0x11420
movl %eax, %ebp
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x11af0
movq %rax, %r15
pushq $0x1d
popq %rsi
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x11150
leal -0x805c(%rax), %ecx
cmpl $0x15, %ecx
jbe 0x3680c
leal -0x8c10(%rax), %ecx
cmpl $0x4, %ecx
jb 0x36833
leal -0x1000(%rax), %ecx
cmpl $0x2, %ecx
jb 0x3681a
leal -0x919d(%rax), %ecx
cmpl $0x2, %ecx
jb 0x3681a
cmpl $0x1003, %eax           # imm = 0x1003
je 0x36879
cmpl $0x86a0, %eax           # imm = 0x86A0
je 0x3681a
cmpl $0x9107, %eax           # imm = 0x9107
je 0x367f5
cmpl $0x884a, %eax           # imm = 0x884A
je 0x3681a
cmpl $0x8c16, %eax           # imm = 0x8C16
je 0x36833
cmpl $0x8c3f, %eax           # imm = 0x8C3F
je 0x3681a
cmpl $0x9106, %eax           # imm = 0x9106
je 0x3681a
cmpl $0x86a1, %eax           # imm = 0x86A1
jne 0x36858
movl 0x4(%rsp), %edx
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %ecx
movl %eax, %r8d
movl %ebx, %r9d
jmp 0x3682c
movl $0x20000f, %edx         # imm = 0x20000F
btl %ecx, %edx
jae 0x36794
movl 0x4(%rsp), %edx
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x36a2a
jmp 0x3684b
movl 0x4(%rsp), %edx
pushq $0x2a
popq %r9
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %ecx
movl %eax, %r8d
callq 0x36a8d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4a26(%rip), %rsi      # 0x3b285
leaq 0x10faf(%rip), %rdx     # 0x47815
movq %r14, %rdi
movl $0x152, %ecx            # imm = 0x152
xorl %eax, %eax
callq 0x11ae0
movl %eax, %ebx
jmp 0x3684b
movl 0x4(%rsp), %edx
pushq $0x11
popq %r9
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %ecx
movl $0x1003, %r8d           # imm = 0x1003
jmp 0x36846