// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x14(%rsp), %rdx
movl $0x24, %ecx
callq 0x11430
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movl $0x4f, %esi
movl $0x2, %edx
callq 0x11160
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movl $0x28, %esi
movl $0x3, %edx
callq 0x11160
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
subl $0x8210, %eax           # imm = 0x8210
je 0x31a23
jmp 0x318fb
movl 0x4(%rsp), %eax
subl $0x8211, %eax           # imm = 0x8211
je 0x319d2
jmp 0x3190c
movl 0x4(%rsp), %eax
addl $0xffff7dee, %eax       # imm = 0xFFFF7DEE
subl $0x6, %eax
jb 0x319fc
jmp 0x31920
movl 0x4(%rsp), %eax
subl $0x8cd0, %eax           # imm = 0x8CD0
je 0x31981
jmp 0x3192d
movl 0x4(%rsp), %eax
subl $0x8cd1, %eax           # imm = 0x8CD1
je 0x319ab
jmp 0x3193a
movl 0x4(%rsp), %eax
subl $0x8cd2, %eax           # imm = 0x8CD2
je 0x31a4d
jmp 0x3194b
movl 0x4(%rsp), %eax
subl $0x8cd3, %eax           # imm = 0x8CD3
je 0x31a95
jmp 0x3195c
movl 0x4(%rsp), %eax
subl $0x8cd4, %eax           # imm = 0x8CD4
je 0x31a4d
jmp 0x3196d
movl 0x4(%rsp), %eax
subl $0x8da7, %eax           # imm = 0x8DA7
je 0x31a71
jmp 0x31abc
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x29, %r9d
callq 0x32310
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
xorl %r9d, %r9d
callq 0x323a0
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x2a, %r9d
callq 0x32310
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
xorl %r9d, %r9d
callq 0x323a0
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x2b, %r9d
callq 0x32310
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
xorl %r9d, %r9d
callq 0x323a0
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
xorl %r9d, %r9d
callq 0x323a0
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl $0x13, %r9d
callq 0x32310
movl %eax, 0x24(%rsp)
jmp 0x31adf
movq 0x18(%rsp), %rdi
leaq 0x207bd(%rip), %rsi     # 0x52285
leaq 0x2cba4(%rip), %rdx     # 0x5e673
movl $0xad, %ecx
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)