// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x13
popq %rsi
pushq $0x1
popq %r14
movl %r14d, %edx
callq 0x11150
movl %eax, %r15d
pushq $0x11
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x11150
movl %eax, %ebp
pushq $0x66
popq %rsi
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0x11150
leal -0x826f(%rax), %ecx
cmpl $0x47, %ecx
ja 0x2bf4c
leaq 0x1a326(%rip), %rdx     # 0x46248
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
pushq $0x67
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %eax, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2c1aa
cmpl $0x80a9, %eax           # imm = 0x80A9
je 0x2c105
cmpl $0x8191, %eax           # imm = 0x8191
je 0x2bf2b
cmpl $0x86a1, %eax           # imm = 0x86A1
je 0x2bfb8
cmpl $0x90c7, %eax           # imm = 0x90C7
je 0x2c0ef
cmpl $0x9380, %eax           # imm = 0x9380
je 0x2bfa9
cmpl $0x9365, %eax           # imm = 0x9365
je 0x2bf2b
leaq 0xf300(%rip), %rsi      # 0x3b285
leaq 0x1a3ef(%rip), %rdx     # 0x4637b
movq %rbx, %rdi
movl $0xb3, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %eax, %ecx
xorl %r8d, %r8d
jmp 0x2bfc9
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %eax, %ecx
movl %r14d, %r8d
callq 0x2c1f5
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2a
jmp 0x2bf2d
pushq $0x7
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x82aa, %ecx           # imm = 0x82AA
jmp 0x2bf39
pushq $0x12
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x82a9, %ecx           # imm = 0x82A9
jmp 0x2bf39
pushq $0x12
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x828d, %ecx           # imm = 0x828D
jmp 0x2bf39
pushq $0x7
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x8292, %ecx           # imm = 0x8292
jmp 0x2bf39
pushq $0x11
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x8270, %ecx           # imm = 0x8270
jmp 0x2bf39
pushq $0x6a
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x82b6, %ecx           # imm = 0x82B6
jmp 0x2bf39
pushq $0x7
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x8290, %ecx           # imm = 0x8290
jmp 0x2bf39
pushq $0x12
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x8291, %ecx           # imm = 0x8291
jmp 0x2bf39
pushq $0x7
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x828e, %ecx           # imm = 0x828E
jmp 0x2bf39
pushq $0x12
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x828f, %ecx           # imm = 0x828F
jmp 0x2bf39
pushq $0x2b
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x8296, %ecx           # imm = 0x8296
jmp 0x2bf39
pushq $0x68
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x82a8, %ecx           # imm = 0x82A8
jmp 0x2bf39
pushq $0x69
popq %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl $0x90c7, %ecx           # imm = 0x90C7
jmp 0x2bf39
movq 0x2983c(%rip), %rax     # 0x55948
pushq $0x4
popq %rcx
leaq 0x4(%rsp), %r14
movl %r15d, %edi
movl %ebp, %esi
movl $0x9380, %edx           # imm = 0x9380
movq %r14, %r8
callq *(%rax)
movq %rbx, %rdi
callq 0x11870
movslq (%r14), %r14
testq %r14, %r14
je 0x2c1a2
movq %r14, %r13
shlq $0x3, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x111f0
movq %rax, %r12
movq 0x298c9(%rip), %rax     # 0x55a18
movl %r15d, %edi
movl %ebp, %esi
movl $0x80a9, %edx           # imm = 0x80A9
movl %r13d, %ecx
movq %r12, %r8
callq *(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11540
xorl %r15d, %r15d
testl %r14d, %r14d
movl $0x0, %r13d
cmovgl %r14d, %r13d
cmpq %r15, %r13
je 0x2c192
movq (%r12,%r15,8), %rsi
movq %rbx, %rdi
callq 0x113b0
incq %r15
jmp 0x2c17c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11360
jmp 0x2bfce
xorl %r14d, %r14d
jmp 0x2bfce