LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/queue.c
// Function: QueueSubmit2
static int QueueSubmit2(lua_State *L)
    {
    int err;
    uint32_t count;
    VkResult ec;
    ud_t *ud;
    VkSubmitInfo2KHR* submits;
    VkQueue queue = checkqueue(L, 1, &ud);
    VkFence fence = testfence(L, 3, NULL);
    CheckDevicePfn(L, ud, QueueSubmit2KHR);
#define CLEANUP zfreearrayVkSubmitInfo2KHR(L, submits, count, 1)
    submits = zcheckarrayVkSubmitInfo2KHR(L, 2, &count, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->QueueSubmit2KHR(queue, count, submits, fence);
    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 0x3726e(%rip), %rcx     # 0x7e9e8
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
leaq 0x37817(%rip), %rcx     # 0x7efab
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a4b0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x698(%rax)
je 0x4780b
pushq $0x2
popq %rsi
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rcx
callq 0x186c0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4781e
movl 0x4(%rsp), %ecx
pushq $0x40
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x197e0
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x4786e
leaq 0x4972e(%rip), %rsi     # 0x90f40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x4786e
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq *0x698(%rax)
movl %eax, %ebp
movl 0x4(%rsp), %ecx
pushq $0x40
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x197e0
testl %ebp, %ebp
je 0x4786c
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x4786e
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/queue.c
// Function: QueueBindSparse
static int QueueBindSparse(lua_State *L)
    {
    int err;
    uint32_t count;
    VkResult ec;
    ud_t *ud;
    VkBindSparseInfo* binds;
    VkQueue queue = checkqueue(L, 1, &ud);
    VkFence fence = testfence(L, 3, NULL);
#define CLEANUP zfreearrayVkBindSparseInfo(L, binds, count, 1)
    binds = zcheckarrayVkBindSparseInfo(L, 2, &count, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->QueueBindSparse(queue, count, binds, fence);
    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 0x37153(%rip), %rcx     # 0x7e9e8
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %rdx
callq 0x1a500
movq %rax, %r15
leaq 0x376ff(%rip), %rcx     # 0x7efab
xorl %r14d, %r14d
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a4b0
movq %rax, %r13
pushq $0x2
popq %rsi
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rcx
callq 0x186b0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x47913
movl 0x4(%rsp), %ecx
pushq $0x60
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x197e0
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x4795f
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq *0x88(%rax)
movl %eax, %ebp
movl 0x4(%rsp), %ecx
pushq $0x60
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x197e0
testl %ebp, %ebp
je 0x47962
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/render_pass.c
// Function: GetRenderAreaGranularity
static int GetRenderAreaGranularity(lua_State *L)
    {
    ud_t *ud;
    VkRenderPass render_pass = checkrender_pass(L, 1, &ud);
    VkDevice device = ud->device;
    VkExtent2D granularity;
    ud->ddt->GetRenderAreaGranularity(device, render_pass, &granularity);
    zpushVkExtent2D(L, &granularity);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x3735a(%rip), %rcx     # 0x7f005
pushq $0x1
popq %rbp
movq %rsp, %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
leaq 0x8(%rsp), %r14
movq %rax, %rsi
movq %r14, %rdx
callq *0x218(%rcx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a0d0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/render_pass.c
// Function: freerender_pass
static int freerender_pass(lua_State *L, ud_t *ud)
    {
    VkRenderPass render_pass = (VkRenderPass)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(render_pass, "render_pass");
    UD(device)->ddt->DestroyRenderPass(device, render_pass, 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 0x47d3e
movq 0x7328b(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x47d23
leaq 0x492ac(%rip), %rdi     # 0x90fc5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x210(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/sampler.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkSampler sampler;
    VkSamplerCreateInfo* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
#define CLEANUP zfreeVkSamplerCreateInfo(L, info, 1)
    info = zcheckVkSamplerCreateInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = device_ud->ddt->CreateSampler(device, info, allocator, &sampler);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    TRACE_CREATE(sampler, "sampler");
    ud = newuserdata_nondispatchable(L, sampler, SAMPLER_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freesampler;
    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 0x3516c(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x18e00
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x47f35
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x47f7d
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x1a8(%rax)
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x47f90
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x73001(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x47fae
movq (%rsp), %rsi
leaq 0x4905a(%rip), %rdi     # 0x91001
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x36685(%rip), %rdx     # 0x7e63e
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18330
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x40(%rax)
leaq 0x3b(%rip), %rdx        # 0x4801e
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
jmp 0x47f7f
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/sampler.c
// Function: freesampler
static int freesampler(lua_State *L, ud_t *ud)
    {
    VkSampler sampler = (VkSampler)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(sampler, "sampler");
    UD(device)->ddt->DestroySampler(device, sampler, 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 0x4806f
movq 0x72f5a(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x48054
leaq 0x48fd0(%rip), %rdi     # 0x9101a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1b0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/sampler_ycbcr_conversion.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkSamplerYcbcrConversion sampler_ycbcr_conversion;
    VkSamplerYcbcrConversionCreateInfoKHR* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckDevicePfn(L, device_ud, CreateSamplerYcbcrConversion);
#define CLEANUP zfreeVkSamplerYcbcrConversionCreateInfoKHR(L, info, 1)
    info = zcheckVkSamplerYcbcrConversionCreateInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = device_ud->ddt->CreateSamplerYcbcrConversion(device,
                            info, allocator, &sampler_ycbcr_conversion);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    TRACE_CREATE(sampler_ycbcr_conversion, "sampler_ycbcr_conversion");
    ud = newuserdata_nondispatchable(L, sampler_ycbcr_conversion, SAMPLER_YCBCR_CONVERSION_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freesampler_ycbcr_conversion;
    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 0x34e3c(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x508(%rax)
je 0x4827a
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1a020
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4828d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x482d5
leaq 0x48df3(%rip), %rsi     # 0x91074
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x482d5
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x508(%rax)
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x482e8
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x72ca9(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x48306
movq (%rsp), %rsi
leaq 0x48da7(%rip), %rdi     # 0x910a6
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x36c16(%rip), %rdx     # 0x7ef27
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18330
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x40(%rax)
leaq 0x3b(%rip), %rdx        # 0x48376
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
jmp 0x482d7
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/sampler_ycbcr_conversion.c
// Function: freesampler_ycbcr_conversion
static int freesampler_ycbcr_conversion(lua_State *L, ud_t *ud)
    {
    VkSamplerYcbcrConversion sampler_ycbcr_conversion = (VkSamplerYcbcrConversion)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(sampler_ycbcr_conversion, "sampler_ycbcr_conversion");
    UD(device)->ddt->DestroySamplerYcbcrConversion(device, sampler_ycbcr_conversion, 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 0x483c7
movq 0x72c02(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x483ac
leaq 0x48d2e(%rip), %rdi     # 0x910d0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x510(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/semaphore.c
// Function: ImportSemaphoreFd
static int ImportSemaphoreFd(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    VkImportSemaphoreFdInfoKHR* info;
    VkSemaphore semaphore = checksemaphore(L, 1, &ud);
    CheckDevicePfn(L, ud, ImportSemaphoreFdKHR);
#define CLEANUP zfreeVkImportSemaphoreFdInfoKHR(L, info, 1)
    info = zcheckVkImportSemaphoreFdInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->semaphore = semaphore;
    ec = ud->ddt->ImportSemaphoreFdKHR(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 0x3687e(%rip), %rcx     # 0x7ef96
pushq $0x1
popq %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x488(%rax)
je 0x48782
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x19b20
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x48795
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x487da
leaq 0x48a2c(%rip), %rsi     # 0x911b5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x487da
movq %r15, 0x10(%r14)
movq (%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq %r14, %rsi
callq *0x488(%rax)
movl %eax, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
testl %ebp, %ebp
je 0x487d8
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x487da
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/semaphore.c
// Function: GetSemaphoreFd
static int GetSemaphoreFd(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    int fd;
    VkSemaphoreGetFdInfoKHR* info;
    VkSemaphore semaphore = checksemaphore(L, 1, &ud);
    CheckDevicePfn(L, ud, GetSemaphoreFdKHR);
#define CLEANUP zfreeVkSemaphoreGetFdInfoKHR(L, info, 1)
    info = zcheckVkSemaphoreGetFdInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->semaphore = semaphore;
    ec = ud->ddt->GetSemaphoreFdKHR(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 0x36799(%rip), %rcx     # 0x7ef96
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x490(%rax)
je 0x48869
pushq $0x2
popq %rsi
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x19cd0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4887c
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x488c8
leaq 0x4896f(%rip), %rsi     # 0x911df
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x488c8
movq %r15, 0x10(%r14)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
leaq 0xc(%rsp), %rdx
movq %r14, %rsi
callq *0x490(%rax)
movl %eax, %r15d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
testl %r15d, %r15d
je 0x488d9
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b50
jmp 0x488ca
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/semaphore.c
// Function: GetSemaphoreCounterValue
static int GetSemaphoreCounterValue(lua_State *L)
    {
    VkResult ec;
    uint64_t value;
    ud_t *ud;
    VkSemaphore semaphore = checksemaphore(L, 1, &ud);
    CheckDevicePfn(L, ud, GetSemaphoreCounterValue);
    ec = ud->ddt->GetSemaphoreCounterValue(ud->device, semaphore, &value);
    CheckError(L, ec);
    lua_pushinteger(L, value);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x3669c(%rip), %rcx     # 0x7ef96
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq (%r14), %rdx
movq 0x50(%rdx), %rcx
movq 0x5d8(%rcx), %rcx
testq %rcx, %rcx
je 0x48945
movq 0x20(%rdx), %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x4895a
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x48956
leaq 0x488ba(%rip), %rsi     # 0x91206
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x48966
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x18b50
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/semaphore.c
// Function: WaitSemaphores
static int WaitSemaphores(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    VkSemaphoreWaitInfo* info;
    VkDevice device = checkdevice(L, 1, &ud);
    uint64_t timeout = luaL_checkinteger(L, 3);
    CheckDevicePfn(L, ud, WaitSemaphores);
#define CLEANUP zfreeVkSemaphoreWaitInfo(L, info, 1)
    info = zcheckVkSemaphoreWaitInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->WaitSemaphores(device, info, timeout);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x346b2(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5e0(%rax)
je 0x48a04
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x19890
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x48a17
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x48a5b
leaq 0x48829(%rip), %rsi     # 0x91234
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x48a5b
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x5e0(%rax)
movl %eax, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
testl %ebp, %ebp
je 0x48a59
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x48a5b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/semaphore.c
// Function: SignalSemaphore
static int SignalSemaphore(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    VkSemaphoreSignalInfo* info;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, SignalSemaphore);
#define CLEANUP zfreeVkSemaphoreSignalInfo(L, info, 1)
    info = zcheckVkSemaphoreSignalInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->SignalSemaphore(device, info);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x345bb(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
movq %rsp, %r15
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5e8(%rax)
je 0x48aea
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1a5d0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x48afd
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x48b3d
leaq 0x48767(%rip), %rsi     # 0x91258
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x48b3d
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x5e8(%rax)
movl %eax, %ebp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19150
testl %ebp, %ebp
je 0x48b3b
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x48b3d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/semaphore.c
// Function: freesemaphore
static int freesemaphore(lua_State *L, ud_t *ud)
    {
    VkSemaphore semaphore = (VkSemaphore)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(semaphore, "semaphore");
    UD(device)->ddt->DestroySemaphore(device, semaphore, 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 0x48b9b
movq 0x7242e(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x48b80
leaq 0x48624(%rip), %rdi     # 0x9119a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xc0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/shader_module.c
// Function: freeshader_module
static int freeshader_module(lua_State *L, ud_t *ud)
    {
    VkShaderModule shader_module = (VkShaderModule)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(shader_module, "shader_module");
    UD(device)->ddt->DestroyShaderModule(device, shader_module, 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 0x48f8e
movq 0x7203b(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x48f73
leaq 0x48372(%rip), %rdi     # 0x912db
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x158(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: GetPhysicalDeviceSurfaceSupport
static int GetPhysicalDeviceSurfaceSupport(lua_State *L)
    {
    VkResult ec;
    VkBool32 supported;
    ud_t *ud;
    VkPhysicalDevice physdev = checkphysical_device(L, 1, &ud);
    uint32_t qfamily = luaL_checkinteger(L, 2);
    VkSurfaceKHR surface = checksurface(L, 3, NULL);
    CheckInstancePfn(L, ud, GetPhysicalDeviceSurfaceSupportKHR);
    ec = ud->idt->GetPhysicalDeviceSurfaceSupportKHR(physdev, qfamily, surface, &supported);
    CheckError(L, ec);
    lua_pushboolean(L, supported);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x35dd7(%rip), %rcx     # 0x7eef4
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r12
movl %ebp, %esi
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x190d0
movq %rax, %r15
leaq 0x47392(%rip), %rcx     # 0x904d9
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a500
movq (%r12), %rcx
movq 0x48(%rcx), %rcx
movq 0x68(%rcx), %r8
testq %r8, %r8
je 0x49190
leaq 0x4(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%r8
testl %eax, %eax
je 0x491a5
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x491a1
leaq 0x483ec(%rip), %rsi     # 0x91583
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x491b1
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x193a0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: CreateHeadlessSurface
static int CreateHeadlessSurface(lua_State *L)
    {
    int err;
    VkResult ec;
    VkSurfaceKHR surface;
    ud_t *ud;
    VkHeadlessSurfaceCreateInfoEXT* info;
    VkInstance instance = checkinstance(L, 1, &ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckInstancePfn(L, ud, CreateHeadlessSurfaceEXT);
#define CLEANUP zfreeVkHeadlessSurfaceCreateInfoEXT(L, info, 1)
    info = zcheckVkHeadlessSurfaceCreateInfoEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->idt->CreateHeadlessSurfaceEXT(instance, info, allocator, &surface);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return newsurface(L, instance, surface, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x34da0(%rip), %rcx     # 0x7e711
pushq $0x1
popq %rsi
movq %rsp, %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x208(%rax)
je 0x499ea
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x19000
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x499fd
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x49a46
leaq 0x47c97(%rip), %rsi     # 0x91688
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x49a46
movq (%rsp), %rax
movq 0x48(%rax), %rax
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x208(%rax)
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x49a59
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x49f8b
jmp 0x49a48
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: CreateDisplayPlaneSurface
static int CreateDisplayPlaneSurface(lua_State *L)
    {
    int err;
    VkResult ec;
    VkSurfaceKHR surface;
    ud_t *ud;
    VkDisplaySurfaceCreateInfoKHR* info;
    VkDisplayModeKHR display_mode = checkdisplay_mode(L, 1, &ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckInstancePfn(L, ud, CreateDisplayPlaneSurfaceKHR);
#define CLEANUP zfreeVkDisplaySurfaceCreateInfoKHR(L, info, 1)
    info = zcheckVkDisplaySurfaceCreateInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    info->displayMode = display_mode;
    ec = ud->idt->CreateDisplayPlaneSurfaceKHR(ud->instance, info, allocator, &surface);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return newsurface(L, ud->instance, surface, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x35d0c(%rip), %rcx     # 0x7f792
pushq $0x1
popq %rsi
movq %rsp, %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r14
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xc8(%rax)
je 0x49aff
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x181f0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x49b12
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
jmp 0x49b61
leaq 0x47be2(%rip), %rsi     # 0x916e8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x49b61
movq %r15, 0x18(%r12)
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x48(%rax), %rax
leaq 0x8(%rsp), %rcx
movq %r12, %rsi
movq %r14, %rdx
callq *0xc8(%rax)
movl %eax, %r15d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r15d, %r15d
je 0x49b74
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x49f8b
jmp 0x49b63
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: CreatedSurface
static int CreatedSurface(lua_State *L) /* NONVK */
    {
    VkInstance instance = checkinstance(L, 1, NULL);
    VkSurfaceKHR surface = (VkSurfaceKHR)checkhandle(L, 2);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    return newsurface(L, instance, surface, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x34b72(%rip), %rcx     # 0x7e711
pushq $0x1
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
callq 0x1a500
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x18c30
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x49f8b
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: GetDeviceGroupSurfacePresentModes
static int GetDeviceGroupSurfacePresentModes(lua_State *L)
    {
    VkResult ec;
    ud_t *ud;
    VkDeviceGroupPresentModeFlagsKHR modes;
    VkDevice device = checkdevice(L, 1, &ud);
    VkSurfaceKHR surface = checksurface(L, 2, NULL);
    CheckDevicePfn(L, ud, GetDeviceGroupSurfacePresentModesKHR);
    ec = ud->ddt->GetDeviceGroupSurfacePresentModesKHR(device, surface, &modes);
    CheckError(L, ec);
    pushflags(L, modes);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x33415(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r15
movl %ebp, %esi
movq %r15, %rdx
callq 0x1a500
movq %rax, %r14
leaq 0x46897(%rip), %rcx     # 0x904d9
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a500
movq (%r15), %rcx
movq 0x50(%rcx), %rcx
movq 0x550(%rcx), %rcx
testq %rcx, %rcx
je 0x49c89
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x49c9e
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x49c9a
leaq 0x47a8a(%rip), %rsi     # 0x9171a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
movl %eax, %ebp
jmp 0x49caa
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x19440
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: GetPhysicalDevicePresentRectangles
static int GetPhysicalDevicePresentRectangles(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    uint32_t i, count = 0;
    VkRect2D* rects = NULL;
    VkPhysicalDevice physdev = checkphysical_device(L, 1, &ud);
    VkSurfaceKHR surface = checksurface(L, 2, NULL);
    CheckDevicePfn(L, ud, GetPhysicalDevicePresentRectanglesKHR);
    ec = ud->ddt->GetPhysicalDevicePresentRectanglesKHR(physdev, surface, &count, NULL);
    CheckError(L, ec);
#define CLEANUP zfreearrayVkRect2D(L, rects, count, 1)
    rects = znewarrayVkRect2D(L, count, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ec = ud->ddt->GetPhysicalDevicePresentRectanglesKHR(physdev, surface, &count, rects);
    if(ec) { CLEANUP; CheckError(L, ec); return 0; }
    lua_newtable(L);
    for(i = 0; i < count; i++)
        {
        zpushVkRect2D(L, &rects[i]);
        lua_rawseti(L, -2, i+1);
        }
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
andl $0x0, 0x4(%rsp)
leaq 0x35220(%rip), %rcx     # 0x7eef4
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
leaq 0x467e9(%rip), %rcx     # 0x904d9
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1a500
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
movq 0x558(%rax), %rax
testq %rax, %rax
je 0x49d34
leaq 0x4(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
callq *%rax
testl %eax, %eax
je 0x49d47
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
jmp 0x49d84
leaq 0x47a19(%rip), %rsi     # 0x91754
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x49d8c
movl 0x4(%rsp), %ecx
pushq $-0x1
popq %rsi
pushq $0x10
popq %rdx
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %r8
callq 0x19820
movq %rax, %r14
cmpl $0x0, (%r13)
je 0x49d9f
movl 0x4(%rsp), %ecx
pushq $0x10
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
xorl %r9d, %r9d
callq 0x18d30
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
leaq 0x4(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq *0x558(%rax)
testl %eax, %eax
je 0x49de9
movl %eax, %r15d
movl 0x4(%rsp), %ecx
pushq $0x10
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
xorl %r9d, %r9d
callq 0x18d30
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
jmp 0x49d2d
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
pushq $-0x2
popq %r12
movq %r14, %r13
movl 0x4(%rsp), %ecx
cmpq %rcx, %r15
jae 0x49e2a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1a3d0
incq %r15
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x19120
addq $0x10, %r13
jmp 0x49dff
pushq $0x10
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x18d30
jmp 0x49d8e
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: GetDeviceGroupPresentCapabilities
static int GetDeviceGroupPresentCapabilities(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    VkDeviceGroupPresentCapabilitiesKHR* capabilities;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, GetDeviceGroupPresentCapabilitiesKHR);
#define CLEANUP zfreeVkDeviceGroupPresentCapabilitiesKHR(L, capabilities, 1)
    capabilities = znewchainVkDeviceGroupPresentCapabilitiesKHR(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ec = ud->ddt->GetDeviceGroupPresentCapabilitiesKHR(device, capabilities);
    if(ec) { CLEANUP; CheckError(L, ec); return 0; }
    zpushVkDeviceGroupPresentCapabilitiesKHR(L, capabilities);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x331e2(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rbp
movq %rsp, %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x1a500
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x548(%rax)
je 0x49ea7
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18390
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x49eba
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
jmp 0x49ef0
leaq 0x478e1(%rip), %rsi     # 0x9178f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x49ef8
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x548(%rax)
testl %eax, %eax
je 0x49f09
movl %eax, %r15d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19150
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19fb0
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19150
jmp 0x49efa
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: PushSupportedSurfaceCounters
static int PushSupportedSurfaceCounters(lua_State *L, VkPhysicalDevice physdev, ud_t *ud, VkSurfaceKHR surface)
/* Calls GetPhysicalDeviceSurfaceCapabilities2EXT() to retrieve the supportedSurfaceCounters
 * field, and sets the field in the table on the top of the stack.
 * (Note that all other capabilities retrieved by this function are the same as in
 * GetPhysicalDeviceSurfaceCapabilitiesKHR(), so we don't bother about them).
 */
    {
    VkResult ec;
    VkSurfaceCapabilities2EXT caps;
    if(!ud->idt->GetPhysicalDeviceSurfaceCapabilities2EXT) return 0;
    memset(&caps, 0, sizeof(caps));
    caps.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT;
    ec = ud->idt->GetPhysicalDeviceSurfaceCapabilities2EXT(physdev, surface, &caps);
    if(ec) return 0;
    pushflags(L, caps.supportedSurfaceCounters);
    lua_setfield(L, -2, "supported_surface_counters");
    return 0;
    }

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq 0x48(%rdx), %rax
movq 0x140(%rax), %rax
testq %rax, %rax
je 0x49f85
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x30(%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
andq $0x0, 0x40(%rdx)
movl $0x3b9c2990, (%rdx)     # imm = 0x3B9C2990
movq %rsi, %rdi
movq %rcx, %rsi
callq *%rax
testl %eax, %eax
jne 0x49f85
movl 0x44(%rsp), %esi
movq %rbx, %rdi
callq 0x19440
leaq 0x4767e(%rip), %rdx     # 0x915f8
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18af0
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: newsurface
static int newsurface(lua_State *L, VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *allocator)
    {
    ud_t *ud;
    TRACE_CREATE(surface, "surface");
    ud = newuserdata_nondispatchable(L, surface, SURFACE_MT);
    ud->parent_ud = UD(instance);
    ud->instance = instance;
    ud->destructor = freesurface;
    ud->allocator = allocator;
    ud->idt = UD(instance)->idt;
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movq 0x70ff2(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x49fbc
leaq 0x47704(%rip), %rdi     # 0x916b6
movq %r15, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x46516(%rip), %rdx     # 0x904d9
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x18330
movq %rax, %r15
movq %rbx, %rdi
callq 0x19eb0
movq %rax, 0x10(%r15)
movq %rbx, 0x18(%r15)
leaq 0x24(%rip), %rax        # 0x4a00e
movq %rax, 0x8(%r15)
movq %r14, 0x40(%r15)
movq %rbx, %rdi
callq 0x19eb0
movq 0x48(%rax), %rax
movq %rax, 0x48(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/surface.c
// Function: freesurface
static int freesurface(lua_State *L, ud_t *ud)
    {
    VkSurfaceKHR surface = (VkSurfaceKHR)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkInstance instance = ud->instance;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(surface, "surface");
    UD(instance)->idt->DestroySurfaceKHR(instance, surface, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %rbx
movq 0x18(%rsi), %r15
movq 0x40(%rsi), %r14
callq 0x18d20
testl %eax, %eax
je 0x4a05c
movq 0x70f6a(%rip), %rax     # 0xbaf98
cmpl $0x0, (%rax)
je 0x4a044
leaq 0x47695(%rip), %rdi     # 0x916cf
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19eb0
movq 0x48(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x60(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: CreateSwapchain
static int CreateSwapchain(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkSwapchainKHR swapchain;
    VkSwapchainCreateInfoKHR *info;
    VkDevice device = checkdevice(L, 1, &ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
#define CLEANUP zfreeVkSwapchainCreateInfoKHR(L, info, 1)
    info = zcheckVkSwapchainCreateInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    CheckDevicePfn(L, ud, CreateSwapchainKHR);
    ec = ud->ddt->CreateSwapchainKHR(device, info, allocator, &swapchain);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    return newswapchain(L, swapchain, device, allocator);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x32e50(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
pushq $0x2
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x19e10
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4a262
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19150
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x18680
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x18420
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), %rax
movq 0x50(%rax), %rax
movq 0x248(%rax), %rax
testq %rax, %rax
je 0x4a2b4
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *%rax
movl %eax, %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x19150
testl %r13d, %r13d
je 0x4a2c7
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x4a24f
leaq 0x475cd(%rip), %rsi     # 0x91888
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19bc0
jmp 0x4a24f
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x4ab50
jmp 0x4a251
// File: /workspace/github_cpp_makefile_star2_O2/stetre[P]moonvulkan/src/swapchain.c
// Function: CreateSharedSwapchains
static int CreateSharedSwapchains(lua_State *L)
    {
    int err;
    VkResult ec;
    ud_t *ud;
    uint32_t count, i;
    VkSwapchainKHR *swapchains;
    VkSwapchainCreateInfoKHR* infos;
    VkDevice device = checkdevice(L, 1, &ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckDevicePfn(L, ud, CreateSharedSwapchainsKHR);
#define CLEANUP zfreearrayVkSwapchainCreateInfoKHR(L, infos, count, 1)
    infos = zcheckarrayVkSwapchainCreateInfoKHR(L, 2, &count, &err);
    swapchains = (VkSwapchainKHR*)MallocNoErr(L, count*sizeof(VkSwapchainKHR));
    if(!swapchains) { CLEANUP; return errmemory(L); }
    ec = ud->ddt->CreateSharedSwapchainsKHR(device, count, infos, allocator, swapchains);
    CLEANUP;
#undef CLEANUP
    if(ec) { Free(L, swapchains); CheckError(L, ec); }
    
    lua_newtable(L);
    for(i = 0; i < count; i++)
        {
        newswapchain(L, swapchains[i], device, allocator);
        lua_rawseti(L, -2, i+1);
        }
    Free(L, swapchains);
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x32d45(%rip), %rcx     # 0x7d03b
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x1a500
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x191a0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x278(%rax)
je 0x4a3bc
pushq $0x2
popq %rsi
leaq 0x4(%rsp), %r12
leaq 0x14(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x18b00
movq %rax, %r13
movl (%r12), %esi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x18050
testq %rax, %rax
je 0x4a3c8
movq %rax, %r12
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r14, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %r12, %r8
callq *0x278(%rax)
movl %eax, %ebp
movl 0x4(%rsp), %ecx
pushq $0x68
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r13, %rsi
callq 0x197e0
testl %ebp, %ebp
je 0x4a402
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182e0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199c0
jmp 0x4a3f3
leaq 0x47523(%rip), %rsi     # 0x918e6
movq %rbx, %rdi
jmp 0x4a3ec
movl 0x4(%rsp), %ecx
pushq $0x68
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r13, %rsi
callq 0x197e0
pushq $-0x6
popq %rdi
callq 0x19950
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x19bc0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
pushq $-0x2
popq %rbp
movl 0x4(%rsp), %eax
cmpq %rax, %r13
jae 0x4a441
movq (%r12,%r13,8), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x4ab50
incq %r13
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x19120
jmp 0x4a414
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182e0
xorl %eax, %eax
jmp 0x4a3f3