// File: /workspace/github_c_makefile_star2_O1/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 0x11160
movl %eax, %r15d
cmpl $0x8139, %eax           # imm = 0x8139
jg 0x34f69
cmpl $0x2801, %r15d          # imm = 0x2801
jg 0x34fc2
cmpl $0x1004, %r15d          # imm = 0x1004
je 0x3504c
cmpl $0x2800, %r15d          # imm = 0x2800
je 0x350bc
cmpl $0x2801, %r15d          # imm = 0x2801
jne 0x3513c
movq %rbx, %rdi
movl $0x1b, %esi
movl $0x3, %edx
callq 0x11160
movq 0x21b0c(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x2801, %esi           # imm = 0x2801
jmp 0x35124
cmpl $0x8500, %r15d          # imm = 0x8500
jg 0x34fff
cmpl $0x813a, %r15d          # imm = 0x813A
je 0x35078
cmpl $0x813b, %r15d          # imm = 0x813B
je 0x350df
cmpl $0x84fe, %r15d          # imm = 0x84FE
jne 0x3513c
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21e4b(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x84fe, %esi           # imm = 0x84FE
jmp 0x350ff
leal -0x2802(%r15), %eax
cmpl $0x2, %eax
jb 0x34fdb
cmpl $0x8072, %r15d          # imm = 0x8072
jne 0x3513c
movq %rbx, %rdi
movl $0x19, %esi
movl $0x3, %edx
callq 0x11160
movq 0x21a74(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl %r15d, %esi
jmp 0x35124
cmpl $0x8501, %r15d          # imm = 0x8501
je 0x3509a
cmpl $0x884c, %r15d          # imm = 0x884C
je 0x35103
cmpl $0x884d, %r15d          # imm = 0x884D
jne 0x3513c
movq %rbx, %rdi
movl $0x16, %esi
movl $0x3, %edx
callq 0x11160
movq 0x21a29(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x884d, %esi           # imm = 0x884D
jmp 0x35124
movq %rsp, %r15
movq %rbx, %rdi
movl $0x3, %esi
movq %r15, %rdx
callq 0x11400
movq 0x21c02(%rip), %rax     # 0x56c68
movl %r14d, %edi
movl $0x1004, %esi           # imm = 0x1004
movq %r15, %rdx
callq *(%rax)
jmp 0x35128
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21d70(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x813a, %esi           # imm = 0x813A
jmp 0x350ff
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21d4e(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x8501, %esi           # imm = 0x8501
jmp 0x350ff
movq %rbx, %rdi
movl $0x1a, %esi
movl $0x3, %edx
callq 0x11160
movq 0x21993(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x2800, %esi           # imm = 0x2800
jmp 0x35124
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11a80
cvtsd2ss %xmm0, %xmm0
movq 0x21d09(%rip), %rax     # 0x56e00
movl %r14d, %edi
movl $0x813b, %esi           # imm = 0x813B
callq *(%rax)
jmp 0x35128
movq %rbx, %rdi
movl $0x17, %esi
movl $0x3, %edx
callq 0x11160
movq 0x2194c(%rip), %rcx     # 0x56a68
movl %r14d, %edi
movl $0x884c, %esi           # imm = 0x884C
movl %eax, %edx
callq *(%rcx)
movq %rbx, %rdi
callq 0x11880
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xa142(%rip), %rsi      # 0x3f285
leaq 0x15fdf(%rip), %rdx     # 0x4b129
movq %rbx, %rdi
movl $0x6c, %ecx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x11ae0