// File: /workspace/github_c_makefile_star2_O3/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
leaq 0xc(%rsp), %rdx
movl $0x1, %esi
movl $0x13, %ecx
callq 0x11420
movl %eax, %r14d
movq %rbx, %rdi
movl $0x2, %esi
callq 0x11af0
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11af0
movq %rax, %r15
movq %rbx, %rdi
movl $0x4, %esi
callq 0x11af0
movq %rax, %r12
movq %rbx, %rdi
movl $0x5, %esi
callq 0x11af0
movq %rax, %r13
movq %rbx, %rdi
movl $0x6, %esi
callq 0x11af0
movq %rax, %rbp
movq %rbx, %rdi
movl $0x7, %esi
callq 0x11850
testl %eax, %eax
jle 0x3806a
movq %rbx, %rdi
movl $0x7, %esi
callq 0x11af0
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movl $0x8, %esi
callq 0x11af0
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movl $0x9, %esi
callq 0x11850
testl %eax, %eax
jle 0x38095
movq %rbx, %rdi
movl $0x9, %esi
callq 0x11af0
testl %r14d, %r14d
je 0x380c1
movq 0x1e457(%rip), %r10     # 0x564b8
subq $0x8, %rsp
movl %r14d, %edi
jmp 0x380d0
testl %r14d, %r14d
je 0x380f3
movq 0x1ec46(%rip), %rax     # 0x56cc0
movl %r14d, %edi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
callq *(%rax)
jmp 0x38135
testl %r14d, %r14d
je 0x3810f
movq 0x1e8ff(%rip), %rax     # 0x569a0
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)
jmp 0x38131
movq 0x1e900(%rip), %r10     # 0x569c8
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 0x38135
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %ebp, %r9d
callq 0x119f0
jmp 0x38135
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
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq