// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/getintformat.c
// Function: GetInternalformat
static int GetInternalformat(lua_State *L)
    {
    GLenum target = checktexturetarget(L, 1);
    GLenum internalformat = checkinternalformat(L, 2);
    GLenum pname = checkintformatpname(L, 3);
    switch(pname)
        {
        /* supported operations queries: */
        case GL_CLEAR_BUFFER:
        case GL_CLEAR_TEXTURE:
        case GL_COMPUTE_TEXTURE:
        case GL_FILTER:
        case GL_FRAGMENT_TEXTURE:
        case GL_FRAMEBUFFER_BLEND:
        case GL_FRAMEBUFFER_RENDERABLE:
        case GL_FRAMEBUFFER_RENDERABLE_LAYERED:
        case GL_GEOMETRY_TEXTURE:
        case GL_MANUAL_GENERATE_MIPMAP:
        case GL_GENERATE_MIPMAP:
        case GL_AUTO_GENERATE_MIPMAP:
        case GL_READ_PIXELS:
        case GL_SHADER_IMAGE_ATOMIC:
        case GL_SHADER_IMAGE_LOAD:
        case GL_SHADER_IMAGE_STORE:
        case GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST:
        case GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE:
        case GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST:
        case GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE:
        case GL_SRGB_READ:
        case GL_SRGB_WRITE:
        case GL_TESS_CONTROL_TEXTURE:
        case GL_TESS_EVALUATION_TEXTURE:
        case GL_TEXTURE_GATHER:
        case GL_TEXTURE_GATHER_SHADOW:
        case GL_TEXTURE_SHADOW:
        case GL_TEXTURE_VIEW:
        case GL_VERTEX_TEXTURE:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_SUPPORTED_OP);
        /* booleans */
        case GL_COLOR_COMPONENTS:
        case GL_COLOR_RENDERABLE:
        case GL_DEPTH_COMPONENTS:
        case GL_DEPTH_RENDERABLE:
        case GL_INTERNALFORMAT_SUPPORTED:  
        case GL_MIPMAP:
        case GL_STENCIL_COMPONENTS:
        case GL_STENCIL_RENDERABLE:
        case GL_TEXTURE_COMPRESSED:
                        return GetBoolean(L, target, internalformat, pname);
        /* integer */
        case GL_INTERNALFORMAT_RED_SIZE:
        case GL_INTERNALFORMAT_GREEN_SIZE:
        case GL_INTERNALFORMAT_ALPHA_SIZE:
        case GL_INTERNALFORMAT_DEPTH_SIZE:
        case GL_INTERNALFORMAT_STENCIL_SIZE:
        case GL_INTERNALFORMAT_BLUE_SIZE:
        case GL_INTERNALFORMAT_SHARED_SIZE:
        case GL_MAX_COMBINED_DIMENSIONS:
        case GL_MAX_WIDTH:
        case GL_MAX_HEIGHT:
        case GL_MAX_DEPTH:
        case GL_MAX_LAYERS:
        case GL_NUM_SAMPLE_COUNTS:
        case GL_TEXTURE_COMPRESSED_BLOCK_SIZE:
        case GL_TEXTURE_COMPRESSED_BLOCK_WIDTH:
        case GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT:
        case GL_IMAGE_TEXEL_SIZE:
                         return GetInt(L, target, internalformat, pname);
        /* N integers */
        case GL_SAMPLES:
                    return GetN(L, target, internalformat, pname, GL_NUM_SAMPLE_COUNTS);
        /* enums */
        case GL_COLOR_ENCODING:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_COLOR_ENCODING);
        case GL_GET_TEXTURE_IMAGE_FORMAT:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_FORMAT);
        case GL_GET_TEXTURE_IMAGE_TYPE:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_TYPE);
        case GL_IMAGE_COMPATIBILITY_CLASS:
                return GetEnum(L, target, internalformat, pname, DOMAIN_IMAGE_COMPATIBILITY_CLASS);
        case GL_IMAGE_FORMAT_COMPATIBILITY_TYPE:
                return GetEnum(L, target, internalformat, pname, DOMAIN_IMAGE_FORMAT_COMP_TYPE);
        case GL_IMAGE_PIXEL_FORMAT:
                return GetEnum(L, target, internalformat, pname, DOMAIN_FORMAT);
        case GL_IMAGE_PIXEL_TYPE:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_TYPE);
        case GL_VIEW_COMPATIBILITY_CLASS:
                return GetEnum(L, target, internalformat, pname, DOMAIN_VIEW_COMPATIBILITY_TYPE);
        case GL_INTERNALFORMAT_PREFERRED:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_INTERNAL_FORMAT);
        case GL_INTERNALFORMAT_RED_TYPE:
        case GL_INTERNALFORMAT_GREEN_TYPE:
        case GL_INTERNALFORMAT_BLUE_TYPE:
        case GL_INTERNALFORMAT_ALPHA_TYPE:
        case GL_INTERNALFORMAT_DEPTH_TYPE:
        case GL_INTERNALFORMAT_STENCIL_TYPE:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_COMPONENT_TYPE);
        case GL_READ_PIXELS_FORMAT:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_FORMAT);
        case GL_READ_PIXELS_TYPE: 
                    return GetEnum(L, target, internalformat, pname, DOMAIN_TYPE);
        case GL_TEXTURE_IMAGE_FORMAT:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_FORMAT);
        case GL_TEXTURE_IMAGE_TYPE:
                    return GetEnum(L, target, internalformat, pname, DOMAIN_TYPE);

        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x13, %esi
