LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x45f0e(%rip), %rcx     # 0x909e8
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r15
leaq 0x464b8(%rip), %rcx     # 0x90fab
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a4d0
movq %rax, %r13
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rcx
callq 0x186c0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x4ab66
movl 0x4(%rsp), %ecx
movl $0x60, %edx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %r8d
callq 0x19800
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4abb6
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
movl $0x60, %edx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %r8d
callq 0x19800
testl %ebp, %ebp
je 0x4abb9
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x460f2(%rip), %rcx     # 0x91005
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rcx
movq 0x20(%rcx), %rdi
movq 0x50(%rcx), %rcx
leaq 0x10(%rsp), %r14
movq %rax, %rsi
movq %r14, %rdx
callq *0x218(%rcx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a0f0
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x18d30
testl %eax, %eax
je 0x4afaa
movq 0x7804f(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4af8f
leaq 0x58020(%rip), %rdi     # 0xa2fa5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x210(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43f00(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x18e10
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4b1b0
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4b25b
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, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x4b1f7
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4b25b
movq 0x77dca(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4b215
movq (%rsp), %rsi
leaq 0x57dd3(%rip), %rdi     # 0xa2fe1
xorl %eax, %eax
callq 0x18970
movq (%rsp), %rsi
leaq 0x4541e(%rip), %rdx     # 0x9063e
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 0x4f(%rip), %rdx        # 0x4b299
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_O1/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 0x18d30
testl %eax, %eax
je 0x4b2ea
movq 0x77d0f(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4b2cf
leaq 0x57d35(%rip), %rdi     # 0xa2ffa
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1b0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43bc0(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x508(%rax)
je 0x4b505
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a040
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4b51b
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4b5c6
leaq 0x57b48(%rip), %rsi     # 0xa3054
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4b5c6
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, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x4b562
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4b5c6
movq 0x77a5f(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4b580
movq (%rsp), %rsi
leaq 0x57b0d(%rip), %rdi     # 0xa3086
xorl %eax, %eax
callq 0x18970
movq (%rsp), %rsi
leaq 0x4599c(%rip), %rdx     # 0x90f27
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 0x4f(%rip), %rdx        # 0x4b604
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_O1/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 0x18d30
testl %eax, %eax
je 0x4b655
movq 0x779a4(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4b63a
leaq 0x57a80(%rip), %rdi     # 0xa30b0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x510(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/semaphore.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkSemaphore semaphore;
    VkSemaphoreCreateInfo* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = NULL;

#define CLEANUP zfreeVkSemaphoreCreateInfo(L, info, 1)
    if(lua_istable(L, 2))
        {
        info = zcheckVkSemaphoreCreateInfo(L, 2, &err);
        if(err) { CLEANUP; return argerror(L, 2); }
        allocator = optallocator(L, 3);
        }
    else
        {
        info = znewVkSemaphoreCreateInfo(L, &err);
        if(err) { CLEANUP; return lua_error(L); }
        info->flags = optflags(L, 2, 0);
        }

    ec = device_ud->ddt->CreateSemaphore(device, info, allocator, &semaphore);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    TRACE_CREATE(semaphore, "semaphore");
    ud = newuserdata_nondispatchable(L, semaphore, SEMAPHORE_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freesemaphore;
    ud->ddt = device_ud->ddt;
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x43856(%rip), %rcx     # 0x8f03b
leaq 0x18(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a130
leaq 0xc(%rsp), %r15
cmpl $0x5, %eax
jne 0x4b85b
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x18900
movq %rax, %r12
cmpl $0x0, (%r15)
je 0x4b88b
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4b963
movl $0x18, %edx
movq %rbx, %rdi
movl $0x9, %esi
movq %r15, %rcx
callq 0x19de0
movq %rax, %r12
cmpl $0x0, (%r15)
je 0x4b89d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x4b8f3
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
jmp 0x4b8b4
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192b0
movl %eax, 0x10(%r12)
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0xb8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x4b8fd
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4b963
movq 0x776c4(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4b91c
movq 0x10(%rsp), %rsi
leaq 0x5784a(%rip), %rdi     # 0xa315f
xorl %eax, %eax
callq 0x18970
movq 0x10(%rsp), %rsi
leaq 0x4566e(%rip), %rdx     # 0x90f96
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18330
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x40(%rax)
leaq 0x4cc(%rip), %rdx       # 0x4be1e
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x455e1(%rip), %rcx     # 0x90f96
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x488(%rax)
je 0x4ba29
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19b40
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4ba3c
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4ba83
leaq 0x57765(%rip), %rsi     # 0xa3195
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4ba83
movq %r15, 0x10(%r14)
movq (%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq %r14, %rsi
callq *0x488(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x4ba81
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4ba83
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x454f0(%rip), %rcx     # 0x90f96
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x490(%rax)
je 0x4bb1c
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19cf0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4bb2f
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4bb80
leaq 0x5769c(%rip), %rsi     # 0xa31bf
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4bb80
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
testl %r15d, %r15d
je 0x4bb91
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b60
jmp 0x4bb82
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x453e5(%rip), %rcx     # 0x90f96
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq (%r14), %rdx
movq 0x50(%rdx), %rcx
movq 0x5d8(%rcx), %rcx
testq %rcx, %rcx
je 0x4bbfe
movq 0x20(%rdx), %rdi
leaq 0x8(%rsp), %rdx
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x4bc11
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4bc23
leaq 0x575e1(%rip), %rsi     # 0xa31e6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4bc23
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b60
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x433f8(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190f0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5e0(%rax)
je 0x4bcca
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x198b0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4bcdd
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4bd23
leaq 0x57543(%rip), %rsi     # 0xa3214
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4bd23
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x5e0(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x4bd21
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4bd23
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x432f3(%rip), %rcx     # 0x8f03b
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5e8(%rax)
je 0x4bdbc
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a5f0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x4bdcf
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4be11
leaq 0x57475(%rip), %rsi     # 0xa3238
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4be11
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x5e8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x4be0f
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4be11
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/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 0x18d30
testl %eax, %eax
je 0x4be6f
movq 0x7718a(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4be54
leaq 0x57330(%rip), %rdi     # 0xa317a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xc0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x18d30
testl %eax, %eax
je 0x4c29d
movq 0x76d5c(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4c282
leaq 0x57043(%rip), %rdi     # 0xa32bb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x158(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x44ac8(%rip), %rcx     # 0x90ef4
leaq 0x10(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190f0
movq %rax, %r15
leaq 0x5605e(%rip), %rcx     # 0xa24b6
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a520
movq (%r12), %rcx
movq 0x48(%rcx), %rcx
movq 0x68(%rcx), %r8
testq %r8, %r8
je 0x4c4a3
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%r8
testl %eax, %eax
je 0x4c4b6
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4c4c7
leaq 0x570b9(%rip), %rsi     # 0xa3563
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4c4c7
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x193c0
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43a05(%rip), %rcx     # 0x90711
movq %rsp, %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x208(%rax)
je 0x4cd91
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19020
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4cda4
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4cdf2
leaq 0x568d0(%rip), %rsi     # 0xa3668
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4cdf2
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %r13d, %r13d
je 0x4ce05
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x4d377
jmp 0x4cdf4
// File: /workspace/github_cpp_makefile_star2_O1/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 0x44960(%rip), %rcx     # 0x91792
movq %rsp, %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r14
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xc8(%rax)
je 0x4ceb7
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x181f0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4ceca
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x4cf1e
leaq 0x5680a(%rip), %rsi     # 0xa36c8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4cf1e
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
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %r15d, %r15d
je 0x4cf31
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x4d377
jmp 0x4cf20
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x437b7(%rip), %rcx     # 0x90711
movl $0x1, %esi
xorl %edx, %edx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18c40
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x4d377
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x42057(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
leaq 0x554b6(%rip), %rcx     # 0xa24b6
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1a520
movq (%r15), %rcx
movq 0x50(%rcx), %rcx
movq 0x550(%rcx), %rcx
testq %rcx, %rcx
je 0x4d049
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x4d05c
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4d06d
leaq 0x566aa(%rip), %rsi     # 0xa36fa
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4d06d
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x19460
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x0, 0x4(%rsp)
leaq 0x43e5d(%rip), %rcx     # 0x90ef4
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
leaq 0x55403(%rip), %rcx     # 0xa24b6
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1a520
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
movq 0x558(%rax), %rax
testq %rax, %rax
je 0x4d0f9
leaq 0x4(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
callq *%rax
testl %eax, %eax
je 0x4d10c
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18990
jmp 0x4d151
leaq 0x56634(%rip), %rsi     # 0xa3734
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4d159
movl 0x4(%rsp), %ecx
leaq 0x14(%rsp), %r13
movl $0x10, %edx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r13, %r8
callq 0x19840
movq %rax, %r14
cmpl $0x0, (%r13)
je 0x4d16c
movl 0x4(%rsp), %ecx
movl $0x10, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x18d40
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %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 0x4d1b8
movl %eax, %ebp
movl 0x4(%rsp), %ecx
movl $0x10, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x18d40
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
jmp 0x4d0f2
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
movl 0x4(%rsp), %ecx
testl %ecx, %ecx
je 0x4d1fd
xorl %r15d, %r15d
movq %r14, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1a3f0
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19140
movl 0x4(%rsp), %ecx
addq $0x10, %r12
cmpq %rcx, %r15
jb 0x4d1d2
movl $0x1, %ebp
movl $0x10, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x18d40
jmp 0x4d15b
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41e05(%rip), %rcx     # 0x8f03b
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x548(%rax)
je 0x4d286
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18390
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4d299
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x4d2cf
leaq 0x564e2(%rip), %rsi     # 0xa376f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4d2d7
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x548(%rax)
testl %eax, %eax
je 0x4d2e8
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19fd0
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19170
jmp 0x4d2d9
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4d371
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x30(%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movq $0x0, 0x40(%rdx)
movl $0x3b9c2990, (%rdx)     # imm = 0x3B9C2990
movq %rsi, %rdi
movq %rcx, %rsi
callq *%rax
testl %eax, %eax
jne 0x4d371
movl 0x44(%rsp), %esi
movq %rbx, %rdi
callq 0x19460
leaq 0x56274(%rip), %rdx     # 0xa35d8
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18b00
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x75c36(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4d3a8
leaq 0x562f8(%rip), %rdi     # 0xa3696
movq %r15, %rsi
xorl %eax, %eax
callq 0x18970
leaq 0x55107(%rip), %rdx     # 0xa24b6
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x18330
movq %rax, %r15
movq %rbx, %rdi
callq 0x19ed0
movq %rax, 0x10(%r15)
movq %rbx, 0x18(%r15)
leaq 0x24(%rip), %rax        # 0x4d3fa
movq %rax, 0x8(%r15)
movq %r14, 0x40(%r15)
movq %rbx, %rdi
callq 0x19ed0
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_O1/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 0x18d30
testl %eax, %eax
je 0x4d448
movq 0x75bae(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x4d430
leaq 0x56289(%rip), %rdi     # 0xa36af
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18970
movq %r15, %rdi
callq 0x19ed0
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_O1/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 0x41a64(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19e30
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4d65a
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
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 0x4d6b1
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *%rax
movl %eax, %r13d
movl $0x1, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %r13d, %r13d
je 0x4d6c4
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4d647
leaq 0x561b0(%rip), %rsi     # 0xa3868
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x4d647
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x4dfb3
jmp 0x4d649
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41948(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x278(%rax)
je 0x4d7c3
leaq 0x4(%rsp), %r12
leaq 0x14(%rsp), %rcx
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x18b10
movq %rax, %r13
movl (%r12), %esi
shlq $0x3, %rsi
movq %rbx, %rdi
callq 0x18050
testq %rax, %rax
je 0x4d7cf
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
movl $0x68, %edx
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %r8d
callq 0x19800
testl %ebp, %ebp
je 0x4d813
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182e0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x4d800
leaq 0x560fc(%rip), %rsi     # 0xa38c6
movq %rbx, %rdi
jmp 0x4d7f9
movl 0x4(%rsp), %ecx
movl $0x68, %edx
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %r8d
callq 0x19800
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
callq 0x19970
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x19be0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
cmpl $0x0, 0x4(%rsp)
je 0x4d859
xorl %r13d, %r13d
movq (%r12,%r13,8), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x4dfb3
incq %r13
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r13, %rdx
callq 0x19140
movl 0x4(%rsp), %eax
cmpq %rax, %r13
jb 0x4d82b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182e0
jmp 0x4d802