LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9fe00(%rip), %r13     # 0xc2fd0
movq (%r13), %rdi
callq 0x180a0
movl %eax, %ebx
movq (%r13), %rdi
movq (%r12), %rax
movslq 0x2c(%rax), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x18980
movq (%r13), %rdi
cmpl $0x6, %eax
jne 0x23256
movq (%r12), %rax
movq 0x18(%rax), %rsi
callq 0x191d0
movq (%r13), %rdi
movl %r15d, %esi
callq 0x19460
movq (%r13), %rdi
movl %ebp, %esi
callq 0x19460
testq %r14, %r14
je 0x2322f
movq (%r13), %rdi
movq %r14, %rsi
callq 0x19ea0
movq (%r13), %rdi
movl $0x4, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1a4e0
movq (%r13), %rdi
testl %eax, %eax
je 0x2327e
callq 0x199e0
jmp 0x23285
leaq 0x6d372(%rip), %rsi     # 0x905cf
leaq 0x6d745(%rip), %rdx     # 0x909a9
movl $0x34, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19be0
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_O1/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 0x18d30
testl %eax, %eax
je 0x232e7
movq 0x9fd12(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x232cc
leaq 0x6d6ff(%rip), %rdi     # 0x909c1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
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
nop
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/descriptor_pool.c
// Function: ResetDescriptorPool
static int ResetDescriptorPool(lua_State *L)
    {
    ud_t *ud;
    VkDescriptorPool descriptor_pool = checkdescriptor_pool(L, 1, &ud);
    VkDevice device = ud->device;
    VkDescriptorPoolResetFlags flags = optflags(L, 2, 0);
    VkResult ec = ud->ddt->ResetDescriptorPool(device, descriptor_pool, flags);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x6d437(%rip), %rcx     # 0x90b1d
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r12
movq (%r15), %rax
movq 0x20(%rax), %r13
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192b0
movq (%r15), %rcx
movq 0x50(%rcx), %rcx
movq %r13, %rdi
movq %r12, %rsi
movl %eax, %edx
callq *0x1d8(%rcx)
testl %eax, %eax
je 0x23744
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x6c1dc(%rip), %rsi     # 0x8f952
movq %r12, %rdx
callq 0x18f00
movq %r13, %rdi
movq %r12, %rsi
callq 0x18d30
testl %eax, %eax
je 0x237c5
movq 0x9f834(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x237aa
leaq 0x6d3fe(%rip), %rdi     # 0x90b9e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1d0(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x6bd42(%rip), %r9      # 0x8f952
leaq 0xc(%rsp), %rdx
leaq 0x24(%rsp), %r15
leaq 0x10(%rsp), %r8
movl $0x1, %esi
movq %r15, %rcx
callq 0x19150
movl (%r15), %edi
testl %edi, %edi
jne 0x23cf3
movq %rax, %r14
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rcx), %rcx
movl 0x28(%rcx), %ebp
movl 0xc(%rsp), %ecx
cmpq $0x2, %rcx
jb 0x23c71
movq (%rax), %rdx
movq 0x10(%rdx), %rdx
movl $0x1, %esi
movq (%rax,%rsi,8), %rdi
cmpq %rdx, 0x10(%rdi)
jne 0x23cd6
incq %rsi
cmpl %esi, %ecx
jne 0x23c60
movq (%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
movl 0xc(%rsp), %edx
testl %edx, %edx
je 0x23cd0
movq %rsi, 0x18(%rsp)
movq 0x9f339(%rip), %r13     # 0xc2fc8
leaq 0x6cfaf(%rip), %r12     # 0x90c45
xorl %r15d, %r15d
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x18d30
cmpl $0x0, (%r13)
je 0x23cbf
movq (%r14,%r15,8), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x18970
incq %r15
movl 0xc(%rsp), %edx
cmpq %rdx, %r15
jb 0x23c99
movq 0x18(%rsp), %rsi
testb $0x8, %bpl
jne 0x23d17
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
callq 0x19970
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x18420
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq %r14, %rcx
callq *0x1e8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
testl %ebp, %ebp
je 0x23d64
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x23d08
xorl %eax, %eax
jmp 0x23d08
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsi), %rax
movq 0x20(%rsi), %r14
movq (%rax), %r15
movl 0x28(%rax), %r12d
callq 0x18d30
movq 0x9f088(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x23f58
movq 0x8(%rsp), %rsi
leaq 0x6ccf4(%rip), %rdi     # 0x90c45
xorl %eax, %eax
callq 0x18970
xorl %ebp, %ebp
testb $0x8, %r12b
je 0x23f9c
movq %r14, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq *0x1e8(%rax)
testl %eax, %eax
je 0x23f9c
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6accf(%rip), %rcx     # 0x8f03b
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x528(%rax)
je 0x243f0
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x197f0
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x24403
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x24445
leaq 0x6c919(%rip), %rsi     # 0x90d10
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x24445
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19b30
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x24458
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
callq 0x199e0
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 0x19810
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x24447
// File: /workspace/github_cpp_makefile_star2_O1/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 0x18d30
testl %eax, %eax
je 0x244f3
movq 0x9eb06(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x244d8
leaq 0x6c81b(%rip), %rdi     # 0x90ce9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1c0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a9b8(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x458(%rax)
je 0x2470d
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x190a0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x24723
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x247ce
leaq 0x6c698(%rip), %rsi     # 0x90dac
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x247ce
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, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x2476a
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x247ce
movq 0x9e857(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x24788
movq (%rsp), %rsi
leaq 0x6c65f(%rip), %rdi     # 0x90de0
xorl %eax, %eax
callq 0x18970
movq (%rsp), %rsi
leaq 0x6b342(%rip), %rdx     # 0x8fad5
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 0xea(%rip), %rdx        # 0x248a7
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x6b131(%rip), %rcx     # 0x8f952
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
leaq 0x6b298(%rip), %rcx     # 0x8fad5
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a520
movq %rax, %r15
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x3, %esi
callq 0x18d60
movq (%r12), %rcx
movq 0x50(%rcx), %rdx
movq 0x468(%rdx), %r8
testq %r8, %r8
je 0x2488a
movq 0x20(%rcx), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq *%r8
xorl %eax, %eax
jmp 0x2489b
leaq 0x6c5a7(%rip), %rsi     # 0x90e38
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x18d30
testl %eax, %eax
je 0x248f8
movq 0x9e701(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x248dd
leaq 0x6c539(%rip), %rdi     # 0x90e0c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x460(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6c46d(%rip), %rcx     # 0x90ef4
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r12
movq (%r14), %rcx
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a360
movq %rax, %r14
cmpl $0x0, (%r13)
je 0x24aff
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x24b41
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 0x24b54
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9e46d(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x24b72
movq (%rsp), %rsi
leaq 0x6c3a4(%rip), %rdi     # 0x90f0f
xorl %eax, %eax
callq 0x18970
movq (%rsp), %rsi
leaq 0x6a4be(%rip), %rdx     # 0x8f03b
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x18330
movq %rax, %r13
movq %r15, %rdi
callq 0x19ed0
movq 0x10(%rax), %rax
movq %rax, 0x10(%r13)
movq %r15, %rdi
callq 0x19ed0
movq 0x18(%rax), %rax
movq %rax, 0x18(%r13)
movq %r12, 0x40(%r13)
leaq 0x610(%rip), %rax       # 0x251cd
movq %rax, 0x8(%r13)
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x18c60
movq %rax, 0x50(%r13)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x24b43
// File: /workspace/github_cpp_makefile_star2_O1/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 0x69f97(%rip), %rcx     # 0x8f03b
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x610(%rax)
je 0x25118
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a350
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x2512b
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x2516d
leaq 0x6bf5b(%rip), %rsi     # 0x9107a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x2516d
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x610(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x2516b
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x2516d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x69eb3(%rip), %rcx     # 0x8f03b
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x50(%rcx), %rcx
movq 0x618(%rcx), %rcx
testq %rcx, %rcx
je 0x251b4
movq %rax, %rdi
callq *%rcx
xorl %eax, %eax
jmp 0x251c5
leaq 0x6beec(%rip), %rsi     # 0x910a7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6b7cc(%rip), %rcx     # 0x90fbc
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r12
movq (%r14), %rax
movq 0x20(%rax), %r13
movq 0x58(%rax), %rbp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1a650
movq %rax, %r15
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x192b0
cmpq $0x0, (%rbp)
je 0x25859
leaq 0x6bb4d(%rip), %rsi     # 0x9139a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x258c0
movq 0x10(%rsp), %rcx
movq 0x50(%rcx), %r10
leaq 0x8(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
movl %eax, %r8d
callq *0x38(%r10)
testl %eax, %eax
je 0x25894
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x258c0
movq 0x8(%rsp), %rax
movq %rax, (%rbp)
cmpq $-0x1, %r15
jne 0x258aa
movq 0x10(%rbp), %r15
subq %r14, %r15
movq %r15, 0x8(%rbp)
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x19540
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x6b6df(%rip), %rcx     # 0x90fbc
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x58(%rcx), %r14
cmpq $0x0, (%r14)
je 0x25913
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0x40(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
xorl %eax, %eax
jmp 0x25924
leaq 0x6ba99(%rip), %rsi     # 0x913b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x6b67f(%rip), %rcx     # 0x90fbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
leaq 0x10(%rsp), %r14
movq %rax, %rsi
movq %r14, %rdx
callq *0x58(%rcx)
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x18b60
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x696a5(%rip), %rcx     # 0x8f03b
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r15
leaq 0xc(%rsp), %rdx
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rcx
callq 0x19b10
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x25a07
movl 0xc(%rsp), %ecx
movl $0x28, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x19800
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x25a55
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
movl $0x28, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x19800
testl %ebp, %ebp
je 0x25a53
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x25a55
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6b465(%rip), %rcx     # 0x90fbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rax
movq 0x58(%rax), %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r14
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x3, %esi
callq 0x184c0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x25bc4
movq (%rsp), %rdx
movq 0x8(%r15), %rcx
subq %r14, %rcx
cmpq %rcx, %rdx
jbe 0x25bd7
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
callq 0x19970
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x25be4
leaq 0x6b7e8(%rip), %rsi     # 0x913b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x25be4
addq %r14, %rdi
movq %rax, %rsi
callq 0x191f0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x6b3bb(%rip), %rcx     # 0x90fbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rax
movq 0x58(%rax), %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1a650
movq (%r15), %rsi
testq %rsi, %rsi
je 0x25c82
movq 0x8(%r15), %rdx
subq %r14, %rdx
cmpq $-0x1, %rax
je 0x25c70
cmpq %rdx, %rax
movq %rax, %rdx
jbe 0x25c70
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
callq 0x19970
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x25c93
addq %r14, %rsi
movq %rbx, %rdi
callq 0x19790
movl $0x1, %eax
jmp 0x25c93
leaq 0x6b72a(%rip), %rsi     # 0x913b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6934b(%rip), %rcx     # 0x8f000
movl $0x1, %ebp
leaq 0x20(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %r13
movq 0x20(%r13), %r14
movq 0x50(%r13), %rax
cmpq $0x0, 0x4b0(%rax)
je 0x25d5b
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a130
leaq 0x8(%rsp), %rbp
cmpl $0x5, %eax
jne 0x25d79
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rdx
callq 0x1a000
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25dae
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x25df4
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x70(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19660
jmp 0x25df6
movl $0x18, %edx
movq %rbx, %rdi
movl $0x3b9d0450, %esi       # imm = 0x3B9D0450
movq %rbp, %rcx
callq 0x19de0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25dae
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x25de2
movq %r15, 0x10(%r12)
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x19500
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x25e07
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
callq 0x199e0
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x25df6
// File: /workspace/github_cpp_makefile_star2_O1/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 0x69b36(%rip), %rcx     # 0x8f99a
movl $0x1, %ebp
leaq 0x20(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %r13
movq 0x20(%r13), %r14
movq 0x50(%r13), %rax
cmpq $0x0, 0x4a8(%rax)
je 0x25f0a
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a130
leaq 0x8(%rsp), %rbp
cmpl $0x5, %eax
jne 0x25f28
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rdx
callq 0x19910
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25f5d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x25fa3
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x78(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19660
jmp 0x25fa5
movl $0x18, %edx
movq %rbx, %rdi
movl $0x3b9d0451, %esi       # imm = 0x3B9D0451
movq %rbp, %rcx
callq 0x19de0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25f5d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x25f91
movq %r15, 0x10(%r12)
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x19500
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x25fb6
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
callq 0x199e0
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x25fa5
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x68d27(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x868(%rax)
je 0x26399
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19010
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x263ac
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x26418
leaq 0x6b028(%rip), %rsi     # 0x913c8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x26418
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19500
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x263f0
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
callq 0x199e0
jmp 0x26418
movq 0x8(%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
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x68bfe(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x870(%rax)
je 0x264c2
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x185d0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x264d5
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x26541
leaq 0x6af39(%rip), %rsi     # 0x91402
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x26541
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19500
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x26519
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
callq 0x199e0
jmp 0x26541
movq 0x8(%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
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x6a4f3(%rip), %rcx     # 0x90fbc
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x478(%rax)
je 0x26b3f
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18de0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x26b52
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x26ba3
leaq 0x6a981(%rip), %rsi     # 0x914c7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x26ba3
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
testl %r15d, %r15d
je 0x26bb4
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
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 0x18b60
jmp 0x26ba5
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x68463(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18f70
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190f0
movq (%r12), %rcx
movq 0x50(%rcx), %rcx
movq 0x480(%rcx), %r8
testq %r8, %r8
je 0x26c48
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq *%r8
testl %eax, %eax
je 0x26c5b
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x26c6d
leaq 0x6a89c(%rip), %rsi     # 0x914eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x26c6d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x18e20
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/device_memory.c
// Function: GetMemoryHostPointerProperties
static int GetMemoryHostPointerProperties(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkMemoryHostPointerPropertiesEXT properties;
    VkDevice device = checkdevice(L, 1, &ud);
    VkExternalMemoryHandleTypeFlagBits handleType = checkflags(L, 2);
    void* ptr = checklightuserdata(L, 3);
    CheckDevicePfn(L, ud, GetMemoryHostPointerPropertiesEXT);
    ec = ud->ddt->GetMemoryHostPointerPropertiesEXT(device, handleType, ptr, &properties);
    CheckError(L, ec);
    zpushVkMemoryHostPointerPropertiesEXT(L, &properties);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x683ad(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18f70
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x182d0
movq (%r12), %rcx
movq 0x50(%rcx), %rcx
movq 0x568(%rcx), %r8
testq %r8, %r8
je 0x26cff
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%r8
testl %eax, %eax
je 0x26d12
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x26d24
leaq 0x6a813(%rip), %rsi     # 0x91519
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x26d24
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1a560
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq