// File: /workspace/github_cpp_makefile_star2_O3/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, 0x8(%rsp)
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
testq %r8, %r8
je 0x46af1
movq $0x0, (%r12)
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a0f0
testl %eax, %eax
jle 0x46bef
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a0f0
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x46cb9
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a120
movl %eax, (%r13)
testl %eax, %eax
je 0x46bf9
movq %r13, (%rsp)
movl %eax, %esi
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x18050
movl $0xfffffffa, %ebx       # imm = 0xFFFFFFFA
testq %rax, %rax
je 0x46caf
movq %rax, %r13
movq (%rsp), %rax
movl (%rax), %esi
testq %r12, %r12
je 0x46c03
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x18050
movq %rax, (%r12)
testq %rax, %rax
je 0x46c66
movq (%rsp), %rax
cmpl $0x0, (%rax)
je 0x46cbf
movq %r14, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0x1(%rbx), %r14
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x18970
movq (%r12,%rbx,8), %rdx
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rcx
callq 0x1a490
movq (%r12,%rbx,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x46c73
movq (%rax), %rax
movq %rax, (%r13,%rbx,8)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq (%rsp), %rax
movl (%rax), %eax
movq %r14, %rbx
cmpq %rax, %r14
jb 0x46b90
jmp 0x46cbf
movl $0x1, %ebx
jmp 0x46cb9
movl $0xfffffffb, %ebx       # imm = 0xFFFFFFFB
jmp 0x46cb9
testq %rsi, %rsi
je 0x46cbf
xorl %ebx, %ebx
leaq 0x1(%rbx), %r12
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x18970
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdx
callq 0x1a1a0
testq %rax, %rax
je 0x46c96
testb $0x1, 0x28(%rax)
je 0x46c96
movq (%rax), %rax
movq %rax, (%r13,%rbx,8)
testq %rax, %rax
je 0x46c9f
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq (%rsp), %rax
movl (%rax), %eax
movq %r12, %rbx
cmpq %rax, %r12
jb 0x46c0e
jmp 0x46cbf
movq %r15, %rdi
movq %r13, %rsi
callq 0x182d0
jmp 0x46caf
movq %r15, %rdi
movq %r13, %rsi
callq 0x182d0
movq (%r12), %rsi
movq %r15, %rdi
callq 0x182d0
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movq 0x10(%rsp), %r14
jmp 0x46caf
movq $0x0, (%r13,%rbx,8)
movq %r15, %rdi
movq %r13, %rsi
callq 0x182d0
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movq (%rsp), %rax
movl $0x0, (%rax)
movl %ebx, (%r14)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)