LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/instance.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkInstance instance;
    VkInstanceCreateInfo* info;
    const VkAllocationCallbacks *allocator = optallocator(L, 2);
#define CLEANUP zfreeVkInstanceCreateInfo(L, info, 1)
    info = zcheckVkInstanceCreateInfo(L, 1, &err);
    if(err) { CLEANUP; return argerror(L, 1); }
    ec = vk.CreateInstance(info, allocator, &instance);
    if(ec)
        { CLEANUP; CheckError(L, ec); return 0; }
    TRACE_CREATE(instance, "instance");
    ud = newuserdata_dispatchable(L, instance, INSTANCE_MT);
    ud->instance = instance;
/*  ud->parent_ud = NULL; */
    ud->destructor = freeinstance;  
    ud->allocator = allocator; /* see you later allocator */
    ud->idt = getproc_instance(L, instance, info);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x2, %esi
callq 0x191b0
movq %rax, %r15
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x187e0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x45713
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 $0x1, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x45750
movq 0x7a8c6(%rip), %rax     # 0xbffe0
movq %rsp, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq *0x10(%rax)
testl %eax, %eax
je 0x45761
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7a860(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x4577f
movq (%rsp), %rsi
leaq 0x59d47(%rip), %rdi     # 0x9f4bf
xorl %eax, %eax
callq 0x18960
movq (%rsp), %rsi
leaq 0x47f87(%rip), %rdx     # 0x8d711
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x18320
movq %rax, %r12
movq (%rsp), %rsi
movq %rsi, 0x18(%rax)
leaq 0x355(%rip), %rax       # 0x45b03
movq %rax, 0x8(%r12)
movq %r15, 0x40(%r12)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x191f0
movq %rax, 0x48(%r12)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x45752
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/instance.c
// Function: EnumeratePhysicalDevices
static int EnumeratePhysicalDevices(lua_State *L)
    {
    uint32_t count, remaining, tot, i;
    VkResult ec;
    VkPhysicalDevice physical_device[N];
    ud_t *ud;
    VkInstance instance = checkinstance(L, 1, &ud);

    lua_newtable(L);
    ec = ud->idt->EnumeratePhysicalDevices(instance, &remaining, NULL);
    CheckError(L, ec);
    if(remaining == 0)
        return 1;

    tot = 0;
    do {
        if(remaining > N)
            { count = N; remaining -= N; }
        else
            { count = remaining; remaining = 0; }
        ec = ud->idt->EnumeratePhysicalDevices(instance, &count, physical_device);
        if(ec != VK_INCOMPLETE)
            CheckError(L, ec);

        for(i=0; i<count; i++)
            {
            pushphysical_device(L, physical_device[i], instance);
            lua_rawseti(L, -2, ++tot);
            }
    } while(remaining > 0);

    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
leaq 0x47eea(%rip), %rcx     # 0x8d711
movl $0x1, %ebp
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movq (%r15), %rax
movq 0x48(%rax), %rax
movq %rsp, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq *0x8(%rax)
testl %eax, %eax
je 0x4588d
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rsp), %eax
testl %eax, %eax
je 0x45879
leaq 0x10(%rsp), %r12
xorl %r13d, %r13d
movl %eax, %ecx
subl $0x20, %ecx
movl $0x20, %edx
cmovael %edx, %eax
movl $0x0, %edx
cmovbl %edx, %ecx
movl %eax, 0x4(%rsp)
movl %ecx, (%rsp)
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
movq %r12, %rdx
callq *0x8(%rax)
cmpl $0x5, %eax
je 0x458d8
testl %eax, %eax
jne 0x45863
cmpl $0x0, 0x4(%rsp)
je 0x45917
movl %r13d, %ebp
xorl %r15d, %r15d
movq 0x10(%rsp,%r15,8), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x19ea0
leal (%r15,%rbp), %edx
incl %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19130
incq %r15
movl 0x4(%rsp), %eax
cmpq %rax, %r15
jb 0x458e5
addl %r15d, %r13d
movl (%rsp), %eax
testl %eax, %eax
jne 0x4589c
movl $0x1, %ebp
jmp 0x45879
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/instance.c
// Function: freeinstance
static int freeinstance(lua_State *L, ud_t *ud)
    {
    VkInstance instance = (VkInstance)(uintptr_t)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    PFN_vkDestroyInstance DestroyInstance = NULL;
    if(ud->idt) DestroyInstance = ud->idt->DestroyInstance;
    freechildren(L, DEBUG_UTILS_MESSENGER_MT, ud);
    freechildren(L, DEBUG_REPORT_CALLBACK_MT, ud);
    freechildren(L, DEVICE_MT, ud);
    freechildren(L, PHYSICAL_DEVICE_MT, ud);
    freechildren(L, SURFACE_MT, ud);
    if(ud->idt) Free(L, ud->idt);
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(instance, "instance");
    if(DestroyInstance) DestroyInstance(instance, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x48(%rsi), %rax
testq %rax, %rax
je 0x45b20
movq (%rax), %r13
jmp 0x45b23
xorl %r13d, %r13d
movq (%r15), %rbx
movq 0x40(%r15), %r14
leaq 0x47d18(%rip), %rsi     # 0x8d849
movq %r12, %rdi
movq %r15, %rdx
callq 0x18ef0
leaq 0x47b24(%rip), %rsi     # 0x8d667
movq %r12, %rdi
movq %r15, %rdx
callq 0x18ef0
leaq 0x464e6(%rip), %rsi     # 0x8c03b
movq %r12, %rdi
movq %r15, %rdx
callq 0x18ef0
leaq 0x4838d(%rip), %rsi     # 0x8def4
movq %r12, %rdi
movq %r15, %rdx
callq 0x18ef0
leaq 0x59960(%rip), %rsi     # 0x9f4d9
movq %r12, %rdi
movq %r15, %rdx
callq 0x18ef0
movq 0x48(%r15), %rsi
testq %rsi, %rsi
je 0x45b95
movq %r12, %rdi
callq 0x182d0
movq %r12, %rdi
movq %r15, %rsi
callq 0x18d20
testl %eax, %eax
je 0x45bcf
movq 0x7a41d(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x45bc1
leaq 0x59935(%rip), %rdi     # 0x9f4ec
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
testq %r13, %r13
je 0x45bcf
movq %rbx, %rdi
movq %r14, %rsi
callq *%r13
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/main.c
// Function: AtExit
static void AtExit(void)
    {
    if(moonvulkan_L)
        {
        enums_free_all(moonvulkan_L);
        moonvulkan_atexit_getproc();
        moonvulkan_L = NULL;
        }
    }

// Assembly:
pushq %rbx
movq 0x798f1(%rip), %rbx     # 0xbffd0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x466f8
callq 0x18340
callq 0x181a0
movq $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_newuserdata
ud_t *newuserdata(lua_State *L, uint64_t handle, const char *mt, int dispatchable)
    {
    ud_t *ud;
    /* For dispatchable objects we use handle as search key.
     * For non-dispatchable objects we cannot use handle as search key, because it
     * is not guaranteed to be unique, so we use ud instead.
     */
    if(dispatchable)
        ud = (ud_t*)udata_new(L, sizeof(ud_t), (uint64_t)handle, mt);
    else 
        ud = (ud_t*)udata_new(L, sizeof(ud_t), 0, mt);
    memset(ud, 0, sizeof(ud_t));
    ud->handle = handle;
    MarkValid(ud);
    ud->ref1 = ud->ref2 = ud->ref3 = ud->ref4 = LUA_NOREF;
    if(dispatchable) MarkDispatchable(ud);
    return ud;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %rcx
movq %rsi, %r14
xorl %edx, %edx
testl %ebx, %ebx
cmovneq %rsi, %rdx
movl $0x60, %esi
callq 0x18c70
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x48(%rax)
movq $0x0, 0x58(%rax)
movq %r14, (%rax)
movl $0xfffffffe, 0x38(%rax) # imm = 0xFFFFFFFE
movaps 0x58eba(%rip), %xmm0    # 0x9f600
movups %xmm0, 0x28(%rax)
testl %ebx, %ebx
je 0x46755
movl $0x3, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_freeuserdata
int freeuserdata(lua_State *L, ud_t *ud)
    {
    /* The 'Valid' mark prevents double calls when an object is explicitly destroyed, 
     * and subsequently deleted also by the GC (the ud sticks around until the GC
     * collects it, so we mark it as invalid when the object is explicitly destroyed
     * by the script, or implicitly destroyed because child of a destroyed object). */
    if(!IsValid(ud)) return 0;
    CancelValid(ud);
    Unreference(L, ud->ref1);
    Unreference(L, ud->ref2);
    Unreference(L, ud->ref3);
    Unreference(L, ud->ref4);
    if(ud->info) 
        Free(L, ud->info);
    if(IsDispatchable(ud))
        udata_free(L, ud->handle);
    else
        udata_free(L, (uint64_t)(uintptr_t)ud);
    return 1;
    }

// Assembly:
movl 0x28(%rsi), %ecx
xorl %eax, %eax
testb $0x1, %cl
je 0x4681c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
andl $-0x2, %ecx
movl %ecx, 0x28(%rsi)
movl 0x2c(%rsi), %edx
cmpl $-0x2, %edx
je 0x46797
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2a0
movl $0xfffffffe, 0x2c(%rbx) # imm = 0xFFFFFFFE
movl 0x30(%rbx), %edx
cmpl $-0x2, %edx
je 0x467b3
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2a0
movl $0xfffffffe, 0x30(%rbx) # imm = 0xFFFFFFFE
movl 0x34(%rbx), %edx
cmpl $-0x2, %edx
je 0x467cf
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2a0
movl $0xfffffffe, 0x34(%rbx) # imm = 0xFFFFFFFE
movl 0x38(%rbx), %edx
cmpl $-0x2, %edx
je 0x467eb
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a2a0
movl $0xfffffffe, 0x38(%rbx) # imm = 0xFFFFFFFE
movq 0x58(%rbx), %rsi
testq %rsi, %rsi
je 0x467fc
movq %r14, %rdi
callq 0x182d0
testb $0x2, 0x28(%rbx)
je 0x46805
movq (%rbx), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19060
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_testxxx
uint64_t testxxx(lua_State *L, int arg, ud_t **udp, const char *mt)
    {
    ud_t *ud = (ud_t*)udata_test(L, arg, mt);
    if(ud && IsValid(ud)) { if(udp) *udp=ud; return ud->handle; }
    if(udp) *udp = NULL;
    return 0;
    }

// Assembly:
pushq %rbx
movq %rdx, %rbx
movq %rcx, %rdx
callq 0x1a1a0
testq %rax, %rax
je 0x468fb
testb $0x1, 0x28(%rax)
jne 0x4690b
testq %rbx, %rbx
je 0x46907
movq $0x0, (%rbx)
xorl %eax, %eax
jmp 0x46916
testq %rbx, %rbx
je 0x46913
movq %rax, (%rbx)
movq (%rax), %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_checkxxx
uint64_t checkxxx(lua_State *L, int arg, ud_t **udp, const char *mt)
    {
    ud_t *ud = (ud_t*)udata_test(L, arg, mt);
    if(ud && IsValid(ud)) 
        { if(udp) *udp = ud; return ud->handle; }
    lua_pushfstring(L, "not a %s", mt);
    return argerror(L, arg);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebx
movq %rdi, %r14
movq %rcx, %rdx
callq 0x1a1a0
testq %rax, %rax
je 0x4693e
testb $0x1, 0x28(%rax)
jne 0x46972
leaq 0x58cd5(%rip), %rsi     # 0x9f61a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x18ea0
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
callq 0x18410
cltq
jmp 0x4697e
testq %r12, %r12
je 0x4697b
movq %rax, (%r12)
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_checkxxxlist_dispatchable
void** checkxxxlist_dispatchable(lua_State *L, int arg, uint32_t *count, int *err, const char *mt)
    {
    void** list;
    uint32_t i;

    *count = 0;
    *err = 0;
    if(lua_isnoneornil(L, arg))
        { *err = ERR_NOTPRESENT; return NULL; }
    if(lua_type(L, arg) != LUA_TTABLE)
        { *err = ERR_TABLE; return NULL; }
    *count = luaL_len(L, arg);
    if(*count == 0)
        { *err = ERR_EMPTY; return NULL; }
    list = (void**)MallocNoErr(L, sizeof(void*) * (*count));

    if(!list)
        { *count = 0; *err = ERR_MEMORY; return NULL; }

    for(i=0; i<*count; i++)
        {
        lua_rawgeti(L, arg, i+1);
        list[i] = (void*)(uintptr_t)testxxx(L, -1, NULL, mt);
        if(!list[i])
            { Free(L, list); *count = 0; *err = ERR_TYPE; return NULL; }
        lua_pop(L, 1);
        }
    return list;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
callq 0x1a0f0
testl %eax, %eax
jle 0x46a6c
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a0f0
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jne 0x46aa6
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a120
movl %eax, (%r14)
testl %eax, %eax
je 0x46a73
movl %eax, %esi
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x18050
testq %rax, %rax
je 0x46a7a
movq %rax, %r13
cmpl $0x0, (%r14)
je 0x46aab
movq %r12, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x1(%rbx), %r12
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x18970
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rdx
callq 0x1a1a0
testq %rax, %rax
je 0x46a81
testb $0x1, 0x28(%rax)
je 0x46a81
movq (%rax), %rax
movq %rax, (%r13,%rbx,8)
testq %rax, %rax
je 0x46a8a
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18150
movl (%r14), %eax
movq %r12, %rbx
cmpq %rax, %r12
jb 0x46a17
jmp 0x46aab
movl $0x1, %ecx
jmp 0x46aa6
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
jmp 0x46aa6
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
jmp 0x46a9f
movq $0x0, (%r13,%rbx,8)
movq %r15, %rdi
movq %r13, %rsi
callq 0x182d0
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
movq 0x8(%rsp), %rbx
movl $0x0, (%r14)
movl %ecx, (%rbx)
xorl %r13d, %r13d
movq %r13, %rax
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/physical_device.c
// Function: moonvulkan_pushphysical_device
int pushphysical_device(lua_State *L, VkPhysicalDevice physical_device, VkInstance instance)
    { 
    ud_t *ud = UD(physical_device);
    if(!ud)
        {
        /* create the userdata associated with this object */
        ud = newuserdata_dispatchable(L, physical_device, PHYSICAL_DEVICE_MT);
        ud->instance = instance;
        ud->parent_ud = UD(instance);
        ud->destructor = freephysical_device;
        ud->idt = UD(instance)->idt;
        TRACE_CREATE(physical_device, "physical_device");
        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 0x46cff
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x195b0
leaq 0x471ee(%rip), %rdx     # 0x8def4
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x18320
movq %rax, %r15
movq %r14, 0x18(%rax)
movq %r14, %rdi
callq 0x19e90
movq %rax, 0x10(%r15)
leaq 0x3c(%rip), %rax        # 0x46d6c
movq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0x19e90
movq 0x48(%rax), %rax
movq %rax, 0x48(%r15)
movq 0x7927d(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x46d61
leaq 0x588cc(%rip), %rdi     # 0x9f623
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/physical_device.c
// Function: freephysical_device
static int freephysical_device(lua_State *L, ud_t *ud)
    {
    VkPhysicalDevice physical_device = (VkPhysicalDevice)(uintptr_t)ud->handle;
    freechildren(L, DISPLAY_MT, ud);
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(physical_device, "physical_device");
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rbx
leaq 0x478cd(%rip), %rsi     # 0x8e64e
movq %r14, %rdx
callq 0x18ef0
movq %r15, %rdi
movq %r14, %rsi
callq 0x18d20
testl %eax, %eax
je 0x46db5
movq 0x79229(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x46db5
leaq 0x58899(%rip), %rdi     # 0x9f644
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceProperties
static int GetPhysicalDeviceProperties(lua_State *L)
    {
    ud_t *ud;
    VkPhysicalDeviceProperties props;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    if(ud->idt->GetPhysicalDeviceProperties2)
        return GetPhysicalDeviceProperties2(L, physical_device, ud);
    ud->idt->GetPhysicalDeviceProperties(physical_device, &props);
    zpushVkPhysicalDeviceProperties(L, &props);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdi, %rbx
leaq 0x46fad(%rip), %rcx     # 0x8def4
movl $0x1, %ebp
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %r13
movq 0x48(%r13), %rax
cmpq $0x0, 0xf0(%rax)
je 0x46fa8
leaq 0x10(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19a80
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x46fc3
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
jmp 0x46ff3
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq *0x38(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19350
jmp 0x46ff3
movq 0x48(%r13), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0xf0(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18990
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl %ebp, %eax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceFeatures
static int GetPhysicalDeviceFeatures(lua_State *L)
    {
    ud_t *ud;
    VkPhysicalDeviceFeatures features;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    if(ud->idt->GetPhysicalDeviceFeatures2)
        return GetPhysicalDeviceFeatures2(L, physical_device, ud);
    ud->idt->GetPhysicalDeviceFeatures(physical_device, &features);
    zpushVkPhysicalDeviceFeatures(L, &features);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
leaq 0x46ed2(%rip), %rcx     # 0x8def4
movl $0x1, %ebp
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %r13
movq 0x48(%r13), %rax
cmpq $0x0, 0xe8(%rax)
je 0x47081
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19720
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x4709c
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
jmp 0x470cc
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18360
jmp 0x470cc
movq 0x48(%r13), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0xe8(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19680
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl %ebp, %eax
addq $0xe8, %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/physical_device.c
// Function: GetPhysicalDeviceFormatProperties
static int GetPhysicalDeviceFormatProperties(lua_State *L)
    {
    VkFormatProperties props;
    VkFormat format;
    ud_t *ud;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    if(ud->idt->GetPhysicalDeviceFormatProperties2)
        return GetPhysicalDeviceFormatProperties2(L, physical_device, ud);
    format = checkformat(L, 2);
    ud->idt->GetPhysicalDeviceFormatProperties(physical_device, format, &props);
    zpushVkFormatProperties(L, &props);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x46dfc(%rip), %rcx     # 0x8def4
movl $0x1, %ebp
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %r13
movq 0x48(%r13), %rax
cmpq $0x0, 0xf8(%rax)
je 0x4716b
movq %rbx, %rdi
movl $0x4, %esi
movl $0x2, %edx
callq 0x19be0
movl %eax, %ebp
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18820
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x471a2
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
jmp 0x471d4
movq %rbx, %rdi
movl $0x4, %esi
movl $0x2, %edx
callq 0x19be0
movq (%rsp), %rcx
movq 0x48(%rcx), %rcx
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movl %eax, %esi
movq %r15, %rdx
callq *0x28(%rcx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18d10
jmp 0x471d4
movq 0x48(%r13), %rax
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq *0xf8(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19790
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl %ebp, %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/physical_device.c
// Function: GetPhysicalDeviceMemoryProperties
static int GetPhysicalDeviceMemoryProperties(lua_State *L)
    {
    VkPhysicalDeviceMemoryProperties props;
    ud_t *ud;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    if(ud->idt->GetPhysicalDeviceMemoryProperties2)
        return GetPhysicalDeviceMemoryProperties2(L, physical_device, ud);
    ud->idt->GetPhysicalDeviceMemoryProperties(physical_device, &props);
    zpushVkPhysicalDeviceMemoryProperties(L, &props);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq 0x46929(%rip), %rcx     # 0x8def4
movl $0x1, %ebp
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %r13
movq 0x48(%r13), %rax
cmpq $0x0, 0x110(%rax)
je 0x4762c
leaq 0x10(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1a360
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x47647
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
jmp 0x47677
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq *0x48(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x194a0
jmp 0x47677
movq 0x48(%r13), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x110(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x188d0
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl %ebp, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceExternalBufferProperties
static int GetPhysicalDeviceExternalBufferProperties(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkPhysicalDeviceExternalBufferInfoKHR* info = NULL;
    VkExternalBufferPropertiesKHR* props = NULL;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceExternalBufferProperties);
#define CLEANUP do {                                        \
    zfreeVkPhysicalDeviceExternalBufferInfoKHR(L, info, 1); \
    zfreeVkExternalBufferPropertiesKHR(L, props, 1);        \
} while(0)
    info = zcheckVkPhysicalDeviceExternalBufferInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    props = znewchainVkExternalBufferPropertiesKHR(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->idt->GetPhysicalDeviceExternalBufferProperties(physical_device, info, props);
    zpushVkExternalBufferPropertiesKHR(L, props);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x46521(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r14), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x120(%rax)
je 0x47a57
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x19520
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x47a6a
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x47aac
leaq 0x57ece(%rip), %rsi     # 0x9f92c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x47aac
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1a590
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x47abf
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x120(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19430
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x47aae
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceExternalFenceProperties
static int GetPhysicalDeviceExternalFenceProperties(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkPhysicalDeviceExternalFenceInfoKHR* info = NULL;
    VkExternalFencePropertiesKHR* props = NULL;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceExternalFenceProperties);
#define CLEANUP do {                                        \
    zfreeVkPhysicalDeviceExternalFenceInfoKHR(L, info, 1);  \
    zfreeVkExternalFencePropertiesKHR(L, props, 1);     \
} while(0)
    info = zcheckVkPhysicalDeviceExternalFenceInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    props = znewchainVkExternalFencePropertiesKHR(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->idt->GetPhysicalDeviceExternalFenceProperties(physical_device, info, props);
    zpushVkExternalFencePropertiesKHR(L, props);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x463d3(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r14), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x130(%rax)
je 0x47ba5
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x1a160
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x47bb8
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x47bfa
leaq 0x57dbf(%rip), %rsi     # 0x9f96b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x47bfa
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18d70
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x47c0d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x130(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18180
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x47bfc
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceExternalSemaphoreProperties
static int GetPhysicalDeviceExternalSemaphoreProperties(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkPhysicalDeviceExternalSemaphoreInfo* info = NULL;
    VkExternalSemaphorePropertiesKHR* props = NULL;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceExternalSemaphoreProperties);
#define CLEANUP do {                                        \
    zfreeVkPhysicalDeviceExternalSemaphoreInfo(L, info, 1);  \
    zfreeVkExternalSemaphorePropertiesKHR(L, props, 1);     \
} while(0)
    info = zcheckVkPhysicalDeviceExternalSemaphoreInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    props = znewchainVkExternalSemaphorePropertiesKHR(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->idt->GetPhysicalDeviceExternalSemaphoreProperties(physical_device, info, props);
    zpushVkExternalSemaphorePropertiesKHR(L, props);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x46285(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r14), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x128(%rax)
je 0x47cf3
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x189f0
movq %rax, %r14
cmpl $0x0, (%r15)
je 0x47d06
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x47d48
leaq 0x57caf(%rip), %rsi     # 0x9f9a9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x47d48
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1a5f0
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x47d5b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x128(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19c20
movl $0x1, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
jmp 0x47d4a
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceMultisampleProperties
static int GetPhysicalDeviceMultisampleProperties(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkMultisamplePropertiesEXT* props;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    VkSampleCountFlagBits samples = checkflags(L, 2);
    CheckInstancePfn(L, ud, GetPhysicalDeviceMultisamplePropertiesEXT);
#define CLEANUP zfreeVkMultisamplePropertiesEXT(L, props, 1)
    props = znewchainVkMultisamplePropertiesEXT(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->idt->GetPhysicalDeviceMultisamplePropertiesEXT(physical_device, samples, props);
    zpushVkMultisamplePropertiesEXT(L, props);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x46137(%rip), %rcx     # 0x8def4
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x18f60
movq %rax, %r12
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x1d0(%rax)
je 0x47e27
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1a300
movq %rax, %r15
cmpl $0x0, (%r13)
je 0x47e3c
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
jmp 0x47e38
leaq 0x57bbd(%rip), %rsi     # 0x9f9eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
jmp 0x47e74
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq *0x1d0(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19120
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl %ebp, %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/physical_device.c
// Function: GetPhysicalDeviceCalibrateableTimeDomains
static int GetPhysicalDeviceCalibrateableTimeDomains(lua_State *L)
    {
    ud_t *ud;
    VkResult ec;
    uint32_t i, count = 0;
    VkTimeDomainEXT* domains;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceCalibrateableTimeDomainsEXT);

    ec = ud->idt->GetPhysicalDeviceCalibrateableTimeDomainsEXT(physical_device, &count, NULL);
    CheckError(L, ec);

    lua_newtable(L);
    if(count==0) return 1;

    domains = (VkTimeDomainEXT*)Malloc(L, sizeof(VkTimeDomainEXT)*count);
    ec = ud->idt->GetPhysicalDeviceCalibrateableTimeDomainsEXT(physical_device, &count, domains);
    if(ec)
        { Free(L, domains); CheckError(L, ec); }
    for(i=0; i<count; i++)
        {
        pushtimedomain(L, domains[i]);
        lua_rawseti(L, -2, i+1);
        }
    Free(L, domains);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x0, 0xc(%rsp)
leaq 0x46053(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x48(%rax), %rax
movq 0x1c8(%rax), %rax
testq %rax, %rax
je 0x47eef
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq *%rax
movq %rbx, %rdi
xorl %esi, %esi
testl %eax, %eax
je 0x47f0f
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x47f00
leaq 0x57b34(%rip), %rsi     # 0x9fa2a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
callq 0x187d0
movl 0xc(%rsp), %esi
movl $0x1, %ebp
testq %rsi, %rsi
je 0x47f02
shlq $0x2, %rsi
movq %rbx, %rdi
callq 0x19200
movq %rax, %r14
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq *0x1c8(%rax)
testl %eax, %eax
je 0x47f6c
movl %eax, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182d0
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
jmp 0x47ee0
cmpl $0x0, 0xc(%rsp)
je 0x47fa3
xorl %r15d, %r15d
movl (%r14,%r15,4), %edx
movq %rbx, %rdi
movl $0x38, %esi
callq 0x18980
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19130
movl 0xc(%rsp), %eax
cmpq %rax, %r15
jb 0x47f76
movq %rbx, %rdi
movq %r14, %rsi
callq 0x182d0
jmp 0x47f02
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceFragmentShadingRates
static int GetPhysicalDeviceFragmentShadingRates(lua_State *L)
    {
    int err;
    VkResult ec;
    uint32_t i, count = 0;
    ud_t *ud;
    VkPhysicalDeviceFragmentShadingRateKHR *rates = NULL;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceFragmentShadingRatesKHR);
    ec = ud->idt->GetPhysicalDeviceFragmentShadingRatesKHR(physical_device, &count, NULL);
    if(ec) { CheckError(L, ec); return 0; }
    lua_newtable(L);
    if(count == 0) return 1;
#define CLEANUP zfreearrayVkPhysicalDeviceFragmentShadingRateKHR(L, rates, count, 1)
    rates = znewchainarrayVkPhysicalDeviceFragmentShadingRateKHR(L, count, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ec = ud->idt->GetPhysicalDeviceFragmentShadingRatesKHR(physical_device, &count, rates);
    if(ec) { CLEANUP; CheckError(L, ec); return 0; }
    for(i=0; i<count; i++)
        {
        zpushVkPhysicalDeviceFragmentShadingRateKHR(L, &rates[i]);
        lua_rawseti(L, -2, i+1);
        }
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x0, 0xc(%rsp)
leaq 0x45f23(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x48(%rax), %rax
movq 0x1e8(%rax), %rax
testq %rax, %rax
je 0x4801f
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq *%rax
movq %rbx, %rdi
xorl %esi, %esi
testl %eax, %eax
je 0x48041
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x48030
leaq 0x57a46(%rip), %rsi     # 0x9fa6c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
callq 0x187d0
movl 0xc(%rsp), %esi
testl %esi, %esi
je 0x48086
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x183e0
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4808d
movl 0xc(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
jmp 0x48015
movl $0x1, %ebp
jmp 0x48032
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq *0x1e8(%rax)
movl (%r12), %ecx
testl %eax, %eax
je 0x480d6
movl %eax, %ebp
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
jmp 0x48010
testl %ecx, %ecx
je 0x4810d
xorl %r15d, %r15d
movq %r14, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x194d0
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19130
movl 0xc(%rsp), %ecx
addq $0x20, %r12
cmpq %rcx, %r15
jb 0x480e0
jmp 0x4810f
xorl %ecx, %ecx
movl $0x1, %ebp
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
jmp 0x48032
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceToolProperties
static int GetPhysicalDeviceToolProperties(lua_State *L)
    {
    int err;
    VkResult ec;
    uint32_t i, count = 0;
    ud_t *ud;
    VkPhysicalDeviceToolPropertiesEXT *props = NULL;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceToolPropertiesEXT);
    ec = ud->idt->GetPhysicalDeviceToolPropertiesEXT(physical_device, &count, NULL);
    if(ec) { CheckError(L, ec); return 0; }
    lua_newtable(L);
    if(count == 0) return 1;
#define CLEANUP zfreearrayVkPhysicalDeviceToolPropertiesEXT(L, props, count, 1)
    props = znewchainarrayVkPhysicalDeviceToolPropertiesEXT(L, count, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ec = ud->idt->GetPhysicalDeviceToolPropertiesEXT(physical_device, &count, props);
    if(ec) { CLEANUP; CheckError(L, ec); return 0; }
    for(i=0; i<count; i++)
        {
        zpushVkPhysicalDeviceToolPropertiesEXT(L, &props[i]);
        lua_rawseti(L, -2, i+1);
        }
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x0, 0xc(%rsp)
leaq 0x45da7(%rip), %rcx     # 0x8def4
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r15
movq (%r14), %rax
movq 0x48(%rax), %rax
movq 0x1f0(%rax), %rax
testq %rax, %rax
je 0x4819b
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq *%rax
movq %rbx, %rdi
xorl %esi, %esi
testl %eax, %eax
je 0x481bd
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x481ac
leaq 0x57908(%rip), %rsi     # 0x9faaa
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
callq 0x187d0
movl 0xc(%rsp), %esi
testl %esi, %esi
je 0x48202
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x18490
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x48209
movl 0xc(%rsp), %ecx
movl $0x418, %edx            # imm = 0x418
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
jmp 0x48191
movl $0x1, %ebp
jmp 0x481ae
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq *0x1f0(%rax)
movl (%r12), %ecx
testl %eax, %eax
je 0x48252
movl %eax, %ebp
movl $0x418, %edx            # imm = 0x418
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
jmp 0x4818c
testl %ecx, %ecx
je 0x4828c
xorl %r15d, %r15d
movq %r14, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x196d0
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0x19130
movl 0xc(%rsp), %ecx
addq $0x418, %r12            # imm = 0x418
cmpq %rcx, %r15
jb 0x4825c
jmp 0x4828e
xorl %ecx, %ecx
movl $0x1, %ebp
movl $0x418, %edx            # imm = 0x418
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
jmp 0x481ae
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceQueueFamilyPerformanceQueryPasses
static int GetPhysicalDeviceQueueFamilyPerformanceQueryPasses(lua_State *L)
    {
    int err;
    uint32_t num_passes;
    ud_t *ud;
    VkQueryPoolPerformanceCreateInfoKHR *info = NULL;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    CheckInstancePfn(L, ud, GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR);
#define CLEANUP zfreeVkQueryPoolPerformanceCreateInfoKHR (L, info, 1)
    info = zcheckVkQueryPoolPerformanceCreateInfoKHR (L, 2, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->idt->GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(physical_device, info, &num_passes);
    CLEANUP;
#undef CLEANUP
    lua_pushinteger(L, num_passes);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x45931(%rip), %rcx     # 0x8def4
movq %rsp, %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x1e0(%rax)
je 0x48620
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x199c0
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x48635
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
callq 0x199a0
jmp 0x48631
leaq 0x5750e(%rip), %rsi     # 0x9fb35
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
jmp 0x48672
movq (%rsp), %rax
movq 0x48(%rax), %rax
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x1e0(%rax)
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl (%r12), %esi
movq %rbx, %rdi
callq 0x18b50
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/pipeline.c
// Function: newpipeline
static int newpipeline(lua_State *L, VkPipeline  pipeline, VkDevice device, const VkAllocationCallbacks *allocator)
    {
    ud_t *ud;
    TRACE_CREATE(pipeline, "pipeline");
    ud = newuserdata_nondispatchable(L, pipeline, PIPELINE_MT);
    ud->parent_ud = UD(device);
    ud->device = device;
    ud->instance = UD(device)->instance;
    ud->allocator = allocator;
    ud->destructor = freepipeline;
    ud->ddt = UD(device)->ddt;
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x76c6b(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x49373
leaq 0x568d2(%rip), %rdi     # 0x9fc3b
movq %r15, %rsi
xorl %eax, %eax
callq 0x18960
leaq 0x435a9(%rip), %rdx     # 0x8c923
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x18320
movq %rax, %r15
movq %rbx, %rdi
callq 0x19e90
movq %rax, 0x10(%r15)
movq %rbx, 0x20(%r15)
movq %rbx, %rdi
callq 0x19e90
movq 0x18(%rax), %rax
movq %rax, 0x18(%r15)
movq %r14, 0x40(%r15)
leaq 0x20(%rip), %rax        # 0x493d5
movq %rax, 0x8(%r15)
movq %rbx, %rdi
callq 0x19e90
movq 0x50(%rax), %rax
movq %rax, 0x50(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/pipeline.c
// Function: freepipeline
static int freepipeline(lua_State *L, ud_t *ud)
    {
    VkPipeline pipeline = (VkPipeline)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    PFN_vkDestroyPipeline DestroyPipeline = ud->ddt->DestroyPipeline;
    VkDevice device = ud->device;

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(pipeline, "pipeline");
    DestroyPipeline(device, pipeline, allocator);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rsi), %rbx
movq 0x20(%rsi), %r15
movq 0x40(%rsi), %r14
movq 0x50(%rsi), %rax
movq 0x190(%rax), %r12
callq 0x18d20
testl %eax, %eax
je 0x49425
movq 0x76bc5(%rip), %rax     # 0xbffc8
cmpl $0x0, (%rax)
je 0x49419
leaq 0x56846(%rip), %rdi     # 0x9fc55
movq %rbx, %rsi
xorl %eax, %eax
callq 0x18960
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *%r12
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/pipeline_cache.c
// Function: GetPipelineCacheData
static int GetPipelineCacheData(lua_State *L)
    {
    VkResult ec;
    size_t size;
    char *data;
    ud_t *ud;
    VkPipelineCache pipeline_cache = checkpipeline_cache(L, 1, &ud);
    VkDevice device = ud->device;
    /* first, get the size */
    ec = ud->ddt->GetPipelineCacheData(device, pipeline_cache, &size, NULL);
    CheckError(L, ec);
    if(size == 0)
        { lua_pushstring(L, ""); return 1; }
    data = (char*)Malloc(L, size);
    ec = ud->ddt->GetPipelineCacheData(device, pipeline_cache, &size, data);
    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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x447b4(%rip), %rcx     # 0x8df7c
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x20(%rax), %r15
movq 0x50(%rax), %rax
movq %rsp, %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq *0x170(%rax)
testl %eax, %eax
je 0x49813
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x4988c
movq (%rsp), %rsi
testq %rsi, %rsi
je 0x4985c
movq %rbx, %rdi
callq 0x19200
movq %rax, %r12
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq *0x170(%rax)
testl %eax, %eax
je 0x4986d
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182d0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
jmp 0x49804
leaq 0x4d274(%rip), %rsi     # 0x96ad7
movq %rbx, %rdi
callq 0x1a2c0
jmp 0x49887
movq (%rsp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19760
movq %rbx, %rdi
movq %r12, %rsi
callq 0x182d0
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq