LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x682f3(%rip), %rcx     # 0x8f03b
movl $0x1, %ebx
leaq 0x10(%rsp), %rbp
movl $0x1, %esi
movq %rbp, %rdx
callq 0x1a520
movq %rax, %r15
movq %r14, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r12
movq %r14, %rdi
movl $0x3, %esi
callq 0x190f0
movq %rax, %r13
movq %r14, %rdi
movl $0x4, %esi
callq 0x190f0
movq (%rbp), %rcx
movq 0x50(%rcx), %rcx
movq 0x530(%rcx), %r9
testq %r9, %r9
je 0x26dc6
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 0x19460
jmp 0x26dd9
leaq 0x6a783(%rip), %rsi     # 0x91550
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
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_O1/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 0x68203(%rip), %rcx     # 0x8f000
movl $0x1, %ebx
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x5f0(%rcx), %rcx
testq %rcx, %rcx
je 0x26e4f
leaq 0x8(%rsp), %rsi
movl $0x3b9e8321, (%rsi)     # imm = 0x3B9E8321
movq $0x0, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq 0x20(%rdx), %rdi
callq *%rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x18b60
jmp 0x26e62
leaq 0x6a730(%rip), %rsi     # 0x91586
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6817f(%rip), %rcx     # 0x8f000
movl $0x1, %ebx
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x5f8(%rcx), %rcx
testq %rcx, %rcx
je 0x26ed3
leaq 0x8(%rsp), %rsi
movl $0x3b9e8321, (%rsi)     # imm = 0x3B9E8321
movq $0x0, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq 0x20(%rdx), %rdi
callq *%rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x18b60
jmp 0x26ee6
leaq 0x6a6d8(%rip), %rsi     # 0x915b2
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a0b7(%rip), %rcx     # 0x90fbc
movl $0x1, %ebx
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x600(%rcx), %rcx
testq %rcx, %rcx
je 0x26f57
leaq 0x8(%rsp), %rsi
movl $0x3b9eb5ec, (%rsi)     # imm = 0x3B9EB5EC
movq $0x0, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq 0x20(%rdx), %rdi
callq *%rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x18b60
jmp 0x26f6a
leaq 0x6a687(%rip), %rsi     # 0x915e5
movq %r14, %rdi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a033(%rip), %rcx     # 0x90fbc
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18850
movq (%r15), %rcx
movq 0x50(%rcx), %rax
movq 0x880(%rax), %rax
testq %rax, %rax
je 0x26fcf
cvtsd2ss %xmm0, %xmm0
movq 0x20(%rcx), %rdi
movq %r14, %rsi
callq *%rax
xorl %eax, %eax
jmp 0x26fe0
leaq 0x6a648(%rip), %rsi     # 0x9161e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/device_memory.c
// Function: 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 0x18d30
testl %eax, %eax
je 0x27038
movq 0x9bfbe(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x27020
leaq 0x6a365(%rip), %rdi     # 0x9137b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x30(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
leaq 0x694f2(%rip), %rcx     # 0x90ef4
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r15
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x27a7c
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %rsp, %rdx
movq %r14, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq *0xa8(%rax)
testl %eax, %eax
je 0x27a92
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x27b3c
leaq 0x69d90(%rip), %rsi     # 0x91813
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x27b3c
movl $0x1, %eax
cmpl $0x0, (%rsp)
je 0x27b3c
xorl %r12d, %r12d
movl (%rsp), %eax
cmpl $0x21, %eax
jb 0x27ab9
movl $0x20, 0x4(%rsp)
addl $-0x20, %eax
jmp 0x27abf
movl %eax, 0x4(%rsp)
xorl %eax, %eax
movl %eax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
leaq 0x4(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq *0xa8(%rax)
testl %eax, %eax
je 0x27aee
cmpl $0x5, %eax
jne 0x27a63
cmpl $0x0, 0x4(%rsp)
je 0x27b2d
movl %r12d, %r13d
xorl %ebp, %ebp
movq 0x10(%rsp,%rbp,8), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27d1d
leal 0x1(%r13,%rbp), %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19140
incq %rbp
movl 0x4(%rsp), %eax
cmpq %rax, %rbp
jb 0x27afa
addl %ebp, %r12d
cmpl $0x0, (%rsp)
jne 0x27aa4
movl $0x1, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x69ac3(%rip), %rcx     # 0x9164e
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rdx
movq 0x48(%rdx), %rcx
movq 0x138(%rcx), %rcx
testq %rcx, %rcx
je 0x27bd4
movq 0x10(%rdx), %rdx
movq (%rdx), %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x27be7
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x27be9
leaq 0x69c71(%rip), %rsi     # 0x9184c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x27be9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x67432(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
leaq 0x69a29(%rip), %rcx     # 0x9164e
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1a520
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x298(%rax)
je 0x27c99
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x3, %esi
movq %r13, %rdx
callq 0x19900
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x27cac
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x27cf2
leaq 0x69bd3(%rip), %rsi     # 0x91873
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x27cf2
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x298(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x27cf0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x27cf2
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_O1/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 0x6991c(%rip), %rcx     # 0x9164e
callq 0x19780
testl %eax, %eax
jne 0x27d8b
movq 0x9b286(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x27d58
leaq 0x69a2b(%rip), %rdi     # 0x91779
movq %r14, %rsi
xorl %eax, %eax
callq 0x18970
leaq 0x698ef(%rip), %rdx     # 0x9164e
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        # 0x27d91
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_O1/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 0x699ec(%rip), %rsi     # 0x91792
movq %r14, %rdx
callq 0x18f00
movq %r15, %rdi
movq %r14, %rsi
callq 0x18d30
testl %eax, %eax
je 0x27dda
movq 0x9b204(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x27dda
leaq 0x699da(%rip), %rdi     # 0x917aa
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x68e2f(%rip), %rcx     # 0x91792
callq 0x19780
testl %eax, %eax
jne 0x289c0
movq 0x9a655(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x28989
leaq 0x68fc6(%rip), %rdi     # 0x91945
movq %r15, %rsi
xorl %eax, %eax
callq 0x18970
leaq 0x68e02(%rip), %rdx     # 0x91792
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        # 0x289cc
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_O1/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 0x18d30
testl %eax, %eax
je 0x289f6
movq 0x9a5e8(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x289f6
leaq 0x68f77(%rip), %rdi     # 0x91963
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x188b0
testq %rax, %rax
je 0x292b4
movl %ebp, %edi
movq %rax, %rsi
callq 0x292cd
testq %rax, %rax
je 0x292bc
movl $0x0, (%rbx)
movl 0x44(%rax), %r14d
jmp 0x292c5
movl $0x1, (%rbx)
jmp 0x292c5
movl $0xfffffffd, (%rbx)     # imm = 0xFFFFFFFD
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x18d60
movq %rax, %r15
movl %ebp, %edi
movq %rax, %rsi
callq 0x292cd
testq %rax, %rax
je 0x2936a
movl 0x44(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68675(%rip), %rsi     # 0x919e6
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x18eb0
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_O1/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 0x293d8
testq %rax, %rax
je 0x293ba
movq 0x48(%rax), %rsi
movq %rbx, %rdi
callq 0x1a300
movl $0x1, %eax
popq %rbx
retq
leaq 0x6720e(%rip), %rsi     # 0x905cf
leaq 0x68631(%rip), %rdx     # 0x919f9
movq %rbx, %rdi
movl $0xca, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x19be0
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
movl %ebx, %edi
callq 0x29229
testq %rax, %rax
je 0x29493
movq %rax, %r15
movl $0x1, %ebp
cmpl %ebx, 0x40(%r15)
jne 0x29453
movq 0x48(%r15), %rsi
movq %r14, %rdi
callq 0x1a300
movslq %ebp, %rdx
incl %ebp
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19140
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x29471
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x2945c
movq %rax, %r15
testq %rax, %rax
jne 0x2942f
jmp 0x29493
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x2947f
cmpq %r15, (%rax)
je 0x29467
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x29467
cmpq 0x8(%rax), %r15
movq %rax, %r15
je 0x2947f
jmp 0x29467
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %r15
xorl %eax, %eax
movq %rcx, 0x8(%rsp)
movl %eax, (%rcx)
movl %eax, (%r8)
movl %edx, %esi
callq 0x1a130
testl %eax, %eax
jle 0x29586
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a130
cmpl $0x5, %eax
jne 0x2958f
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a160
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x29586
movl %eax, %esi
shlq $0x2, %rsi
movq %r15, %rdi
callq 0x18050
testq %rax, %rax
je 0x295ab
movq %rax, %r13
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r12
jae 0x29599
leaq 0x1(%r12), %rbx
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x18980
movq %r15, %rdi
movl 0x14(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rcx
callq 0x18b20
movl %eax, (%r13,%r12,4)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
cmpl $0x0, (%r14)
movq %rbx, %r12
je 0x29521
movq %r15, %rdi
movq %r13, %rsi
callq 0x182e0
movq 0x8(%rsp), %rax
movl $0x0, (%rax)
jmp 0x29596
movl $0x1, (%r14)
jmp 0x29596
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
movl $0x0, (%rax)
movl $0xfffffffa, (%r14)     # imm = 0xFFFFFFFA
jmp 0x29596
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x59c48(%rip), %rcx     # 0x8f9ab
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xd8(%rcx)
movl %eax, %ebp
testl %eax, %eax
je 0x35dd4
cmpl $0x4, %ebp
je 0x35dad
cmpl $0x3, %ebp
jne 0x35dbe
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x193c0
jmp 0x35dd4
movq %rbx, %rdi
xorl %esi, %esi
callq 0x193c0
movl $0x1, %ebp
jmp 0x35dd4
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x59bbe(%rip), %rcx     # 0x8f9ab
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xe0(%rcx)
testl %eax, %eax
je 0x35e2b
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x35e2d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x59b68(%rip), %rcx     # 0x8f9ab
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xe8(%rcx)
testl %eax, %eax
je 0x35e81
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x35e83
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x18d30
testl %eax, %eax
je 0x35edc
movq 0x8d11d(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x35ec1
leaq 0x63c64(%rip), %rdi     # 0x99b1b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xd0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58fd0(%rip), %rcx     # 0x8f03b
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a130
leaq 0x4(%rsp), %r12
cmpl $0x5, %eax
jne 0x360e2
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a260
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x36113
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x3618a
movl $0x18, %edx
movq %rbx, %rdi
movl $0x8, %esi
movq %r12, %rcx
callq 0x19de0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x36125
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x36182
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r12
jmp 0x3613b
xorl %r12d, %r12d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192b0
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
testl %r13d, %r13d
je 0x3619d
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x3688a
jmp 0x3618c
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58e71(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x2a0(%rax)
je 0x36251
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19b90
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x36264
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x362b1
leaq 0x6399b(%rip), %rsi     # 0x99bf3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x362b1
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %r13d, %r13d
je 0x362c4
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3688a
jmp 0x362b3
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58d4b(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r13
movl $0x1, %esi
movq %r13, %rdx
callq 0x1a520
movq %rax, %r14
leaq 0x5b342(%rip), %rcx     # 0x9164e
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1a520
movq %rax, %r12
movq %rbx, %rdi
movl $0x4, %esi
callq 0x191c0
movq %rax, %r15
movq (%r13), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x2a8(%rax)
je 0x3638f
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movl $0x3, %esi
movq %rbp, %rdx
callq 0x19ff0
movq %rax, %r13
cmpl $0x0, (%rbp)
je 0x363a2
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x363f2
leaq 0x63889(%rip), %rsi     # 0x99c1f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x363f2
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x19170
testl %r12d, %r12d
je 0x36405
movq %rbx, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3688a
jmp 0x363f4
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5ab4f(%rip), %r9      # 0x90fab
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %r15
leaq 0x8(%rsp), %r8
movl $0x1, %esi
movq %r15, %rcx
callq 0x19150
movl (%r15), %edi
testl %edi, %edi
je 0x36496
callq 0x19970
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x364f7
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %r15
movq %r15, %rdi
callq 0x19ed0
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 0x364f5
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x364f7
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x5aa97(%rip), %rcx     # 0x90fab
movl $0x1, %ebp
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xa8(%rcx)
cmpl $0x1, %eax
je 0x36557
testl %eax, %eax
jne 0x36563
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x3655c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x193c0
jmp 0x36579
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x2, %esi
callq 0x187a0
movl %eax, %ebp
movq %rbx, %rdi
movl $0x3, %esi
callq 0x19ba0
movq %rax, %r14
leaq 0x5a9f5(%rip), %r9      # 0x90fab
leaq 0xc(%rsp), %rdx
leaq 0x1c(%rsp), %r12
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
movl $0x1, %esi
movq %r12, %rcx
callq 0x19150
movl (%r12), %edi
testl %edi, %edi
je 0x36603
callq 0x19970
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x18420
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movl 0xc(%rsp), %esi
movq %r15, %rdx
movl %ebp, %ecx
movq %r14, %r8
callq *0xb0(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x182e0
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x182e0
cmpl $0x2, %ebp
je 0x3665f
testl %ebp, %ebp
jne 0x36670
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x193c0
jmp 0x365f4
movq %rbx, %rdi
xorl %esi, %esi
callq 0x193c0
movl $0x1, %ebp
jmp 0x365f4
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x365f2
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5a90c(%rip), %rcx     # 0x90fab
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x498(%rax)
je 0x36713
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19cc0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x36726
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x3676d
leaq 0x63532(%rip), %rsi     # 0x99c4c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x3676d
movq %r15, 0x10(%r14)
movq (%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq %r14, %rsi
callq *0x498(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x3676b
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x3676d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x5a81b(%rip), %rcx     # 0x90fab
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4a0(%rax)
je 0x36806
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18220
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x36819
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x3686a
leaq 0x63465(%rip), %rsi     # 0x99c72
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x3686a
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
testl %r15d, %r15d
je 0x3687b
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b60
jmp 0x3686c
// File: /workspace/github_cpp_makefile_star2_O1/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 0x19ed0
movq %rax, %r15
movq 0x8c717(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x368c7
leaq 0x63308(%rip), %rdi     # 0x99bc5
movq %r12, %rsi
xorl %eax, %eax
callq 0x18970
leaq 0x5a6dd(%rip), %rdx     # 0x90fab
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        # 0x3690c
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_O1/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 0x18d30
testl %eax, %eax
je 0x3695d
movq 0x8c69c(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x36942
leaq 0x632a4(%rip), %rdi     # 0x99bdc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x98(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x1, %esi
callq 0x1a130
cmpl $0x3, %eax
jne 0x399bd
movq %rbx, %rdi
movl $0x1, %esi
callq 0x190f0
movq %rax, %r14
xorl %ebp, %ebp
testb $0x1, %r14b
je 0x39986
leaq 0x64244(%rip), %rsi     # 0x9dbbd
movq %rbx, %rdi
callq 0x1a300
movl $0x1, %ebp
testb $0x2, %r14b
je 0x3999d
leaq 0x6423a(%rip), %rsi     # 0x9dbcd
movq %rbx, %rdi
callq 0x1a300
incl %ebp
testb $0x3, %r14b
je 0x39a80
leaq 0x64215(%rip), %rsi     # 0x9dbc3
movq %rbx, %rdi
callq 0x1a300
incl %ebp
jmp 0x39a80
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1a680
xorl %r14d, %r14d
testl %eax, %eax
je 0x39a70
leaq 0x641dc(%rip), %r15     # 0x9dbbd
leaq 0x641e5(%rip), %r12     # 0x9dbcd
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x18690
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x19000
testl %eax, %eax
je 0x39a30
movq %r13, %rdi
movq %r12, %rsi
callq 0x19000
testl %eax, %eax
je 0x39a36
movq %r13, %rdi
leaq 0x641a4(%rip), %rsi     # 0x9dbc3
callq 0x19000
movl $0x3, %r14d
testl %eax, %eax
je 0x39a3a
jmp 0x39a4c
orl $0x1, %r14d
jmp 0x39a3a
orl $0x2, %r14d
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1a680
testl %eax, %eax
jne 0x399e8
jmp 0x39a70
leaq 0x57f93(%rip), %rsi     # 0x919e6
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x18eb0
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x18420
movl %eax, %r14d
movl %r14d, %esi
movq %rbx, %rdi
callq 0x18b60
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/flags.c
// Function: CommandBufferResetFlags
static int CommandBufferResetFlags(lua_State *L)
    {
    if(lua_type(L, 1) == LUA_TNUMBER)
        return pushcommandbufferresetflags(L, luaL_checkinteger(L, 1));
    lua_pushinteger(L, checkcommandbufferresetflags(L, 1));
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0x1a130
cmpl $0x3, %eax
jne 0x39ad9
movq %rbx, %rdi
movl $0x1, %esi
callq 0x190f0
movq %rax, %rcx
xorl %eax, %eax
testb $0x1, %cl
je 0x39b5f
leaq 0x64106(%rip), %rsi     # 0x9dbd2
movq %rbx, %rdi
callq 0x1a300
jmp 0x39b5a
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1a680
testl %eax, %eax
je 0x39b2b
leaq 0x640dc(%rip), %r14     # 0x9dbd2
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x18690
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x19000
testl %eax, %eax
jne 0x39b2f
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1a680
testl %eax, %eax
jne 0x39af6
movl $0x1, %esi
jmp 0x39b52
xorl %esi, %esi
jmp 0x39b52
leaq 0x57eb0(%rip), %rsi     # 0x919e6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x18eb0
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x18420
movl %eax, %esi
movq %rbx, %rdi
callq 0x18b60
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq