// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/sampler.c
// Function: SamplerParameter
static int SamplerParameter(lua_State *L)
    {
    GLuint sampler = luaL_checkinteger(L, 1);
    GLenum pname = checksamplerpname(L, 2);
    switch(pname)
        {
        case GL_TEXTURE_WRAP_S:
        case GL_TEXTURE_WRAP_T: 
        case GL_TEXTURE_WRAP_R: return SetEnum(L, sampler, pname, 3, DOMAIN_WRAP);
        case GL_TEXTURE_MIN_FILTER:  return SetEnum(L, sampler, pname, 3, DOMAIN_MIN_FILTER);
        case GL_TEXTURE_MAG_FILTER:  return SetEnum(L, sampler, pname, 3, DOMAIN_MAG_FILTER);
        case GL_TEXTURE_BORDER_COLOR:  return SetColor(L, sampler, pname, 3);
        case GL_TEXTURE_MIN_LOD:  return SetFloat(L, sampler, pname, 3);
        case GL_TEXTURE_MAX_LOD:  return SetFloat(L, sampler, pname, 3);
        case GL_TEXTURE_LOD_BIAS: return SetFloat(L, sampler, pname, 3);
        case GL_TEXTURE_COMPARE_MODE:  return SetEnum(L, sampler, pname, 3, DOMAIN_COMPARE_MODE);
        case GL_TEXTURE_COMPARE_FUNC:  return SetEnum(L, sampler, pname, 3, DOMAIN_COMPARE_FUNC);
        case GL_TEXTURE_MAX_ANISOTROPY:  return SetFloat(L, sampler, pname, 3); //GL_VERSION_4_6
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    CheckError(L);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %esi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x43, %esi
movl $0x2, %edx
callq 0x11150
movl %eax, %r15d
cmpl $0x8139, %eax           # imm = 0x8139
jg 0x35001
cmpl $0x2801, %r15d          # imm = 0x2801
jg 0x3505a
cmpl $0x1004, %r15d          # imm = 0x1004
je 0x350e4
cmpl $0x2800, %r15d          # imm = 0x2800
je 0x35154
cmpl $0x2801, %r15d          # imm = 0x2801
jne 0x351d4
movq %rbx, %rdi
movl $0x1b, %esi
movl $0x3, %edx
callq 0x11150
movq 0x21a74(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x2801, %esi           # imm = 0x2801
jmp 0x351bc
cmpl $0x8500, %r15d          # imm = 0x8500
jg 0x35097
cmpl $0x813a, %r15d          # imm = 0x813A
je 0x35110
cmpl $0x813b, %r15d          # imm = 0x813B
je 0x35177
cmpl $0x84fe, %r15d          # imm = 0x84FE
jne 0x351d4
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21db3(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x84fe, %esi           # imm = 0x84FE
jmp 0x35197
leal -0x2802(%r15), %eax
cmpl $0x2, %eax
jb 0x35073
cmpl $0x8072, %r15d          # imm = 0x8072
jne 0x351d4
movq %rbx, %rdi
movl $0x19, %esi
movl $0x3, %edx
callq 0x11150
movq 0x219dc(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl %r15d, %esi
jmp 0x351bc
cmpl $0x8501, %r15d          # imm = 0x8501
je 0x35132
cmpl $0x884c, %r15d          # imm = 0x884C
je 0x3519b
cmpl $0x884d, %r15d          # imm = 0x884D
jne 0x351d4
movq %rbx, %rdi
movl $0x16, %esi
movl $0x3, %edx
callq 0x11150
movq 0x21991(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x884d, %esi           # imm = 0x884D
jmp 0x351bc
movq %rsp, %r15
movq %rbx, %rdi
movl $0x3, %esi
movq %r15, %rdx
callq 0x113f0
movq 0x21b6a(%rip), %rax     # 0x56c68
movl %r14d, %edi
movl $0x1004, %esi           # imm = 0x1004
movq %r15, %rdx
callq *(%rax)
jmp 0x351c0
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21cd8(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x813a, %esi           # imm = 0x813A
jmp 0x35197
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21cb6(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x8501, %esi           # imm = 0x8501
jmp 0x35197
movq %rbx, %rdi
movl $0x1a, %esi
movl $0x3, %edx
callq 0x11150
movq 0x218fb(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x2800, %esi           # imm = 0x2800
jmp 0x351bc
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21c71(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x813b, %esi           # imm = 0x813B
callq *(%rax)
jmp 0x351c0
movq %rbx, %rdi
movl $0x17, %esi
movl $0x3, %edx
callq 0x11150
movq 0x218b4(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x884c, %esi           # imm = 0x884C
movl %eax, %edx
callq *(%rcx)
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xa0aa(%rip), %rsi      # 0x3f285
leaq 0x15f47(%rip), %rdx     # 0x4b129
movq %rbx, %rdi
movl $0x6c, %ecx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x11ae0