// File: /workspace/github_c_makefile_star2_O2/stetre[P]moongl/src/framebuffer.c
// Function: GetFramebufferAttachmentParameter
static int GetFramebufferAttachmentParameter(lua_State *L)
    {
    GLenum target;
    GLuint framebuffer = checktargetorname(L, 1, &target, DOMAIN_FRAMEBUFFER_TARGET);
    GLenum attachment = checkbuffer(L, 2);
    GLenum pname = checkframebufferapname(L, 3);
    switch(pname)
        {
        case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
                return AGetEnum(L, target, framebuffer, attachment, pname, DOMAIN_OBJECT_TYPE);
        case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
                        return AGetInt(L, target, framebuffer, attachment, pname);
        case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
                return AGetEnum(L, target, framebuffer, attachment, pname, DOMAIN_COMPONENT_TYPE);
        case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
        case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
        case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 
        case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 
        case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
        case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 
                            return AGetInt(L, target, framebuffer, attachment, pname);
        case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
                return AGetEnum(L, target, framebuffer, attachment, pname, DOMAIN_COLOR_ENCODING);
        case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:
        case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
                            return AGetInt(L, target, framebuffer, attachment, pname);
        case GL_FRAMEBUFFER_ATTACHMENT_LAYERED:
                            return AGetBoolean(L, target, framebuffer, attachment, pname);
        case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
                return AGetEnum(L, target, framebuffer, attachment, pname, DOMAIN_TEXTURE_TARGET);
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x4(%rsp), %rdx
pushq $0x24
popq %rcx
movl %ebx, %esi
callq 0x11420
movl %eax, %ebp
pushq $0x4f
popq %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x11150
movl %eax, %r15d
pushq $0x28
popq %rsi
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x11150
leal -0x8212(%rax), %ecx
cmpl $0x6, %ecx
jb 0x29656
leal -0x8cd0(%rax), %ecx
cmpl $0x4, %ecx
ja 0x2966f
leaq 0x1bff7(%rip), %rdx     # 0x45644
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl %eax, %r8d
callq 0x29d32
jmp 0x29718
cmpl $0x8210, %eax           # imm = 0x8210
je 0x296cc
cmpl $0x8211, %eax           # imm = 0x8211
je 0x296fb
cmpl $0x8da7, %eax           # imm = 0x8DA7
jne 0x29725
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x8da7, %r8d           # imm = 0x8DA7
jmp 0x29665
movl 0x4(%rsp), %esi
pushq $0x13
popq %r9
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x8cd3, %r8d           # imm = 0x8CD3
jmp 0x29711
movl 0x4(%rsp), %esi
pushq $0x29
popq %r9
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x8cd0, %r8d           # imm = 0x8CD0
jmp 0x29711
movl 0x4(%rsp), %esi
pushq $0x2b
popq %r9
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x8210, %r8d           # imm = 0x8210
jmp 0x29711
movl 0x4(%rsp), %esi
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x8cd1, %r8d           # imm = 0x8CD1
jmp 0x29665
movl 0x4(%rsp), %esi
pushq $0x2a
popq %r9
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x8211, %r8d           # imm = 0x8211
callq 0x29cdf
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11b59(%rip), %rsi     # 0x3b285
leaq 0x1e7a4(%rip), %rdx     # 0x47ed7
movq %r14, %rdi
movl $0xad, %ecx
xorl %eax, %eax
callq 0x11ae0
jmp 0x29716