// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/teximage.c
// Function: GetTextureSubImage
static int GetTextureSubImage(lua_State *L)
    {
    int arg = 1;
    GLuint texture = luaL_checkinteger(L, arg++);
    GLint level = luaL_checkinteger(L, arg++);
    GLenum format = checkformat(L, arg++);
    GLenum type = checktype(L, arg++);
    GLint xoffset = luaL_checkinteger(L, arg++);
    GLint yoffset = luaL_checkinteger(L, arg++);
    GLint zoffset = luaL_checkinteger(L, arg++);
    GLsizei width = luaL_checkinteger(L, arg++);
    GLsizei height = luaL_checkinteger(L, arg++);
    GLsizei depth = luaL_checkinteger(L, arg++);
    GLsizei bufsz = luaL_checkinteger(L, arg++);
    char* data = (char*)Malloc(L, bufsz *sizeof(char));
    glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufsz, (void*)data);
    CheckErrorFree(L, data);
    lua_pushlstring(L, data, bufsz);
    Free(L, data);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl $0x1, 0x6c(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x68(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x64(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
movl $0x12, %esi
callq 0x11160
movl %eax, 0x60(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
movl $0x7, %esi
callq 0x11160
movl %eax, 0x5c(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x58(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x54(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x50(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x4c(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x44(%rsp)
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
callq 0x11af0
movl %eax, 0x40(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x40(%rsp), %rsi
shlq $0x0, %rsi
callq 0x11200
movq %rax, 0x38(%rsp)
movq 0x1f7ff(%rip), %rax     # 0x673e8
movq (%rax), %rax
movl 0x68(%rsp), %edi
movl 0x64(%rsp), %esi
movl 0x58(%rsp), %edx
movl 0x54(%rsp), %ecx
movl 0x50(%rsp), %r8d
movl 0x4c(%rsp), %r9d
movl 0x48(%rsp), %r15d
movl 0x44(%rsp), %r14d
movl 0x60(%rsp), %ebp
movl 0x5c(%rsp), %ebx
movl 0x40(%rsp), %r11d
movq 0x38(%rsp), %r10
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movl %ebp, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movq %r10, 0x28(%rsp)
callq *%rax
movq 0x70(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x11550
movq 0x70(%rsp), %rdi
movq 0x38(%rsp), %rsi
movslq 0x40(%rsp), %rdx
callq 0x11ab0
movq 0x70(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x11370
movl $0x1, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)