LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0x6be60(%rip), %rcx     # 0xd0f1f
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x1a240
cmpl $0x5, %eax
jne 0x6510a
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x560(%rax)
je 0x6510a
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x65860
movl %eax, 0x24(%rsp)
jmp 0x65122
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x65990
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
leaq 0x6bdd0(%rip), %rcx     # 0xd0f1f
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x19190
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movl $0x3, %esi
callq 0x19190
movq %rax, (%rsp)
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x628(%rax)
jne 0x651ac
movq 0x28(%rsp), %rdi
leaq 0x7e77c(%rip), %rsi     # 0xe391b
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x651f3
jmp 0x651ae
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x628(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x20(%rcx), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq (%rsp), %rcx
callq *%rax
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
leaq 0x6b781(%rip), %rcx     # 0xd09a0
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x198b0
movl %eax, 0x30(%rsp)
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x270(%rax)
jne 0x6526d
movq 0x38(%rsp), %rdi
leaq 0x7e6e5(%rip), %rsi     # 0xe3942
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x653a7
jmp 0x6526f
movq 0x38(%rsp), %rdi
movl 0x30(%rsp), %ecx
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x19080
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x652dd
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq (%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x653a7
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x270(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq *%rax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movl $0x1, 0x28(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x6538b
movq 0x38(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x65383
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x2c(%rsp), %ecx
movl (%rax,%rcx,4), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x65332
movl $0x2, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl 0x28(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
leaq 0x6bb50(%rip), %rcx     # 0xd0f1f
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x260(%rax)
jne 0x65413
movq 0x28(%rsp), %rdi
leaq 0x7e561(%rip), %rsi     # 0xe3967
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x6544d
jmp 0x65415
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x260(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq *%rax
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0x2c(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x6ba96(%rip), %r9      # 0xd0f1f
callq 0x191f0
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x2c(%rsp)
je 0x654c8
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x2c(%rsp), %edi
callq 0x19a60
movq 0x10(%rsp), %rdi
movq %rax, %rdx
movl $0x1, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x655f0
jmp 0x654ca
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4c8(%rax)
jne 0x654fc
movq 0x38(%rsp), %rdi
leaq 0x7e4a6(%rip), %rsi     # 0xe3992
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x655f0
jmp 0x654fe
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x2c(%rsp), %rdx
callq 0x1a690
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x2c(%rsp)
je 0x65587
jmp 0x65520
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x18300
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x18300
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x655f0
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rax), %rax
movq 0x4c8(%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movq 0x20(%rcx), %rdi
movl 0x28(%rsp), %esi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq *%rax
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x18300
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x18300
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x20(%rsp), %rdx
leaq 0x6b900(%rip), %rcx     # 0xd0f1f
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x19370
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x2b0(%rax)
jne 0x6566c
movq 0x28(%rsp), %rdi
leaq 0x7e35a(%rip), %rsi     # 0xe39b9
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x656ae
jmp 0x6566e
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x2b0(%rax), %rax
movq 0x20(%rsp), %rcx
movq 0x20(%rcx), %rdi
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
leaq 0x18(%rsp), %rcx
callq *%rax
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x18be0
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x20(%rsp), %rdi
callq 0x19fd0
movq %rax, 0x8(%rsp)
movq 0x978aa(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x65706
movq 0x28(%rsp), %rsi
leaq 0x7e163(%rip), %rdi     # 0xe3862
movb $0x0, %al
callq 0x189d0
jmp 0x65708
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x6b806(%rip), %rdx     # 0xd0f1f
xorl %ecx, %ecx
callq 0x18350
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x10(%rsp), %rax
leaq 0x23(%rip), %rcx        # 0x65790
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x6a1c2(%rip), %rsi     # 0xcf99a
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x657fb
movl $0x0, 0x34(%rsp)
jmp 0x6584c
jmp 0x657fd
movq 0x97794(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x6581c
movq 0x18(%rsp), %rsi
leaq 0x7e068(%rip), %rdi     # 0xe387d
movb $0x0, %al
callq 0x189d0
jmp 0x6581e
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x250(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq *%rax
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/swapchain.c
// Function: AcquireNextImage2
static int AcquireNextImage2(lua_State *L, VkSwapchainKHR swapchain, ud_t *ud)
    {
    int err;
    VkResult ec;
    uint32_t imageindex;
    VkDevice device = ud->device;
#define CLEANUP zfreeVkAcquireNextImageInfoKHR(L, info, 1)
    VkAcquireNextImageInfoKHR* info = zcheckVkAcquireNextImageInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->swapchain = swapchain;
    ec = ud->ddt->AcquireNextImage2KHR(device, info, &imageindex);
    switch(ec)
        {
        case VK_SUCCESS:
        case VK_SUBOPTIMAL_KHR: lua_pushinteger(L, imageindex); break;
        //case VK_NOT_READY:
        //case VK_TIMEOUT:
        default: lua_pushnil(L); break;
        }
    CLEANUP;
#undef CLEANUP
    pushresult(L, ec);
    return 2;
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x19c70
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x658ed
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x54(%rsp)
jmp 0x65983
movq 0x40(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x560(%rax), %rax
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
callq *%rax
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x6593b
jmp 0x6592e
movl 0xc(%rsp), %eax
subl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
jne 0x6594d
jmp 0x6593b
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, %esi
callq 0x18be0
jmp 0x65957
movq 0x48(%rsp), %rdi
callq 0x19e20
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x48(%rsp), %rdi
movl 0x30(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movl $0x2, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: stetre[P]moonvulkan/src/swapchain.c
// Function: AcquireNextImage1
static int AcquireNextImage1(lua_State *L, VkSwapchainKHR swapchain, ud_t *ud)
    {
    VkResult ec;
    uint32_t imageindex;
    VkDevice device = ud->device;
    uint64_t timeout = checktimeout(L, 2); /* = UINT64_MAX for 'blocking' */
    VkSemaphore semaphore = testsemaphore(L, 3, NULL);
    VkFence fence = testfence(L, 4, NULL);
    CheckDevicePfn(L, ud, AcquireNextImageKHR);
    ec = ud->ddt->AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, &imageindex);
    switch(ec)
        {
        case VK_SUCCESS:
        case VK_SUBOPTIMAL_KHR: lua_pushinteger(L, imageindex); break;
        //case VK_NOT_READY:
        //case VK_TIMEOUT:
        default: lua_pushnil(L); break;
        }
    pushresult(L, ec);
    return 2;
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movl $0x2, %esi
callq 0x19ca0
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
leaq 0x6b574(%rip), %rcx     # 0xd0f4e
callq 0x1a5f0
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
movl $0x4, %esi
xorl %eax, %eax
movl %eax, %edx
leaq 0x6b56a(%rip), %rcx     # 0xd0f63
callq 0x1a5f0
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x268(%rax)
jne 0x65a32
movq 0x48(%rsp), %rdi
leaq 0x7ded0(%rip), %rsi     # 0xe38f2
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x54(%rsp)
jmp 0x65ab7
jmp 0x65a34
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x268(%rax), %rax
movq 0x28(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
leaq 0x30(%rsp), %r9
callq *%rax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x65a83
jmp 0x65a76
movl 0xc(%rsp), %eax
subl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
jne 0x65a95
jmp 0x65a83
movq 0x48(%rsp), %rdi
movl 0x30(%rsp), %eax
movl %eax, %esi
callq 0x18be0
jmp 0x65a9f
movq 0x48(%rsp), %rdi
callq 0x19e20
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movl $0x2, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x665b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x66683
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7d3c9(%rip), %rsi     # 0xe3a3f
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x666b9
movq 0x8(%rsp), %rax
cmpl $-0x2, 0x28(%rax)
je 0x666b1
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x28(%rax), %edx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a400
movq 0x8(%rsp), %rax
movl $0xfffffffe, 0x28(%rax) # imm = 0xFFFFFFFE
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x665b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x66713
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7d339(%rip), %rsi     # 0xe3a3f
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66756
movq 0x8(%rsp), %rax
cmpl $-0x2, 0x28(%rax)
je 0x66735
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x28(%rax), %edx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a400
movq 0x8(%rsp), %rdi
callq 0x66760
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x18300
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x665b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x667c3
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7d289(%rip), %rsi     # 0xe3a3f
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66831
movq 0x8(%rsp), %rax
cmpl $-0x2, 0x28(%rax)
jne 0x667e7
movq 0x18(%rsp), %rdi
leaq 0x7d282(%rip), %rsi     # 0xe3a5c
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66831
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movslq 0x28(%rax), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x189e0
cmpl $0x7, %eax
je 0x66829
movq 0x18(%rsp), %rdi
leaq 0x69d77(%rip), %rsi     # 0xd0587
leaq 0x7d259(%rip), %rdx     # 0xe3a70
movl $0xa4, %ecx
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66831
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x66880
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x66878
movq 0x8(%rsp), %rdi
callq 0x66760
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x18300
jmp 0x66849
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x66880
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x66948
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x66946
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rcx
movq 0x30(%rcx), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq *%rax
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x66944
movl $0x1, 0x44(%rsp)
jmp 0x66950
jmp 0x66946
jmp 0x668d9
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
movq 0x28(%rsp), %rdx
callq 0x19560
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x6699f
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x66a67
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x183f0
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
jne 0x669c6
movq $0x0, 0x40(%rsp)
jmp 0x66a67
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a5a0
cmpl $0x5, %eax
je 0x66a02
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x7d088(%rip), %rsi     # 0xe3a78
movb $0x0, %al
callq 0x19ce0
movq $0x0, 0x40(%rsp)
jmp 0x66a67
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
callq 0x180a0
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %esi
movl %eax, %edx
callq 0x66a80
movl %eax, 0x1c(%rsp)
movq 0x38(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
cmpl $0x0, 0x1c(%rsp)
je 0x66a54
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x66a5d
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x66a5d
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
leaq 0x7d00f(%rip), %rdx     # 0xe3ab0
callq 0x19b50
cmpl $0x0, %eax
jne 0x66ab8
movl $0x0, 0x34(%rsp)
jmp 0x66b41
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
callq 0x180a0
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %esi
movl %eax, %edx
callq 0x19a30
cmpl $0x0, %eax
je 0x66b02
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl $0x1, 0x34(%rsp)
jmp 0x66b41
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x180a0
movq 0x8(%rsp), %rdi
movl %eax, %esi
movl 0x20(%rsp), %edx
callq 0x66a80
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1a340
cmpl $0x0, %eax
jne 0x66b9c
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7cf07(%rip), %rsi     # 0xe3a93
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66c2d
movq 0x18(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18f40
movq 0x18(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x7cef4(%rip), %rdx     # 0xe3ab0
callq 0x18b80
cmpq $0x0, (%rsp)
je 0x66bd8
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
xorl %edx, %edx
callq 0x18410
cmpq $0x0, 0x8(%rsp)
je 0x66c16
movq 0x18(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x7cebf(%rip), %rdx     # 0xe3ab0
callq 0x18cf0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x18410
movq 0x18(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movq 0x18(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a5a0
cmpl $0x5, %eax
je 0x66c8a
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7cdfb(%rip), %rsi     # 0xe3a78
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66cfd
movq 0x18(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x7ce15(%rip), %rdx     # 0xe3ab0
callq 0x18cf0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a5a0
cmpl $0x5, %eax
je 0x66cd7
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rdx
leaq 0x7cdae(%rip), %rsi     # 0xe3a78
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66cfd
movq 0x18(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191b0
movq 0x18(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x18170
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a5a0
cmpl $0x5, %eax
je 0x66d5a
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7cd2b(%rip), %rsi     # 0xe3a78
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x66daf
cmpq $0x0, 0x8(%rsp)
je 0x66d98
movq 0x18(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x7cd3d(%rip), %rdx     # 0xe3ab0
callq 0x18cf0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x18410
movq 0x18(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movq 0x18(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: stetre[P]moonvulkan/src/utils.c
// Function: moonvulkan_sleeep
void sleeep(double seconds)
    {
#if _POSIX_C_SOURCE >= 199309L
    struct timespec ts, ts1;
    struct timespec *req, *rem, *tmp;
    sectots(&ts, seconds);
    req = &ts;
    rem = &ts1;
    while(1)
        {
        if(nanosleep(req, rem) == 0)
            return;
        tmp = req;
        req = rem;
        rem = tmp;
        }
#else
    usleep((useconds_t)(seconds*1.0e6));
#endif
    }

// Assembly:
subq $0x48, %rsp
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
leaq 0x30(%rsp), %rdi
callq 0x680e0
leaq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x18ac0
cmpl $0x0, %eax
jne 0x680b7
addq $0x48, %rsp
retq
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x6809e
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x6877c
jmp 0x687bc
movl $0x0, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x687ad
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x18300
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x68783
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x18300
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movq 0x10(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movl $0x0, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x6883a
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x1a420
movq 0x10(%rsp), %rdi
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x687f7
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a240
cmpl $0x0, %eax
jg 0x68899
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
movq $0x0, 0x30(%rsp)
jmp 0x68a16
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a240
cmpl $0x5, %eax
je 0x688c5
movq 0x10(%rsp), %rax
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movq $0x0, 0x30(%rsp)
jmp 0x68a16
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a270
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x688ff
movq 0x10(%rsp), %rax
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
movq $0x0, 0x30(%rsp)
jmp 0x68a16
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x18050
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x68947
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0xfffffffa, (%rax)     # imm = 0xFFFFFFFA
movq $0x0, 0x30(%rsp)
jmp 0x68a16
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x68a0c
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x189e0
movq 0x28(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a720
cmpl $0x0, %eax
jne 0x689cc
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x18300
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movq $0x0, 0x30(%rsp)
jmp 0x68a16
movq 0x28(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x18690
movl %eax, %edx
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x6894f
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movq 0x10(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movl $0x0, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x68a8b
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, %esi
callq 0x18be0
movq 0x10(%rsp), %rdi
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x68a47
addq $0x18, %rsp
retq
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a240
cmpl $0x0, %eax
jg 0x68ae9
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
movq $0x0, 0x30(%rsp)
jmp 0x68c62
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a240
cmpl $0x5, %eax
je 0x68b15
movq 0x10(%rsp), %rax
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movq $0x0, 0x30(%rsp)
jmp 0x68c62
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a270
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x68b4f
movq 0x10(%rsp), %rax
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
movq $0x0, 0x30(%rsp)
jmp 0x68c62
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x18050
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x68b97
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0xfffffffa, (%rax)     # imm = 0xFFFFFFFA
movq $0x0, 0x30(%rsp)
jmp 0x68c62
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x68c58
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x189e0
movq 0x28(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a240
cmpl $0x1, %eax
je 0x68c1c
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x18300
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movq $0x0, 0x30(%rsp)
jmp 0x68c62
movq 0x28(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x18340
movl %eax, %edx
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x68b9f
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movq 0x10(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movl $0x0, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x68cd9
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rsp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x19480
movq 0x10(%rsp), %rdi
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x68c97
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a240
cmpl $0x0, %eax
jg 0x68d39
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
movq $0x0, 0x30(%rsp)
jmp 0x68eb6
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a240
cmpl $0x5, %eax
je 0x68d65
movq 0x10(%rsp), %rax
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movq $0x0, 0x30(%rsp)
jmp 0x68eb6
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a270
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x68d9f
movq 0x10(%rsp), %rax
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
movq $0x0, 0x30(%rsp)
jmp 0x68eb6
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x18050
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x68de7
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0xfffffffa, (%rax)     # imm = 0xFFFFFFFA
movq $0x0, 0x30(%rsp)
jmp 0x68eb6
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x68eac
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x189e0
movq 0x28(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a720
cmpl $0x0, %eax
jne 0x68e6c
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x18300
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movq $0x0, 0x30(%rsp)
jmp 0x68eb6
movq 0x28(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x18690
movl %eax, %edx
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x68def
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movq 0x10(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movl $0x0, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x68f2a
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rsp), %ecx
movslq (%rax,%rcx,4), %rsi
callq 0x18be0
movq 0x10(%rsp), %rdi
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x68ee7
addq $0x18, %rsp
retq
nop