movl $0x1, %edx
callq 0x11150
movl %eax, %r14d
movq %rbx, %rdi
movl $0x11, %esi
movl $0x2, %edx
callq 0x11150
movl %eax, %ebp
movq %rbx, %rdi
movl $0x66, %esi
movl $0x3, %edx
callq 0x11150
cmpl $0x86a0, %eax           # imm = 0x86A0
jg 0x2e4ec
leal -0x826f(%rax), %ecx
cmpl $0x47, %ecx
ja 0x2e54d
leaq 0x1bdd3(%rip), %rdx     # 0x4a24c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x284bf(%rip), %r9      # 0x56948
movq %rsp, %r15
movl %r14d, %edi
movl %ebp, %esi
movl %eax, %edx
movl $0x4, %ecx
movq %r15, %r8
callq *(%r9)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x67, %esi
callq 0x11110
jmp 0x2e5d2
movq 0x28486(%rip), %r9      # 0x56948
movq %rsp, %r15
movl %r14d, %edi
movl %ebp, %esi
movl %eax, %edx
movl $0x4, %ecx
movq %r15, %r8
callq *(%r9)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %edx
movq %rbx, %rdi
movl $0x2a, %esi
jmp 0x2e4b1
cmpl $0x9364, %eax           # imm = 0x9364
jg 0x2e565
cmpl $0x86a1, %eax           # imm = 0x86A1
je 0x2e519
cmpl $0x90c7, %eax           # imm = 0x90C7
jne 0x2e577
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x90c7, %ecx           # imm = 0x90C7
movl $0x69, %r8d
jmp 0x2e6a1
movq 0x284f8(%rip), %r9      # 0x56a18
movq %rsp, %r15
movl %r14d, %edi
movl %ebp, %esi
movl %eax, %edx
movl $0x8, %ecx
movq %r15, %r8
callq *(%r9)
movq %rbx, %rdi
callq 0x11870
movl (%r15), %esi
movq %rbx, %rdi
callq 0x117e0
jmp 0x2e5cd
cmpl $0x80a9, %eax           # imm = 0x80A9
je 0x2e6c2
cmpl $0x8191, %eax           # imm = 0x8191
je 0x2e482
jmp 0x2e577
cmpl $0x9380, %eax           # imm = 0x9380
je 0x2e59e
cmpl $0x9365, %eax           # imm = 0x9365
je 0x2e482
leaq 0x10d07(%rip), %rsi     # 0x3f285
leaq 0x1bdfa(%rip), %rdx     # 0x4a37f
movq %rbx, %rdi
movl $0xb3, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0
movq 0x28473(%rip), %r9      # 0x56a18
movq %rsp, %r15
movl %r14d, %edi
movl %ebp, %esi
movl %eax, %edx
movl $0x8, %ecx
movq %r15, %r8
callq *(%r9)
movq %rbx, %rdi
callq 0x11870
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x113b0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x8290, %ecx           # imm = 0x8290
jmp 0x2e64d
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x8292, %ecx           # imm = 0x8292
jmp 0x2e64d
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x8291, %ecx           # imm = 0x8291
jmp 0x2e69b
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x82aa, %ecx           # imm = 0x82AA
jmp 0x2e64d
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x82a9, %ecx           # imm = 0x82A9
jmp 0x2e69b
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x8296, %ecx           # imm = 0x8296
movl $0x2b, %r8d
jmp 0x2e6a1
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x828e, %ecx           # imm = 0x828E
movl $0x7, %r8d
jmp 0x2e6a1
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x82b6, %ecx           # imm = 0x82B6
movl $0x6a, %r8d
jmp 0x2e6a1
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x828f, %ecx           # imm = 0x828F
jmp 0x2e69b
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x8270, %ecx           # imm = 0x8270
movl $0x11, %r8d
jmp 0x2e6a1
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x828d, %ecx           # imm = 0x828D
movl $0x12, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2e6d6
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0x82a8, %ecx           # imm = 0x82A8
movl $0x68, %r8d
jmp 0x2e6a1
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2e720