// File: /workspace/github_c_makefile_star2_O2/stetre[P]moongl/src/teximage.c
// Function: CopyTextureSubImage
static int CopyTextureSubImage(lua_State *L)
/* copy_texture_subimage(target|texture, level, xofs, x, y, w)
 * copy_texture_subimage(target|texture, level, xofs,yofs, x, y, w, h)
 * copy_texture_subimage(target|texture, level, xofs,yofs,zofs, x, y, w, h)
 */
    {
    GLint v1, v2, v3, v4, v5, v6, v7;
    int arg = 1;
    GLenum target;
    GLuint texture = checktargetorname(L, arg++, &target, DOMAIN_TEXTURE_TARGET);
    GLint level = luaL_checkinteger(L, arg++);
    v1 = luaL_checkinteger(L, arg++);
    v2 = luaL_checkinteger(L, arg++);
    v3 = luaL_checkinteger(L, arg++);
    v4 = luaL_checkinteger(L, arg++);
    if(lua_isnoneornil(L, arg))
        {
        if(texture==0)
            glCopyTexSubImage1D(target, level, v1, v2, v3, v4);
        else
            glCopyTextureSubImage1D(texture, level, v1, v2, v3, v4);
        CheckError(L);
        return 0;
        }
    v5 = luaL_checkinteger(L, arg++);
    v6 = luaL_checkinteger(L, arg++);
    if(lua_isnoneornil(L, arg))
        {
        if(texture==0)
            glCopyTexSubImage2D(target, level, v1, v2, v3, v4, v5, v6);
        else
            glCopyTextureSubImage2D(texture, level, v1, v2, v3, v4, v5, v6);
        CheckError(L);
        return 0;
        }
    v7 = luaL_checkinteger(L, arg++);
    if(texture==0)
        glCopyTexSubImage3D(target, level, v1, v2, v3, v4, v5, v6, v7);
    else
        glCopyTextureSubImage3D(texture, level, v1, v2, v3, v4, v5, v6, v7);
    CheckError(L);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rsi
leaq 0xc(%rsp), %rdx
pushq $0x13
popq %rcx
callq 0x11420
movl %eax, %r14d
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, 0x10(%rsp)
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r15
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r12
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %r13
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, %rbp
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x11850
testl %eax, %eax
jle 0x35101
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, 0x20(%rsp)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, 0x18(%rsp)
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x11850
testl %eax, %eax
jle 0x3512c
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x11af0
testl %r14d, %r14d
je 0x3515c
movq 0x203c0(%rip), %r10     # 0x554b8
subq $0x8, %rsp
movl %r14d, %edi
jmp 0x3516b
testl %r14d, %r14d
je 0x3518e
movq 0x20baf(%rip), %rax     # 0x55cc0
movl %r14d, %edi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
callq *(%rax)
jmp 0x351ce
testl %r14d, %r14d
je 0x351aa
movq 0x20868(%rip), %rax     # 0x559a0
movl %r14d, %edi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq *(%rax)
addq $0x10, %rsp
jmp 0x351ce
movq 0x20865(%rip), %r10     # 0x559c8
movl 0xc(%rsp), %edi
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
pushq %rax
pushq 0x28(%rsp)
pushq 0x38(%rsp)
callq *(%r10)
addq $0x20, %rsp
jmp 0x351ce
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
callq 0x119f0
jmp 0x351ce
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x11560
popq %rax
popq %rcx
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq