// File: /workspace/github_c_makefile_star2_O1/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, %rbx
leaq 0x4(%rsp), %rdx
movl $0x1, %esi
movl $0x13, %ecx
callq 0x11430
movl %eax, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x1d, %esi
movl $0x3, %edx
callq 0x11160
cmpl $0x8c0f, %eax           # imm = 0x8C0F
jg 0x39898
cmpl $0x869f, %eax           # imm = 0x869F
jg 0x398e8
leal -0x805c(%rax), %ecx
cmpl $0x15, %ecx
ja 0x39864
movl $0x20000f, %edx         # imm = 0x20000F
btl %ecx, %edx
jb 0x3990c
leal -0x1000(%rax), %ecx
cmpl $0x2, %ecx
jb 0x3990c
cmpl $0x1003, %eax           # imm = 0x1003
jne 0x39964
movl 0x4(%rsp), %edx
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %ecx
movl $0x1003, %r8d           # imm = 0x1003
movl $0x11, %r9d
jmp 0x398c3
cmpl $0x8c3e, %eax           # imm = 0x8C3E
jg 0x398ca
leal -0x8c10(%rax), %ecx
cmpl $0x4, %ecx
jae 0x39959
movl 0x4(%rsp), %edx
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %ecx
movl %eax, %r8d
movl $0x2a, %r9d
callq 0x39b86
jmp 0x39923
cmpl $0x919c, %eax           # imm = 0x919C
jg 0x398ff
cmpl $0x8c3f, %eax           # imm = 0x8C3F
je 0x3990c
cmpl $0x9106, %eax           # imm = 0x9106
je 0x3990c
cmpl $0x9107, %eax           # imm = 0x9107
je 0x39937
jmp 0x39964
cmpl $0x86a0, %eax           # imm = 0x86A0
je 0x3990c
cmpl $0x86a1, %eax           # imm = 0x86A1
je 0x39937
cmpl $0x884a, %eax           # imm = 0x884A
je 0x3990c
jmp 0x39964
movl %eax, %ecx
addl $0xffff6e63, %ecx       # imm = 0xFFFF6E63
cmpl $0x2, %ecx
jae 0x39964
movl 0x4(%rsp), %edx
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x39b23
movl $0x1, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rsp), %edx
movl $0x1, %r15d
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %ecx
movl %eax, %r8d
movl $0x1, %r9d
callq 0x39b23
jmp 0x39929
cmpl $0x8c16, %eax           # imm = 0x8C16
je 0x398ae
leaq 0x591a(%rip), %rsi      # 0x3f285
leaq 0x11e7b(%rip), %rdx     # 0x4b7ed
movq %rbx, %rdi
movl $0x152, %ecx            # imm = 0x152
xorl %eax, %eax
callq 0x11ae0
movl %eax, %r15d
jmp 0x39929