// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_checkxxxlist_nondispatchable
uint64_t* checkxxxlist_nondispatchable(lua_State *L, int arg, uint32_t *count, int *err, ud_t ***ud, const char *mt)
/* if ud != NULL, at return it will point to the array of ud_t* for the elements
 * i.e. ud[i] = the ud for element i  (also this array must be Free'd by the caller).
 */
    {
    uint64_t* list;
    uint32_t i;

    *count = 0;
    *err = 0;
    if(ud) *ud = NULL;
    if(lua_isnoneornil(L, arg))
        { *err = ERR_NOTPRESENT; return NULL; }
    if(lua_type(L, arg) != LUA_TTABLE)
        { *err = ERR_TABLE; return NULL; }
    *count = luaL_len(L, arg);
    if(*count == 0)
        { *err = ERR_EMPTY; return NULL; }
    list = (uint64_t*)MallocNoErr(L, sizeof(uint64_t) * (*count));
    if(!list)
        { *count = 0; *err = ERR_MEMORY; return NULL; }
    if(ud)
        {
        *ud = (ud_t**)MallocNoErr(L, sizeof(ud_t*) *(*count));
        if(!*ud)
            { Free(L, list); *count = 0; *err = ERR_MEMORY; return NULL; }
        }
    
    if(ud)
        {
        for(i=0; i<*count; i++)
            {
            lua_rawgeti(L, arg, i+1);
            (void)testxxx(L, -1, ud[i], mt);
            if(!*ud[i])
                {  Free(L, list); Free(L, *ud); *count = 0; *err = ERR_TYPE; return NULL; }
            list[i] = (*ud[i])->handle;
            lua_pop(L, 1);
            }
        }
    else
        {
        for(i=0; i<*count; i++)
            {
            lua_rawgeti(L, arg, i+1);
            list[i] = (uint64_t)testxxx(L, -1, NULL, mt);
            if(!list[i])
                { Free(L, list); *count = 0; *err = ERR_TYPE; return NULL; }
            lua_pop(L, 1);
            }
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r12
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %r15
movq %rdx, (%rsp)
andl $0x0, (%rdx)
andl $0x0, (%rcx)
testq %r8, %r8
je 0x43ec1
andq $0x0, (%r12)
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
testl %eax, %eax
jle 0x43fa3
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x43fa7
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a140
movq (%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x43fab
movl %eax, %esi
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x18050
pushq $-0x6
popq %r13
testq %rax, %rax
je 0x4404e
movq %rax, %rbx
testq %r12, %r12
je 0x43fc6
movq (%rsp), %rax
movl (%rax), %esi
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x18050
movq %rax, (%r12)
testq %rax, %rax
je 0x44019
movq %r14, 0x8(%rsp)
xorl %r14d, %r14d
movq (%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r14
jae 0x43fb4
leaq 0x1(%r14), %r13
movq %r15, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18970
movq (%r12,%r14,8), %rdx
movq %r15, %rdi
pushq $-0x1
popq %rsi
movq 0x10(%rsp), %rcx
callq 0x1a4b0
movq (%r12,%r14,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x44026
movq (%rax), %rax
movq %rax, (%rbx,%r14,8)
movq %r15, %rdi
pushq $-0x2
popq %rsi
callq 0x18150
movq %r13, %r14
jmp 0x43f4c
pushq $0x1
jmp 0x43fad
pushq $-0x4
jmp 0x43fad
pushq $-0x5
popq %r13
movl %r13d, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x8(%rsp)
xorl %r13d, %r13d
pushq $-0x1
popq %r12
movq (%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r13
jae 0x43fb4
leaq 0x1(%r13), %r14
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x18970
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
movq 0x10(%rsp), %rcx
callq 0x1a4b0
movq %rax, (%rbx,%r13,8)
testq %rax, %rax
je 0x4403a
movq %r15, %rdi
pushq $-0x2
popq %rsi
callq 0x18150
movq %r14, %r13
jmp 0x43fd2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x182e0
jmp 0x4404e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x182e0
movq (%r12), %rsi
movq %r15, %rdi
jmp 0x44040
movq %r15, %rdi
movq %rbx, %rsi
callq 0x182e0
movq 0x8(%rsp), %r14
pushq $-0x2
popq %r13
movq (%rsp), %rax
andl $0x0, (%rax)
jmp 0x43faf
nop