// File: /workspace/github_c_makefile_star2_O2/stetre[P]moongl/src/proginterface.c
// Function: GetProgramResource
static int GetProgramResource(lua_State *L)
    {
    GLuint prog = luaL_checkinteger(L, 1);
    GLenum itf = checkinterface(L, 2);
    GLuint index = luaL_checkinteger(L, 3);
    GLenum prop = checkresourceproperty(L, 4);
    switch(prop)
        {
        case GL_ACTIVE_VARIABLES: return GetActiveVariables(L, prog, itf, index, prop);
        case GL_ARRAY_SIZE: return GetPropInt(L, prog, itf, index, prop);
        case GL_ARRAY_STRIDE: return GetPropInt(L, prog, itf, index, prop);
        case GL_ATOMIC_COUNTER_BUFFER_INDEX: return GetPropInt(L, prog, itf, index, prop);
        case GL_BLOCK_INDEX: return GetPropInt(L, prog, itf, index, prop);
        case GL_BUFFER_BINDING: return GetPropInt(L, prog, itf, index, prop);
        case GL_BUFFER_DATA_SIZE: return GetPropInt(L, prog, itf, index, prop);
        case GL_IS_PER_PATCH: return GetPropBoolean(L, prog, itf, index, prop);
        case GL_IS_ROW_MAJOR: return GetPropBoolean(L, prog, itf, index, prop);
        case GL_LOCATION: return GetPropInt(L, prog, itf, index, prop);
        case GL_LOCATION_COMPONENT: return GetPropInt(L, prog, itf, index, prop);
        case GL_LOCATION_INDEX: return GetPropInt(L, prog, itf, index, prop);
        case GL_MATRIX_STRIDE: return GetPropInt(L, prog, itf, index, prop);
        case GL_NAME_LENGTH: return GetPropInt(L, prog, itf, index, prop);
        case GL_NUM_ACTIVE_VARIABLES: return GetPropInt(L, prog, itf, index, prop);
        case GL_OFFSET: return GetPropInt(L, prog, itf, index, prop);
        case GL_REFERENCED_BY_VERTEX_SHADER: return GetPropInt(L, prog, itf, index, prop);
        case GL_REFERENCED_BY_TESS_CONTROL_SHADER: return GetPropInt(L, prog, itf, index, prop);
        case GL_REFERENCED_BY_TESS_EVALUATION_SHADER: return GetPropInt(L, prog, itf, index, prop);
        case GL_REFERENCED_BY_GEOMETRY_SHADER: return GetPropInt(L, prog, itf, index, prop);
        case GL_REFERENCED_BY_FRAGMENT_SHADER:  return GetPropInt(L, prog, itf, index, prop);
        case GL_REFERENCED_BY_COMPUTE_SHADER:  return GetPropInt(L, prog, itf, index, prop);
        case GL_TOP_LEVEL_ARRAY_SIZE: return GetPropInt(L, prog, itf, index, prop);
        case GL_TOP_LEVEL_ARRAY_STRIDE: return GetPropInt(L, prog, itf, index, prop);
        case GL_TRANSFORM_FEEDBACK_BUFFER_INDEX: return GetPropInt(L, prog, itf, index, prop);
        case GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE: return GetPropInt(L, prog, itf, index, prop);
        case GL_TYPE: return GetPropType(L, prog, itf, index, prop);
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
pushq $0x1
popq %r13
movl %r13d, %esi
callq 0x11af0
movq %rax, %r12
pushq $0x40
popq %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x11150
movl %eax, %ebp
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x11af0
movq %rax, %r15
pushq $0x42
popq %rsi
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x11150
leal -0x92e7(%rax), %ecx
cmpl $0x28, %ecx
ja 0x3055b
leaq 0x16708(%rip), %rax     # 0x46c44
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92e7, %r8d           # imm = 0x92E7
jmp 0x305f6
cmpl $0x934a, %eax           # imm = 0x934A
je 0x3086e
cmpl $0x934b, %eax           # imm = 0x934B
je 0x30881
cmpl $0x934c, %eax           # imm = 0x934C
jne 0x3058e
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x934c, %r8d           # imm = 0x934C
jmp 0x30892
leaq 0xacf0(%rip), %rsi      # 0x3b285
leaq 0x167ee(%rip), %rdx     # 0x46d8a
movq %r14, %rdi
movl $0xce, %ecx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x930f, %r8d           # imm = 0x930F
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x930a, %r8d           # imm = 0x930A
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9300, %r8d           # imm = 0x9300
callq 0x30a67
jmp 0x30897
leaq 0x8(%rsp), %rax
movl $0x9305, (%rax)         # imm = 0x9305
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl $0x92f7, %ecx           # imm = 0x92F7
callq 0x309dd
movl %eax, 0xc(%rsp)
movslq %eax, %r13
leaq (,%r13,4), %rsi
movq %r14, %rdi
callq 0x111f0
movq %rax, %rbx
movq 0x250ca(%rip), %rax     # 0x55708
leaq 0x10(%rsp), %r10
pushq $0x1
popq %rcx
movl %r12d, %edi
movl %ebp, %esi
movl %r15d, %edx
leaq 0x8(%rsp), %r8
movl %r13d, %r9d
pushq %rbx
pushq %r10
callq *(%rax)
addq $0x10, %rsp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11540
xorl %r15d, %r15d
testl %r13d, %r13d
cmovlel %r15d, %r13d
cmpq %r15, %r13
je 0x3068a
movslq (%rbx,%r15,4), %rsi
movq %r14, %rdi
callq 0x113b0
incq %r15
jmp 0x30674
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11360
movl 0xc(%rsp), %r13d
jmp 0x30897
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92ff, %r8d           # imm = 0x92FF
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x930c, %r8d           # imm = 0x930C
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92fc, %r8d           # imm = 0x92FC
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x930b, %r8d           # imm = 0x930B
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9308, %r8d           # imm = 0x9308
jmp 0x30892
leaq 0x8(%rsp), %r8
movl $0x92fa, (%r8)          # imm = 0x92FA
movq 0x24fe8(%rip), %rax     # 0x55708
leaq 0x14(%rsp), %rbx
leaq 0x10(%rsp), %r10
pushq $0x1
popq %r13
movl %r12d, %edi
movl %ebp, %esi
movl %r15d, %edx
movl %r13d, %ecx
movl %r13d, %r9d
pushq %rbx
pushq %r10
callq *(%rax)
addq $0x10, %rsp
movq %r14, %rdi
callq 0x11870
movl (%rbx), %edx
pushq $0xe
popq %rsi
movq %r14, %rdi
callq 0x11110
jmp 0x30897
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9309, %r8d           # imm = 0x9309
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x930d, %r8d           # imm = 0x930D
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9302, %r8d           # imm = 0x9302
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9303, %r8d           # imm = 0x9303
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92fb, %r8d           # imm = 0x92FB
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92f9, %r8d           # imm = 0x92F9
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9306, %r8d           # imm = 0x9306
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92fd, %r8d           # imm = 0x92FD
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9301, %r8d           # imm = 0x9301
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x930e, %r8d           # imm = 0x930E
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9307, %r8d           # imm = 0x9307
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x9304, %r8d           # imm = 0x9304
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x92fe, %r8d           # imm = 0x92FE
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x934a, %r8d           # imm = 0x934A
jmp 0x30892
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x934b, %r8d           # imm = 0x934B
callq 0x30a0e
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq