// File: /workspace/github_c_makefile_star2_O1/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 0x11430
movl %eax, %ebx
movq %r14, %rdi
movl $0x4f, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, %ebp
movq %r14, %rdi
movl $0x28, %esi
movl $0x3, %edx
callq 0x11160
cmpl $0x8ccf, %eax           # imm = 0x8CCF
jg 0x2b559
leal -0x8212(%rax), %ecx
cmpl $0x6, %ecx
jb 0x2b574
cmpl $0x8210, %eax           # imm = 0x8210
je 0x2b5c5
cmpl $0x8211, %eax           # imm = 0x8211
jne 0x2b619
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8211, %r8d           # imm = 0x8211
movl $0x2a, %r9d
jmp 0x2b5f5
leal -0x8cd0(%rax), %ecx
cmpl $0x4, %ecx
ja 0x2b58e
leaq 0x1e0d9(%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 0x2bca0
movl $0x1, %eax
jmp 0x2b5fa
cmpl $0x8da7, %eax           # imm = 0x8DA7
jne 0x2b619
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8da7, %r8d           # imm = 0x8DA7
jmp 0x2b582
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8cd3, %r8d           # imm = 0x8CD3
movl $0x13, %r9d
jmp 0x2b5f5
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8210, %r8d           # imm = 0x8210
movl $0x2b, %r9d
jmp 0x2b5f5
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
movl $0x8cd0, %r8d           # imm = 0x8CD0
movl $0x29, %r9d
callq 0x2bc4d
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 0x2b582
leaq 0x13c65(%rip), %rsi     # 0x3f285
leaq 0x20888(%rip), %rdx     # 0x4beaf
movq %r14, %rdi
movl $0xad, %ecx
xorl %eax, %eax
callq 0x11ae0
jmp 0x2b5fa