// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rdx
movl $0x1, %esi
movl $0x36, %ecx
callq 0x11430
movl %eax, %ebp
movq %rbx, %rdi
movl $0x39, %esi
movl $0x2, %edx
callq 0x11160
cmpl $0x88ba, %eax           # imm = 0x88BA
jle 0x128e3
cmpl $0x911e, %eax           # imm = 0x911E
jle 0x12946
cmpl $0x911f, %eax           # imm = 0x911F
je 0x1298d
cmpl $0x9120, %eax           # imm = 0x9120
je 0x129ce
cmpl $0x9121, %eax           # imm = 0x9121
jne 0x129f9
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x9121, %ecx           # imm = 0x9121
jmp 0x129dc
cmpl $0x8763, %eax           # imm = 0x8763
jg 0x1291b
cmpl $0x821f, %eax           # imm = 0x821F
je 0x12968
cmpl $0x8220, %eax           # imm = 0x8220
jne 0x129f9
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x8220, %ecx           # imm = 0x8220
callq 0x130df
leaq 0x44cca(%rip), %rdx     # 0x575e0
jmp 0x129a7
cmpl $0x8764, %eax           # imm = 0x8764
je 0x1297d
cmpl $0x8765, %eax           # imm = 0x8765
jne 0x129f9
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x8765, %ecx           # imm = 0x8765
movl $0x38, %r8d
jmp 0x129c7
cmpl $0x88bb, %eax           # imm = 0x88BB
je 0x129b3
cmpl $0x88bc, %eax           # imm = 0x88BC
jne 0x129f9
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x88bc, %ecx           # imm = 0x88BC
jmp 0x12976
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x821f, %ecx           # imm = 0x821F
callq 0x1305a
jmp 0x129ed
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x8764, %ecx           # imm = 0x8764
jmp 0x129dc
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x911f, %ecx           # imm = 0x911F
callq 0x130df
leaq 0x44cb1(%rip), %rdx     # 0x57658
movq %rbx, %rdi
movl %eax, %esi
callq 0x115b0
jmp 0x129f2
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x88bb, %ecx           # imm = 0x88BB
movl $0x3a, %r8d
callq 0x1300a
jmp 0x129f2
movl 0x4(%rsp), %esi
movq %rbx, %rdi
movl %ebp, %edx
movl $0x9120, %ecx           # imm = 0x9120
callq 0x130a5
cvtsi2sd %eax, %xmm0
movq %rbx, %rdi
callq 0x11380
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2c885(%rip), %rsi     # 0x3f285
leaq 0x394ad(%rip), %rdx     # 0x4beb4
movq %rbx, %rdi
movl $0x1c3, %ecx            # imm = 0x1C3
xorl %eax, %eax
callq 0x11ae0
jmp 0x129f2