LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/pipeline_cache.c
// Function: MergePipelineCaches
static int MergePipelineCaches(lua_State *L)
    {
    int err;
    uint32_t count;
    VkResult ec;
    ud_t *ud;
    VkPipelineCache destination = checkpipeline_cache(L, 1, &ud);
    VkDevice device = ud->device;
    VkPipelineCache *source = checkpipeline_cachelist(L, 2, &count, &err, NULL);
    if(err) return argerrorc(L, 2, err);
    ec = ud->ddt->MergePipelineCaches(device, destination, count, source);
    Free(L, source);
    CheckError(L, ec);
    return 0;
# undef first
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x446cb(%rip), %r13     # 0x8df7c
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
movq %r13, %rcx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x20(%rax), %r12
xorl %r14d, %r14d
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rcx
xorl %r8d, %r8d
movq %r13, %r9
callq 0x19140
movl (%rbp), %edi
testl %edi, %edi
je 0x49911
callq 0x19930
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x49955
movq %rax, %r13
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %edx
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq *0x178(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x182d0
testl %ebp, %ebp
je 0x49958
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
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_O3/stetre[P]moonvulkan/src/pipeline_cache.c
// Function: freepipeline_cache
static int freepipeline_cache(lua_State *L, ud_t *ud)
    {
    VkPipelineCache pipeline_cache = (VkPipelineCache)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(pipeline_cache, "pipeline_cache");
    UD(device)->ddt->DestroyPipelineCache(device, pipeline_cache, 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 0x499bb
movq 0x7663e(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x499a0
leaq 0x56416(%rip), %rdi     # 0x9fdac
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x168(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/pipeline_layout.c
// Function: freepipeline_layout
static int freepipeline_layout(lua_State *L, ud_t *ud)
    {
    VkPipelineLayout pipeline_layout = (VkPipelineLayout)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(pipeline_layout, "pipeline_layout");
    UD(device)->ddt->DestroyPipelineLayout(device, pipeline_layout, 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 0x49df6
movq 0x76203(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x49ddb
leaq 0x5604b(%rip), %rdi     # 0x9fe1c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1a0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/query_pool.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkQueryPool query_pool;
    VkQueryPoolCreateInfo* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
#define CLEANUP zfreeVkQueryPoolCreateInfo(L, info, 1)
    info = zcheckVkQueryPoolCreateInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = device_ud->ddt->CreateQueryPool(device, info, allocator, &query_pool);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    TRACE_CREATE(query_pool, "query_pool");
    ud = newuserdata_nondispatchable(L, query_pool, QUERY_POOL_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freequery_pool;
    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 0x420b4(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a0e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x49ffc
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4a0a7
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0xf0(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
testl %ebp, %ebp
je 0x4a043
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4a0a7
movq 0x75f7e(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4a061
movq (%rsp), %rsi
leaq 0x55e1f(%rip), %rdi     # 0x9fe79
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x429a3(%rip), %rdx     # 0x8ca0f
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18320
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 0x205(%rip), %rdx       # 0x4a29b
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/query_pool.c
// Function: GetQueryPoolResults
static int GetQueryPoolResults(lua_State *L)
    {
// @@ TODO: specialization for performance counters results (see VK_KHR_performance_query).
    VkResult ec;
    ud_t * ud;
    VkQueryPool query_pool  = checkquery_pool(L, 1, &ud);
    VkDevice device = ud->device;
    uint32_t first = luaL_checkinteger(L, 2);
    uint32_t count = luaL_checkinteger(L, 3);
    size_t size = luaL_checkinteger(L, 4);
    VkDeviceSize stride = luaL_checkinteger(L, 5);
    VkQueryResultFlags flags = checkflags(L, 6);

    char* data = (char*)Malloc(L, size);

    ec = ud->ddt->GetQueryPoolResults(device, query_pool, first, count, size, data, stride, flags);
    if(ec)
        {
        Free(L, data);
        CheckError(L, ec);
        return 0;
        }
    lua_pushlstring(L, data, size);
    Free(L, data);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x42912(%rip), %rcx     # 0x8ca0f
leaq 0x20(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, 0x18(%rsp)
movq (%r14), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190e0
movq %rax, %r15
movq %rbx, %rdi
movl $0x4, %esi
callq 0x190e0
movq %rax, %r12
movq %rbx, %rdi
movl $0x5, %esi
callq 0x190e0
movq %rax, %r13
movq %rbx, %rdi
movl $0x6, %esi
callq 0x18f60
movq %rax, %rbp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19200
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
movl %r15d, %ecx
movq %r12, %r8
movq %r14, %r9
pushq %rbp
pushq %r13
callq *0x100(%rax)
addq $0x10, %rsp
testl %eax, %eax
je 0x4a1d8
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182d0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4a1f6
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x19760
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182d0
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/query_pool.c
// Function: ResetQueryPool
static int ResetQueryPool(lua_State *L)
    {
    ud_t *ud;
    VkQueryPool query_pool  = checkquery_pool(L, 1, &ud);
    VkDevice device = ud->device;
    uint32_t first = luaL_checkinteger(L, 2);
    uint32_t count = luaL_checkinteger(L, 3);
    CheckDevicePfn(L, ud, ResetQueryPool);
    ud->ddt->ResetQueryPool(device, query_pool, first, count);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x427f3(%rip), %rcx     # 0x8ca0f
leaq 0x8(%rsp), %r13
movl $0x1, %esi
movq %r13, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r13), %rax
movq 0x20(%rax), %r15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r12
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190e0
movq (%r13), %rcx
movq 0x50(%rcx), %rcx
movq 0x608(%rcx), %r8
testq %r8, %r8
je 0x4a27c
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %eax, %ecx
callq *%r8
xorl %eax, %eax
jmp 0x4a28d
leaq 0x55c2e(%rip), %rsi     # 0x9feb1
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/query_pool.c
// Function: freequery_pool
static int freequery_pool(lua_State *L, ud_t *ud)
    {
    VkQueryPool query_pool = (VkQueryPool)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(query_pool, "query_pool");
    UD(device)->ddt->DestroyQueryPool(device, query_pool, 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 0x4a2ec
movq 0x75d0d(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4a2d1
leaq 0x55bce(%rip), %rdi     # 0x9fe95
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xf8(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/queue.c
// Function: moonvulkan_pushqueue
int pushqueue(lua_State *L, VkQueue queue, VkDevice device)
    { 
    ud_t *ud = UD(queue);
    if(!ud)
        {
        /* create the userdata associated with this object */
        ud = newuserdata_dispatchable(L, queue, QUEUE_MT);
        ud->parent_ud = UD(device);
        ud->instance = UD(device)->instance;
        ud->device = device;
        ud->destructor = freequeue;
        ud->ddt = UD(device)->ddt;
        TRACE_CREATE(queue, "queue");
        return 1;
        }
    return pushuserdata(L, ud);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x19e90
testq %rax, %rax
je 0x4a31f
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x195b0
leaq 0x436c2(%rip), %rdx     # 0x8d9e8
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x18320
movq %rax, %r15
movq %r14, %rdi
callq 0x19e90
movq %rax, 0x10(%r15)
movq %r14, %rdi
callq 0x19e90
movq 0x18(%rax), %rax
movq %rax, 0x18(%r15)
movq %r14, 0x20(%r15)
leaq 0x3c(%rip), %rax        # 0x4a39c
movq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %rax, 0x50(%r15)
movq 0x75c4d(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4a391
leaq 0x55b4e(%rip), %rdi     # 0x9fed5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/queue.c
// Function: freequeue
static int freequeue(lua_State *L, ud_t *ud)
    {
    VkQueue queue = (VkQueue)(uintptr_t)ud->handle;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(queue, "queue");
    return 0;
    }

// Assembly:
pushq %rbx
movq (%rsi), %rbx
callq 0x18d20
testl %eax, %eax
je 0x4a3c6
movq 0x75c18(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4a3c6
leaq 0x55b30(%rip), %rdi     # 0x9feec
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/queue.c
// Function: QueueSubmit
static int QueueSubmit(lua_State *L)
    {
    int err;
    uint32_t count;
    VkResult ec;
    ud_t *ud;
    VkSubmitInfo* submits;
    VkQueue queue = checkqueue(L, 1, &ud);
    VkFence fence = testfence(L, 3, NULL);
#define CLEANUP zfreearrayVkSubmitInfo(L, submits, count, 1)
    submits = zcheckarrayVkSubmitInfo(L, 2, &count, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->QueueSubmit(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 0x43448(%rip), %rcx     # 0x8d9e8
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r15
leaq 0x439f2(%rip), %rcx     # 0x8dfab
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a490
movq %rax, %r13
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rcx
callq 0x1a2b0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x4a62c
movl 0x4(%rsp), %ecx
movl $0x48, %edx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4a679
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq *0x10(%rax)
movl %eax, %ebp
movl 0x4(%rsp), %ecx
movl $0x48, %edx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %r8d
callq 0x197d0
testl %ebp, %ebp
je 0x4a67c
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
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_O3/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 0x43342(%rip), %rcx     # 0x8d9e8
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
leaq 0x438e9(%rip), %rcx     # 0x8dfab
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a490
movq %rax, %r12
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x698(%rax)
je 0x4a744
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rcx
callq 0x186c0
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x4a757
movl 0x4(%rsp), %ecx
movl $0x40, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4a7ab
leaq 0x557f5(%rip), %rsi     # 0x9ff40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4a7ab
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
callq *0x698(%rax)
movl %eax, %ebp
movl 0x4(%rsp), %ecx
movl $0x40, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x197d0
testl %ebp, %ebp
je 0x4a7a9
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4a7ab
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/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 0x43216(%rip), %rcx     # 0x8d9e8
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r15
leaq 0x437c0(%rip), %rcx     # 0x8dfab
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a490
movq %rax, %r13
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rcx
callq 0x186b0
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x4a85e
movl 0x4(%rsp), %ecx
movl $0x60, %edx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4a8ae
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 0x197d0
testl %ebp, %ebp
je 0x4a8b1
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
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_O3/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 0x433fa(%rip), %rcx     # 0x8e005
leaq 0x8(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
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 0x1a0b0
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4aca2
movq 0x75357(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4ac87
leaq 0x55348(%rip), %rdi     # 0x9ffc5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x210(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x41208(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x18e00
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4aea8
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4af53
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 0x19160
testl %ebp, %ebp
je 0x4aeef
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4af53
movq 0x750d2(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4af0d
movq (%rsp), %rsi
leaq 0x550fb(%rip), %rdi     # 0xa0001
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x42726(%rip), %rdx     # 0x8d63e
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18320
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        # 0x4af91
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/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 0x4afe2
movq 0x75017(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4afc7
leaq 0x5505d(%rip), %rdi     # 0xa001a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x1b0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x40ec8(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x508(%rax)
je 0x4b1fd
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a000
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4b213
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4b2be
leaq 0x54e70(%rip), %rsi     # 0xa0074
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4b2be
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 0x19160
testl %ebp, %ebp
je 0x4b25a
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4b2be
movq 0x74d67(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4b278
movq (%rsp), %rsi
leaq 0x54e35(%rip), %rdi     # 0xa00a6
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x42ca4(%rip), %rdx     # 0x8df27
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18320
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        # 0x4b2fc
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/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 0x4b34d
movq 0x74cac(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4b332
leaq 0x54da8(%rip), %rdi     # 0xa00d0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x510(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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 0x40b5e(%rip), %rcx     # 0x8c03b
leaq 0x18(%rsp), %rdx
movl $0x1, %esi
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a0f0
leaq 0xc(%rsp), %r15
cmpl $0x5, %eax
jne 0x4b553
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x188f0
movq %rax, %r12
cmpl $0x0, (%r15)
je 0x4b583
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4b65b
movl $0x18, %edx
movq %rbx, %rdi
movl $0x9, %esi
movq %r15, %rcx
callq 0x19da0
movq %rax, %r12
cmpl $0x0, (%r15)
je 0x4b595
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x4b5eb
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
jmp 0x4b5ac
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x192a0
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 0x19160
testl %ebp, %ebp
je 0x4b5f5
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4b65b
movq 0x749cc(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4b614
movq 0x10(%rsp), %rsi
leaq 0x54b72(%rip), %rdi     # 0xa017f
xorl %eax, %eax
callq 0x18960
movq 0x10(%rsp), %rsi
leaq 0x42976(%rip), %rdx     # 0x8df96
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18320
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       # 0x4bb16
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_O3/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 0x428e9(%rip), %rcx     # 0x8df96
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x488(%rax)
je 0x4b721
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19b00
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4b734
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4b77b
leaq 0x54a8d(%rip), %rsi     # 0xa01b5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4b77b
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 0x19160
testl %ebp, %ebp
je 0x4b779
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4b77b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x427f8(%rip), %rcx     # 0x8df96
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x490(%rax)
je 0x4b814
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19cb0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4b827
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4b878
leaq 0x549c4(%rip), %rsi     # 0xa01df
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4b878
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 0x19160
testl %r15d, %r15d
je 0x4b889
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b50
jmp 0x4b87a
// File: /workspace/github_cpp_makefile_star2_O3/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 0x426ed(%rip), %rcx     # 0x8df96
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq (%r14), %rdx
movq 0x50(%rdx), %rcx
movq 0x5d8(%rcx), %rcx
testq %rcx, %rcx
je 0x4b8f6
movq 0x20(%rdx), %rdi
leaq 0x8(%rsp), %rdx
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x4b909
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4b91b
leaq 0x54909(%rip), %rsi     # 0xa0206
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4b91b
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x18b50
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x40700(%rip), %rcx     # 0x8c03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x190e0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5e0(%rax)
je 0x4b9c2
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19870
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4b9d5
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4ba1b
leaq 0x5486b(%rip), %rsi     # 0xa0234
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4ba1b
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 0x19160
testl %ebp, %ebp
je 0x4ba19
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4ba1b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/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 0x405fb(%rip), %rcx     # 0x8c03b
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5e8(%rax)
je 0x4bab4
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a5b0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x4bac7
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4bb09
leaq 0x5479d(%rip), %rsi     # 0xa0258
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4bb09
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 0x19160
testl %ebp, %ebp
je 0x4bb07
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4bb09
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4bb67
movq 0x74492(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4bb4c
leaq 0x54658(%rip), %rdi     # 0xa019a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0xc0(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4bf73
movq 0x74086(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4bf58
leaq 0x5438d(%rip), %rdi     # 0xa02db
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x158(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x41df4(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x190e0
movq %rax, %r15
leaq 0x533ad(%rip), %rcx     # 0x9f4d9
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1a4e0
movq (%r12), %rcx
movq 0x48(%rcx), %rcx
movq 0x68(%rcx), %r8
testq %r8, %r8
je 0x4c177
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq *%r8
testl %eax, %eax
je 0x4c18a
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4c19b
leaq 0x54405(%rip), %rsi     # 0xa0583
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4c19b
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x193a0
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x40d10(%rip), %rcx     # 0x8d711
movq %rsp, %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r15
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x208(%rax)
je 0x4ca86
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x19010
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4ca99
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4cae7
leaq 0x53bfb(%rip), %rsi     # 0xa0688
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4cae7
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 0x19160
testl %r13d, %r13d
je 0x4cafa
movq %rbx, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x4d06a
jmp 0x4cae9
// File: /workspace/github_cpp_makefile_star2_O3/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 0x41c6b(%rip), %rcx     # 0x8e792
movq %rsp, %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a4e0
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rax, %r14
movq (%r12), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xc8(%rax)
je 0x4cbac
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x181e0
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x4cbbf
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x4cc13
leaq 0x53b35(%rip), %rsi     # 0xa06e8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x4cc13
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 0x19160
testl %r15d, %r15d
je 0x4cc26
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x4d06a
jmp 0x4cc15
// File: /workspace/github_cpp_makefile_star2_O3/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 0x40ac2(%rip), %rcx     # 0x8d711
movl $0x1, %esi
xorl %edx, %edx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18c30
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191b0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x4d06a
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq