// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x4(%rsp), %rdx
movl $0x1, %esi
movl $0x36, %ecx
callq 0x11420
movl %eax, %ebx
movq %r14, %rdi
movl $0x39, %esi
movl $0x2, %edx
callq 0x11150
cmpl $0x88ba, %eax           # imm = 0x88BA
jle 0x128e8
cmpl $0x911e, %eax           # imm = 0x911E
jle 0x12943
cmpl $0x911f, %eax           # imm = 0x911F
je 0x1298a
cmpl $0x9120, %eax           # imm = 0x9120
je 0x129c1
cmpl $0x9121, %eax           # imm = 0x9121
jne 0x129e1
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x9121, %ecx           # imm = 0x9121
jmp 0x129cf
cmpl $0x8763, %eax           # imm = 0x8763
jg 0x1291b
cmpl $0x821f, %eax           # imm = 0x821F
je 0x12965
cmpl $0x8220, %eax           # imm = 0x8220
jne 0x129e1
movl 0x4(%rsp), %esi
leaq 0x44cd4(%rip), %r8      # 0x575e0
movq %r14, %rdi
movl %ebx, %edx
movl $0x8220, %ecx           # imm = 0x8220
jmp 0x1299f
cmpl $0x8764, %eax           # imm = 0x8764
je 0x1297a
cmpl $0x8765, %eax           # imm = 0x8765
jne 0x129e1
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x8765, %ecx           # imm = 0x8765
movl $0x38, %r8d
jmp 0x129ba
cmpl $0x88bb, %eax           # imm = 0x88BB
je 0x129a6
cmpl $0x88bc, %eax           # imm = 0x88BC
jne 0x129e1
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x88bc, %ecx           # imm = 0x88BC
jmp 0x12973
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x821f, %ecx           # imm = 0x821F
callq 0x131d2
jmp 0x129d4
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x8764, %ecx           # imm = 0x8764
jmp 0x129cf
movl 0x4(%rsp), %esi
leaq 0x44cc3(%rip), %r8      # 0x57658
movq %r14, %rdi
movl %ebx, %edx
movl $0x911f, %ecx           # imm = 0x911F
callq 0x13181
jmp 0x129d9
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x88bb, %ecx           # imm = 0x88BB
movl $0x3a, %r8d
callq 0x13131
jmp 0x129d9
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl $0x9120, %ecx           # imm = 0x9120
callq 0x130ed
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2c89d(%rip), %rsi     # 0x3f285
leaq 0x394c5(%rip), %rdx     # 0x4beb4
movq %r14, %rdi
movl $0x1c3, %ecx            # imm = 0x1C3
xorl %eax, %eax
callq 0x11ae0
jmp 0x129d9