LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: GetSwapchainImages
static int GetSwapchainImages(lua_State *L)
    {
    VkResult ec; 
    uint32_t count, i;
    VkImage *images;
    ud_t *ud; 
    VkSwapchainKHR swapchain = checkswapchain(L, 1, &ud);
    VkDevice device = ud->device;
    CheckDevicePfn(L, ud, GetSwapchainImagesKHR);
    ec = ud->ddt->GetSwapchainImagesKHR(device, swapchain, &count, NULL);
    CheckError(L, ec);
    
    lua_newtable(L);
    if(count == 0) return 1;
    
    images = (VkImage*)Malloc(L, sizeof(VkImage)*count);
    ec = ud->ddt->GetSwapchainImagesKHR(device, swapchain, &count, images);
    if(ec) { Free(L, images); CheckError(L, ec); }

    for(i = 0; i < count; i++)
        {
        pushimage_swapchain(L, images[i], ud); 
        lua_rawseti(L, -2, i+1);
        }
    
    Free(L, images);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x34ad4(%rip), %rcx     # 0x7ef67
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rcx
movq 0x50(%rcx), %rax
movq 0x258(%rax), %rax
testq %rax, %rax
je 0x4a4e8
movq 0x20(%rcx), %r12
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq *%rax
movq %rbx, %rdi
xorl %esi, %esi
testl %eax, %eax
je 0x4a50a
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x4a4f9
leaq 0x47426(%rip), %rsi     # 0x91915
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
callq 0x187d0
movl 0x4(%rsp), %esi
testq %rsi, %rsi
je 0x4a4fb
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x191f0
movq %rax, %r14
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq *0x258(%rax)
testl %eax, %eax
je 0x4a565
movl %eax, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
jmp 0x4a4d9
xorl %r15d, %r15d
pushq $-0x2
popq %r12
movl 0x4(%rsp), %eax
cmpq %rax, %r15
jae 0x4a599
movq (%r14,%r15,8), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x18260
incq %r15
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x19120
jmp 0x4a56c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
jmp 0x4a4fb
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: AcquireNextImage
static int AcquireNextImage(lua_State *L)
    {
    ud_t *ud;
    VkSwapchainKHR swapchain =  checkswapchain(L, 1, &ud);
    if((lua_type(L, 2) == LUA_TTABLE) && ud->ddt->AcquireNextImage2KHR)
        return AcquireNextImage2(L, swapchain, ud);
    return AcquireNextImage1(L, swapchain, ud);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x349a6(%rip), %rcx     # 0x7ef67
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdx
callq 0x1a500
movq %rax, 0x8(%rsp)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1a110
movq (%r15), %r14
cmpl $0x5, %eax
jne 0x4a64a
movq 0x50(%r14), %rax
cmpq $0x0, 0x560(%rax)
je 0x4a64a
movq 0x20(%r14), %r12
pushq $0x2
popq %rbp
movq %rsp, %r13
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x19b50
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x4a6eb
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x4a6dd
movq 0x20(%r14), %r15
pushq $0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x19b80
movq %rax, %r12
leaq 0x34931(%rip), %rcx     # 0x7ef96
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a4b0
movq %rax, %r13
leaq 0x3492f(%rip), %rcx     # 0x7efab
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a4b0
movq 0x50(%r14), %rcx
movq 0x268(%rcx), %r10
testq %r10, %r10
je 0x4a6cc
movq %rsp, %r9
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
callq *%r10
movl %eax, %r14d
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
je 0x4a6bf
testl %r14d, %r14d
jne 0x4a6e1
movl (%rsp), %esi
movq %rbx, %rdi
callq 0x18b50
jmp 0x4a73c
leaq 0x4726d(%rip), %rsi     # 0x91940
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x4a749
movq %rbx, %rdi
callq 0x19d00
jmp 0x4a73c
movq 0x8(%rsp), %rax
movq %rax, 0x10(%r15)
movq 0x50(%r14), %rax
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq *0x560(%rax)
movl %eax, %r14d
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
je 0x4a718
testl %r14d, %r14d
jne 0x4a726
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x18b50
jmp 0x4a72e
movq %rbx, %rdi
callq 0x19d00
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x18980
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: WaitForPresent
static int WaitForPresent(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkSwapchainKHR swapchain =  checkswapchain(L, 1, &ud);
    uint64_t presentId = luaL_checkinteger(L, 2);
    uint64_t timeout = luaL_checkinteger(L, 3);
    CheckDevicePfn(L, ud, WaitForPresentKHR);
    ec = ud->ddt->WaitForPresentKHR(ud->device, swapchain, presentId, timeout);
    pushresult(L, ec);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x347f6(%rip), %rcx     # 0x7ef67
pushq $0x1
popq %rbx
leaq 0x8(%rsp), %r13
movl %ebx, %esi
movq %r13, %rdx
callq 0x1a500
movq %rax, %r15
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x190d0
movq %rax, %r12
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x190d0
movq (%r13), %rcx
movq 0x50(%rcx), %rdx
movq 0x628(%rdx), %r8
testq %r8, %r8
je 0x4a7d1
movq 0x20(%rcx), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq *%r8
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
jmp 0x4a7e4
leaq 0x47191(%rip), %rsi     # 0x91969
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: QueuePresent
static int QueuePresent(lua_State *L)
    {
    int err, per_swapchain_results;
    uint32_t i, n;
    VkResult ec;
    ud_t *ud;
    VkPresentInfoKHR  *info;
    VkQueue queue = checkqueue(L, 1, &ud);
    per_swapchain_results = optboolean(L, 3, 0);
    CheckDevicePfn(L, ud, QueuePresentKHR);
#define CLEANUP zfreeVkPresentInfoKHR(L, info, 1)
    info = zcheckVkPresentInfoKHR(L, 2, &err, per_swapchain_results);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->QueuePresentKHR(queue, info);
    pushresult(L, ec);
    n = 1;
    if(per_swapchain_results)
        {   
        lua_newtable(L);
        for(i = 0; i < info->swapchainCount; i++)
            {
            pushresult(L, info->pResults[i]);
            lua_rawseti(L, -2, i+1);
            }
        n = 2;
        }
    CLEANUP;
#undef CLEANUP
    return n;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x341dc(%rip), %rcx     # 0x7e9e8
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r13
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x197c0
movl %eax, %r12d
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x270(%rax)
je 0x4a88c
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x18fc0
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x4a8a1
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x4a89d
leaq 0x470fd(%rip), %rsi     # 0x91990
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x4a91b
pushq $0x2
popq %r15
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r13, %rdi
movq %r14, %rsi
callq *0x270(%rax)
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
testl %r12d, %r12d
je 0x4a90d
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
pushq $-0x2
popq %rbp
movl 0x20(%r14), %eax
cmpq %rax, %r12
jae 0x4a90a
movq 0x38(%r14), %rax
movl (%rax,%r12,4), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18980
incq %r12
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x19120
jmp 0x4a8dd
movl %r15d, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: GetSwapchainStatus
static int GetSwapchainStatus(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkSwapchainKHR swapchain = checkswapchain(L, 1, &ud);
    VkDevice device = ud->device;
    CheckDevicePfn(L, ud, GetSwapchainStatusKHR);
    ec = ud->ddt->GetSwapchainStatusKHR(device, swapchain);
    pushresult(L, ec);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x34628(%rip), %rcx     # 0x7ef67
pushq $0x1
popq %rbx
leaq 0x8(%rsp), %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x1a500
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x260(%rcx), %rcx
testq %rcx, %rcx
je 0x4a97b
movq 0x20(%rdx), %rdi
movq %rax, %rsi
callq *%rcx
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
jmp 0x4a98e
leaq 0x47033(%rip), %rsi     # 0x919b5
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: SetHdrMetadata
static int SetHdrMetadata(lua_State *L)
    {
    ud_t **ud;
    int err;
    uint32_t count;
    VkHdrMetadataEXT *metadata;
    VkSwapchainKHR *swapchains;
#define CLEANUP do { zfreeVkHdrMetadataEXT(L, metadata, 1); Free(L, swapchains); Free(L, ud); } while(0)
    swapchains = checkswapchainlist(L, 1, &count, &err, &ud);
    if(err) return argerrorc(L, 1, err);
    CheckDevicePfn(L, ud[0], SetHdrMetadataEXT);
    metadata = zcheckVkHdrMetadataEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ud[0]->ddt->SetHdrMetadataEXT(ud[0]->device, count, swapchains, metadata);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x345b8(%rip), %r9      # 0x7ef67
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
leaq 0x14(%rsp), %r15
leaq 0x8(%rsp), %r8
movq %r15, %rcx
callq 0x19130
movl (%r15), %edi
testl %edi, %edi
je 0x4a9ef
callq 0x19950
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4c8(%rax)
je 0x4aa5f
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1a550
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x4aa75
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
jmp 0x4a9d7
leaq 0x46f7a(%rip), %rsi     # 0x919e0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x4a9e3
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movl 0x10(%rsp), %esi
movq %r14, %rdx
movq %r15, %rcx
callq *0x4c8(%rax)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
xorl %eax, %eax
jmp 0x4a9e3
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: GetSwapchainCounter
static int GetSwapchainCounter(lua_State *L)
    {
    ud_t *ud;
    uint64_t val;
    VkSwapchainKHR swapchain = checkswapchain(L, 1, &ud);
    VkSurfaceCounterFlagBitsEXT counter = (VkSurfaceCounterFlagBitsEXT)optflags(L, 2, 0);
    CheckDevicePfn(L, ud, GetSwapchainCounterEXT);
    ud->ddt->GetSwapchainCounterEXT(ud->device, swapchain, counter, &val);
    lua_pushinteger(L, val);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x34490(%rip), %rcx     # 0x7ef67
pushq $0x1
popq %rbx
leaq 0x10(%rsp), %r12
movl %ebx, %esi
movq %r12, %rdx
callq 0x1a500
movq %rax, %r15
pushq $0x2
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x19290
movq (%r12), %rcx
movq 0x50(%rcx), %rdx
movq 0x2b0(%rdx), %r8
testq %r8, %r8
je 0x4ab2f
movq 0x20(%rcx), %rdi
leaq 0x8(%rsp), %r12
movq %r15, %rsi
movl %eax, %edx
movq %r12, %rcx
callq *%r8
movq (%r12), %rsi
movq %r14, %rdi
callq 0x18b50
jmp 0x4ab42
leaq 0x46ed1(%rip), %rsi     # 0x91a07
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: newswapchain
static int newswapchain(lua_State *L, VkSwapchainKHR swapchain, VkDevice device, const VkAllocationCallbacks *allocator)
    {
    ud_t *ud, *device_ud;
    device_ud = UD(device);
    TRACE_CREATE(swapchain, "swapchain");
    ud = newuserdata_nondispatchable(L, swapchain, SWAPCHAIN_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freeswapchain;
    ud->ddt = device_ud->ddt;
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq %rdx, %rdi
callq 0x19eb0
movq %rax, %r15
movq 0x70421(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x4ab8d
leaq 0x46d2d(%rip), %rdi     # 0x918b0
movq %r12, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x343d3(%rip), %rdx     # 0x7ef67
movq %r13, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x18330
movq %r15, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%r15), %rcx
movq %rcx, 0x18(%rax)
movq %rbx, 0x40(%rax)
leaq 0x16(%rip), %rcx        # 0x4abd2
movq %rcx, 0x8(%rax)
movq 0x50(%r15), %rcx
movq %rcx, 0x50(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: freeswapchain
static int freeswapchain(lua_State *L, ud_t *ud)
    {
    VkSwapchainKHR swapchain = (VkSwapchainKHR)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;

    freechildren(L, IMAGE_MT, ud);

    if(!freeuserdata(L, ud)) return 0; /* double call */
    TRACE_DELETE(swapchain, "swapchain");
    UD(device)->ddt->DestroySwapchainKHR(device, swapchain, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %r13
movq (%rsi), %rbx
movq 0x20(%rsi), %r15
movq 0x40(%rsi), %r14
leaq 0x32da7(%rip), %rsi     # 0x7d99a
movq %r12, %rdx
callq 0x18ee0
movq %r13, %rdi
movq %r12, %rsi
callq 0x18d20
testl %eax, %eax
je 0x4ac42
movq 0x70387(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x4ac27
leaq 0x46cae(%rip), %rdi     # 0x918cb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x250(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_unref
int udata_unref(lua_State *L, uint64_t id)
/* unreference udata so that it will be garbage collected */
    {
//  printf("unref object %lu\n", id);
    udata_t *udata = udata_search(id);
    if(!udata) 
        return luaL_error(L, "invalid object identifier %I", id);
    if(udata->ref != LUA_NOREF)
        {
        luaL_unref(L, LUA_REGISTRYINDEX, udata->ref);
        udata->ref = LUA_NOREF;
        }
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4b48e
testq %rax, %rax
je 0x4b501
movq %rax, %r14
movl 0x28(%rax), %edx
cmpl $-0x2, %edx
je 0x4b4f9
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2c0
movl $0xfffffffe, 0x28(%r14) # imm = 0xFFFFFFFE
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x46585(%rip), %rsi     # 0x91a8d
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_free
int udata_free(lua_State *L, uint64_t id)
/* this should be called in the __gc metamethod
 */
    {
    udata_t *udata = udata_search(id);
//  printf("free object %lu\n", id);
    if(!udata) 
        return luaL_error(L, "invalid object identifier %I", id);
    /* release all references */
    if(udata->ref != LUA_NOREF)
        luaL_unref(L, LUA_REGISTRYINDEX, udata->ref);
    udata_remove(udata);
    Free(L, udata);
    /* mem is released by Lua at garbage collection */
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4b48e
testq %rax, %rax
je 0x4b565
movq %rax, %r14
movl 0x28(%rax), %edx
cmpl $-0x2, %edx
je 0x4b54a
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2c0
movq %r14, %rdi
callq 0x4b57e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x46521(%rip), %rsi     # 0x91a8d
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_push
int udata_push(lua_State *L, uint64_t id)
    {
    udata_t *udata = udata_search(id);
//  printf("free object %lu\n", id);
    if(!udata) 
        return luaL_error(L, "invalid object identifier %I", id);
    if(udata->ref == LUA_NOREF)
        return luaL_error(L, "unreferenced object");
    if(lua_rawgeti(L, LUA_REGISTRYINDEX, udata->ref) != LUA_TUSERDATA)
        return luaL_error(L, UNEXPECTED_ERROR);
    return 1; /* one value pushed */
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4b48e
testq %rax, %rax
je 0x4b97c
movslq 0x28(%rax), %rdx
cmpq $-0x2, %rdx
jne 0x4b997
leaq 0x4613f(%rip), %rsi     # 0x91aaa
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19bc0
leaq 0x4610a(%rip), %rsi     # 0x91a8d
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19bc0
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x18970
cmpl $0x7, %eax
jne 0x4b9b4
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x32c14(%rip), %rsi     # 0x7e5cf
leaq 0x460fc(%rip), %rdx     # 0x91abe
movq %rbx, %rdi
movl $0xa4, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_free_all
void udata_free_all(lua_State *L)
/* free all without unreferencing (for atexit()) */
    {
    udata_t *udata;
    while((udata = udata_first(0)))
        {
        udata_remove(udata);
        Free(L, udata);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x4ba0b
testq %rax, %rax
je 0x4ba03
movq %rax, %r14
movq %rax, %rdi
callq 0x4b57e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
jmp 0x4b9df
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_scan
int udata_scan(lua_State *L, const char *mt,  
            void *info, int (*func)(lua_State *L, const void *mem, const char* mt, const void *info))
/* scans the udata database, and calls the func callback for every 'mt' object found
 * (the object may be deleted in the callback).
 * func must return 0 to continue the scan, !=0 to interrupt it.
 * returns 1 if interrupted, 0 otherwise
 */
    {
    int stop = 0;
    uint64_t id = 0;
    udata_t *udata;
    while((udata = udata_first(id)))
        {
        id = udata->id + 1;
        if(mt == udata->mt)
            {
            stop = func(L, (const void*)(udata->mem), mt, info);
            if(stop) return 1;
            }
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebx, %ebx
xorl %ebp, %ebp
movq %rbp, %rdi
callq 0x4ba0b
testq %rax, %rax
je 0x4ba81
movq 0x20(%rax), %rbp
incq %rbp
cmpq %r12, 0x38(%rax)
jne 0x4ba4e
movq 0x30(%rax), %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq *%r14
testl %eax, %eax
je 0x4ba4e
pushq $0x1
popq %rax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_test
void *udata_test(lua_State *L, int arg, const char *mt)
/* same as luaL_testudata(), but succeeds also if the userdata has not
 * mt as metatable but as ancestor
 */ 
    {
    void *mem;
    int ok;
    if((mem = luaL_testudata(L, arg, mt)))
        return mem;
    
    if((mem = lua_touserdata(L, arg)) == NULL)
        return NULL;

    if(luaL_getmetatable(L, mt)!=LUA_TTABLE)
        { luaL_error(L, "cannot find metatable '%s'", mt); return NULL; }
    ok = is_subclass(L, arg, lua_gettop(L));
    lua_pop(L, 1);
    return ok ? mem : NULL;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
callq 0x19480
movq %rax, %rbx
testq %rax, %rax
je 0x4babc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl %ebp, %esi
callq 0x183c0
testq %rax, %rax
je 0x4bb0e
movq %rax, %rbx
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r15, %rdx
callq 0x1a460
cmpl $0x5, %eax
jne 0x4bb12
movq %r14, %rdi
callq 0x180a0
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x4bb2a
movl %eax, %ebp
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x18150
xorl %eax, %eax
testl %ebp, %ebp
cmoveq %rax, %rbx
jmp 0x4baae
xorl %ebx, %ebx
jmp 0x4baae
leaq 0x45fad(%rip), %rsi     # 0x91ac6
xorl %ebx, %ebx
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x19bc0
jmp 0x4baae
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: is_subclass
static int is_subclass(lua_State *L, int arg, int mt_index)
    {
    int ok;
    if(luaL_getmetafield(L, arg, "__index") == LUA_TNIL)
        return 0;
    if(lua_rawequal(L, mt_index, lua_gettop(L)))
        {
        lua_pop(L, 1);
        return 1;
        }
    ok = is_subclass(L, lua_gettop(L), mt_index);
    lua_pop(L, 1);
    return ok;
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x45fc5(%rip), %rdx     # 0x91afe
callq 0x19a40
testl %eax, %eax
je 0x4bb5f
movq %rbx, %rdi
callq 0x180a0
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x19920
testl %eax, %eax
je 0x4bb63
pushq $0x1
popq %rbp
jmp 0x4bb79
xorl %ebp, %ebp
jmp 0x4bb84
movq %rbx, %rdi
callq 0x180a0
movq %rbx, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x4bb2a
movl %eax, %ebp
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18150
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_define
int udata_define(lua_State *L, const char* mt, const luaL_Reg* methods, const luaL_Reg* metamethods)
    {
    /* create the metatable */
    if(!luaL_newmetatable(L, mt))
        return luaL_error(L, "cannot create metatable '%s'", mt);
    lua_pushvalue(L, -1);
    lua_setfield(L, -2, "__index");
    if(metamethods)
        /* add metamethods */
        luaL_setfuncs(L, metamethods, 0);
    if(methods)
        {
        /* add methods */
        luaL_getsubtable(L, -1, "__index");
        luaL_setfuncs(L, methods, 0);
        lua_pop(L, 1);
        }
    lua_pop(L, 1);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
callq 0x1a210
testl %eax, %eax
je 0x4bc21
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x18e80
leaq 0x45f42(%rip), %rdx     # 0x91afe
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18af0
testq %r15, %r15
je 0x4bbd9
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x183e0
testq %r14, %r14
je 0x4bc08
leaq 0x45f19(%rip), %rdx     # 0x91afe
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x18c60
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x183e0
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18150
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18150
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x45eb9(%rip), %rsi     # 0x91ae1
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_inherit
int udata_inherit(lua_State *L, const char *sub, const char *super)
/* Sets  metatable(sub).__index = metatable(super)
 *
 * This way, if one accesses a field/method of a 'sub' object which is not defined in
 * the 'sub' metatable, Lua searches for it in the 'super' metatable (i.e., the 'sub'
 * type inherits from 'super').
 */
    {
    if(luaL_getmetatable(L, sub)!=LUA_TTABLE)
        return luaL_error(L, "cannot find metatable '%s'", sub);
    luaL_getsubtable(L, -1, "__index");
    if(luaL_getmetatable(L, super)!=LUA_TTABLE)
        return luaL_error(L, "cannot find metatable '%s'", super);
    lua_setmetatable(L, -2);
    lua_pop(L, 2);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r15, %rdx
callq 0x1a460
cmpl $0x5, %eax
jne 0x4bca5
leaq 0x45e97(%rip), %rdx     # 0x91afe
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x18c60
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r14, %rdx
callq 0x1a460
cmpl $0x5, %eax
jne 0x4bcb4
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x190f0
pushq $-0x3
popq %rsi
movq %rbx, %rdi
callq 0x18150
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x45e1a(%rip), %rsi     # 0x91ac6
movq %rbx, %rdi
movq %r15, %rdx
jmp 0x4bcc1
leaq 0x45e0b(%rip), %rsi     # 0x91ac6
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/udata.c
// Function: moonvulkan_udata_addmethods
int udata_addmethods(lua_State *L, const char* mt, const luaL_Reg* methods)
/* Adds methods to the metatable mt */
    {
    if(luaL_getmetatable(L, mt)!=LUA_TTABLE)
        return luaL_error(L, "cannot find metatable '%s'", mt);
    if(methods)
        {
        /* add methods */
        luaL_getsubtable(L, -1, "__index");
        luaL_setfuncs(L, methods, 0);
        lua_pop(L, 1);
        }
    lua_pop(L, 1);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r15, %rdx
callq 0x1a460
cmpl $0x5, %eax
jne 0x4bd2f
testq %r14, %r14
je 0x4bd1c
leaq 0x45e05(%rip), %rdx     # 0x91afe
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x18c60
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x183e0
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18150
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18150
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x45d90(%rip), %rsi     # 0x91ac6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_now
double now(void)
    {
#if _POSIX_C_SOURCE >= 199309L
    struct timespec ts;
    if(clock_gettime(CLOCK_MONOTONIC,&ts)!=0)
        { printf("clock_gettime error\n"); return -1; }
    return ts.tv_sec + ts.tv_nsec*1.0e-9;
#else
    struct timeval tv;
    if(gettimeofday(&tv, NULL) != 0)
        { printf("gettimeofday error\n"); return -1; }
    return tv.tv_sec + tv.tv_usec*1.0e-6;
#endif
    }

// Assembly:
subq $0x18, %rsp
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x185c0
testl %eax, %eax
je 0x4bd84
leaq 0x45eae(%rip), %rdi     # 0x91c23
callq 0x183b0
movsd 0x45d86(%rip), %xmm0    # 0x91b08
jmp 0x4bd9e
cvtsi2sdq 0x8(%rsp), %xmm1
cvtsi2sdq 0x10(%rsp), %xmm0
mulsd 0x45d76(%rip), %xmm0    # 0x91b10
addsd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_checkstringlist
char** checkstringlist(lua_State *L, int arg, uint32_t *count, int *err)
    {
    int t;
    char** list;
    const char* s;
    uint32_t i;
    *count = 0;
    *err = 0;
    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 = (char**)MallocNoErr(L, sizeof(char*) * (*count + 1));
    if(!list)
        { *err = ERR_MEMORY; return NULL; }
    for(i=0; i<*count; i++)
        {
        t = lua_rawgeti(L, arg, i+1);
        if(t != LUA_TSTRING)
            {
            lua_pop(L, 1);
            freestringlist(L, list, *count);
            *count = 0;
            *err = ERR_TYPE;
            return NULL;
            }
        s = lua_tostring(L, -1);
        list[i] = Strdup(L, s);
        lua_pop(L, 1);
        }
    /* list[*count]=NULL; */
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %esi, %ebp
movq %rdx, 0x8(%rsp)
andl $0x0, (%rdx)
movq %rdi, %r15
andl $0x0, (%rcx)
callq 0x1a110
testl %eax, %eax
jle 0x4c088
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x4c08c
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a140
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x4c090
leaq 0x8(,%rax,8), %rax
movabsq $0x7fffffff8, %rsi      # imm = 0x7FFFFFFF8
andq %rax, %rsi
callq 0x18050
testq %rax, %rax
je 0x4c094
movq %rax, %r13
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
pushq $-0x2
popq %r12
movq 0x8(%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r14
jae 0x4c09e
leaq 0x1(%r14), %rbx
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x18970
cmpl $0x4, %eax
jne 0x4c0b0
movq %r15, %rdi
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x18680
movq %r15, %rdi
movq %rax, %rsi
callq 0x19060
movq %rax, (%r13,%r14,8)
movq %r15, %rdi
movl %r12d, %esi
callq 0x18150
movq %rbx, %r14
jmp 0x4c039
pushq $0x1
jmp 0x4c096
pushq $-0x4
jmp 0x4c096
pushq $-0x5
jmp 0x4c096
pushq $-0x6
popq %r12
movl %r12d, (%rbx)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movl %r12d, %esi
callq 0x18150
movq 0x8(%rsp), %rbx
movl (%rbx), %edx
movq %r13, %rsi
callq 0x19900
andl $0x0, (%rbx)
movq 0x10(%rsp), %rbx
jmp 0x4c098
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_freestringlist
void freestringlist(lua_State *L, char** list, uint32_t count)
    {
    uint32_t i;
    if(!list)
        return;
    for(i=0; i<count; i++)
        Free(L, list[i]);
    Free(L, list);
    }

// Assembly:
testq %rsi, %rsi
je 0x4c107
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edx, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x4c0fa
movq (%rbx,%r15,8), %rsi
callq 0x182e0
incq %r15
jmp 0x4c0e7
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x182e0
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_pushstringlist
void pushstringlist(lua_State *L, char** list, uint32_t count)
    {
    uint32_t i;
    lua_newtable(L);
    for(i=0; i<count; i++)
        {
        lua_pushstring(L, list[i]);
        lua_rawseti(L, -2, i+1);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl %ebp, %r12d
negq %r12
pushq $0x1
popq %r15
pushq $-0x2
popq %rbp
leaq (%r12,%r15), %rax
cmpq $0x1, %rax
je 0x4c157
movq -0x8(%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x1a2e0
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x19120
incq %r15
jmp 0x4c12e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_checkuint32list
uint32_t* checkuint32list(lua_State *L, int arg, uint32_t *count, int *err)
    {
    uint32_t* list;
    uint32_t i;

    *count = 0;
    *err = 0;
    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 = (uint32_t*)MallocNoErr(L, sizeof(uint32_t) * (*count));
    if(!list)
        { *count = 0; *err = ERR_MEMORY; return NULL; }

    for(i=0; i<*count; i++)
        {
        lua_rawgeti(L, arg, i+1);
        if(!lua_isinteger(L, -1))
            { lua_pop(L, 1); Free(L, list); *count = 0; *err = ERR_TYPE; return NULL; }
        list[i] = lua_tointeger(L, -1);
        lua_pop(L, 1);
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %esi, %ebp
movq %rdx, (%rsp)
andl $0x0, (%rdx)
movq %rdi, %r15
andl $0x0, (%rcx)
callq 0x1a110
testl %eax, %eax
jle 0x4c230
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x4c234
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a140
movq (%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x4c238
movl %eax, %esi
shlq $0x2, %rsi
callq 0x18050
testq %rax, %rax
je 0x4c252
movq %rax, %r13
movl %ebp, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
pushq $-0x2
popq %rbp
pushq $-0x1
popq %r12
movq (%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r14
jae 0x4c240
leaq 0x1(%r14), %rbx
movq %r15, %rdi
movl 0xc(%rsp), %esi
movq %rbx, %rdx
callq 0x18970
movq %r15, %rdi
movl %r12d, %esi
callq 0x1a5e0
testl %eax, %eax
je 0x4c257
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x18640
movl %eax, (%r13,%r14,4)
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %rbx, %r14
jmp 0x4c1e2
pushq $0x1
jmp 0x4c23a
pushq $-0x4
jmp 0x4c23a
pushq $-0x5
popq %rbp
movl %ebp, (%rbx)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x6
popq %rbp
jmp 0x4c26e
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %r13, %rsi
callq 0x182e0
movq 0x10(%rsp), %rbx
movq (%rsp), %rax
andl $0x0, (%rax)
jmp 0x4c23b
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_pushuint32list
void pushuint32list(lua_State *L, uint32_t *list, uint32_t count)
    {
    uint32_t i;
    lua_newtable(L);
    for(i=0; i<count; i++)
        {
        lua_pushinteger(L, list[i]);
        lua_rawseti(L, -2, i+1);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl %ebp, %r12d
negq %r12
pushq $0x1
popq %r15
pushq $-0x2
popq %rbp
leaq (%r12,%r15), %rax
cmpq $0x1, %rax
je 0x4c2c6
movl -0x4(%rbx,%r15,4), %esi
movq %r14, %rdi
callq 0x18b50
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x19120
incq %r15
jmp 0x4c29d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_checkbooleanlist
VkBool32* checkbooleanlist(lua_State *L, int arg, uint32_t *count, int *err)
    {
    VkBool32* list;
    uint32_t i;

    *count = 0;
    *err = 0;
    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 = (VkBool32*)MallocNoErr(L, sizeof(VkBool32) * (*count));
    if(!list)
        { *count = 0; *err = ERR_MEMORY; return NULL; }

    for(i=0; i<*count; i++)
        {
        lua_rawgeti(L, arg, i+1);
        if(!lua_isboolean(L, -1))
            { lua_pop(L, 1); Free(L, list); *count = 0; *err = ERR_TYPE; return NULL; }
        list[i] = lua_toboolean(L, -1);
        lua_pop(L, 1);
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %esi, %ebp
movq %rdx, (%rsp)
andl $0x0, (%rdx)
movq %rdi, %r15
andl $0x0, (%rcx)
callq 0x1a110
testl %eax, %eax
jle 0x4c39a
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x4c39e
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a140
movq (%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x4c3a2
movl %eax, %esi
shlq $0x2, %rsi
callq 0x18050
testq %rax, %rax
je 0x4c3bc
movq %rax, %r13
movl %ebp, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
pushq $-0x2
popq %rbp
pushq $-0x1
popq %r12
movq (%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r14
jae 0x4c3aa
leaq 0x1(%r14), %rbx
movq %r15, %rdi
movl 0xc(%rsp), %esi
movq %rbx, %rdx
callq 0x18970
movq %r15, %rdi
movl %r12d, %esi
callq 0x1a110
cmpl $0x1, %eax
jne 0x4c3c1
movq %r15, %rdi
movl %r12d, %esi
callq 0x18320
movl %eax, (%r13,%r14,4)
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %rbx, %r14
jmp 0x4c34d
pushq $0x1
jmp 0x4c3a4
pushq $-0x4
jmp 0x4c3a4
pushq $-0x5
popq %rbp
movl %ebp, (%rbx)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x6
popq %rbp
jmp 0x4c3d8
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %r13, %rsi
callq 0x182e0
movq 0x10(%rsp), %rbx
movq (%rsp), %rax
andl $0x0, (%rax)
jmp 0x4c3a5
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_pushbooleanlist
void pushbooleanlist(lua_State *L, VkBool32 *list, uint32_t count)
    {
    uint32_t i;
    lua_newtable(L);
    for(i=0; i<count; i++)
        {
        lua_pushboolean(L, list[i]);
        lua_rawseti(L, -2, i+1);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl %ebp, %r12d
negq %r12
pushq $0x1
popq %r15
pushq $-0x2
popq %rbp
leaq (%r12,%r15), %rax
cmpq $0x1, %rax
je 0x4c430
movl -0x4(%rbx,%r15,4), %esi
movq %r14, %rdi
callq 0x193a0
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x19120
incq %r15
jmp 0x4c407
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_checkint32list
int32_t* checkint32list(lua_State *L, int arg, uint32_t *count, int *err)
    {
    int32_t* list;
    uint32_t i;

    *count = 0;
    *err = 0;
    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 = (int32_t*)MallocNoErr(L, sizeof(int32_t) * (*count));
    if(!list)
        { *count = 0; *err = ERR_MEMORY; return NULL; }

    for(i=0; i<*count; i++)
        {
        lua_rawgeti(L, arg, i+1);
        if(!lua_isinteger(L, -1))
            { lua_pop(L, 1); Free(L, list); *count = 0; *err = ERR_TYPE; return NULL; }
        list[i] = lua_tointeger(L, -1);
        lua_pop(L, 1);
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %esi, %ebp
movq %rdx, (%rsp)
andl $0x0, (%rdx)
movq %rdi, %r15
andl $0x0, (%rcx)
callq 0x1a110
testl %eax, %eax
jle 0x4c509
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x4c50d
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a140
movq (%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x4c511
movl %eax, %esi
shlq $0x2, %rsi
callq 0x18050
testq %rax, %rax
je 0x4c52b
movq %rax, %r13
movl %ebp, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
pushq $-0x2
popq %rbp
pushq $-0x1
popq %r12
movq (%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r14
jae 0x4c519
leaq 0x1(%r14), %rbx
movq %r15, %rdi
movl 0xc(%rsp), %esi
movq %rbx, %rdx
callq 0x18970
movq %r15, %rdi
movl %r12d, %esi
callq 0x1a5e0
testl %eax, %eax
je 0x4c530
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x18640
movl %eax, (%r13,%r14,4)
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %rbx, %r14
jmp 0x4c4bb
pushq $0x1
jmp 0x4c513
pushq $-0x4
jmp 0x4c513
pushq $-0x5
popq %rbp
movl %ebp, (%rbx)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x6
popq %rbp
jmp 0x4c547
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %r13, %rsi
callq 0x182e0
movq 0x10(%rsp), %rbx
movq (%rsp), %rax
andl $0x0, (%rax)
jmp 0x4c514
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_pushint32list
void pushint32list(lua_State *L, int32_t *list, uint32_t count)
    {
    uint32_t i;
    lua_newtable(L);
    for(i=0; i<count; i++)
        {
        lua_pushinteger(L, list[i]);
        lua_rawseti(L, -2, i+1);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl %ebp, %r12d
negq %r12
pushq $0x1
popq %r15
pushq $-0x2
popq %rbp
leaq (%r12,%r15), %rax
cmpq $0x1, %rax
je 0x4c59f
movslq -0x4(%rbx,%r15,4), %rsi
movq %r14, %rdi
callq 0x18b50
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x19120
incq %r15
jmp 0x4c576
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_checkuint64list
uint64_t* checkuint64list(lua_State *L, int arg, uint32_t *count, int *err)
    {
    uint64_t* list;
    uint32_t i;

    *count = 0;
    *err = 0;
    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; }

    for(i=0; i<*count; i++)
        {
        lua_rawgeti(L, arg, i+1);
        if(!lua_isinteger(L, -1))
            { lua_pop(L, 1); Free(L, list); *count = 0; *err = ERR_TYPE; return NULL; }
        list[i] = lua_tointeger(L, -1);
        lua_pop(L, 1);
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %esi, %ebp
movq %rdx, (%rsp)
andl $0x0, (%rdx)
movq %rdi, %r15
andl $0x0, (%rcx)
callq 0x1a110
testl %eax, %eax
jle 0x4c678
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x4c67c
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a140
movq (%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x4c680
movl %eax, %esi
shlq $0x3, %rsi
callq 0x18050
testq %rax, %rax
je 0x4c69a
movq %rax, %r13
movl %ebp, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
pushq $-0x2
popq %rbp
pushq $-0x1
popq %r12
movq (%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r14
jae 0x4c688
leaq 0x1(%r14), %rbx
movq %r15, %rdi
movl 0xc(%rsp), %esi
movq %rbx, %rdx
callq 0x18970
movq %r15, %rdi
movl %r12d, %esi
callq 0x1a5e0
testl %eax, %eax
je 0x4c69f
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x18640
movq %rax, (%r13,%r14,8)
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %rbx, %r14
jmp 0x4c62a
pushq $0x1
jmp 0x4c682
pushq $-0x4
jmp 0x4c682
pushq $-0x5
popq %rbp
movl %ebp, (%rbx)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x6
popq %rbp
jmp 0x4c6b6
movq %r15, %rdi
movl %ebp, %esi
callq 0x18150
movq %r13, %rsi
callq 0x182e0
movq 0x10(%rsp), %rbx
movq (%rsp), %rax
andl $0x0, (%rax)
jmp 0x4c683
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_pushuint64list
void pushuint64list(lua_State *L, uint64_t *list, uint32_t count)
    {
    uint32_t i;
    lua_newtable(L);
    for(i=0; i<count; i++)
        {
        lua_pushinteger(L, list[i]);
        lua_rawseti(L, -2, i+1);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl %ebp, %r12d
negq %r12
pushq $0x1
popq %r15
pushq $-0x2
popq %rbp
leaq (%r12,%r15), %rax
cmpq $0x1, %rax
je 0x4c70e
movq -0x8(%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x18b50
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x19120
incq %r15
jmp 0x4c6e5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_checkdevicesize
VkDeviceSize checkdevicesize(lua_State *L, int arg)
    {
    const char *s;
    if(lua_type(L, arg) == LUA_TSTRING)
        {
        s = lua_tostring(L, arg);
        if(strcmp(s, "whole size") == 0)
            return VK_WHOLE_SIZE;
        else
            return argerrorc(L, arg, ERR_VALUE);
        }
    return (VkDeviceSize)luaL_checkinteger(L, arg);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x1a110
cmpl $0x4, %eax
jne 0x4c75e
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x18680
leaq 0x45428(%rip), %rsi     # 0x91b65
movq %rax, %rdi
callq 0x18fe0
testl %eax, %eax
je 0x4c76f
leaq 0x4546c(%rip), %rdx     # 0x91bbc
movq %r14, %rdi
movl %ebx, %esi
callq 0x18420
cltq
jmp 0x4c772
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x190d0
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq