// File: /workspace/github_c_makefile_star2_O3/stetre[P]moongl/src/teximage.c
// Function: CompressedTextureSubImage
static int CompressedTextureSubImage(lua_State *L)
    {
#define imagesize (GLsizei)len
    const void* data;
    size_t len;
    int arg = 1;
    GLint v1, v2, v3, v4, v5, v6;
    GLenum target;
    GLuint texture = checktargetorname(L, arg++, &target, DOMAIN_TEXTURE_TARGET);
    GLint level = luaL_checkinteger(L, arg++);
    GLenum intfmt = checkinternalformat(L, arg++);
    if(lua_isstring(L, arg))
        data = (void*)luaL_checklstring(L, arg++, &len);
    else if(lua_istable(L, arg))
        data = (void*)checkdataptr(L, arg++, &len);
    else
        return luaL_argerror(L, arg, "invalid type");
    v1 = luaL_checkinteger(L, arg++);
    v2 = luaL_checkinteger(L, arg++);
    if(lua_isnoneornil(L, arg))
        {
        CheckError(L);
        if(texture==0)
            glCompressedTexSubImage1D(target,level,v1,v2,intfmt,imagesize,data);
        else
            glCompressedTextureSubImage1D(texture,level,v1,v2,intfmt,imagesize,data);
        return 0;
        }
    v3 = luaL_checkinteger(L, arg++);
    v4 = luaL_checkinteger(L, arg++);
    if(lua_isnoneornil(L, arg))
        {
        if(texture==0)
            glCompressedTexSubImage2D(target,level,v1,v2,v3,v4,intfmt,imagesize,data);
        else
            glCompressedTextureSubImage2D(texture,level,v1,v2,v3,v4,intfmt,imagesize,data);
        CheckError(L);
        return 0;
        }
    v5 = luaL_checkinteger(L, arg++);
    v6 = luaL_checkinteger(L, arg++);
    if(texture==0)
        glCompressedTexSubImage3D(target,level,v1,v2,v3,v4,v5,v6,intfmt,imagesize,data);
    else
        glCompressedTextureSubImage3D(texture,level,v1,v2,v3,v4,v5,v6,intfmt,imagesize,data);
    CheckError(L);
    return 0;
#undef imagesize
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x1c(%rsp), %rdx
movl $0x1, %esi
movl $0x13, %ecx
callq 0x11420
movl %eax, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, %r12
movq %rbx, %rdi
movl $0x11, %esi
movl $0x3, %edx
callq 0x11150
movl %eax, %r15d
movq %rbx, %rdi
movl $0x4, %esi
callq 0x110b0
testl %eax, %eax
je 0x3796e
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11440
jmp 0x37996
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11850
cmpl $0x5, %eax
jne 0x37a81
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11b20
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl $0x5, %esi
callq 0x11af0
movq %rax, %r13
movq %rbx, %rdi
movl $0x6, %esi
callq 0x11af0
movq %rax, %r14
movq %rbx, %rdi
movl $0x7, %esi
callq 0x11850
testl %eax, %eax
jle 0x37a3b
movq %r15, 0x28(%rsp)
movq %rbx, %rdi
movl $0x7, %esi
callq 0x11af0
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movl $0x8, %esi
callq 0x11af0
movq %rax, %r15
movq %rbx, %rdi
movl $0x9, %esi
callq 0x11850
testl %eax, %eax
jle 0x37a62
movq %rbx, %rdi
movl $0x9, %esi
callq 0x11af0
movq %rax, 0x30(%rsp)
movq %rbx, %rdi
movl $0xa, %esi
callq 0x11af0
testl %ebp, %ebp
je 0x37a9a
movq 0x1f38a(%rip), %r10     # 0x56db8
movl 0x10(%rsp), %r11d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x37aae
movq %rbx, %rdi
callq 0x11870
testl %ebp, %ebp
je 0x37ad7
movq 0x1ee36(%rip), %rax     # 0x56888
movl 0x10(%rsp), %r9d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x37aeb
testl %ebp, %ebp
je 0x37b03
movq 0x1ef27(%rip), %rax     # 0x56998
movl 0x10(%rsp), %r10d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x37b17
leaq 0x7770(%rip), %rdx      # 0x3f1f8
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11930
jmp 0x37b42
movq 0x1f087(%rip), %r10     # 0x56b28
movl 0x1c(%rsp), %edi
movl 0x10(%rsp), %r11d
subq $0x8, %rsp
movl %r12d, %esi
movl %r13d, %edx
movl %r14d, %ecx
movq 0x28(%rsp), %r8
movl %r15d, %r9d
pushq 0x10(%rsp)
pushq %r11
pushq 0x40(%rsp)
pushq %rax
pushq 0x58(%rsp)
callq *(%r10)
addq $0x30, %rsp
jmp 0x37b38
movq 0x1eb4a(%rip), %rax     # 0x56628
movl 0x1c(%rsp), %edi
movl 0x10(%rsp), %r9d
subq $0x8, %rsp
movl %r12d, %esi
movl %r13d, %edx
movl %r14d, %ecx
movl %r15d, %r8d
pushq 0x10(%rsp)
callq *(%rax)
addq $0x10, %rsp
jmp 0x37b40
movq 0x1edc6(%rip), %rax     # 0x568d0
movl 0x1c(%rsp), %edi
movl 0x10(%rsp), %r10d
subq $0x8, %rsp
movl %r12d, %esi
movl %r13d, %edx
movl %r14d, %ecx
movq 0x28(%rsp), %r8
movl %r15d, %r9d
pushq 0x10(%rsp)
pushq %r10
pushq 0x40(%rsp)
callq *(%rax)
addq $0x20, %rsp
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq