LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x436bc(%rip), %rcx     # 0x90f67
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rcx
movq 0x50(%rcx), %rax
movq 0x258(%rax), %rax
testq %rax, %rax
je 0x4d900
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 0x4d922
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4d911
leaq 0x55fee(%rip), %rsi     # 0xa38f5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
callq 0x187e0
movl 0x4(%rsp), %esi
movl $0x1, %ebp
testq %rsi, %rsi
je 0x4d913
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x19210
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 0x4d982
movl %eax, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
jmp 0x4d8f1
cmpl $0x0, 0x4(%rsp)
je 0x4d9b9
xorl %r15d, %r15d
movq (%r14,%r15,8), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x18260
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
movl 0x4(%rsp), %eax
cmpq %rax, %r15
jb 0x4d98c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
jmp 0x4d913
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43586(%rip), %rcx     # 0x90f67
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a130
cmpl $0x5, %eax
jne 0x4da73
movq 0x10(%rsp), %rbp
movq 0x50(%rbp), %rax
cmpq $0x0, 0x560(%rax)
je 0x4da73
movq 0x20(%rbp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19b70
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x4db1a
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4db77
movq 0x10(%rsp), %rbp
movq 0x20(%rbp), %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x19ba0
movq %rax, %r12
leaq 0x43503(%rip), %rcx     # 0x90f96
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a4d0
movq %rax, %r13
leaq 0x434ff(%rip), %rcx     # 0x90fab
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x1a4d0
movq 0x50(%rbp), %rcx
movq 0x268(%rcx), %r10
testq %r10, %r10
je 0x4dafd
leaq 0x8(%rsp), %r9
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
callq *%r10
movl %eax, %ebp
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
je 0x4daef
testl %ebp, %ebp
jne 0x4db10
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0x18b60
jmp 0x4db66
leaq 0x55e1c(%rip), %rsi     # 0xa3920
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4db77
movq %rbx, %rdi
callq 0x19d20
jmp 0x4db66
movq %r14, 0x10(%r15)
movq 0x50(%rbp), %rax
leaq 0xc(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq *0x560(%rax)
movl %eax, %ebp
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
je 0x4db40
testl %ebp, %ebp
jne 0x4db4e
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x18b60
jmp 0x4db56
movq %rbx, %rdi
callq 0x19d20
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movl $0x2, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x433ca(%rip), %rcx     # 0x90f67
movl $0x1, %ebx
leaq 0x8(%rsp), %r13
movl $0x1, %esi
movq %r13, %rdx
callq 0x1a520
movq %rax, %r15
movq %r14, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r12
movq %r14, %rdi
movl $0x3, %esi
callq 0x190f0
movq (%r13), %rcx
movq 0x50(%rcx), %rdx
movq 0x628(%rdx), %r8
testq %r8, %r8
je 0x4dc06
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 0x18990
jmp 0x4dc19
leaq 0x55d3c(%rip), %rsi     # 0xa3949
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
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_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x42da9(%rip), %rcx     # 0x909e8
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x197e0
movl %eax, %ebp
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x270(%rax)
je 0x4dcc6
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x18fe0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4dcde
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4dcd7
leaq 0x55ca3(%rip), %rsi     # 0xa3970
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebp
jmp 0x4dd62
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x270(%rax)
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
testl %ebp, %ebp
je 0x4dd4d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
movl $0x2, %ebp
cmpl $0x0, 0x20(%r14)
je 0x4dd52
xorl %r15d, %r15d
movq 0x38(%r14), %rax
movl (%rax,%r15,4), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18990
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
movl 0x20(%r14), %eax
cmpq %rax, %r15
jb 0x4dd1d
jmp 0x4dd52
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x431e3(%rip), %rcx     # 0x90f67
movl $0x1, %ebx
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x260(%rcx), %rcx
testq %rcx, %rcx
je 0x4ddc5
movq 0x20(%rdx), %rdi
movq %rax, %rsi
callq *%rcx
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
jmp 0x4ddd8
leaq 0x55bc9(%rip), %rsi     # 0xa3995
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4316e(%rip), %r9      # 0x90f67
leaq 0x10(%rsp), %rdx
leaq 0x14(%rsp), %r15
leaq 0x8(%rsp), %r8
movl $0x1, %esi
movq %r15, %rcx
callq 0x19150
movl (%r15), %edi
testl %edi, %edi
je 0x4de3d
callq 0x19970
movq %rbx, %rdi
movl $0x1, %esi
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 0x4deb9
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a570
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x4decf
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x4de29
leaq 0x55b00(%rip), %rsi     # 0xa39c0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4de31
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)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
xorl %eax, %eax
jmp 0x4de31
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43034(%rip), %rcx     # 0x90f67
movl $0x1, %ebx
leaq 0x10(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r15
movq %r14, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192b0
movq (%r12), %rcx
movq 0x50(%rcx), %rdx
movq 0x2b0(%rdx), %r8
testq %r8, %r8
je 0x4df92
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 0x18b60
jmp 0x4dfa5
leaq 0x55a4e(%rip), %rsi     # 0xa39e7
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x19ed0
movq %rax, %r15
movq 0x74fee(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4dff0
leaq 0x558aa(%rip), %rdi     # 0xa3890
movq %r12, %rsi
xorl %eax, %eax
callq 0x18970
leaq 0x42f70(%rip), %rdx     # 0x90f67
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        # 0x4e035
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_O1/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 0x41944(%rip), %rsi     # 0x8f99a
movq %r12, %rdx
callq 0x18f00
movq %r13, %rdi
movq %r12, %rsi
callq 0x18d30
testl %eax, %eax
je 0x4e0a5
movq 0x74f54(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4e08a
leaq 0x5582b(%rip), %rdi     # 0xa38ab
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
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
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq %rsi, %rdx
movq 0x75a1f(%rip), %rbx     # 0xc43b8
testq %rbx, %rbx
je 0x4e9af
cmpq %rdx, 0x20(%rbx)
ja 0x4e9aa
jae 0x4e9b1
addq $0x8, %rbx
movq (%rbx), %rbx
jmp 0x4e999
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x4e9d3
movl 0x28(%rbx), %edx
cmpl $-0x2, %edx
je 0x4e9cf
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2e0
movl $0xfffffffe, 0x28(%rbx) # imm = 0xFFFFFFFE
xorl %eax, %eax
popq %rbx
retq
leaq 0x55093(%rip), %rsi     # 0xa3a6d
xorl %eax, %eax
popq %rbx
jmp 0x19be0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq %rdi, %rbx
movq 0x759c5(%rip), %r14     # 0xc43b8
testq %r14, %r14
je 0x4ea09
cmpq %rdx, 0x20(%r14)
ja 0x4ea04
jae 0x4ea0c
addq $0x8, %r14
movq (%r14), %r14
jmp 0x4e9f3
xorl %r14d, %r14d
testq %r14, %r14
je 0x4ea44
movl 0x28(%r14), %edx
cmpl $-0x2, %edx
je 0x4ea27
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2e0
movq %r14, %rdi
callq 0x4ea5c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x55022(%rip), %rsi     # 0xa3a6d
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19be0
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq %rsi, %rdx
movq %rdi, %rbx
movq 0x75579(%rip), %rax     # 0xc43b8
testq %rax, %rax
je 0x4ee55
cmpq %rdx, 0x20(%rax)
ja 0x4ee50
jae 0x4ee57
addq $0x8, %rax
movq (%rax), %rax
jmp 0x4ee3f
xorl %eax, %eax
testq %rax, %rax
je 0x4ee78
movslq 0x28(%rax), %rdx
cmpq $-0x2, %rdx
jne 0x4ee8a
leaq 0x54c1d(%rip), %rsi     # 0xa3a8a
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x19be0
leaq 0x54bee(%rip), %rsi     # 0xa3a6d
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x19be0
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x18980
cmpl $0x7, %eax
jne 0x4eea3
movl $0x1, %eax
popq %rbx
retq
leaq 0x41725(%rip), %rsi     # 0x905cf
leaq 0x54bed(%rip), %rdx     # 0xa3a9e
movq %rbx, %rdi
movl $0xa4, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x19be0
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x754e9(%rip), %rax     # 0xc43b8
testq %rax, %rax
je 0x4eee8
movq %rax, %r14
cmpq $0x0, 0x20(%rax)
je 0x4eeeb
movq (%r14), %rax
testq %rax, %rax
jne 0x4eed4
jmp 0x4eeeb
xorl %r14d, %r14d
testq %r14, %r14
je 0x4ef05
movq %r14, %rdi
callq 0x4ea5c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
jmp 0x4eec8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq 0x7548c(%rip), %rcx     # 0xc43b8
xorl %eax, %eax
testq %rcx, %rcx
je 0x4ef4c
cmpq %r13, 0x20(%rcx)
jbe 0x4ef3e
movq %rcx, %rax
jmp 0x4ef44
jae 0x4ef49
addq $0x8, %rcx
movq (%rcx), %rcx
jmp 0x4ef2e
movq %rcx, %rax
testq %rax, %rax
je 0x4ef78
movq 0x20(%rax), %r13
incq %r13
cmpq %r15, 0x38(%rax)
jne 0x4ef25
movq 0x30(%rax), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq *%rbx
testl %eax, %eax
je 0x4ef25
movl $0x1, %eax
jmp 0x4ef7a
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x194a0
movq %rax, %rbx
testq %rax, %rax
je 0x4efae
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 0x4f002
movq %rax, %rbx
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r15, %rdx
callq 0x1a480
cmpl $0x5, %eax
jne 0x4f006
movq %r14, %rdi
callq 0x180a0
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x4f01e
movl %eax, %ebp
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
xorl %eax, %eax
testl %ebp, %ebp
cmoveq %rax, %rbx
jmp 0x4efa0
xorl %ebx, %ebx
jmp 0x4efa0
leaq 0x54a99(%rip), %rsi     # 0xa3aa6
xorl %ebx, %ebx
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x19be0
jmp 0x4efa0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x54ab0(%rip), %rdx     # 0xa3ade
callq 0x19a60
testl %eax, %eax
je 0x4f07b
movq %rbx, %rdi
callq 0x180a0
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x19940
movl $0x1, %r14d
testl %eax, %eax
jne 0x4f06c
movq %rbx, %rdi
callq 0x180a0
movq %rbx, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x4f01e
movl %eax, %r14d
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
jmp 0x4f07e
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a230
testl %eax, %eax
je 0x4f128
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18ea0
leaq 0x54a23(%rip), %rdx     # 0xa3ade
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18b00
testq %r15, %r15
je 0x4f0da
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x183e0
testq %r14, %r14
je 0x4f10d
leaq 0x549f8(%rip), %rdx     # 0xa3ade
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18c70
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x183e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x54992(%rip), %rsi     # 0xa3ac1
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x19be0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a480
cmpl $0x5, %eax
jne 0x4f1b2
leaq 0x54970(%rip), %rdx     # 0xa3ade
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18c70
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r14, %rdx
callq 0x1a480
cmpl $0x5, %eax
jne 0x4f1c1
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19110
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x18150
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x548ed(%rip), %rsi     # 0xa3aa6
movq %rbx, %rdi
movq %r15, %rdx
jmp 0x4f1ce
leaq 0x548de(%rip), %rsi     # 0xa3aa6
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19be0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a480
cmpl $0x5, %eax
jne 0x4f242
testq %r14, %r14
je 0x4f22d
leaq 0x548d8(%rip), %rdx     # 0xa3ade
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18c70
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x183e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5485d(%rip), %rsi     # 0xa3aa6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19be0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0x8(%rsp), %rsi
movl $0x1, %edi
callq 0x185c0
testl %eax, %eax
je 0x4f29a
leaq 0x54978(%rip), %rdi     # 0xa3c03
callq 0x183b0
movsd 0x54850(%rip), %xmm0    # 0xa3ae8
jmp 0x4f2b4
cvtsi2sdq 0x8(%rsp), %xmm1
cvtsi2sdq 0x10(%rsp), %xmm0
mulsd 0x54840(%rip), %xmm0    # 0xa3af0
addsd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
callq 0x1a130
testl %eax, %eax
jle 0x4f563
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a130
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x4f61f
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a160
movl %eax, (%r14)
testl %eax, %eax
je 0x4f56d
movq %r12, (%rsp)
leaq 0x8(,%rax,8), %rax
movabsq $0x7fffffff8, %r13      # imm = 0x7FFFFFFF8
andq %rax, %r13
movq 0x74e77(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4f577
movq 0x74e73(%rip), %rdi     # 0xc43c8
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
callq *%rax
movq %rax, %r12
jmp 0x4f57a
movl $0x1, %ebx
jmp 0x4f61f
movl $0xfffffffb, %ebx       # imm = 0xFFFFFFFB
jmp 0x4f61f
xorl %r12d, %r12d
testq %r12, %r12
je 0x4f58e
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x18b50
jmp 0x4f591
xorl %r12d, %r12d
testq %r12, %r12
je 0x4f5f0
cmpl $0x0, (%r14)
je 0x4f626
xorl %ebx, %ebx
leaq 0x1(%rbx), %r13
movq %r15, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18980
cmpl $0x4, %eax
jne 0x4f5f7
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %r15, %rdi
movq %rax, %rsi
callq 0x19080
movq %rax, (%r12,%rbx,8)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %eax
movq %r13, %rbx
cmpq %rax, %r13
jb 0x4f5a2
jmp 0x4f626
movl $0xfffffffa, %ebx       # imm = 0xFFFFFFFA
jmp 0x4f61b
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %edx
movq %r12, %rsi
callq 0x19920
movl $0x0, (%r14)
movq (%rsp), %r12
movl %ebx, (%r12)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x4f69a
movq %rsi, %rbx
testl %edx, %edx
je 0x4f679
movl %edx, %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x4f671
movq 0x74d61(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4f671
movq 0x74d5d(%rip), %rdi     # 0xc43c8
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
incq %r15
cmpq %r15, %r14
jne 0x4f64f
movq 0x74d40(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4f69a
movq 0x74d3c(%rip), %rdi     # 0xc43c8
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmpq *%rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x187e0
testl %ebp, %ebp
je 0x4f6f6
movl %ebp, %r12d
negq %r12
movl $0x1, %r15d
movq -0x8(%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x1a300
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
leaq (%r12,%r15), %rax
incq %rax
incq %r15
cmpq $0x1, %rax
jne 0x4f6c9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
callq 0x1a130
testl %eax, %eax
jle 0x4f776
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a130
movl $0xfffffffc, %r13d      # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x4f84c
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a160
movl %eax, (%r14)
testl %eax, %eax
je 0x4f781
movl %eax, %r13d
shlq $0x2, %r13
movq 0x74c64(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4f78c
movq 0x74c60(%rip), %rdi     # 0xc43c8
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
callq *%rax
movq %rax, %r12
jmp 0x4f78f
movl $0x1, %r13d
jmp 0x4f84c
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
jmp 0x4f84c
xorl %r12d, %r12d
testq %r12, %r12
je 0x4f7a3
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x18b50
jmp 0x4f7a6
xorl %r12d, %r12d
testq %r12, %r12
je 0x4f80a
cmpl $0x0, (%r14)
je 0x4f852
movq %rbx, (%rsp)
xorl %ebx, %ebx
leaq 0x1(%rbx), %r13
movq %r15, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18980
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a600
testl %eax, %eax
je 0x4f812
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18640
movl %eax, (%r12,%rbx,4)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %eax
movq %r13, %rbx
cmpq %rax, %r13
jb 0x4f7bb
jmp 0x4f852
movl $0xfffffffa, %r13d      # imm = 0xFFFFFFFA
jmp 0x4f845
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq 0x74b94(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4f841
movq 0x74b90(%rip), %rdi     # 0xc43c8
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
movq (%rsp), %rbx
movl $0x0, (%r14)
movl %r13d, (%rbx)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x187e0
testl %ebp, %ebp
je 0x4f8ba
movl %ebp, %r12d
negq %r12
movl $0x1, %r15d
movl -0x4(%rbx,%r15,4), %esi
movq %r14, %rdi
callq 0x18b60
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
leaq (%r12,%r15), %rax
incq %rax
incq %r15
cmpq $0x1, %rax
jne 0x4f88d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
callq 0x1a130
testl %eax, %eax
jle 0x4f93a
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a130
movl $0xfffffffc, %r13d      # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x4fa0f
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a160
movl %eax, (%r14)
testl %eax, %eax
je 0x4f945
movl %eax, %r13d
shlq $0x2, %r13
movq 0x74aa0(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4f950
movq 0x74a9c(%rip), %rdi     # 0xc43c8
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
callq *%rax
movq %rax, %r12
jmp 0x4f953
movl $0x1, %r13d
jmp 0x4fa0f
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
jmp 0x4fa0f
xorl %r12d, %r12d
testq %r12, %r12
je 0x4f967
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x18b50
jmp 0x4f96a
xorl %r12d, %r12d
testq %r12, %r12
je 0x4f9cd
cmpl $0x0, (%r14)
je 0x4fa15
movq %rbx, (%rsp)
xorl %ebx, %ebx
leaq 0x1(%rbx), %r13
movq %r15, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18980
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a130
cmpl $0x1, %eax
jne 0x4f9d5
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18320
movl %eax, (%r12,%rbx,4)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %eax
movq %r13, %rbx
cmpq %rax, %r13
jb 0x4f97f
jmp 0x4fa15
movl $0xfffffffa, %r13d      # imm = 0xFFFFFFFA
jmp 0x4fa08
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq 0x749d1(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4fa04
movq 0x749cd(%rip), %rdi     # 0xc43c8
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
movq (%rsp), %rbx
movl $0x0, (%r14)
movl %r13d, (%rbx)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x187e0
testl %ebp, %ebp
je 0x4fa7d
movl %ebp, %r12d
negq %r12
movl $0x1, %r15d
movl -0x4(%rbx,%r15,4), %esi
movq %r14, %rdi
callq 0x193c0
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
leaq (%r12,%r15), %rax
incq %rax
incq %r15
cmpq $0x1, %rax
jne 0x4fa50
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
callq 0x1a130
testl %eax, %eax
jle 0x4fafd
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a130
movl $0xfffffffc, %r13d      # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x4fbd3
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a160
movl %eax, (%r14)
testl %eax, %eax
je 0x4fb08
movl %eax, %r13d
shlq $0x2, %r13
movq 0x748dd(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4fb13
movq 0x748d9(%rip), %rdi     # 0xc43c8
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
callq *%rax
movq %rax, %r12
jmp 0x4fb16
movl $0x1, %r13d
jmp 0x4fbd3
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
jmp 0x4fbd3
xorl %r12d, %r12d
testq %r12, %r12
je 0x4fb2a
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x18b50
jmp 0x4fb2d
xorl %r12d, %r12d
testq %r12, %r12
je 0x4fb91
cmpl $0x0, (%r14)
je 0x4fbd9
movq %rbx, (%rsp)
xorl %ebx, %ebx
leaq 0x1(%rbx), %r13
movq %r15, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18980
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a600
testl %eax, %eax
je 0x4fb99
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18640
movl %eax, (%r12,%rbx,4)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %eax
movq %r13, %rbx
cmpq %rax, %r13
jb 0x4fb42
jmp 0x4fbd9
movl $0xfffffffa, %r13d      # imm = 0xFFFFFFFA
jmp 0x4fbcc
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq 0x7480d(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4fbc8
movq 0x74809(%rip), %rdi     # 0xc43c8
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
movq (%rsp), %rbx
movl $0x0, (%r14)
movl %r13d, (%rbx)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x187e0
testl %ebp, %ebp
je 0x4fc41
movl %ebp, %r12d
negq %r12
movl $0x1, %r15d
movslq -0x4(%rbx,%r15,4), %rsi
movq %r14, %rdi
callq 0x18b60
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
leaq (%r12,%r15), %rax
incq %rax
incq %r15
cmpq $0x1, %rax
jne 0x4fc14
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
callq 0x1a130
testl %eax, %eax
jle 0x4fcc1
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a130
movl $0xfffffffc, %r13d      # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x4fd97
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a160
movl %eax, (%r14)
testl %eax, %eax
je 0x4fccc
movl %eax, %r13d
shlq $0x3, %r13
movq 0x74719(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4fcd7
movq 0x74715(%rip), %rdi     # 0xc43c8
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
callq *%rax
movq %rax, %r12
jmp 0x4fcda
movl $0x1, %r13d
jmp 0x4fd97
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
jmp 0x4fd97
xorl %r12d, %r12d
testq %r12, %r12
je 0x4fcee
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x18b50
jmp 0x4fcf1
xorl %r12d, %r12d
testq %r12, %r12
je 0x4fd55
cmpl $0x0, (%r14)
je 0x4fd9d
movq %rbx, (%rsp)
xorl %ebx, %ebx
leaq 0x1(%rbx), %r13
movq %r15, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18980
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a600
testl %eax, %eax
je 0x4fd5d
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18640
movq %rax, (%r12,%rbx,8)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %eax
movq %r13, %rbx
cmpq %rax, %r13
jb 0x4fd06
jmp 0x4fd9d
movl $0xfffffffa, %r13d      # imm = 0xFFFFFFFA
jmp 0x4fd90
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movq 0x74649(%rip), %rax     # 0xc43c0
testq %rax, %rax
je 0x4fd8c
movq 0x74645(%rip), %rdi     # 0xc43c8
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
movq (%rsp), %rbx
movl $0x0, (%r14)
movl %r13d, (%rbx)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq