// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/sampler.c
// Function: GetSamplerParameter
static int GetSamplerParameter(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 GetEnum(L, sampler, pname, DOMAIN_WRAP);
        case GL_TEXTURE_MIN_FILTER:  return GetEnum(L, sampler, pname, DOMAIN_MIN_FILTER);
        case GL_TEXTURE_MAG_FILTER:  return GetEnum(L, sampler, pname, DOMAIN_MAG_FILTER);
        case GL_TEXTURE_BORDER_COLOR:  return GetFloat4(L, sampler, pname);
        case GL_TEXTURE_MIN_LOD:  return GetFloat(L, sampler, pname);
        case GL_TEXTURE_MAX_LOD:  return GetFloat(L, sampler, pname);
        case GL_TEXTURE_LOD_BIAS: return GetFloat(L, sampler, pname);
        case GL_TEXTURE_COMPARE_MODE:  return GetEnum(L, sampler, pname, DOMAIN_COMPARE_MODE);
        case GL_TEXTURE_COMPARE_FUNC: return GetEnum(L, sampler, pname, DOMAIN_COMPARE_FUNC);
        case GL_TEXTURE_MAX_ANISOTROPY:  return GetFloat(L, sampler, pname); //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
cmpl $0x8139, %eax           # imm = 0x8139
jg 0x35287
cmpl $0x2801, %eax           # imm = 0x2801
jg 0x352d2
cmpl $0x1004, %eax           # imm = 0x1004
je 0x35364
cmpl $0x2800, %eax           # imm = 0x2800
je 0x35405
cmpl $0x2801, %eax           # imm = 0x2801
jne 0x3549d
movq 0x21a91(%rip), %rax     # 0x56cf0
movq %rsp, %r15
movl %r14d, %edi
movl $0x2801, %esi           # imm = 0x2801
movq %r15, %rdx
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x1b, %esi
jmp 0x35489
cmpl $0x8500, %eax           # imm = 0x8500
jg 0x35314
cmpl $0x813a, %eax           # imm = 0x813A
je 0x353cd
cmpl $0x813b, %eax           # imm = 0x813B
je 0x35431
cmpl $0x84fe, %eax           # imm = 0x84FE
jne 0x3549d
movq %rbx, %rdi
callq 0x11870
movq 0x21216(%rip), %rax     # 0x564d8
movq %rsp, %r15
movl %r14d, %edi
movl $0x84fe, %esi           # imm = 0x84FE
jmp 0x3544b
leal -0x2802(%rax), %ecx
cmpl $0x2, %ecx
jb 0x352e8
cmpl $0x8072, %eax           # imm = 0x8072
jne 0x3549d
movq 0x21a01(%rip), %rcx     # 0x56cf0
movq %rsp, %r15
movl %r14d, %edi
movl %eax, %esi
movq %r15, %rdx
callq *(%rcx)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x19, %esi
jmp 0x35489
cmpl $0x8501, %eax           # imm = 0x8501
je 0x353e9
cmpl $0x884c, %eax           # imm = 0x884C
je 0x3545f
cmpl $0x884d, %eax           # imm = 0x884D
jne 0x3549d
movq 0x219b4(%rip), %rax     # 0x56cf0
movq %rsp, %r15
movl %r14d, %edi
movl $0x884d, %esi           # imm = 0x884D
movq %r15, %rdx
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x16, %esi
jmp 0x35489
movq %rbx, %rdi
callq 0x11870
movq 0x21165(%rip), %rax     # 0x564d8
movq %rsp, %r15
movl %r14d, %edi
movl $0x1004, %esi           # imm = 0x1004
movq %r15, %rdx
callq *(%rax)
cvtss2sd (%r15), %xmm0
movq %rbx, %rdi
callq 0x11370
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r15), %xmm0
movq %rbx, %rdi
callq 0x11370
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r15), %xmm0
movq %rbx, %rdi
callq 0x11370
xorps %xmm0, %xmm0
cvtss2sd 0xc(%r15), %xmm0
movq %rbx, %rdi
callq 0x11370
movl $0x4, %eax
jmp 0x35493
movq %rbx, %rdi
callq 0x11870
movq 0x210fc(%rip), %rax     # 0x564d8
movq %rsp, %r15
movl %r14d, %edi
movl $0x813a, %esi           # imm = 0x813A
jmp 0x3544b
movq %rbx, %rdi
callq 0x11870
movq 0x210e0(%rip), %rax     # 0x564d8
movq %rsp, %r15
movl %r14d, %edi
movl $0x8501, %esi           # imm = 0x8501
jmp 0x3544b
movq 0x218e4(%rip), %rax     # 0x56cf0
movq %rsp, %r15
movl %r14d, %edi
movl $0x2800, %esi           # imm = 0x2800
movq %r15, %rdx
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x1a, %esi
jmp 0x35489
movq %rbx, %rdi
callq 0x11870
movq 0x21098(%rip), %rax     # 0x564d8
movq %rsp, %r15
movl %r14d, %edi
movl $0x813b, %esi           # imm = 0x813B
movq %r15, %rdx
callq *(%rax)
cvtss2sd (%r15), %xmm0
movq %rbx, %rdi
callq 0x11370
jmp 0x3548e
movq 0x2188a(%rip), %rax     # 0x56cf0
movq %rsp, %r15
movl %r14d, %edi
movl $0x884c, %esi           # imm = 0x884C
movq %r15, %rdx
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x17, %esi
callq 0x11110
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9de1(%rip), %rsi      # 0x3f285
leaq 0x15c7e(%rip), %rdx     # 0x4b129
movq %rbx, %rdi
movl $0xa7, %ecx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x11ae0
nop