LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: SubmitDebugUtilsMessage
static int SubmitDebugUtilsMessage(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDebugUtilsMessageSeverityFlagBitsEXT severity;
    VkDebugUtilsMessageTypeFlagsEXT types;
    VkDebugUtilsMessengerCallbackDataEXT* cbdata;
    VkInstance instance = checkinstance(L, 1, &ud);
    CheckInstancePfn(L, ud, SubmitDebugUtilsMessageEXT);
    severity = checkflags(L, 2);
    types = checkflags(L, 3);
#define CLEANUP zfreeVkDebugUtilsMessengerCallbackDataEXT(L, cbdata, 1)
    cbdata = zcheckVkDebugUtilsMessengerCallbackDataEXT(L, 4, &err);
    if(err) { CLEANUP; return argerror(L, 4); }
    ud->idt->SubmitDebugUtilsMessageEXT(instance, severity, types, cbdata);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x5beac(%rip), %rcx     # 0x7e711
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x198(%rax)
je 0x228ec
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x18f50
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x18f50
movq %rax, %r13
pushq $0x4
popq %rsi
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x18f40
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x228ff
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x4
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x2292a
leaq 0x5c1fa(%rip), %rsi     # 0x7eaed
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x2292a
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
movl %r13d, %edx
movq %r12, %rcx
callq *0x198(%rax)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: Callback
static VkBool32 Callback(
        VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
        VkDebugUtilsMessageTypeFlagsEXT messageType,
        const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, 
        void* pUserData)
    {
#define ud ((ud_info_t*)pUserData)->ud
#define L moonvulkan_L
    int top = lua_gettop(L);
    /* retrieve and push the callback */
    if(lua_rawgeti(L, LUA_REGISTRYINDEX, ud->ref1) != LUA_TFUNCTION)
        return unexpected(L);
    /* push args */
    pushinstance(L, ud->instance);
    pushflags(L, messageSeverity);
    pushflags(L, messageType);
    if(pCallbackData) zpushVkDebugUtilsMessengerCallbackDataEXT(L, pCallbackData);
    /* execute the callback */
    if(lua_pcall(L, 4, 0, 0) != LUA_OK)
        { lua_error(L); return 0; }
    lua_settop(L, top);
    return 0;
#undef L
#undef ud
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
movq 0x9864a(%rip), %r13     # 0xbafa0
movq (%r13), %rdi
callq 0x180a0
movl %eax, %ebx
movq (%r13), %rdi
movq (%r12), %rax
movslq 0x2c(%rax), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x18970
movq (%r13), %rdi
cmpl $0x6, %eax
jne 0x229da
movq (%r12), %rax
movq 0x18(%rax), %rsi
callq 0x191b0
movq (%r13), %rdi
movl %r15d, %esi
callq 0x19440
movq (%r13), %rdi
movl %ebp, %esi
callq 0x19440
testq %r14, %r14
je 0x229b5
movq (%r13), %rdi
movq %r14, %rsi
callq 0x19e80
movq (%r13), %rdi
pushq $0x4
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1a4c0
movq (%r13), %rdi
testl %eax, %eax
je 0x22a00
callq 0x199c0
jmp 0x22a07
leaq 0x5bbee(%rip), %rsi     # 0x7e5cf
leaq 0x5bfc1(%rip), %rdx     # 0x7e9a9
pushq $0x34
popq %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19bc0
movl %ebx, %esi
callq 0x18150
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: freedebug_utils_messenger
static int freedebug_utils_messenger(lua_State *L, ud_t *ud)
    {
    VkDebugUtilsMessengerEXT debug_utils_messenger = (VkDebugUtilsMessengerEXT)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkInstance instance = ud->instance;
    if(!freeuserdata(L, ud)) return 0; /* double call */
    TRACE_DELETE(debug_utils_messenger, "debug_utils_messenger");
    UD(instance)->idt->DestroyDebugUtilsMessengerEXT(instance, debug_utils_messenger, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %rbx
movq 0x18(%rsi), %r15
movq 0x40(%rsi), %r14
callq 0x18d20
testl %eax, %eax
je 0x22a69
movq 0x98560(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x22a4e
leaq 0x5bf7d(%rip), %rdi     # 0x7e9c1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x48(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x190(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_pool.c
// Function: freedescriptor_pool
static int freedescriptor_pool(lua_State *L, ud_t *ud)
    {
    VkDescriptorPool descriptor_pool = (VkDescriptorPool)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    freechildren(L, DESCRIPTOR_SET_MT, ud);
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(descriptor_pool, "descriptor_pool");
    UD(device)->ddt->DestroyDescriptorPool(device, descriptor_pool, 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 0x5aa8c(%rip), %rsi     # 0x7d952
movq %r12, %rdx
callq 0x18ee0
movq %r13, %rdi
movq %r12, %rsi
callq 0x18d20
testl %eax, %eax
je 0x22f15
movq 0x980b4(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x22efa
leaq 0x5bcae(%rip), %rdi     # 0x7eb9e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1d0(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_set.c
// Function: FreeDescriptorSets
static int FreeDescriptorSets(lua_State *L)
    {
    ud_t **ud;
    int err, free_allowed;
    VkResult ec;
    uint32_t i, count;
    VkDescriptorPool descriptor_pool;
    VkDescriptorSet *descriptor_set = checkdescriptor_setlist(L, 1, &count, &err, &ud);
    if(err) return argerrorc(L, 1, err);
    free_allowed = IsFreeDescriptorSetAllowed(ud[1]->parent_ud);
#define CLEANUP do {  Free(L, descriptor_set); Free(L, ud); } while(0)
    /* check that they all are from the same pool */
    for(i = 1; i < count; i++)
        {
        if(ud[i]->parent_ud != ud[0]->parent_ud)
            { CLEANUP; return argerrorc(L, 1, ERR_POOL); }
        }

    descriptor_pool = (VkDescriptorPool)ud[0]->parent_ud->handle;
    for(i = 0; i < count; i++)
        {
        freeuserdata(L, ud[i]);
        TRACE_DELETE(descriptor_set[i], "descriptor_set");
        }

    if(!free_allowed)
        { CLEANUP; return argerrorc(L, 1, ERR_POOL); }

    ec = ud[0]->ddt->FreeDescriptorSets(ud[0]->device, descriptor_pool, count, descriptor_set);
    CLEANUP;
    CheckError(L, ec);
    return 0;
#undef CLEANUP
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x5a60b(%rip), %r9      # 0x7d952
pushq $0x1
popq %rsi
leaq 0x14(%rsp), %rdx
leaq 0x24(%rsp), %r15
leaq 0x8(%rsp), %r8
movq %r15, %rcx
callq 0x19130
movl (%r15), %edi
testl %edi, %edi
jne 0x23418
movq %rax, %r14
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rcx), %rcx
movl 0x28(%rcx), %ebp
movl 0x14(%rsp), %edx
pushq $0x1
popq %rcx
cmpq %rdx, %rcx
jae 0x233a1
movq (%rax,%rcx,8), %rsi
movq 0x10(%rsi), %rsi
movq (%rax), %rdi
incq %rcx
cmpq 0x10(%rdi), %rsi
je 0x23386
jmp 0x233fd
movq (%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x97be1(%rip), %r13     # 0xbaf98
leaq 0x5b887(%rip), %r12     # 0x7ec45
xorl %r15d, %r15d
movl %edx, %eax
cmpq %rax, %r15
jae 0x233f7
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x18d20
cmpl $0x0, (%r13)
je 0x233ee
movq (%r14,%r15,8), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x18960
incq %r15
movl 0x14(%rsp), %edx
jmp 0x233c1
testb $0x8, %bpl
jne 0x2343a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
pushq $-0x8
popq %rdi
callq 0x19950
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq 0x18(%rsp), %rsi
movq %r14, %rcx
callq *0x1e8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
testl %ebp, %ebp
je 0x2348c
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x2342b
xorl %eax, %eax
jmp 0x2342b
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_set.c
// Function: freedescriptor_set
static int freedescriptor_set(lua_State *L, ud_t *ud)
    {
    VkResult ec;
    VkDescriptorSet descriptor_set = (VkDescriptorSet)ud->handle;
    VkDevice device = ud->device;
    VkDescriptorPool descriptor_pool = (VkDescriptorPool)ud->parent_ud->handle;
    int free_allowed = IsFreeDescriptorSetAllowed(ud->parent_ud);
    freeuserdata(L, ud);
    TRACE_DELETE(descriptor_set, "descriptor_set");
    if(!free_allowed)
        return 0;
    ec = UD(device)->ddt->FreeDescriptorSets(device, descriptor_pool, 1, &descriptor_set);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %r12
movq %r12, (%rsp)
movq 0x10(%rsi), %rax
movq 0x20(%rsi), %r14
movq (%rax), %r15
movl 0x28(%rax), %r13d
callq 0x18d20
movq 0x9795e(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x23650
leaq 0x5b5ff(%rip), %rdi     # 0x7ec45
movq %r12, %rsi
xorl %eax, %eax
callq 0x18960
xorl %ebp, %ebp
testb $0x8, %r13b
je 0x23690
movq %r14, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
pushq $0x1
popq %rdx
movq %rsp, %rcx
movq %r14, %rdi
movq %r15, %rsi
callq *0x1e8(%rax)
testl %eax, %eax
je 0x23690
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_set_layout.c
// Function: GetDescriptorSetLayoutSupport
static int GetDescriptorSetLayoutSupport(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDescriptorSetLayoutCreateInfo *info=NULL;
    VkDescriptorSetLayoutSupport *support=NULL;
    VkDevice device = checkdevice(L, 1, &ud);
#define CLEANUP do { zfreeVkDescriptorSetLayoutCreateInfo(L, info, 1); \
                    zfreeVkDescriptorSetLayoutSupport(L, support, 1); } while(0);
    CheckDevicePfn(L, ud, GetDescriptorSetLayoutSupport);
    info = zcheckVkDescriptorSetLayoutCreateInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    support = znewchainVkDescriptorSetLayoutSupport(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->ddt->GetDescriptorSetLayoutSupport(device, info, support);
    zpushVkDescriptorSetLayoutSupport(L, support);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x595fd(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x528(%rax)
je 0x23ab9
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x197d0
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x23acc
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x23b0b
leaq 0x5b250(%rip), %rsi     # 0x7ed10
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x23b0b
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19b10
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x23b1e
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x528(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x197f0
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
jmp 0x23b0d
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_set_layout.c
// Function: freedescriptor_set_layout
static int freedescriptor_set_layout(lua_State *L, ud_t *ud)
    {
    VkDescriptorSetLayout descriptor_set_layout = (VkDescriptorSetLayout)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(descriptor_set_layout, "descriptor_set_layout");
    UD(device)->ddt->DestroyDescriptorSetLayout(device, descriptor_set_layout, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %rbx
movq 0x20(%rsi), %r15
movq 0x40(%rsi), %r14
callq 0x18d20
testl %eax, %eax
je 0x23bae
movq 0x9741b(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x23b93
leaq 0x5b160(%rip), %rdi     # 0x7ece9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1c0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_update_template.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkDescriptorUpdateTemplate du_template;
    VkDescriptorUpdateTemplateCreateInfoKHR* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckDevicePfn(L, device_ud, CreateDescriptorUpdateTemplate);
#define CLEANUP zfreeVkDescriptorUpdateTemplateCreateInfoKHR(L, info, 1)
    info = zcheckVkDescriptorUpdateTemplateCreateInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = device_ud->ddt->CreateDescriptorUpdateTemplate(device, info, allocator, &du_template);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    TRACE_CREATE(du_template, "descriptor_update_template");
    ud = newuserdata_nondispatchable(L, du_template, DESCRIPTOR_UPDATE_TEMPLATE_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freedescriptor_update_template;
    ud->ddt = device_ud->ddt;
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x592fc(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x458(%rax)
je 0x23dba
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x19080
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x23dcd
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x23e15
leaq 0x5afeb(%rip), %rsi     # 0x7edac
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x23e15
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x458(%rax)
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x23e28
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x97169(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x23e46
movq (%rsp), %rsi
leaq 0x5afa1(%rip), %rdi     # 0x7ede0
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x59c84(%rip), %rdx     # 0x7dad5
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18330
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x40(%rax)
leaq 0xd0(%rip), %rdx        # 0x23f4b
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
jmp 0x23e17
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_update_template.c
// Function: UpdateDescriptorSetWithTemplate
static int UpdateDescriptorSetWithTemplate(lua_State *L)
    {
    size_t len;
    ud_t *ud1, *ud2;
    VkDescriptorSet descriptor_set = checkdescriptor_set(L, 1, &ud1);
    VkDescriptorUpdateTemplate du_template = checkdescriptor_update_template(L, 2, &ud2);
    const void* data = luaL_checklstring(L, 3, &len);
    CheckDevicePfn(L, ud1, UpdateDescriptorSetWithTemplate);
    ud1->ddt->UpdateDescriptorSetWithTemplate(ud1->device, descriptor_set, du_template, data);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x59a87(%rip), %rcx     # 0x7d952
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
leaq 0x59bf0(%rip), %rcx     # 0x7dad5
pushq $0x2
popq %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x1a500
movq %rax, %r15
pushq $0x3
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x18d50
movq (%r12), %rcx
movq 0x50(%rcx), %rdx
movq 0x468(%rdx), %r8
testq %r8, %r8
je 0x23f2e
movq 0x20(%rcx), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq *%r8
xorl %eax, %eax
jmp 0x23f3f
leaq 0x5af03(%rip), %rsi     # 0x7ee38
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/descriptor_update_template.c
// Function: freedescriptor_update_template
static int freedescriptor_update_template(lua_State *L, ud_t *ud)
    {
    VkDescriptorUpdateTemplate du_template = (VkDescriptorUpdateTemplate)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(du_template, "descriptor_update_template");
    UD(device)->ddt->DestroyDescriptorUpdateTemplate(device, du_template, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %rbx
movq 0x20(%rsi), %r15
movq 0x40(%rsi), %r14
callq 0x18d20
testl %eax, %eax
je 0x23f9c
movq 0x9702d(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x23f81
leaq 0x5ae95(%rip), %rdi     # 0x7ee0c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x460(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *physdev_ud;
    VkResult ec;
    VkDevice device;
    VkDeviceCreateInfo* info;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &physdev_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
#define CLEANUP zfreeVkDeviceCreateInfo(L, info, 1)
    info = zcheckVkDeviceCreateInfo(L, 2, &err, physdev_ud);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = physdev_ud->idt->CreateDevice(physical_device, info, allocator, &device);
    if(ec) { CLEANUP; CheckError(L, ec); return 0; }
    TRACE_CREATE(device, "device");
    ud = newuserdata_dispatchable(L, device, DEVICE_MT);
    ud->parent_ud = UD(physical_device)->parent_ud; /* instance ud */
    ud->instance = UD(physical_device)->instance;
    ud->allocator = allocator;
    ud->destructor = freedevice;
    ud->ddt = getproc_device(L, device, info);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x5adc9(%rip), %rcx     # 0x7eef4
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r12
movq (%r14), %rcx
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1a340
movq %rax, %r14
cmpl $0x0, (%r13)
je 0x24199
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x241db
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0x50(%rax)
testl %eax, %eax
je 0x241ee
movl %eax, %r13d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x96da3(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x2420c
movq (%rsp), %rsi
leaq 0x5ad0a(%rip), %rdi     # 0x7ef0f
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x58e24(%rip), %rdx     # 0x7d03b
movq %rbx, %rdi
movl %ebp, %ecx
callq 0x18330
movq %rax, %r13
movq %r15, %rdi
callq 0x19eb0
movq 0x10(%rax), %rax
movq %rax, 0x10(%r13)
movq %r15, %rdi
callq 0x19eb0
movq 0x18(%rax), %rax
movq %rax, 0x18(%r13)
movq %r12, 0x40(%r13)
leaq 0x5ba(%rip), %rax       # 0x24809
movq %rax, 0x8(%r13)
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x18c50
movq %rax, 0x50(%r13)
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
jmp 0x241dd
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device.c
// Function: AcquireProfilingLock
static int AcquireProfilingLock(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkAcquireProfilingLockInfoKHR *info = NULL;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, AcquireProfilingLockKHR);
#define CLEANUP zfreeVkAcquireProfilingLockInfoKHR(L, info, 1)
    info = zcheckVkAcquireProfilingLockInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->AcquireProfilingLockKHR(device, info);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x5894d(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
movq %rsp, %r15
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x610(%rax)
je 0x24758
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1a330
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x2476b
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x247ab
leaq 0x5a91b(%rip), %rsi     # 0x7f07a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x247ab
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x610(%rax)
movl %eax, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
testl %ebp, %ebp
je 0x247a9
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x247ab
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device.c
// Function: ReleaseProfilingLock
static int ReleaseProfilingLock(lua_State *L)
    {
    ud_t *ud;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, ReleaseProfilingLockKHR);
    ud->ddt->ReleaseProfilingLockKHR(device);
    return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x58875(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rcx
movq 0x50(%rcx), %rcx
movq 0x618(%rcx), %rcx
testq %rcx, %rcx
je 0x247f0
movq %rax, %rdi
callq *%rcx
xorl %eax, %eax
jmp 0x24801
leaq 0x5a8b0(%rip), %rsi     # 0x7f0a7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: MapMemory
static int MapMemory(lua_State *L)
    {
    VkResult ec;
    void *data;
    ud_t *ud;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    ud_info_t *ud_info = (ud_info_t*)ud->info;
    VkDevice device = ud->device;
    VkDeviceSize offset = luaL_checkinteger(L, 2);
    VkDeviceSize size = checksizeorwholesize(L, 3);
    VkMemoryMapFlags flags = optflags(L, 4, 0);

    if(ud_info->memp)
        return luaL_error(L, "memory is already mapped");

    ec = ud->ddt->MapMemory(device, memory, offset, size, flags, &data);
    CheckError(L, ec);
    ud_info->memp = (char*)data;
    ud_info->memsz = (size == VK_WHOLE_SIZE) ? ud_info->maxsz - offset : size;
    lua_pushlightuserdata(L, data);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x5a1be(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, (%rsp)
movq (%r14), %rax
movq 0x20(%rax), %r13
movq 0x58(%rax), %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq %rax, %r12
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1a630
movq %rax, %r15
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x19290
cmpq $0x0, (%r14)
je 0x24e61
leaq 0x5a545(%rip), %rsi     # 0x7f39a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x24e9b
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %r10
leaq 0x10(%rsp), %r9
movq %r13, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movl %eax, %r8d
callq *0x38(%r10)
testl %eax, %eax
je 0x24eae
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rsi
movq %rsi, (%r14)
cmpq $-0x1, %r15
jne 0x24ec3
movq 0x10(%r14), %r15
subq %r12, %r15
movq %r15, 0x8(%r14)
movq %rbx, %rdi
callq 0x19520
jmp 0x24e9d
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: UnmapMemory
static int UnmapMemory(lua_State *L)
    {
    ud_t *ud;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    ud_info_t *ud_info = (ud_info_t*)ud->info;
    VkDevice device = ud->device;

    if(ud_info->memp == NULL)
        return luaL_error(L, "memory is not mapped");

    ud->ddt->UnmapMemory(device, memory);
    ud_info->memp = NULL;
    ud_info->memsz = 0;
    return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5a0dd(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rcx
movq 0x58(%rcx), %r14
cmpq $0x0, (%r14)
je 0x24f13
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0x40(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
xorl %eax, %eax
jmp 0x24f24
leaq 0x5a499(%rip), %rsi     # 0x7f3b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceMemoryCommitment
static int GetDeviceMemoryCommitment(lua_State *L)
    {
    VkDeviceSize bytes;
    ud_t *ud;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    VkDevice device = ud->device;
    ud->ddt->GetDeviceMemoryCommitment(device, memory, &bytes);
    lua_pushinteger(L, bytes);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x5a07e(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rbp
movq %rsp, %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
leaq 0x8(%rsp), %r14
movq %rax, %rsi
movq %r14, %rdx
callq *0x58(%rcx)
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x18b50
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: FlushMappedMemoryRanges
static int FlushMappedMemoryRanges(lua_State *L)
    {
    int err;
    uint32_t count;
    VkResult ec;
    ud_t *ud;
    VkDevice device = checkdevice(L, 1, &ud);
#define CLEANUP zfreearrayVkMappedMemoryRange(L, ranges, count, 1)
    VkMappedMemoryRange* ranges = zcheckarrayVkMappedMemoryRange(L, 2, &count, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->FlushMappedMemoryRanges(device, count, ranges);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x580a8(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
callq 0x1a500
movq %rax, %r15
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %rdx
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rcx
callq 0x19af0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x24ff8
movl 0xc(%rsp), %ecx
pushq $0x28
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x197e0
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x25042
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movl 0xc(%rsp), %esi
movq %r15, %rdi
movq %r14, %rdx
callq *0x48(%rax)
movl %eax, %ebp
movl 0xc(%rsp), %ecx
pushq $0x28
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x197e0
testl %ebp, %ebp
je 0x25040
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x25042
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: Write
static int Write(lua_State *L) /* NONVK */
    {
    size_t size;
    ud_t *ud;
    ud_info_t *ud_info;
    VkDeviceSize offset;
    const char *data;

    (void)checkdevice_memory(L, 1, &ud);
    ud_info = (ud_info_t*)ud->info;
    offset = luaL_checkinteger(L, 2);
    data = luaL_tolstring(L, 3, &size);
    if(!ud_info->memp)
        return luaL_error(L, "memory is not mapped");
    /* boundary checks */
    if(size > (ud_info->memsz - offset))
        return argerrorc(L, 3, ERR_LENGTH);
    memcpy(ud_info->memp + offset, data, size);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x59e88(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rax
movq 0x58(%rax), %r15
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x184c0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x25197
movq (%rsp), %rdx
movq 0x8(%r15), %rcx
subq %r14, %rcx
cmpq %rcx, %rdx
jbe 0x251aa
pushq $-0x7
popq %rdi
callq 0x19950
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x251b7
leaq 0x5a215(%rip), %rsi     # 0x7f3b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x251b7
addq %r14, %rdi
movq %rax, %rsi
callq 0x191d0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: Read
static int Read(lua_State *L) /* NONVK */
    {
    ud_t *ud;
    ud_info_t *ud_info;
    VkDeviceSize offset, size;

    (void)checkdevice_memory(L, 1, &ud);
    ud_info = (ud_info_t*)ud->info;
    offset = luaL_checkinteger(L, 2);
    size = checksizeorwholesize(L, 3);
    if(!ud_info->memp)
        return luaL_error(L, "memory is not mapped");
    /* boundary checks */
    if(size == VK_WHOLE_SIZE)
        size = ud_info->memsz - offset;
    else if(size > (ud_info->memsz - offset))
        return argerrorc(L, 3, ERR_LENGTH);
    lua_pushlstring(L, ud_info->memp + offset, size);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x59dea(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rbp
movq %rsp, %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rax
movq 0x58(%rax), %r15
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1a630
movq (%r15), %rsi
testq %rsi, %rsi
je 0x25244
movq 0x8(%r15), %rdx
subq %r14, %rdx
cmpq $-0x1, %rax
je 0x25237
cmpq %rdx, %rax
movq %rax, %rdx
jbe 0x25237
pushq $-0x7
popq %rdi
callq 0x19950
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x25255
addq %r14, %rsi
movq %rbx, %rdi
callq 0x19770
jmp 0x25257
leaq 0x5a168(%rip), %rsi     # 0x7f3b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetBufferMemoryRequirements
static int GetBufferMemoryRequirements(lua_State *L)
    {
    ud_t *ud;
    VkBuffer buffer = checkbuffer(L, 1, &ud);
    VkDevice device = ud->device;
    VkMemoryRequirements req;

    if(ud->ddt->GetBufferMemoryRequirements2)
        return GetBufferMemoryRequirements2(L, buffer, ud);

    ud->ddt->GetBufferMemoryRequirements(device, buffer, &req);
    zpushVkMemoryRequirements(L, &req);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x57d84(%rip), %rcx     # 0x7d000
pushq $0x1
popq %rbp
leaq 0x20(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %r13
movq 0x20(%r13), %r14
movq 0x50(%r13), %rax
cmpq $0x0, 0x4b0(%rax)
je 0x25312
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1a110
cmpl $0x5, %eax
jne 0x25330
pushq $0x2
popq %rsi
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x19fe0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25368
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x253ab
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x70(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19640
jmp 0x253ad
pushq $0x18
popq %rdx
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movl $0x3b9d0450, %esi       # imm = 0x3B9D0450
movq %rbp, %rcx
callq 0x19dc0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25368
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x2539c
movq %r15, 0x10(%r12)
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x194e0
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x253be
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%r13), %rax
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x4b0(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18170
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
jmp 0x253ad
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetImageMemoryRequirements
static int GetImageMemoryRequirements(lua_State *L)
    {
    ud_t *ud;
    VkImage image = checkimage(L, 1, &ud);
    VkDevice device = ud->device;
    VkMemoryRequirements req;
    if(ud->ddt->GetImageMemoryRequirements2)
        return GetImageMemoryRequirements2(L, image, ud);
    ud->ddt->GetImageMemoryRequirements(device, image, &req);
    zpushVkMemoryRequirements(L, &req);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x58587(%rip), %rcx     # 0x7d99a
pushq $0x1
popq %rbp
leaq 0x20(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %r13
movq 0x20(%r13), %r14
movq 0x50(%r13), %rax
cmpq $0x0, 0x4a8(%rax)
je 0x254a9
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1a110
cmpl $0x5, %eax
jne 0x254c7
pushq $0x2
popq %rsi
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x198f0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x254ff
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x25542
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x78(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19640
jmp 0x25544
pushq $0x18
popq %rdx
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movl $0x3b9d0451, %esi       # imm = 0x3B9D0451
movq %rbp, %rcx
callq 0x19dc0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x254ff
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x25533
movq %r15, 0x10(%r12)
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x194e0
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x25555
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%r13), %rax
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x4a8(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18170
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
jmp 0x25544
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceBufferMemoryRequirements
static int GetDeviceBufferMemoryRequirements(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDeviceBufferMemoryRequirementsKHR *info = NULL;
    VkMemoryRequirements2 *req = NULL;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, GetDeviceBufferMemoryRequirementsKHR);
#define CLEANUP do {                                            \
    zfreeVkDeviceBufferMemoryRequirementsKHR(L, info, 1);       \
    zfreeVkMemoryRequirements2(L, req, 1);                      \
} while(0)
    info = zcheckVkDeviceBufferMemoryRequirementsKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    req = znewchainVkMemoryRequirements2(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->ddt->GetDeviceBufferMemoryRequirementsKHR(device, info, req);
    zpushVkMemoryRequirements2(L, req);
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x577cf(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r15
movl %ebp, %esi
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x868(%rax)
je 0x258e8
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x18ff0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x258fb
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x2593a
leaq 0x59ad9(%rip), %rsi     # 0x7f3c8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x2593a
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x194e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x2594d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x868(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18170
jmp 0x2593c
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceImageMemoryRequirements
static int GetDeviceImageMemoryRequirements(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDeviceImageMemoryRequirementsKHR *info = NULL;
    VkMemoryRequirements2 *req = NULL;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, GetDeviceImageMemoryRequirementsKHR);
#define CLEANUP do {                                            \
    zfreeVkDeviceImageMemoryRequirementsKHR(L, info, 1);        \
    zfreeVkMemoryRequirements2(L, req, 1);                      \
} while(0)
    info = zcheckVkDeviceImageMemoryRequirementsKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    req = znewchainVkMemoryRequirements2(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->ddt->GetDeviceImageMemoryRequirementsKHR(device, info, req);
    zpushVkMemoryRequirements2(L, req);
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x576b1(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r15
movl %ebp, %esi
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x870(%rax)
je 0x25a06
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x185d0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x25a19
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x25a58
leaq 0x599f5(%rip), %rsi     # 0x7f402
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x25a58
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x194e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x25a6b
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x870(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18170
jmp 0x25a5a
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetMemoryFd
static int GetMemoryFd(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    int fd;
    VkMemoryGetFdInfoKHR* info;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    CheckDevicePfn(L, ud, GetMemoryFdKHR);
#define CLEANUP zfreeVkMemoryGetFdInfoKHR(L, info, 1)
    info = zcheckVkMemoryGetFdInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->memory = memory;
    ec = ud->ddt->GetMemoryFdKHR(ud->device, info, &fd);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    lua_pushinteger(L, fd);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x5901d(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x478(%rax)
je 0x2600b
pushq $0x2
popq %rsi
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x18dd0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x2601e
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x2606a
leaq 0x594b5(%rip), %rsi     # 0x7f4c7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x2606a
movq %r15, 0x10(%r14)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
leaq 0xc(%rsp), %rdx
movq %r14, %rsi
callq *0x478(%rax)
movl %eax, %r15d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
testl %r15d, %r15d
je 0x2607b
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b50
jmp 0x2606c
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetMemoryFdProperties
static int GetMemoryFdProperties(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkMemoryFdPropertiesKHR properties;
    VkDevice device = checkdevice(L, 1, &ud);
    VkExternalMemoryHandleTypeFlagBits handleType = checkflags(L, 2);
    int fd = luaL_checkinteger(L, 3);

    CheckDevicePfn(L, ud, GetMemoryFdPropertiesKHR);
    ec = ud->ddt->GetMemoryFdPropertiesKHR(device, handleType, fd, &properties);
    CheckError(L, ec);
    zpushVkMemoryFdPropertiesKHR(L, &properties);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x56f9b(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
movq %rsp, %r12
movl %ebp, %esi
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x18f50
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq (%r12), %rcx
movq 0x50(%rcx), %rcx
movq 0x480(%rcx), %r8
testq %r8, %r8
je 0x2610a
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq *%r8
testl %eax, %eax
je 0x2611f
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x2611b
leaq 0x593da(%rip), %rsi     # 0x7f4eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x2612c
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x18e10
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq