LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: QueueBeginDebugUtilsLabel
static int QueueBeginDebugUtilsLabel(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDebugUtilsLabelEXT* label;
    VkQueue queue = checkqueue(L, 1, &ud);
    CheckInstancePfn(L, ud, QueueBeginDebugUtilsLabelEXT);
#define CLEANUP zfreeVkDebugUtilsLabelEXT(L, label, 1)
    label = zcheckVkDebugUtilsLabelEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ud->idt->QueueBeginDebugUtilsLabelEXT(queue, label);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x6ada5(%rip), %rcx     # 0x8d9e8
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x158(%rax)
je 0x22cb9
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18350
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x22ccc
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x22cf3
leaq 0x6ad39(%rip), %rsi     # 0x8d9f9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x22cf3
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x158(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: QueueEndDebugUtilsLabel
static int QueueEndDebugUtilsLabel(lua_State *L)
    {
    ud_t *ud;
    VkQueue queue = checkqueue(L, 1, &ud);
    CheckInstancePfn(L, ud, QueueEndDebugUtilsLabelEXT);
    ud->idt->QueueEndDebugUtilsLabelEXT(queue);
    return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6acdb(%rip), %rcx     # 0x8d9e8
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rcx
movq 0x48(%rcx), %rcx
movq 0x160(%rcx), %rcx
testq %rcx, %rcx
je 0x22d39
movq %rax, %rdi
callq *%rcx
xorl %eax, %eax
jmp 0x22d4a
leaq 0x6aceb(%rip), %rsi     # 0x8da2b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: QueueInsertDebugUtilsLabel
static int QueueInsertDebugUtilsLabel(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDebugUtilsLabelEXT* label;
    VkQueue queue = checkqueue(L, 1, &ud);
    CheckInstancePfn(L, ud, QueueInsertDebugUtilsLabelEXT);
#define CLEANUP zfreeVkDebugUtilsLabelEXT(L, label, 1)
    label = zcheckVkDebugUtilsLabelEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ud->idt->QueueInsertDebugUtilsLabelEXT(queue, label);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x6ac81(%rip), %rcx     # 0x8d9e8
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x168(%rax)
je 0x22ddd
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18350
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x22df0
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x22e17
leaq 0x6ac77(%rip), %rsi     # 0x8da5b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x22e17
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x168(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: SetDebugUtilsObjectName
static int SetDebugUtilsObjectName(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkDebugUtilsObjectNameInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckInstancePfn(L, ud, SetDebugUtilsObjectNameEXT);
#define CLEANUP zfreeVkDebugUtilsObjectNameInfoEXT(L, info, 1)
    info = zcheckVkDebugUtilsObjectNameInfoEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->idt->SetDebugUtilsObjectNameEXT(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 0x69202(%rip), %rcx     # 0x8c03b
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x148(%rax)
je 0x22ead
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18200
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x22ec0
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x22f02
leaq 0x6abda(%rip), %rsi     # 0x8da8e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x22f02
movq (%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x148(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
testl %ebp, %ebp
je 0x22f00
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x22f02
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: SetDebugUtilsObjectTag
static int SetDebugUtilsObjectTag(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkDebugUtilsObjectTagInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckInstancePfn(L, ud, SetDebugUtilsObjectTagEXT);
#define CLEANUP zfreeVkDebugUtilsObjectTagInfoEXT(L, info, 1)
    info = zcheckVkDebugUtilsObjectTagInfoEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->idt->SetDebugUtilsObjectTagEXT(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 0x69116(%rip), %rcx     # 0x8c03b
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x150(%rax)
je 0x22f99
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19210
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x22fac
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x22fee
leaq 0x6ab1e(%rip), %rsi     # 0x8dabe
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x22fee
movq (%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x150(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
testl %ebp, %ebp
je 0x22fec
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x22fee
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6a6fe(%rip), %rcx     # 0x8d711
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x198(%rax)
je 0x230a8
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18f60
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x18f60
movq %rax, %r13
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movl $0x4, %esi
movq %rbp, %rdx
callq 0x18f50
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x230bb
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x4, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x230e8
leaq 0x6aa3e(%rip), %rsi     # 0x8daed
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x230e8
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
movl %r13d, %edx
movq %r12, %rcx
callq *0x198(%rax)
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
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_O3/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 0x9cebc(%rip), %r13     # 0xbffd0
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 0x2319a
movq (%r12), %rax
movq 0x18(%rax), %rsi
callq 0x191c0
movq (%r13), %rdi
movl %r15d, %esi
callq 0x19440
movq (%r13), %rdi
movl %ebp, %esi
callq 0x19440
testq %r14, %r14
je 0x23173
movq (%r13), %rdi
movq %r14, %rsi
callq 0x19e60
movq (%r13), %rdi
movl $0x4, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1a4a0
movq (%r13), %rdi
testl %eax, %eax
je 0x231c2
callq 0x199a0
jmp 0x231c9
leaq 0x6a42e(%rip), %rsi     # 0x8d5cf
leaq 0x6a801(%rip), %rdx     # 0x8d9a9
movl $0x34, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19ba0
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_O3/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 0x2322b
movq 0x9cdce(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x23210
leaq 0x6a7bb(%rip), %rdi     # 0x8d9c1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
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_O3/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 0x6a50c(%rip), %rcx     # 0x8db1d
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r15), %rax
movq 0x20(%rax), %r13
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192a0
movq (%r15), %rcx
movq 0x50(%rcx), %rcx
movq %r13, %rdi
movq %r12, %rsi
movl %eax, %edx
callq *0x1d8(%rcx)
testl %eax, %eax
je 0x2366f
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
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_O3/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 0x692b1(%rip), %rsi     # 0x8c952
movq %r12, %rdx
callq 0x18ef0
movq %r13, %rdi
movq %r12, %rsi
callq 0x18d20
testl %eax, %eax
je 0x236f0
movq 0x9c909(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x236d5
leaq 0x6a4d3(%rip), %rdi     # 0x8db9e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
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
// File: /workspace/github_cpp_makefile_star2_O3/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 0x68e0d(%rip), %r9      # 0x8c952
leaq 0x14(%rsp), %rdx
leaq 0x24(%rsp), %r15
leaq 0x8(%rsp), %r8
movl $0x1, %esi
movq %r15, %rcx
callq 0x19140
movl (%r15), %edi
testl %edi, %edi
jne 0x23c23
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq 0x10(%rcx), %rcx
movl 0x28(%rcx), %ebp
movl 0x14(%rsp), %ecx
movq 0x10(%rdx), %rdx
cmpq $0x2, %rcx
jb 0x23ba7
movl $0x1, %esi
movq (%rax,%rsi,8), %rdi
cmpq %rdx, 0x10(%rdi)
jne 0x23c06
incq %rsi
cmpq %rsi, %rcx
jne 0x23b95
movq (%rdx), %rsi
testq %rcx, %rcx
je 0x23bfe
movq %rsi, 0x18(%rsp)
movq 0x9c40d(%rip), %r13     # 0xbffc8
leaq 0x6a083(%rip), %r12     # 0x8dc45
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x18d20
cmpl $0x0, (%r13)
je 0x23beb
movq (%r14,%r15,8), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x18960
incq %r15
movl 0x14(%rsp), %edx
cmpq %rdx, %r15
jb 0x23bc5
movq 0x18(%rsp), %rsi
jmp 0x23c00
xorl %edx, %edx
testb $0x8, %bpl
jne 0x23c47
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182d0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182d0
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
callq 0x19930
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x18410
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 %r14, %rcx
callq *0x1e8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182d0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182d0
testl %ebp, %ebp
je 0x23c94
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x23c38
xorl %eax, %eax
jmp 0x23c38
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9c15e(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x23e80
leaq 0x69dcf(%rip), %rdi     # 0x8dc45
movq %r12, %rsi
xorl %eax, %eax
callq 0x18960
xorl %ebp, %ebp
testb $0x8, %r13b
je 0x23ec2
movq %r14, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq *0x1e8(%rax)
testl %eax, %eax
je 0x23ec2
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x67da7(%rip), %rcx     # 0x8c03b
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x528(%rax)
je 0x24318
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x197c0
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x2432b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x2436d
leaq 0x699f1(%rip), %rsi     # 0x8dd10
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x2436d
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19af0
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x24380
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
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 0x197e0
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x2436f
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2441b
movq 0x9bbde(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x24400
leaq 0x698f3(%rip), %rdi     # 0x8dce9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
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_O3/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 0x67a90(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x458(%rax)
je 0x24635
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19090
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x2464b
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x246f6
leaq 0x69770(%rip), %rsi     # 0x8ddac
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x246f6
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 0x19160
testl %ebp, %ebp
je 0x24692
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x246f6
movq 0x9b92f(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x246b0
movq (%rsp), %rsi
leaq 0x69737(%rip), %rdi     # 0x8dde0
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x6841a(%rip), %rdx     # 0x8cad5
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18320
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        # 0x247cf
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_O3/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 0x68209(%rip), %rcx     # 0x8c952
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
leaq 0x68370(%rip), %rcx     # 0x8cad5
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a4e0
movq %rax, %r15
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x3, %esi
callq 0x18d50
movq (%r12), %rcx
movq 0x50(%rcx), %rdx
movq 0x468(%rdx), %r8
testq %r8, %r8
je 0x247b2
movq 0x20(%rcx), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq *%r8
xorl %eax, %eax
jmp 0x247c3
leaq 0x6967f(%rip), %rsi     # 0x8de38
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24820
movq 0x9b7d9(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x24805
leaq 0x69611(%rip), %rdi     # 0x8de0c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
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_O3/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 0x69545(%rip), %rcx     # 0x8def4
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r12
movq (%r14), %rcx
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a320
movq %rax, %r14
cmpl $0x0, (%r13)
je 0x24a27
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x24a69
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 0x24a7c
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9b545(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x24a9a
movq (%rsp), %rsi
leaq 0x6947c(%rip), %rdi     # 0x8df0f
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x67596(%rip), %rdx     # 0x8c03b
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x18320
movq %rax, %r13
movq %r15, %rdi
callq 0x19e90
movq 0x10(%rax), %rax
movq %rax, 0x10(%r13)
movq %r15, %rdi
callq 0x19e90
movq 0x18(%rax), %rax
movq %rax, 0x18(%r13)
movq %r12, 0x40(%r13)
leaq 0x623(%rip), %rax       # 0x25108
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 $0x1, %edx
callq 0x19160
jmp 0x24a6b
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device.c
// Function: GetDeviceQueue
static int GetDeviceQueue(lua_State *L)
    {
    int err;
    VkQueue queue;
    ud_t *ud;
    VkDeviceQueueInfo2* info;
    VkDevice device = checkdevice(L, 1, &ud);
#define CLEANUP zfreeVkDeviceQueueInfo2(L, info, 1)
    if(lua_istable(L, 2))
        {
        info = zcheckVkDeviceQueueInfo2(L, 2, &err);
        if(err) { CLEANUP; return argerror(L, 2); }
        }
    else
        {
        uint32_t queueFamilyIndex = luaL_checkinteger(L, 2);
        uint32_t queueIndex = luaL_checkinteger(L, 3);
        VkFlags flags = optflags(L, 4, 0);
        info = znewVkDeviceQueueInfo2(L, &err);
        if(err) { CLEANUP; return lua_error(L); }
        info->queueFamilyIndex = queueFamilyIndex;
        info->queueIndex = queueIndex;
        info->flags = flags;
        }
    if(ud->ddt->GetDeviceQueue2 && info->flags != 0)
        ud->ddt->GetDeviceQueue2(device, info, &queue);
    else
        ud->ddt->GetDeviceQueue(device, info->queueFamilyIndex, info->queueIndex, &queue);
    CLEANUP;
#undef CLEANUP
    if(!queue) return luaL_error(L, "cannot retrieve queue");
    pushqueue(L, queue, device);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x674e3(%rip), %rcx     # 0x8c03b
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a0f0
cmpl $0x5, %eax
jne 0x24bd3
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18230
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x24c5b
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x24cd6
movq %r14, 0x18(%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r12
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190e0
movq %rax, %r13
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x192a0
movq %rax, %rbp
leaq 0xc(%rsp), %r14
movl $0x20, %edx
movq %rbx, %rdi
movl $0x3b9d006b, %esi       # imm = 0x3B9D006B
movq %r14, %rcx
callq 0x19da0
movq %rax, %r15
cmpl $0x0, (%r14)
je 0x24c4a
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
jmp 0x24cd6
movl %r12d, 0x14(%r15)
movl %r13d, 0x18(%r15)
movl %ebp, 0x10(%r15)
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x450(%rax), %rcx
testq %rcx, %rcx
je 0x24c86
cmpl $0x0, 0x10(%r15)
je 0x24c86
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq *%rcx
jmp 0x24c99
movl 0x14(%r15), %esi
movl 0x18(%r15), %edx
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
callq *0x8(%rax)
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x24cc5
movq %rbx, %rdi
movq %r14, %rdx
callq 0x189d0
jmp 0x24cd8
leaq 0x69368(%rip), %rsi     # 0x8e034
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6705c(%rip), %rcx     # 0x8c03b
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x610(%rax)
je 0x25053
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a310
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x25066
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x250a8
leaq 0x69020(%rip), %rsi     # 0x8e07a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x250a8
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 0x19160
testl %ebp, %ebp
je 0x250a6
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x250a8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x66f78(%rip), %rcx     # 0x8c03b
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rcx
movq 0x50(%rcx), %rcx
movq 0x618(%rcx), %rcx
testq %rcx, %rcx
je 0x250ef
movq %rax, %rdi
callq *%rcx
xorl %eax, %eax
jmp 0x25100
leaq 0x68fb1(%rip), %rsi     # 0x8e0a7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x688b3(%rip), %rcx     # 0x8dfbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r14), %rax
movq 0x20(%rax), %r13
movq 0x58(%rax), %rbp
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1a610
movq %rax, %r15
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x192a0
cmpq $0x0, (%rbp)
je 0x25772
leaq 0x68c34(%rip), %rsi     # 0x8e39a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x257d4
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %r10
leaq 0x10(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
movl %eax, %r8d
callq *0x38(%r10)
testl %eax, %eax
je 0x257ad
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x257d4
movq 0x10(%rsp), %rsi
movq %rsi, (%rbp)
cmpq $-0x1, %r15
jne 0x257c3
movq 0x10(%rbp), %r15
subq %r14, %r15
movq %r15, 0x8(%rbp)
movq %rbx, %rdi
callq 0x19510
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_O3/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 0x687cb(%rip), %rcx     # 0x8dfbc
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rcx
movq 0x58(%rcx), %r14
cmpq $0x0, (%r14)
je 0x25827
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0x40(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
xorl %eax, %eax
jmp 0x25838
leaq 0x68b85(%rip), %rsi     # 0x8e3b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6876b(%rip), %rcx     # 0x8dfbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
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 0x18b50
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x66791(%rip), %rcx     # 0x8c03b
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r15
leaq 0xc(%rsp), %rdx
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rcx
callq 0x19ad0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x2591b
movl 0xc(%rsp), %ecx
movl $0x28, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x25969
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 0x197d0
testl %ebp, %ebp
je 0x25967
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x25969
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x68551(%rip), %rcx     # 0x8dfbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rax
movq 0x58(%rax), %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r14
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x3, %esi
callq 0x184b0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x25ad8
movq (%rsp), %rdx
movq 0x8(%r15), %rcx
subq %r14, %rcx
cmpq %rcx, %rdx
jbe 0x25aeb
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
callq 0x19930
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x25af8
leaq 0x688d4(%rip), %rsi     # 0x8e3b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x25af8
addq %r14, %rdi
movq %rax, %rsi
callq 0x191e0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x684a7(%rip), %rcx     # 0x8dfbc
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rax
movq 0x58(%rax), %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1a610
movq (%r15), %rsi
testq %rsi, %rsi
je 0x25b96
movq 0x8(%r15), %rdx
subq %r14, %rdx
cmpq $-0x1, %rax
je 0x25b84
cmpq %rdx, %rax
movq %rax, %rdx
jbe 0x25b84
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
callq 0x19930
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x25ba7
addq %r14, %rsi
movq %rbx, %rdi
callq 0x19760
movl $0x1, %eax
jmp 0x25ba7
leaq 0x68816(%rip), %rsi     # 0x8e3b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x66437(%rip), %rcx     # 0x8c000
movl $0x1, %ebp
leaq 0x20(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %r13
movq 0x20(%r13), %r14
movq 0x50(%r13), %rax
cmpq $0x0, 0x4b0(%rax)
je 0x25c6f
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a0f0
leaq 0x8(%rsp), %rbp
cmpl $0x5, %eax
jne 0x25c8d
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rdx
callq 0x19fc0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25cc2
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x25d08
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x70(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19630
jmp 0x25d0a
movl $0x18, %edx
movq %rbx, %rdi
movl $0x3b9d0450, %esi       # imm = 0x3B9D0450
movq %rbp, %rcx
callq 0x19da0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25cc2
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x25cf6
movq %r15, 0x10(%r12)
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x194e0
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x25d1b
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
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 0x18160
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x25d0a