LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x56eea(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
movq %rsp, %r12
movl %ebp, %esi
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x18f50
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x182d0
movq (%r12), %rcx
movq 0x50(%rcx), %rcx
movq 0x568(%rcx), %r8
testq %r8, %r8
je 0x261bc
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%r8
testl %eax, %eax
je 0x261d1
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x261cd
leaq 0x59356(%rip), %rsi     # 0x7f519
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x261de
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1a540
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceGroupPeerMemoryFeatures
static int GetDeviceGroupPeerMemoryFeatures(lua_State *L)
    {
    ud_t *ud;
    VkPeerMemoryFeatureFlags flags;
    VkDevice device = checkdevice(L, 1, &ud);
    uint32_t heapIndex = luaL_checkinteger(L, 2);
    uint32_t localDeviceIndex = luaL_checkinteger(L, 3);
    uint32_t remoteDeviceIndex = luaL_checkinteger(L, 4);
    CheckDevicePfn(L, ud, GetDeviceGroupPeerMemoryFeatures);
    ud->ddt->GetDeviceGroupPeerMemoryFeatures(device,
            heapIndex, localDeviceIndex, remoteDeviceIndex, &flags);
    pushflags(L, flags);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x56e36(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbx
leaq 0x10(%rsp), %rbp
movl %ebx, %esi
movq %rbp, %rdx
callq 0x1a500
movq %rax, %r15
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x190d0
movq %rax, %r12
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x190d0
movq %rax, %r13
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x190d0
movq (%rbp), %rcx
movq 0x50(%rcx), %rcx
movq 0x530(%rcx), %r9
testq %r9, %r9
je 0x26278
leaq 0xc(%rsp), %rbp
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %eax, %ecx
movq %rbp, %r8
callq *%r9
movl (%rbp), %esi
movq %r14, %rdi
callq 0x19440
jmp 0x2628b
leaq 0x592d1(%rip), %rsi     # 0x7f550
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetBufferDeviceAddress
static int GetBufferDeviceAddress(lua_State *L)
    {
    VkBufferDeviceAddressInfo info;
    VkDeviceAddress address;
    ud_t *ud;
    VkBuffer buffer = checkbuffer(L, 1, &ud);
    CheckDevicePfn(L, ud, GetBufferDeviceAddress);
    info.sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO;
    info.pNext = NULL;
    info.buffer = buffer;
    address = ud->ddt->GetBufferDeviceAddress(ud->device, &info);
    lua_pushinteger(L, address);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x56d51(%rip), %rcx     # 0x7d000
pushq $0x1
popq %rbx
movq %rsp, %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x1a500
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x5f0(%rcx), %rcx
testq %rcx, %rcx
je 0x262f9
leaq 0x8(%rsp), %rsi
movl $0x3b9e8321, (%rsi)     # imm = 0x3B9E8321
andq $0x0, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq 0x20(%rdx), %rdi
callq *%rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x18b50
jmp 0x2630c
leaq 0x59286(%rip), %rsi     # 0x7f586
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetBufferOpaqueCaptureAddress
static int GetBufferOpaqueCaptureAddress(lua_State *L)
    {
    VkBufferDeviceAddressInfo info;
    uint64_t address;
    ud_t *ud;
    VkBuffer buffer = checkbuffer(L, 1, &ud);
    CheckDevicePfn(L, ud, GetBufferOpaqueCaptureAddress);
    info.sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO;
    info.pNext = NULL;
    info.buffer = buffer;
    address = ud->ddt->GetBufferOpaqueCaptureAddress(ud->device, &info);
    lua_pushinteger(L, address);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x56cd5(%rip), %rcx     # 0x7d000
pushq $0x1
popq %rbx
movq %rsp, %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x1a500
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x5f8(%rcx), %rcx
testq %rcx, %rcx
je 0x26375
leaq 0x8(%rsp), %rsi
movl $0x3b9e8321, (%rsi)     # imm = 0x3B9E8321
andq $0x0, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq 0x20(%rdx), %rdi
callq *%rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x18b50
jmp 0x26388
leaq 0x59236(%rip), %rsi     # 0x7f5b2
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceMemoryOpaqueCaptureAddress
static int GetDeviceMemoryOpaqueCaptureAddress(lua_State *L)
    {
    VkDeviceMemoryOpaqueCaptureAddressInfo info;
    uint64_t address;
    ud_t *ud;
    VkDeviceMemory device_memory = checkdevice_memory(L, 1, &ud);
    CheckDevicePfn(L, ud, GetDeviceMemoryOpaqueCaptureAddress);
    info.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO;
    info.pNext = NULL;
    info.memory = device_memory;
    address = ud->ddt->GetDeviceMemoryOpaqueCaptureAddress(ud->device, &info);
    lua_pushinteger(L, address);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x58c15(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rbx
movq %rsp, %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x1a500
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x600(%rcx), %rcx
testq %rcx, %rcx
je 0x263f1
leaq 0x8(%rsp), %rsi
movl $0x3b9eb5ec, (%rsi)     # imm = 0x3B9EB5EC
andq $0x0, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq 0x20(%rdx), %rdi
callq *%rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x18b50
jmp 0x26404
leaq 0x591ed(%rip), %rsi     # 0x7f5e5
movq %r14, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: SetDeviceMemoryPriority
static int SetDeviceMemoryPriority(lua_State *L)
    {
    ud_t *ud;
    VkDeviceMemory device_memory = checkdevice_memory(L, 1, &ud);
    float priority = luaL_checknumber(L, 2);
    CheckDevicePfn(L, ud, SetDeviceMemoryPriorityEXT);
    ud->ddt->SetDeviceMemoryPriorityEXT(ud->device, device_memory, priority);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x58b99(%rip), %rcx     # 0x7efbc
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x18840
movq (%r15), %rcx
movq 0x50(%rcx), %rax
movq 0x880(%rax), %rax
testq %rax, %rax
je 0x26465
cvtsd2ss %xmm0, %xmm0
movq 0x20(%rcx), %rdi
movq %r14, %rsi
callq *%rax
xorl %eax, %eax
jmp 0x26476
leaq 0x591b2(%rip), %rsi     # 0x7f61e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/device_memory.c
// Function: freedevice_memory
static int freedevice_memory(lua_State *L, ud_t *ud)
    {
    VkDeviceMemory device_memory = (VkDeviceMemory)ud->handle;
    VkDevice device = ud->device;
    const VkAllocationCallbacks *allocator = ud->allocator;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(device_memory, "device_memory");
    UD(device)->ddt->FreeMemory(device, device_memory, 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 0x264ce
movq 0x94af8(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x264b6
leaq 0x58ecf(%rip), %rdi     # 0x7f37b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x30(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display.c
// Function: GetDisplayPlaneSupportedDisplays
static int GetDisplayPlaneSupportedDisplays(lua_State *L)
    {
    VkResult ec;
    uint32_t count, remaining, tot, i;
    VkDisplayKHR display[32];
    ud_t *ud;
    VkPhysicalDevice physdev = checkphysical_device(L, 1, &ud);
    uint32_t planeIndex = luaL_checkinteger(L, 2);

    CheckInstancePfn(L, ud, GetDisplayPlaneSupportedDisplaysKHR);

    lua_newtable(L);
    ec = ud->idt->GetDisplayPlaneSupportedDisplaysKHR(physdev, planeIndex, &remaining, NULL);
    CheckError(L, ec);
    if(remaining==0) return 1;
    tot = 0;
    do {
        if(remaining > 32)
            { count = 32; remaining -= 32; }
        else
            { count = remaining; remaining = 0; }

        ec = ud->idt->GetDisplayPlaneSupportedDisplaysKHR(physdev, planeIndex, &count, display);
        if(ec != VK_INCOMPLETE)
            CheckError(L, ec);
    
        for(i = 0; i < count; i++)
            {
            pushdisplay(L, display[i], ud);
            lua_rawseti(L, -2, ++tot);
            }
        } while (remaining > 0);

    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
leaq 0x58122(%rip), %rcx     # 0x7eef4
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r12
movl %ebp, %esi
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq %rax, %r15
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x26e49
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq *0xa8(%rax)
testl %eax, %eax
je 0x26e70
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x26e5a
leaq 0x589c3(%rip), %rsi     # 0x7f813
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
movl %ebp, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rsp), %eax
testl %eax, %eax
je 0x26e5c
pushq $-0x2
popq %r12
xorl %r13d, %r13d
movq %r15, 0x18(%rsp)
movl %eax, %ecx
subl $0x20, %ecx
pushq $0x20
popq %rdx
cmovael %edx, %eax
movl $0x0, %edx
cmovbl %edx, %ecx
movl %eax, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
leaq 0xc(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq *0xa8(%rax)
cmpl $0x5, %eax
je 0x26ecb
testl %eax, %eax
jne 0x26e33
movq %r14, %r15
movl %r13d, %ebp
xorl %r14d, %r14d
movl 0xc(%rsp), %eax
cmpq %rax, %r14
jae 0x26f05
movq 0x20(%rsp,%r14,8), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x270e1
leal (%r14,%rbp), %edx
incl %edx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x19120
incq %r14
jmp 0x26ed4
movl 0x8(%rsp), %eax
addl %r14d, %r13d
testl %eax, %eax
movq %r15, %r14
movq 0x18(%rsp), %r15
jne 0x26e84
pushq $0x1
popq %rbp
jmp 0x26e5c
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display.c
// Function: ReleaseDisplay
static int ReleaseDisplay(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkDisplayKHR display = checkdisplay(L, 1, &ud);
    VkPhysicalDevice physdev = PHYSDEV(ud);
    CheckInstancePfn(L, ud, ReleaseDisplayEXT);
    ec = ud->idt->ReleaseDisplayEXT(physdev, display);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x586ef(%rip), %rcx     # 0x7f64e
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rdx
movq 0x48(%rdx), %rcx
movq 0x138(%rcx), %rcx
testq %rcx, %rcx
je 0x26fa6
movq 0x10(%rdx), %rdx
movq (%rdx), %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x26fb9
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x26fbb
leaq 0x5889f(%rip), %rsi     # 0x7f84c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x26fbb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display.c
// Function: DisplayPowerControl
static int DisplayPowerControl(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    VkDevice device = checkdevice(L, 1, &ud);
    VkDisplayKHR display = checkdisplay(L, 2, NULL);
    VkDisplayPowerInfoEXT* info;
    CheckDevicePfn(L, ud, DisplayPowerControlEXT);
#define CLEANUP zfreeVkDisplayPowerInfoEXT(L, info, 1)
    info = zcheckVkDisplayPowerInfoEXT(L, 3, &err);
    if(err) { CLEANUP; return argerror(L, 3); }
    ec = ud->ddt->DisplayPowerControlEXT(device, display, info);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x56060(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
leaq 0x58659(%rip), %rcx     # 0x7f64e
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a500
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x298(%rax)
je 0x2705f
pushq $0x3
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x198e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x27072
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x270b6
leaq 0x5880d(%rip), %rsi     # 0x7f873
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x270b6
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x298(%rax)
movl %eax, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
testl %ebp, %ebp
je 0x270b4
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x270b6
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display.c
// Function: pushdisplay
static int pushdisplay(lua_State *L, VkDisplayKHR display, ud_t *parent_ud)
    {
    ud_t *ud;
    if(pushnondispatchable(L, (uint64_t)display, parent_ud, DISPLAY_MT)) return 1;
    TRACE_CREATE(display, "display");
    ud = newuserdata_nondispatchable(L, display, DISPLAY_MT);
    ud->parent_ud = parent_ud;
    ud->instance = parent_ud->instance;
    ud->destructor = freedisplay;
    ud->idt = parent_ud->idt;
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x58558(%rip), %rcx     # 0x7f64e
callq 0x19760
testl %eax, %eax
jne 0x2714f
movq 0x93e92(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x2711c
leaq 0x58667(%rip), %rdi     # 0x7f779
movq %r14, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x5852b(%rip), %rdx     # 0x7f64e
movq %r15, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x18330
movq %rbx, 0x10(%rax)
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
leaq 0x12(%rip), %rcx        # 0x27155
movq %rcx, 0x8(%rax)
movq 0x48(%rbx), %rcx
movq %rcx, 0x48(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display.c
// Function: freedisplay
static int freedisplay(lua_State *L, ud_t *ud)
    {
    VkDisplayKHR display = (VkDisplayKHR)ud->handle;
    freechildren(L, DISPLAY_MODE_MT, ud);
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(display, "display");
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rbx
leaq 0x58628(%rip), %rsi     # 0x7f792
movq %r14, %rdx
callq 0x18ee0
movq %r15, %rdi
movq %r14, %rsi
callq 0x18d20
testl %eax, %eax
je 0x2719e
movq 0x93e10(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x2719e
leaq 0x58616(%rip), %rdi     # 0x7f7aa
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display_mode.c
// Function: pushdisplaymode
static int pushdisplaymode(lua_State *L, VkDisplayModeKHR display_mode, ud_t *parent_ud, const VkAllocationCallbacks *allocator)
    {
    ud_t *ud;
    if(pushnondispatchable(L, (uint64_t)display_mode, parent_ud, DISPLAY_MODE_MT)) return 1;
    TRACE_CREATE(display_mode, "display_mode");
    ud = newuserdata_nondispatchable(L, display_mode, DISPLAY_MODE_MT);
    ud->parent_ud = parent_ud;
    ud->instance = parent_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freedisplay_mode;
    ud->idt = parent_ud->idt;
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x57b57(%rip), %rcx     # 0x7f792
callq 0x19760
testl %eax, %eax
jne 0x27c98
movq 0x9334d(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x27c61
leaq 0x57cee(%rip), %rdi     # 0x7f945
movq %r15, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x57b2a(%rip), %rdx     # 0x7f792
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x18330
movq %rbx, 0x10(%rax)
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq %r14, 0x40(%rax)
leaq 0x18(%rip), %rcx        # 0x27ca4
movq %rcx, 0x8(%rax)
movq 0x48(%rbx), %rcx
movq %rcx, 0x48(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/display_mode.c
// Function: freedisplay_mode
static int freedisplay_mode(lua_State *L, ud_t *ud)
    {
    VkDisplayModeKHR display_mode = (VkDisplayModeKHR)ud->handle;
    //const VkAllocationCallbacks *allocator = ud->allocator;
    //VkPhysicalDevice physical_device = (VkPhysicalDevice)ud->parent_ud->parent_ud->handle;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(display_mode, "display_mode");
    //@@UD(device)->ddt->DestroyDisplayModeKHR(device, display_mode, allocator);
    return 0;
    }

// Assembly:
pushq %rbx
movq (%rsi), %rbx
callq 0x18d20
testl %eax, %eax
je 0x27cce
movq 0x932e0(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x27cce
leaq 0x57c9f(%rip), %rdi     # 0x7f963
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/enums.c
// Function: moonvulkan_enums_test
uint32_t enums_test(lua_State *L, uint32_t domain, int arg, int *err)
    {
    rec_t *rec;
    const char *s = luaL_optstring(L, arg, NULL);

    if(!s)
        { *err = ERR_NOTPRESENT; return 0; }

    rec = str_search(domain, s);
    if(!rec)
        { *err = ERR_VALUE; return 0; }
    
    *err = ERR_SUCCESS;
    return rec->code;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %esi, %ebp
xorl %r14d, %r14d
movl %edx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x188a0
testq %rax, %rax
je 0x28543
movl %ebp, %edi
movq %rax, %rsi
callq 0x2855c
testq %rax, %rax
je 0x2854b
andl $0x0, (%rbx)
movl 0x44(%rax), %r14d
jmp 0x28554
movl $0x1, (%rbx)
jmp 0x28554
movl $0xfffffffd, (%rbx)     # imm = 0xFFFFFFFD
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/enums.c
// Function: moonvulkan_enums_check
uint32_t enums_check(lua_State *L, uint32_t domain, int arg)
    {
    rec_t *rec;
    const char *s = luaL_checkstring(L, arg);

    rec = str_search(domain, s);
    if(!rec)
        return luaL_argerror(L, arg, badvalue(L, s));
    
    return rec->code;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %edx, %esi
xorl %edx, %edx
callq 0x18d50
movq %rax, %r15
movl %ebp, %edi
movq %rax, %rsi
callq 0x2855c
testq %rax, %rax
je 0x285ec
movl 0x44(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x573f3(%rip), %rsi     # 0x7f9e6
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x18e90
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x18420
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/enums.c
// Function: moonvulkan_enums_push
int enums_push(lua_State *L, uint32_t domain, uint32_t code)
    {
    rec_t *rec = code_search(domain, code);

    if(!rec)
        return unexpected(L);

    lua_pushstring(L, rec->str);
    return 1;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, %edi
movl %edx, %esi
callq 0x28658
testq %rax, %rax
je 0x2863a
movq 0x48(%rax), %rsi
movq %rbx, %rdi
callq 0x1a2e0
pushq $0x1
popq %rax
popq %rbx
retq
leaq 0x55f8e(%rip), %rsi     # 0x7e5cf
leaq 0x573b1(%rip), %rdx     # 0x7f9f9
movq %rbx, %rdi
movl $0xca, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x19bc0
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/enums.c
// Function: moonvulkan_enums_values
int enums_values(lua_State *L, uint32_t domain)
    {
    int i;
    rec_t *rec;

    lua_newtable(L);
    i = 1;
    rec = code_first(domain, 0);
    while(rec)
        {
        if(rec->domain == domain)
            {
            lua_pushstring(L, rec->str);
            lua_rawseti(L, -2, i++);
            }
        rec = code_next(rec);
        }

    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl %ebx, %edi
callq 0x284bd
pushq $0x1
popq %r15
pushq $-0x2
popq %rbp
testq %rax, %rax
je 0x28728
movq %rax, %r12
cmpl %ebx, 0x40(%rax)
jne 0x286e9
movq 0x48(%r12), %rsi
movq %r14, %rdi
callq 0x1a2e0
movslq %r15d, %rdx
incl %r15d
movq %r14, %rdi
movl %ebp, %esi
callq 0x19120
movq 0x8(%r12), %rcx
testq %rcx, %rcx
je 0x28700
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x286f3
jmp 0x286bf
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x2870f
cmpq %r12, (%rax)
je 0x286bf
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x28724
cmpq 0x8(%rax), %r12
movq %rax, %r12
je 0x2870f
jmp 0x286bf
xorl %eax, %eax
jmp 0x286bf
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/enums.c
// Function: moonvulkan_enums_checklist
uint32_t* enums_checklist(lua_State *L, uint32_t domain, int arg, uint32_t *count, int *err)
    {
    uint32_t* list;
    uint32_t i;

    *count = 0;
    *err = 0;
    if(lua_isnoneornil(L, arg))
        { *err = ERR_NOTPRESENT; return NULL; }
    if(lua_type(L, arg) != LUA_TTABLE)
        { *err = ERR_TABLE; return NULL; }

    *count = luaL_len(L, arg);
    if(*count == 0)
        { *err = ERR_NOTPRESENT; return NULL; }

    list = (uint32_t*)MallocNoErr(L, sizeof(uint32_t) * (*count));
    if(!list)
        { *count = 0; *err = ERR_MEMORY; return NULL; }

    for(i=0; i<*count; i++)
        {
        lua_rawgeti(L, arg, i+1);
        list[i] = enums_test(L, domain, -1, err);
        lua_pop(L, 1);
        if(*err)
            { Free(L, list); *count = 0; return NULL; }
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movl %edx, %ebp
movl %esi, 0x14(%rsp)
movq %rcx, 0x8(%rsp)
andl $0x0, (%rcx)
movq %rdi, %r12
andl $0x0, (%r8)
movl %edx, %esi
callq 0x1a110
testl %eax, %eax
jle 0x2880b
movq %r12, %rdi
movl %ebp, %esi
callq 0x1a110
cmpl $0x5, %eax
jne 0x28814
movq %r12, %rdi
movl %ebp, %esi
callq 0x1a140
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x2880b
movl %eax, %esi
shlq $0x2, %rsi
movq %r12, %rdi
callq 0x18050
testq %rax, %rax
je 0x28830
movq %rax, %r13
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r15
jae 0x2881e
leaq 0x1(%r15), %rbx
movq %r12, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x18970
movq %r12, %rdi
movl 0x14(%rsp), %esi
pushq $-0x1
popq %rdx
movq %r14, %rcx
callq 0x18b10
movl %eax, (%r13,%r15,4)
movq %r12, %rdi
pushq $-0x2
popq %rsi
callq 0x18150
cmpl $0x0, (%r14)
movq %rbx, %r15
je 0x287ae
movq %r12, %rdi
movq %r13, %rsi
callq 0x182e0
movq 0x8(%rsp), %rax
andl $0x0, (%rax)
jmp 0x2881b
movl $0x1, (%r14)
jmp 0x2881b
movl $0xfffffffc, (%r14)     # imm = 0xFFFFFFFC
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
andl $0x0, (%rax)
movl $0xfffffffa, (%r14)     # imm = 0xFFFFFFFA
jmp 0x2881b
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/event.c
// Function: GetEventStatus
static int GetEventStatus(lua_State *L)
    {
    ud_t *ud;
    VkEvent event = checkevent(L, 1, &ud);
    VkDevice device = ud->device;
    VkResult ec = ud->ddt->GetEventStatus(device, event);
    switch(ec)
        {
        case VK_EVENT_SET: lua_pushboolean(L, 1); return 1;
        case VK_EVENT_RESET: lua_pushboolean(L, 0); return 1;
        default:
            CheckError(L, ec);
        }
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x49a03(%rip), %rcx     # 0x7d9ab
pushq $0x1
popq %rbx
leaq 0x8(%rsp), %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x1a500
movq (%r15), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xd8(%rcx)
testl %eax, %eax
je 0x34003
cmpl $0x4, %eax
je 0x33fe3
cmpl $0x3, %eax
jne 0x33fef
movq %r14, %rdi
movl %ebx, %esi
jmp 0x33fe8
movq %r14, %rdi
xorl %esi, %esi
callq 0x193a0
jmp 0x34005
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %r14, %rdi
callq 0x199c0
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/event.c
// Function: SetEvent_damnwindows
static int SetEvent_damnwindows (lua_State *L)
    {
    ud_t *ud;
    VkEvent event = checkevent(L, 1, &ud);
    VkDevice device = ud->device;
    VkResult ec = ud->ddt->SetEvent(device, event);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4998c(%rip), %rcx     # 0x7d9ab
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xe0(%rcx)
testl %eax, %eax
je 0x3405b
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x3405d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/event.c
// Function: ResetEvent_damnwindows
static int ResetEvent_damnwindows (lua_State *L)
    {
    ud_t *ud;
    VkEvent event = checkevent(L, 1, &ud);
    VkDevice device = ud->device;
    VkResult ec = ud->ddt->ResetEvent(device, event);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x49938(%rip), %rcx     # 0x7d9ab
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xe8(%rcx)
testl %eax, %eax
je 0x340af
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x340b1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/event.c
// Function: freeevent
static int freeevent(lua_State *L, ud_t *ud)
    {
    VkEvent event = (VkEvent)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(event, "event");
    UD(device)->ddt->DestroyEvent(device, event, 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 0x3410a
movq 0x86ebf(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x340ef
leaq 0x53a36(%rip), %rdi     # 0x87b1b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xd0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *device_ud;
    VkResult ec;
    VkFence fence;
    VkFenceCreateInfo* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = NULL;
#define CLEANUP zfreeVkFenceCreateInfo(L, info, 1)
    if(lua_istable(L, 2))
        {
        info = zcheckVkFenceCreateInfo(L, 2, &err);
        if(err) { CLEANUP; return argerror(L, 2); }
        allocator = optallocator(L, 3);
        }
    else
        {
        info = znewVkFenceCreateInfo(L, &err);
        if(err) { CLEANUP; return lua_error(L); }
        info->flags = optflags(L, 2, 0);
        }
    ec = device_ud->ddt->CreateFence(device, info, allocator, &fence);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return Created(L, fence, device, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x48da0(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1a110
cmpl $0x5, %eax
jne 0x34306
pushq $0x2
popq %rsi
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1a240
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x34336
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x343a4
pushq $0x8
popq %rsi
pushq $0x18
popq %rdx
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rcx
callq 0x19dc0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x34346
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
jmp 0x3439c
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r12
jmp 0x3435a
xorl %r12d, %r12d
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x19290
movl %eax, 0x10(%r15)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x90(%rax)
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x343b7
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x34a46
jmp 0x343a6
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: RegisterDeviceEvent
static int RegisterDeviceEvent(lua_State *L)
    {
    int err;
    ud_t *device_ud;
    VkResult ec;
    VkFence fence;
    VkDeviceEventInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckDevicePfn(L, device_ud, RegisterDeviceEventEXT);
#define CLEANUP zfreeVkDeviceEventInfoEXT(L, info, 1)
    info = zcheckVkDeviceEventInfoEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = device_ud->ddt->RegisterDeviceEventEXT(device, info, allocator, &fence);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return Created(L, fence, device, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x48c57(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x2a0(%rax)
je 0x3445f
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x19b70
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x34472
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x344ba
leaq 0x5378d(%rip), %rsi     # 0x87bf3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x344ba
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x2a0(%rax)
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x344cd
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x34a46
jmp 0x344bc
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: RegisterDisplayEvent
static int RegisterDisplayEvent(lua_State *L)
    {
    int err;
    ud_t *device_ud;
    VkResult ec;
    VkFence fence;
    VkDisplayEventInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    VkDisplayKHR display = checkdisplay(L, 2, NULL);
    const VkAllocationCallbacks *allocator = optallocator(L, 4);
    CheckDevicePfn(L, device_ud, RegisterDisplayEventEXT);
#define CLEANUP zfreeVkDisplayEventInfoEXT(L, info, 1)
    info = zcheckVkDisplayEventInfoEXT(L, 3, &err);
    if(err) { CLEANUP; return argerror(L, 3); }
    ec = device_ud->ddt->RegisterDisplayEventEXT(device, display, info, allocator, &fence);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return Created(L, fence, device, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x48b42(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r13
movq %r13, %rdx
callq 0x1a500
movq %rax, %r14
leaq 0x4b13b(%rip), %rcx     # 0x7f64e
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a500
movq %rax, %r12
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
movq (%r13), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x2a8(%rax)
je 0x3458a
pushq $0x3
popq %rsi
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x19fd0
movq %rax, %r13
cmpl $0x0, (%rbp)
je 0x3459d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x345e8
leaq 0x5368e(%rip), %rsi     # 0x87c1f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x345e8
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %r8
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq *0x2a8(%rax)
movl %eax, %r12d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x19150
testl %r12d, %r12d
je 0x345fb
movq %rbx, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x34a46
jmp 0x345ea
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: ResetFences
static int ResetFences(lua_State *L)
    {
    ud_t **ud;
    int err;
    uint32_t count;
    VkResult ec;
    VkDevice device;
    VkFence *fences = checkfencelist(L, 1, &count, &err, &ud);
    if(err) return argerrorc(L, 1, err);
    device = ud[0]->device;
    ec = UD(device)->ddt->ResetFences(device, count, fences);
    Free(L, fences);
    Free(L, ud);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x4a95b(%rip), %r9      # 0x7efab
pushq $0x1
popq %rsi
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %r15
leaq 0x8(%rsp), %r8
movq %r15, %rcx
callq 0x19130
movl (%r15), %edi
testl %edi, %edi
je 0x34686
callq 0x19950
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x346e7
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %r15
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r15, %rdi
movq %r14, %rdx
callq *0xa0(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
testl %ebp, %ebp
je 0x346e5
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x346e7
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: GetFenceStatus
static int GetFenceStatus(lua_State *L)
    {
    ud_t *ud;
    VkFence fence = checkfence(L, 1, &ud);
    VkDevice device = ud->device;
    VkResult ec = ud->ddt->GetFenceStatus(device, fence);
    switch(ec)
        {
        case VK_SUCCESS: lua_pushboolean(L, 1); return 1;
        case VK_NOT_READY: lua_pushboolean(L, 0); return 1;
        default:
            CheckError(L, ec);
        }
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x4a8a6(%rip), %rcx     # 0x7efab
pushq $0x1
popq %rbx
leaq 0x8(%rsp), %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x1a500
movq (%r15), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xa8(%rcx)
cmpl $0x1, %eax
je 0x3473b
testl %eax, %eax
jne 0x34747
movq %r14, %rdi
movl %ebx, %esi
jmp 0x34740
movq %r14, %rdi
xorl %esi, %esi
callq 0x193a0
jmp 0x3475d
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %r14, %rdi
callq 0x199c0
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: WaitForFences
static int WaitForFences(lua_State *L)
    {
    ud_t **ud;
    int err;
    uint32_t count;
    VkResult ec;
    VkBool32 waitall = checkboolean(L, 2);
    uint64_t timeout = checktimeout(L, 3);
    VkFence *fences = checkfencelist(L, 1, &count, &err, &ud);
    if(err) return argerrorc(L, 1, err);
    ec = ud[0]->ddt->WaitForFences(ud[0]->device, count, fences, waitall, timeout);
    Free(L, fences);
    Free(L, ud);
    switch(ec)
        {
        case VK_SUCCESS: lua_pushboolean(L, 1); return 1;
        case VK_TIMEOUT: lua_pushboolean(L, 0); return 1;
        default:
            CheckError(L, ec);
        }
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x2
popq %rsi
callq 0x18790
movl %eax, %r14d
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x19b80
movq %rax, %r15
leaq 0x4a811(%rip), %r9      # 0x7efab
pushq $0x1
popq %rbp
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %r13
leaq 0x8(%rsp), %r8
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rcx
callq 0x19130
movl (%r13), %edi
testl %edi, %edi
je 0x347d8
callq 0x19950
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
movl %eax, %ebp
jmp 0x34835
movq %rax, %r12
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r12, %rdx
movl %r14d, %ecx
movq %r15, %r8
callq *0xb0(%rax)
movl %eax, %r14d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182e0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
cmpl $0x2, %r14d
je 0x3482b
testl %r14d, %r14d
jne 0x34846
movq %rbx, %rdi
movl %ebp, %esi
jmp 0x34830
movq %rbx, %rdi
xorl %esi, %esi
callq 0x193a0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x347d4
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: ImportFenceFd
static int ImportFenceFd(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    VkImportFenceFdInfoKHR* info;
    VkFence fence = checkfence(L, 1, &ud);
    CheckDevicePfn(L, ud, ImportFenceFdKHR);
#define CLEANUP zfreeVkImportFenceFdInfoKHR(L, info, 1)
    info = zcheckVkImportFenceFdInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->fence = fence;
    ec = ud->ddt->ImportFenceFdKHR(ud->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 0x4a735(%rip), %rcx     # 0x7efab
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x498(%rax)
je 0x348e0
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x19ca0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x348f3
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x34938
leaq 0x53365(%rip), %rsi     # 0x87c4c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x34938
movq %r15, 0x10(%r14)
movq (%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq %r14, %rsi
callq *0x498(%rax)
movl %eax, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
testl %ebp, %ebp
je 0x34936
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x34938
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: GetFenceFd
static int GetFenceFd(lua_State *L)
    {
    int err, fd;
    VkResult ec;
    ud_t *ud;
    VkFenceGetFdInfoKHR* info;
    VkFence fence = checkfence(L, 1, &ud);
    CheckDevicePfn(L, ud, GetFenceFdKHR);
#define CLEANUP zfreeVkFenceGetFdInfoKHR(L, info, 1)
    info = zcheckVkFenceGetFdInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->fence = fence;
    ec = ud->ddt->GetFenceFdKHR(ud->device, info, &fd);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    lua_pushinteger(L, fd);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x4a650(%rip), %rcx     # 0x7efab
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4a0(%rax)
je 0x349c7
pushq $0x2
popq %rsi
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x18220
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x349da
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x34a26
leaq 0x532a4(%rip), %rsi     # 0x87c72
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x34a26
movq %r15, 0x10(%r14)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
leaq 0xc(%rsp), %rdx
movq %r14, %rsi
callq *0x4a0(%rax)
movl %eax, %r15d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
testl %r15d, %r15d
je 0x34a37
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b50
jmp 0x34a28
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: Created
static int Created(lua_State *L, VkFence fence, VkDevice device, const VkAllocationCallbacks *allocator)
    {
    ud_t *ud, *device_ud = UD(device);
    TRACE_CREATE(fence, "fence");
    ud = newuserdata_nondispatchable(L, fence, FENCE_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freefence;
    ud->ddt = device_ud->ddt;
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq %rdx, %rdi
callq 0x19eb0
movq %rax, %r15
movq 0x8652b(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x34a83
leaq 0x5314c(%rip), %rdi     # 0x87bc5
movq %r12, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x4a521(%rip), %rdx     # 0x7efab
movq %r13, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x18330
movq %r15, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%r15), %rcx
movq %rcx, 0x18(%rax)
movq %rbx, 0x40(%rax)
leaq 0x16(%rip), %rcx        # 0x34ac8
movq %rcx, 0x8(%rax)
movq 0x50(%r15), %rcx
movq %rcx, 0x50(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/fence.c
// Function: freefence
static int freefence(lua_State *L, ud_t *ud)
    {
    VkFence fence = (VkFence)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(fence, "fence");
    UD(device)->ddt->DestroyFence(device, fence, 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 0x34b19
movq 0x864b0(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x34afe
leaq 0x530e8(%rip), %rdi     # 0x87bdc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x98(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/flags.c
// Function: StencilFaceFlags
static int StencilFaceFlags(lua_State *L)
    {
    if(lua_type(L, 1) == LUA_TNUMBER)
        return pushstencilfaceflags(L, luaL_checkinteger(L, 1));
    lua_pushinteger(L, checkstencilfaceflags(L, 1));
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x1a110
cmpl $0x3, %eax
jne 0x37610
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x190d0
movq %rax, %r14
xorl %ebp, %ebp
testb $0x1, %r14b
je 0x375d9
leaq 0x54612(%rip), %rsi     # 0x8bbe0
movq %rbx, %rdi
callq 0x1a2e0
movl %r15d, %ebp
testb $0x2, %r14b
je 0x375f0
leaq 0x5460a(%rip), %rsi     # 0x8bbf0
movq %rbx, %rdi
callq 0x1a2e0
incl %ebp
testb $0x3, %r14b
je 0x376b7
leaq 0x545e5(%rip), %rsi     # 0x8bbe6
movq %rbx, %rdi
callq 0x1a2e0
incl %ebp
jmp 0x376b7
xorl %r14d, %r14d
leaq 0x545c6(%rip), %r15     # 0x8bbe0
leaq 0x545cf(%rip), %r12     # 0x8bbf0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1a660
testl %eax, %eax
je 0x376a9
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x18680
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x18fe0
testl %eax, %eax
je 0x37677
movq %r13, %rdi
movq %r12, %rsi
callq 0x18fe0
testl %eax, %eax
je 0x3767d
movq %r13, %rdi
leaq 0x54580(%rip), %rsi     # 0x8bbe6
callq 0x18fe0
pushq $0x3
popq %rcx
movl %ecx, %r14d
testl %eax, %eax
je 0x37681
jmp 0x37685
orl $0x1, %r14d
jmp 0x37681
orl $0x2, %r14d
incl %ebp
jmp 0x37621
leaq 0x4835a(%rip), %rsi     # 0x7f9e6
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x18e90
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x18420
movl %eax, %r14d
movl %r14d, %esi
movq %rbx, %rdi
callq 0x18b50
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq