// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x11af0
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x40, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movl $0x3, %esi
callq 0x11af0
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movl $0x42, %esi
movl $0x4, %edx
callq 0x11160
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
addl $0xffff6d19, %eax       # imm = 0xFFFF6D19
movl %eax, %ecx
movq %rcx, (%rsp)
subl $0x65, %eax
ja 0x3f11e
movq (%rsp), %rax
leaq 0x1e4b6(%rip), %rcx     # 0x5d208
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f360
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f4d0
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f4d0
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f450
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x3f550
movl %eax, 0x24(%rsp)
jmp 0x3f141
movq 0x18(%rsp), %rdi
leaq 0x1315b(%rip), %rsi     # 0x52285
leaq 0x1e311(%rip), %rdx     # 0x5d442
movl $0xce, %ecx
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)