// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
leaq 0x1c(%rsp), %rdx
pushq $0x13
popq %rcx
callq 0x11420
movl %eax, %ebp
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r12
pushq $0x11
popq %rsi
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0x11150
movl %eax, %r15d
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x110b0
pushq $0x4
popq %rsi
testl %eax, %eax
je 0x34a88
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x11440
jmp 0x34aa9
movq %rbx, %rdi
callq 0x11850
cmpl $0x5, %eax
jne 0x34b84
pushq $0x4
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x11b20
movq %rax, 0x8(%rsp)
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r13
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r14
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x11850
testl %eax, %eax
jle 0x34b3e
movq %r15, 0x28(%rsp)
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, 0x20(%rsp)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r15
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x11850
testl %eax, %eax
jle 0x34b65
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, 0x30(%rsp)
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x11af0
testl %ebp, %ebp
je 0x34b9b
movq 0x21287(%rip), %r10     # 0x55db8
movl 0x10(%rsp), %r11d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x34baf
movq %rbx, %rdi
callq 0x11870
testl %ebp, %ebp
je 0x34bd8
movq 0x20d33(%rip), %rax     # 0x55888
movl 0x10(%rsp), %r9d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x34bec
testl %ebp, %ebp
je 0x34c04
movq 0x20e24(%rip), %rax     # 0x55998
movl 0x10(%rsp), %r10d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x34c18
leaq 0x666d(%rip), %rdx      # 0x3b1f8
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x11930
jmp 0x34c43
movq 0x20f86(%rip), %r10     # 0x55b28
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 0x34c39
movq 0x20a49(%rip), %rax     # 0x55628
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 0x34c41
movq 0x20cc5(%rip), %rax     # 0x558d0
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