// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/texture.c
// Function: TextureParameter
static int TextureParameter(lua_State *L) 
/* texture_parameter(texture|target, pname, ...) */
    {
    int arg = 1;
    GLenum target, pname;
    GLuint texture = checktargetorname(L, arg++, &target, DOMAIN_TEXTURE_TARGET);
    pname = checktexturepname(L, arg++);
    
    switch(pname)
        {
        case GL_DEPTH_STENCIL_TEXTURE_MODE: 
                return SetEnum(L, texture, target, pname, arg, DOMAIN_DEPTH_STENCIL);
        case GL_TEXTURE_BASE_LEVEL: 
        case GL_TEXTURE_MAX_LEVEL:  return SetInt(L, texture, target, pname, arg);
        case GL_TEXTURE_BORDER_COLOR:   return SetColor(L, texture, target, pname, arg);
        case GL_TEXTURE_COMPARE_FUNC:
                return SetEnum(L, texture, target, pname, arg, DOMAIN_COMPARE_FUNC);
        case GL_TEXTURE_COMPARE_MODE:   
                return SetEnum(L, texture, target, pname, arg, DOMAIN_COMPARE_MODE);
        case GL_TEXTURE_LOD_BIAS:
        case GL_TEXTURE_MIN_LOD:
        case GL_TEXTURE_MAX_LOD:   return SetFloat(L, texture, target, pname, arg);
        case GL_TEXTURE_SWIZZLE_R:
        case GL_TEXTURE_SWIZZLE_G:
        case GL_TEXTURE_SWIZZLE_B:
        case GL_TEXTURE_SWIZZLE_A:   
                return SetEnum(L, texture, target, pname, arg, DOMAIN_RGBA);
        case GL_TEXTURE_SWIZZLE_RGBA:   
                return SetEnum4(L, texture, target, pname, arg, DOMAIN_RGBA);
        case GL_TEXTURE_MIN_FILTER:
                return SetEnum(L, texture, target, pname, arg, DOMAIN_MIN_FILTER);
        case GL_TEXTURE_MAG_FILTER:  
                return SetEnum(L, texture, target, pname, arg, DOMAIN_MAG_FILTER);
        case GL_TEXTURE_WRAP_S:
        case GL_TEXTURE_WRAP_T:
        case GL_TEXTURE_WRAP_R:  
                return SetEnum(L, texture, target, pname, arg, DOMAIN_WRAP);
        case GL_TEXTURE_MAX_ANISOTROPY:   return SetFloat(L, texture, target, pname, arg); //GL_VERSION_4_6
        default:
            return luaL_error(L, "cannot set parameter '%s'",  luaL_checkstring(L, arg));
        }
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl $0x1, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
incl %eax
movl %eax, 0x24(%rsp)
leaq 0x20(%rsp), %rdx
movl $0x13, %ecx
callq 0x11430
movl %eax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %edx
movl %edx, %eax
incl %eax
movl %eax, 0x24(%rsp)
movl $0x14, %esi
callq 0x11160
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x14(%rsp)
subl $0x1004, %eax           # imm = 0x1004
je 0x48b50
jmp 0x48a19
movl 0x14(%rsp), %eax
subl $0x2800, %eax           # imm = 0x2800
je 0x48c6a
jmp 0x48a2a
movl 0x14(%rsp), %eax
subl $0x2801, %eax           # imm = 0x2801
je 0x48c40
jmp 0x48a3b
movl 0x14(%rsp), %eax
addl $0xffffd7fe, %eax       # imm = 0xFFFFD7FE
subl $0x2, %eax
jb 0x48c91
jmp 0x48a4f
movl 0x14(%rsp), %eax
subl $0x8072, %eax           # imm = 0x8072
je 0x48c91
jmp 0x48a60
movl 0x14(%rsp), %eax
addl $0xffff7ec6, %eax       # imm = 0xFFFF7EC6
subl $0x2, %eax
jb 0x48bc8
jmp 0x48a74
movl 0x14(%rsp), %eax
addl $0xffff7ec4, %eax       # imm = 0xFFFF7EC4
subl $0x2, %eax
jb 0x48b2c
jmp 0x48a88
movl 0x14(%rsp), %eax
subl $0x84fe, %eax           # imm = 0x84FE
je 0x48cb8
jmp 0x48a99
movl 0x14(%rsp), %eax
subl $0x8501, %eax           # imm = 0x8501
je 0x48bc8
jmp 0x48aaa
movl 0x14(%rsp), %eax
subl $0x884c, %eax           # imm = 0x884C
je 0x48b9e
jmp 0x48abb
movl 0x14(%rsp), %eax
subl $0x884d, %eax           # imm = 0x884D
je 0x48b74
jmp 0x48acc
movl 0x14(%rsp), %eax
addl $0xffff71be, %eax       # imm = 0xFFFF71BE
subl $0x4, %eax
jb 0x48bec
jmp 0x48ae0
movl 0x14(%rsp), %eax
subl $0x8e46, %eax           # imm = 0x8E46
je 0x48c16
jmp 0x48af1
movl 0x14(%rsp), %eax
subl $0x90ea, %eax           # imm = 0x90EA
jne 0x48cd9
jmp 0x48b02
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x15, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
callq 0x49390
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
callq 0x49400
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x16, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x17, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
callq 0x49470
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x18, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x18, %r9d
callq 0x494f0
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x1b, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x1a, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl $0x19, %r9d
callq 0x49310
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x24(%rsp), %r8d
callq 0x49470
movl %eax, 0x34(%rsp)
jmp 0x48d0f
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x11450
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x151ae(%rip), %rsi     # 0x5deb2
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)