// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/buffer.c
// Function: ClearBufferSubData
static int ClearBufferSubData(lua_State *L)
    {
    int arg = 1;
    size_t len;
    const void* data;
    GLenum target;
    GLuint buffer = checktargetorname(L, arg++, &target, DOMAIN_BUFFER_TARGET);
    GLenum internalformat = checkinternalformat(L, arg++);
    GLintptr offset = luaL_checkinteger(L, arg++);
    GLsizei size = luaL_checkinteger(L, arg++);
    GLenum format = checkformat(L, arg++);
    GLenum type = checktype(L, arg++);
    if(lua_isnoneornil(L, arg))
        data = NULL;
    else if(lua_isstring(L, arg))
        data = lua_tolstring(L, arg, &len);
    else if(lua_istable(L, arg))
        data = checkdataptr(L, arg, &len);
    else
        return luaL_argerror(L, arg, "invalid type");
    if(buffer == 0)
        glClearBufferSubData(target, internalformat, offset, size, format, type, (void*)data);
    else
        glClearNamedBufferSubData(buffer,internalformat, offset, size, format, type, (void*)data);
    return 0;
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movl $0x1, 0x44(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
leaq 0x2c(%rsp), %rdx
movl $0x36, %ecx
callq 0x11430
movl %eax, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movl $0x11, %esi
callq 0x11160
movl %eax, 0x24(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
callq 0x11af0
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
callq 0x11af0
movl %eax, 0x14(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movl $0x12, %esi
callq 0x11160
movl %eax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movl $0x7, %esi
callq 0x11160
movl %eax, 0xc(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x11860
cmpl $0x0, %eax
jg 0x129fb
movq $0x0, 0x30(%rsp)
jmp 0x12a74
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x110b0
cmpl $0x0, %eax
je 0x12a28
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x38(%rsp), %rdx
callq 0x11950
movq %rax, 0x30(%rsp)
jmp 0x12a72
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x11860
cmpl $0x5, %eax
jne 0x12a55
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x38(%rsp), %rdx
callq 0x11b20
movq %rax, 0x30(%rsp)
jmp 0x12a70
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x3f793(%rip), %rdx     # 0x521f8
callq 0x11940
movl %eax, 0x54(%rsp)
jmp 0x12ae7
jmp 0x12a72
jmp 0x12a74
cmpl $0x0, 0x28(%rsp)
jne 0x12aae
movq 0x54c6e(%rip), %rax     # 0x676f0
movq (%rax), %rax
movl 0x2c(%rsp), %edi
movl 0x24(%rsp), %esi
movq 0x18(%rsp), %rdx
movslq 0x14(%rsp), %rcx
movl 0x10(%rsp), %r8d
movl 0xc(%rsp), %r9d
movq 0x30(%rsp), %r10
movq %r10, (%rsp)
callq *%rax
jmp 0x12adf
movq 0x54d6b(%rip), %rax     # 0x67820
movq (%rax), %rax
movl 0x28(%rsp), %edi
movl 0x24(%rsp), %esi
movq 0x18(%rsp), %rdx
movslq 0x14(%rsp), %rcx
movl 0x10(%rsp), %r8d
movl 0xc(%rsp), %r9d
movq 0x30(%rsp), %r10
movq %r10, (%rsp)
callq *%rax
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq