// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/texture.c
// Function: GetTextureParameter
static int GetTextureParameter(lua_State *L) 
/* get_texture_parameter(texture|target, pname) */
    {
    GLenum target, pname;
    GLuint texture = checktargetorname(L, 1, &target, DOMAIN_TEXTURE_TARGET);
    pname = checktexturepname(L, 2);

    switch(pname)
        {
        case GL_DEPTH_STENCIL_TEXTURE_MODE:
                return GetEnum(L, texture, target, pname, DOMAIN_DEPTH_STENCIL);
        case GL_TEXTURE_BASE_LEVEL: 
        case GL_TEXTURE_MAX_LEVEL:  return GetInt(L, texture, target, pname);

        case GL_TEXTURE_BORDER_COLOR:   return GetFloat4(L, texture, target, pname);
        case GL_TEXTURE_COMPARE_FUNC:
                return GetEnum(L, texture, target, pname, DOMAIN_COMPARE_FUNC);
        case GL_TEXTURE_COMPARE_MODE:
                return GetEnum(L, texture, target, pname, DOMAIN_COMPARE_MODE);
        case GL_TEXTURE_LOD_BIAS:
        case GL_TEXTURE_MIN_LOD:
        case GL_TEXTURE_MAX_LOD:    return GetFloat(L, texture, target, pname);
        case GL_TEXTURE_SWIZZLE_R:
        case GL_TEXTURE_SWIZZLE_G:
        case GL_TEXTURE_SWIZZLE_B:
        case GL_TEXTURE_SWIZZLE_A:  
                return GetEnum(L, texture, target, pname, DOMAIN_RGBA);
        case GL_TEXTURE_SWIZZLE_RGBA: 
            return GetEnum4(L, texture, target, pname, DOMAIN_RGBA);

        case GL_TEXTURE_MIN_FILTER:
                return GetEnum(L, texture, target, pname, DOMAIN_MIN_FILTER);
        case GL_TEXTURE_MAG_FILTER:
                return GetEnum(L, texture, target, pname, DOMAIN_MAG_FILTER);

        case GL_TEXTURE_WRAP_S:
        case GL_TEXTURE_WRAP_T:
        case GL_TEXTURE_WRAP_R:
                return GetEnum(L, texture, target, pname, DOMAIN_WRAP);
        case GL_IMAGE_FORMAT_COMPATIBILITY_TYPE:
                return GetEnum(L, texture, target, pname, DOMAIN_IMAGE_FORMAT_COMPATIBILITY);
        case GL_TEXTURE_IMMUTABLE_FORMAT:   return GetBoolean(L, texture, target, pname); 
        case GL_TEXTURE_IMMUTABLE_LEVELS:
        case GL_TEXTURE_VIEW_MIN_LEVEL:
        case GL_TEXTURE_VIEW_NUM_LEVELS:
        case GL_TEXTURE_VIEW_MIN_LAYER:
        case GL_TEXTURE_VIEW_NUM_LAYERS:    return GetInt(L, texture, target, pname);
        case GL_TEXTURE_TARGET:     return GetInt(L, texture, target, pname);
        case GL_TEXTURE_MAX_ANISOTROPY:    return GetFloat(L, texture, target, pname); //GL_VERSION_4_6
        default:
            {
            const char *name = luaL_checkstring(L, 2);
            return luaL_error(L, "cannot get parameter '%s'", name);
            }
        }
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x24(%rsp), %rdx
movl $0x13, %ecx
callq 0x11430
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
movl $0x14, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
subl $0x1004, %eax           # imm = 0x1004
je 0x48ee9
jmp 0x48d73
movl 0xc(%rsp), %eax
subl $0x1006, %eax           # imm = 0x1006
je 0x49093
jmp 0x48d84
movl 0xc(%rsp), %eax
subl $0x2800, %eax           # imm = 0x2800
je 0x48fe0
jmp 0x48d95
movl 0xc(%rsp), %eax
subl $0x2801, %eax           # imm = 0x2801
je 0x48fbb
jmp 0x48da6
movl 0xc(%rsp), %eax
addl $0xffffd7fe, %eax       # imm = 0xFFFFD7FE
subl $0x2, %eax
jb 0x49005
jmp 0x48dba
movl 0xc(%rsp), %eax
subl $0x8072, %eax           # imm = 0x8072
je 0x49005
jmp 0x48dcb
movl 0xc(%rsp), %eax
addl $0xffff7ec6, %eax       # imm = 0xFFFF7EC6
subl $0x2, %eax
jb 0x48f52
jmp 0x48ddf
movl 0xc(%rsp), %eax
addl $0xffff7ec4, %eax       # imm = 0xFFFF7EC4
subl $0x2, %eax
jb 0x48ec7
jmp 0x48df3
movl 0xc(%rsp), %eax
addl $0xffff7d25, %eax       # imm = 0xFFFF7D25
subl $0x5, %eax
jb 0x49074
jmp 0x48e07
movl 0xc(%rsp), %eax
subl $0x84fe, %eax           # imm = 0x84FE
je 0x490b2
jmp 0x48e18
movl 0xc(%rsp), %eax
subl $0x8501, %eax           # imm = 0x8501
je 0x48f52
jmp 0x48e29
movl 0xc(%rsp), %eax
subl $0x884c, %eax           # imm = 0x884C
je 0x48f2d
jmp 0x48e3a
movl 0xc(%rsp), %eax
subl $0x884d, %eax           # imm = 0x884D
je 0x48f08
jmp 0x48e4b
movl 0xc(%rsp), %eax
addl $0xffff71be, %eax       # imm = 0xFFFF71BE
subl $0x4, %eax
jb 0x48f71
jmp 0x48e5f
movl 0xc(%rsp), %eax
subl $0x8e46, %eax           # imm = 0x8E46
je 0x48f96
jmp 0x48e70
movl 0xc(%rsp), %eax
subl $0x90c7, %eax           # imm = 0x90C7
je 0x4902a
jmp 0x48e81
movl 0xc(%rsp), %eax
subl $0x90ea, %eax           # imm = 0x90EA
je 0x48ea2
jmp 0x48e8e
movl 0xc(%rsp), %eax
subl $0x912f, %eax           # imm = 0x912F
je 0x4904f
jmp 0x490ce
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x15, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
xorl %r8d, %r8d
callq 0x49650
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
callq 0x496e0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x16, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x17, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
callq 0x49790
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x18, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x18, %r8d
callq 0x49800
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x1b, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x1a, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x19, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x1c, %r8d
callq 0x495d0
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl $0x1, %r8d
callq 0x49650
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
xorl %r8d, %r8d
callq 0x49650
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
xorl %r8d, %r8d
callq 0x49650
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
callq 0x49790
movl %eax, 0x34(%rsp)
jmp 0x49102
movq 0x28(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x11450
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x14dd5(%rip), %rsi     # 0x5decc
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)