// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0xc(%rsp), %rdx
movl $0x1, %esi
movl $0x24, %ecx
callq 0x11420
movl %eax, %ebx
movq %r14, %rdi
movl $0x4f, %esi
movl $0x2, %edx
callq 0x11150
movl %eax, %ebp
movq %r14, %rdi
movl $0x28, %esi
movl $0x3, %edx
callq 0x11150
cmpl $0x8ccf, %eax           # imm = 0x8CCF
jg 0x2b6e5
leal -0x8212(%rax), %ecx
cmpl $0x6, %ecx
jb 0x2b700
cmpl $0x8210, %eax           # imm = 0x8210
je 0x2b751
cmpl $0x8211, %eax           # imm = 0x8211
jne 0x2b7a5
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8211, %r8d           # imm = 0x8211
movl $0x2a, %r9d
jmp 0x2b781
leal -0x8cd0(%rax), %ecx
cmpl $0x4, %ecx
ja 0x2b71a
leaq 0x1df4d(%rip), %rdx     # 0x49644
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2be2c
movl $0x1, %eax
jmp 0x2b786
cmpl $0x8da7, %eax           # imm = 0x8DA7
jne 0x2b7a5
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8da7, %r8d           # imm = 0x8DA7
jmp 0x2b70e
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8cd3, %r8d           # imm = 0x8CD3
movl $0x13, %r9d
jmp 0x2b781
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8210, %r8d           # imm = 0x8210
movl $0x2b, %r9d
jmp 0x2b781
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8cd0, %r8d           # imm = 0x8CD0
movl $0x29, %r9d
callq 0x2bdd9
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8cd1, %r8d           # imm = 0x8CD1
jmp 0x2b70e
leaq 0x13ad9(%rip), %rsi     # 0x3f285
leaq 0x206fc(%rip), %rdx     # 0x4beaf
movq %r14, %rdi
movl $0xad, %ecx
xorl %eax, %eax
callq 0x11ae0
jmp 0x2b786