// File: /workspace/github_c_makefile_star2_O1/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 0x11430
movl %eax, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, %r12
movq %rbx, %rdi
movl $0x11, %esi
movl $0x3, %edx
callq 0x11160
movl %eax, %r15d
movq %rbx, %rdi
movl $0x4, %esi
callq 0x110b0
testl %eax, %eax
je 0x378c2
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11450
jmp 0x378ea
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11860
cmpl $0x5, %eax
jne 0x379d5
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 0x11860
testl %eax, %eax
jle 0x3798f
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 0x11860
testl %eax, %eax
jle 0x379b6
movq %rbx, %rdi
movl $0x9, %esi
callq 0x11af0
movq %rax, 0x30(%rsp)
movq %rbx, %rdi
movl $0xa, %esi
callq 0x11af0
testl %ebp, %ebp
je 0x379ee
movq 0x1f436(%rip), %r10     # 0x56db8
movl 0x10(%rsp), %r11d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x37a02
movq %rbx, %rdi
callq 0x11880
testl %ebp, %ebp
je 0x37a2b
movq 0x1eee2(%rip), %rax     # 0x56888
movl 0x10(%rsp), %r9d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x37a3f
testl %ebp, %ebp
je 0x37a57
movq 0x1efd3(%rip), %rax     # 0x56998
movl 0x10(%rsp), %r10d
subq $0x8, %rsp
movl %ebp, %edi
jmp 0x37a6b
leaq 0x781c(%rip), %rdx      # 0x3f1f8
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11940
jmp 0x37a96
movq 0x1f133(%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 0x37a8c
movq 0x1ebf6(%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 0x37a94
movq 0x1ee72(%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 0x11880
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq