// File: /workspace/github_c_makefile_star2_O0/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 %rbx
subq $0x60, %rsp
movq %rdi, 0x50(%rsp)
movl $0x1, 0x30(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
leaq 0x2c(%rsp), %rdx
movl $0x13, %ecx
callq 0x11430
movl %eax, 0x28(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x24(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x4c(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x44(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x40(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x11860
cmpl $0x0, %eax
jg 0x46e96
cmpl $0x0, 0x28(%rsp)
jne 0x46e59
movl 0x2c(%rsp), %edi
movl 0x24(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
callq 0x119f0
jmp 0x46e7f
movq 0x20dd0(%rip), %rax     # 0x67c30
movq (%rax), %rax
movl 0x28(%rsp), %edi
movl 0x24(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
callq *%rax
movq 0x50(%rsp), %rdi
callq 0x11880
movl $0x0, 0x5c(%rsp)
jmp 0x47024
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x3c(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x38(%rsp)
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x11860
cmpl $0x0, %eax
jg 0x46f6c
cmpl $0x0, 0x28(%rsp)
jne 0x46f1c
movl 0x2c(%rsp), %edi
movl 0x24(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x3c(%rsp), %r10d
movl 0x38(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x11570
jmp 0x46f55
movq 0x2098d(%rip), %rax     # 0x678b0
movq (%rax), %rax
movl 0x28(%rsp), %edi
movl 0x24(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x3c(%rsp), %r11d
movl 0x38(%rsp), %r10d
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
callq *%rax
movq 0x50(%rsp), %rdi
callq 0x11880
movl $0x0, 0x5c(%rsp)
jmp 0x47024
movq 0x50(%rsp), %rdi
movl 0x30(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
callq 0x11af0
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x28(%rsp)
jne 0x46fd1
movq 0x20943(%rip), %rax     # 0x678d8
movq (%rax), %rax
movl 0x2c(%rsp), %edi
movl 0x24(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x3c(%rsp), %ebx
movl 0x38(%rsp), %r11d
movl 0x34(%rsp), %r10d
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
callq *%rax
jmp 0x47012
movq 0x20358(%rip), %rax     # 0x67330
movq (%rax), %rax
movl 0x28(%rsp), %edi
movl 0x24(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x3c(%rsp), %ebx
movl 0x38(%rsp), %r11d
movl 0x34(%rsp), %r10d
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
callq *%rax
movq 0x50(%rsp), %rdi
callq 0x11880
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
addq $0x60, %rsp
popq %rbx
retq
nop