// File: /workspace/github_c_makefile_star2_O2/stetre[P]moongl/src/buffer.c
// Function: GetBufferParameter
static int GetBufferParameter(lua_State *L)
/* get_buffer_parameter(target|buffer, pname) */
    {
    GLenum target;
    GLuint buffer = checktargetorname(L, 1, &target, DOMAIN_BUFFER_TARGET);
    GLenum pname = checkbufferpname(L, 2);
    switch(pname)
        {
        case GL_BUFFER_SIZE: return GetInt64(L, target, buffer, pname);
        case GL_BUFFER_USAGE: return GetEnum(L, target, buffer, pname, DOMAIN_BUFFER_USAGE);
        case GL_BUFFER_ACCESS: return GetEnum(L, target, buffer, pname, DOMAIN_BUFFER_ACCESS);
        case GL_BUFFER_ACCESS_FLAGS:
                    return GetBitfield(L, target, buffer, pname, &AccessFlagsBitfield);
        case GL_BUFFER_IMMUTABLE_STORAGE: return GetBoolean(L, target, buffer, pname);
        case GL_BUFFER_MAPPED: return GetBoolean(L, target, buffer, pname);
/*      case GL_BUFFER_MAP_POINTER: NOT_AVAILABLE; used internally (see mapbuffer.c) */
        case GL_BUFFER_MAP_OFFSET: return GetInt64(L, target, buffer, pname);
        case GL_BUFFER_MAP_LENGTH: return GetInt64(L, target, buffer, pname);
        case GL_BUFFER_STORAGE_FLAGS: 
                    return GetBitfield(L, target, buffer, pname, &StorageFlagsBitfield);
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0xc(%rsp), %rdx
pushq $0x36
popq %rcx
movl %ebx, %esi
callq 0x11420
movl %eax, %ebp
pushq $0x39
popq %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x11150
cmpl $0x821f, %eax           # imm = 0x821F
je 0x12891
cmpl $0x8220, %eax           # imm = 0x8220
je 0x128e2
cmpl $0x9121, %eax           # imm = 0x9121
je 0x128cd
cmpl $0x8765, %eax           # imm = 0x8765
je 0x12851
cmpl $0x88bb, %eax           # imm = 0x88BB
je 0x12875
cmpl $0x88bc, %eax           # imm = 0x88BC
je 0x128b8
cmpl $0x911f, %eax           # imm = 0x911F
je 0x128a1
cmpl $0x9120, %eax           # imm = 0x9120
je 0x12865
cmpl $0x8764, %eax           # imm = 0x8764
jne 0x128fe
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl $0x8764, %ecx           # imm = 0x8764
jmp 0x128db
movl 0xc(%rsp), %esi
pushq $0x38
popq %r8
movq %r14, %rdi
movl %ebp, %edx
movl $0x8765, %ecx           # imm = 0x8765
jmp 0x12887
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl $0x9120, %ecx           # imm = 0x9120
jmp 0x128db
movl 0xc(%rsp), %esi
pushq $0x3a
popq %r8
movq %r14, %rdi
movl %ebp, %edx
movl $0x88bb, %ecx           # imm = 0x88BB
callq 0x12ef2
jmp 0x1291b
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl $0x821f, %ecx           # imm = 0x821F
jmp 0x128c6
movl 0xc(%rsp), %esi
leaq 0x43dac(%rip), %r8      # 0x56658
movq %r14, %rdi
movl %ebp, %edx
movl $0x911f, %ecx           # imm = 0x911F
jmp 0x128f7
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl $0x88bc, %ecx           # imm = 0x88BC
callq 0x12f65
jmp 0x1291d
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl $0x9121, %ecx           # imm = 0x9121
callq 0x12edc
jmp 0x1291d
movl 0xc(%rsp), %esi
leaq 0x43cf3(%rip), %r8      # 0x565e0
movq %r14, %rdi
movl %ebp, %edx
movl $0x8220, %ecx           # imm = 0x8220
callq 0x12f42
jmp 0x1291b
leaq 0x28980(%rip), %rsi     # 0x3b285
leaq 0x355d0(%rip), %rdx     # 0x47edc
movq %r14, %rdi
movl $0x1c3, %ecx            # imm = 0x1C3
xorl %eax, %eax
callq 0x11ae0
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq