LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: GetImageMemoryRequirements
static int GetImageMemoryRequirements(lua_State *L)
    {
    ud_t *ud;
    VkImage image = checkimage(L, 1, &ud);
    VkDevice device = ud->device;
    VkMemoryRequirements req;
    if(ud->ddt->GetImageMemoryRequirements2)
        return GetImageMemoryRequirements2(L, image, ud);
    ud->ddt->GetImageMemoryRequirements(device, image, &req);
    zpushVkMemoryRequirements(L, &req);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x66c22(%rip), %rcx     # 0x8c99a
movl $0x1, %ebp
leaq 0x20(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %r13
movq 0x20(%r13), %r14
movq 0x50(%r13), %rax
cmpq $0x0, 0x4a8(%rax)
je 0x25e1e
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a0f0
leaq 0x8(%rsp), %rbp
cmpl $0x5, %eax
jne 0x25e3c
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rdx
callq 0x198d0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25e71
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x25eb7
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x78(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19630
jmp 0x25eb9
movl $0x18, %edx
movq %rbx, %rdi
movl $0x3b9d0451, %esi       # imm = 0x3B9D0451
movq %rbp, %rcx
callq 0x19da0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x25e71
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x25ea5
movq %r15, 0x10(%r12)
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x194e0
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x25eca
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%r13), %rax
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x4a8(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18160
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x25eb9
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceBufferMemoryRequirements
static int GetDeviceBufferMemoryRequirements(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDeviceBufferMemoryRequirementsKHR *info = NULL;
    VkMemoryRequirements2 *req = NULL;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, GetDeviceBufferMemoryRequirementsKHR);
#define CLEANUP do {                                            \
    zfreeVkDeviceBufferMemoryRequirementsKHR(L, info, 1);       \
    zfreeVkMemoryRequirements2(L, req, 1);                      \
} while(0)
    info = zcheckVkDeviceBufferMemoryRequirementsKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    req = znewchainVkMemoryRequirements2(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->ddt->GetDeviceBufferMemoryRequirementsKHR(device, info, req);
    zpushVkMemoryRequirements2(L, req);
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x65e1b(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x868(%rax)
je 0x262a5
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19000
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x262b8
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x26324
leaq 0x6811c(%rip), %rsi     # 0x8e3c8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x26324
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x194e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x262fc
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
jmp 0x26324
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x868(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18160
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceImageMemoryRequirements
static int GetDeviceImageMemoryRequirements(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDeviceImageMemoryRequirementsKHR *info = NULL;
    VkMemoryRequirements2 *req = NULL;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, GetDeviceImageMemoryRequirementsKHR);
#define CLEANUP do {                                            \
    zfreeVkDeviceImageMemoryRequirementsKHR(L, info, 1);        \
    zfreeVkMemoryRequirements2(L, req, 1);                      \
} while(0)
    info = zcheckVkDeviceImageMemoryRequirementsKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    req = znewchainVkMemoryRequirements2(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->ddt->GetDeviceImageMemoryRequirementsKHR(device, info, req);
    zpushVkMemoryRequirements2(L, req);
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x65cf2(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x870(%rax)
je 0x263ce
leaq 0x4(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x185c0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x263e1
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x2644d
leaq 0x6802d(%rip), %rsi     # 0x8e402
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x2644d
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x194e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x26425
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
jmp 0x2644d
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x870(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18160
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: GetMemoryFd
static int GetMemoryFd(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    int fd;
    VkMemoryGetFdInfoKHR* info;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    CheckDevicePfn(L, ud, GetMemoryFdKHR);
#define CLEANUP zfreeVkMemoryGetFdInfoKHR(L, info, 1)
    info = zcheckVkMemoryGetFdInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->memory = memory;
    ec = ud->ddt->GetMemoryFdKHR(ud->device, info, &fd);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    lua_pushinteger(L, fd);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x675eb(%rip), %rcx     # 0x8dfbc
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x478(%rax)
je 0x26a47
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18dd0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x26a5a
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x26aab
leaq 0x67a79(%rip), %rsi     # 0x8e4c7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x26aab
movq %r15, 0x10(%r14)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
leaq 0xc(%rsp), %rdx
movq %r14, %rsi
callq *0x478(%rax)
movl %eax, %r15d
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
testl %r15d, %r15d
je 0x26abc
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
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 0x26aad
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: GetMemoryFdProperties
static int GetMemoryFdProperties(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkMemoryFdPropertiesKHR properties;
    VkDevice device = checkdevice(L, 1, &ud);
    VkExternalMemoryHandleTypeFlagBits handleType = checkflags(L, 2);
    int fd = luaL_checkinteger(L, 3);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x6555b(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18f60
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190e0
movq (%r12), %rcx
movq 0x50(%rcx), %rcx
movq 0x480(%rcx), %r8
testq %r8, %r8
je 0x26b50
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq *%r8
testl %eax, %eax
je 0x26b63
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x26b75
leaq 0x67994(%rip), %rsi     # 0x8e4eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x26b75
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x18e10
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: GetMemoryHostPointerProperties
static int GetMemoryHostPointerProperties(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkMemoryHostPointerPropertiesEXT properties;
    VkDevice device = checkdevice(L, 1, &ud);
    VkExternalMemoryHandleTypeFlagBits handleType = checkflags(L, 2);
    void* ptr = checklightuserdata(L, 3);
    CheckDevicePfn(L, ud, GetMemoryHostPointerPropertiesEXT);
    ec = ud->ddt->GetMemoryHostPointerPropertiesEXT(device, handleType, ptr, &properties);
    CheckError(L, ec);
    zpushVkMemoryHostPointerPropertiesEXT(L, &properties);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x654a5(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18f60
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x182c0
movq (%r12), %rcx
movq 0x50(%rcx), %rcx
movq 0x568(%rcx), %r8
testq %r8, %r8
je 0x26c07
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%r8
testl %eax, %eax
je 0x26c1a
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x26c2c
leaq 0x6790b(%rip), %rsi     # 0x8e519
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x26c2c
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1a520
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x653eb(%rip), %rcx     # 0x8c03b
movl $0x1, %ebx
leaq 0x10(%rsp), %rbp
movl $0x1, %esi
movq %rbp, %rdx
callq 0x1a4e0
movq %rax, %r15
movq %r14, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r12
movq %r14, %rdi
movl $0x3, %esi
callq 0x190e0
movq %rax, %r13
movq %r14, %rdi
movl $0x4, %esi
callq 0x190e0
movq (%rbp), %rcx
movq 0x50(%rcx), %rcx
movq 0x530(%rcx), %r9
testq %r9, %r9
je 0x26cce
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 0x26ce1
leaq 0x6787b(%rip), %rsi     # 0x8e550
movq %r14, %rdi
xorl %eax, %eax
callq 0x19ba0
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_O3/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 0x652fb(%rip), %rcx     # 0x8c000
movl $0x1, %ebx
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x5f0(%rcx), %rcx
testq %rcx, %rcx
je 0x26d57
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 0x18b50
jmp 0x26d6a
leaq 0x67828(%rip), %rsi     # 0x8e586
movq %r14, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x65277(%rip), %rcx     # 0x8c000
movl $0x1, %ebx
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x5f8(%rcx), %rcx
testq %rcx, %rcx
je 0x26ddb
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 0x18b50
jmp 0x26dee
leaq 0x677d0(%rip), %rsi     # 0x8e5b2
movq %r14, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x671af(%rip), %rcx     # 0x8dfbc
movl $0x1, %ebx
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq (%r15), %rdx
movq 0x50(%rdx), %rcx
movq 0x600(%rcx), %rcx
testq %rcx, %rcx
je 0x26e5f
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 0x18b50
jmp 0x26e72
leaq 0x6777f(%rip), %rsi     # 0x8e5e5
movq %r14, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6712b(%rip), %rcx     # 0x8dfbc
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18840
movq (%r15), %rcx
movq 0x50(%rcx), %rax
movq 0x880(%rax), %rax
testq %rax, %rax
je 0x26ed7
cvtsd2ss %xmm0, %xmm0
movq 0x20(%rcx), %rdi
movq %r14, %rsi
callq *%rax
xorl %eax, %eax
jmp 0x26ee8
leaq 0x67740(%rip), %rsi     # 0x8e61e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/device_memory.c
// Function: 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 0x26f40
movq 0x990b6(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x26f28
leaq 0x6745d(%rip), %rdi     # 0x8e37b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x30(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x66612(%rip), %rcx     # 0x8def4
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r15
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x2795c
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
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 0x27972
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x27a1c
leaq 0x66eb0(%rip), %rsi     # 0x8e813
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x27a1c
movl (%rsp), %edx
movl $0x1, %eax
testl %edx, %edx
je 0x27a1c
xorl %r12d, %r12d
movl %edx, %ecx
subl $0x20, %ecx
movl $0x20, %eax
cmovael %eax, %edx
movl $0x0, %eax
cmovbl %eax, %ecx
movl %edx, 0x4(%rsp)
movl %ecx, (%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 0x279cd
cmpl $0x5, %eax
jne 0x27943
cmpl $0x0, 0x4(%rsp)
je 0x27a0c
movl %r12d, %r13d
xorl %ebp, %ebp
movq 0x10(%rsp,%rbp,8), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27bfd
leal 0x1(%r13,%rbp), %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19130
incq %rbp
movl 0x4(%rsp), %eax
cmpq %rax, %rbp
jb 0x279d9
addl %ebp, %r12d
movl (%rsp), %edx
testl %edx, %edx
jne 0x27985
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_O3/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 0x66be3(%rip), %rcx     # 0x8e64e
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rdx
movq 0x48(%rdx), %rcx
movq 0x138(%rcx), %rcx
testq %rcx, %rcx
je 0x27ab4
movq 0x10(%rdx), %rdx
movq (%rdx), %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x27ac7
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x27ac9
leaq 0x66d91(%rip), %rsi     # 0x8e84c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x27ac9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x64552(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
leaq 0x66b49(%rip), %rcx     # 0x8e64e
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1a4e0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x298(%rax)
je 0x27b79
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x3, %esi
movq %r13, %rdx
callq 0x198c0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x27b8c
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x27bd2
leaq 0x66cf3(%rip), %rsi     # 0x8e873
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x27bd2
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 0x19160
testl %ebp, %ebp
je 0x27bd0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x27bd2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/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 0x66a3c(%rip), %rcx     # 0x8e64e
callq 0x19750
testl %eax, %eax
jne 0x27c6b
movq 0x983a6(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x27c38
leaq 0x66b4b(%rip), %rdi     # 0x8e779
movq %r14, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x66a0f(%rip), %rdx     # 0x8e64e
movq %r15, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x18320
movq %rbx, 0x10(%rax)
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
leaq 0x12(%rip), %rcx        # 0x27c71
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_O3/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 0x66b0c(%rip), %rsi     # 0x8e792
movq %r14, %rdx
callq 0x18ef0
movq %r15, %rdi
movq %r14, %rsi
callq 0x18d20
testl %eax, %eax
je 0x27cba
movq 0x98324(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x27cba
leaq 0x66afa(%rip), %rdi     # 0x8e7aa
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_O3/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 0x65fca(%rip), %rcx     # 0x8e792
callq 0x19750
testl %eax, %eax
jne 0x28825
movq 0x977f0(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x287ee
leaq 0x66161(%rip), %rdi     # 0x8e945
movq %r15, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x65f9d(%rip), %rdx     # 0x8e792
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x18320
movq %rbx, 0x10(%rax)
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq %r14, 0x40(%rax)
leaq 0x18(%rip), %rcx        # 0x28831
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_O3/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 0x2885b
movq 0x97783(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x2885b
leaq 0x66112(%rip), %rdi     # 0x8e963
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x29142
movl %ebp, %edi
movq %rax, %rsi
callq 0x2915b
testq %rax, %rax
je 0x2914a
movl $0x0, (%rbx)
movl 0x44(%rax), %r14d
jmp 0x29153
movl $0x1, (%rbx)
jmp 0x29153
movl $0xfffffffd, (%rbx)     # imm = 0xFFFFFFFD
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2915b
testq %rax, %rax
je 0x291ec
movl 0x44(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x657f3(%rip), %rsi     # 0x8e9e6
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x18ea0
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x18410
// File: /workspace/github_cpp_makefile_star2_O3/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 %rax
movq 0x98121(%rip), %rax     # 0xc1340
testq %rax, %rax
je 0x2923e
cmpl %esi, 0x40(%rax)
jne 0x2922c
cmpl %edx, 0x44(%rax)
setb %cl
ja 0x29239
testb %cl, %cl
je 0x2925a
addq $0x8, %rax
movq (%rax), %rax
jmp 0x2921f
leaq 0x6438a(%rip), %rsi     # 0x8d5cf
leaq 0x657ad(%rip), %rdx     # 0x8e9f9
movl $0xca, %ecx
xorl %eax, %eax
popq %r8
jmp 0x19ba0
movq 0x48(%rax), %rsi
callq 0x1a2c0
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x187d0
movq 0x980ba(%rip), %rax     # 0xc1340
testq %rax, %rax
je 0x29323
xorl %ecx, %ecx
movl 0x40(%rax), %edx
cmpl %ebx, %edx
jne 0x292a3
cmpl $0x0, 0x44(%rax)
movq %rax, %rcx
jne 0x292b0
jmp 0x292c0
jbe 0x292aa
movq %rax, %rcx
jmp 0x292b0
jae 0x292c0
addq $0x8, %rax
movq (%rax), %rax
testq %rax, %rax
jne 0x29291
movq %rcx, %rax
testq %rcx, %rcx
je 0x29323
movl $0x1, %ebp
movq %rax, %r15
cmpl %ebx, 0x40(%rax)
jne 0x292eb
movq 0x48(%r15), %rsi
movq %r14, %rdi
callq 0x1a2c0
movslq %ebp, %rdx
incl %ebp
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19130
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x29301
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x292f4
jmp 0x292c5
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x2930f
cmpq %r15, (%rax)
je 0x292c5
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x29323
cmpq 0x8(%rax), %r15
movq %rax, %r15
je 0x2930f
jmp 0x292c5
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a0f0
testl %eax, %eax
jle 0x29416
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a0f0
cmpl $0x5, %eax
jne 0x2941f
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a120
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
testl %eax, %eax
je 0x29416
movl %eax, %esi
shlq $0x2, %rsi
movq %r15, %rdi
callq 0x18050
testq %rax, %rax
je 0x2943b
movq %rax, %r13
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movl (%rax), %eax
cmpq %rax, %r12
jae 0x29429
leaq 0x1(%r12), %rbx
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x18970
movq %r15, %rdi
movl 0x14(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rcx
callq 0x18b10
movl %eax, (%r13,%r12,4)
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
cmpl $0x0, (%r14)
movq %rbx, %r12
je 0x293b1
movq %r15, %rdi
movq %r13, %rsi
callq 0x182d0
movq 0x8(%rsp), %rax
movl $0x0, (%rax)
jmp 0x29426
movl $0x1, (%r14)
jmp 0x29426
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 0x29426
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/event.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkEvent event;
    VkEventCreateInfo* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = NULL;
#define CLEANUP zfreeVkEventCreateInfo(L, info, 1)
    if(lua_istable(L, 2))
        {
        allocator = optallocator(L, 3);
        info = zcheckVkEventCreateInfo(L, 2, &err);
        if(err) { CLEANUP; return argerror(L, 2); }
        }
    else
        {
        VkFlags flags = optflags(L, 2, 0);
        info = znewVkEventCreateInfo(L, &err);
        if(err) { CLEANUP; return lua_error(L); }
        info->flags = flags;
        }
    ec = device_ud->ddt->CreateEvent(device, info, allocator, &event);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    TRACE_CREATE(event, "event");
    ud = newuserdata_nondispatchable(L, event, EVENT_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freeevent;
    ud->ddt = device_ud->ddt;
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x565dc(%rip), %rcx     # 0x8c03b
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a0f0
movq %rbx, %rdi
cmpl $0x5, %eax
jne 0x35aea
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a1e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x35b37
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x35be6
movl $0x2, %esi
xorl %edx, %edx
callq 0x192a0
movq %rax, %r15
leaq 0x4(%rsp), %r13
movl $0x18, %edx
movq %rbx, %rdi
movl $0xa, %esi
movq %r13, %rcx
callq 0x19da0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x35b2f
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x35b76
movl %r15d, 0x10(%r12)
xorl %r15d, %r15d
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0xc8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
testl %ebp, %ebp
je 0x35b80
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x35be6
movq 0x8a441(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x35b9f
movq 0x8(%rsp), %rsi
leaq 0x60f6c(%rip), %rdi     # 0x96b04
xorl %eax, %eax
callq 0x18960
movq 0x8(%rsp), %rsi
leaq 0x56e00(%rip), %rdx     # 0x8c9ab
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18320
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x40(%rax)
leaq 0x189(%rip), %rdx       # 0x35d5e
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/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 0x56d75(%rip), %rcx     # 0x8c9ab
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xd8(%rcx)
movl %eax, %ebp
testl %eax, %eax
je 0x35ca7
cmpl $0x4, %ebp
je 0x35c80
cmpl $0x3, %ebp
jne 0x35c91
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x193a0
jmp 0x35ca7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x193a0
movl $0x1, %ebp
jmp 0x35ca7
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x56ceb(%rip), %rcx     # 0x8c9ab
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xe0(%rcx)
testl %eax, %eax
je 0x35cfe
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x35d00
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x56c95(%rip), %rcx     # 0x8c9ab
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
movq %rax, %rsi
callq *0xe8(%rcx)
testl %eax, %eax
je 0x35d54
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x35d56
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x35daf
movq 0x8a24a(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x35d94
leaq 0x60d91(%rip), %rdi     # 0x96b1b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xd0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x560fc(%rip), %rcx     # 0x8c03b
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a0f0
leaq 0x4(%rsp), %r12
cmpl $0x5, %eax
jne 0x35fb6
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a220
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x35fe7
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x3605e
movl $0x18, %edx
movq %rbx, %rdi
movl $0x8, %esi
movq %r12, %rcx
callq 0x19da0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x35ff9
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x36056
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r12
jmp 0x3600f
xorl %r12d, %r12d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192a0
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 0x19160
testl %r13d, %r13d
je 0x36071
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x3675e
jmp 0x36060
// File: /workspace/github_cpp_makefile_star2_O3/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 0x55f9d(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x2a0(%rax)
je 0x36125
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19b50
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x36138
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x36185
leaq 0x60ac7(%rip), %rsi     # 0x96bf3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x36185
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 0x19160
testl %r13d, %r13d
je 0x36198
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3675e
jmp 0x36187