LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: stetre[P]moonvulkan/src/image.c
// Function: newimage
static int newimage(lua_State *L, VkImage image, ud_t *parent_ud, VkDevice device, const VkAllocationCallbacks *allocator, int borrowed)
    {
    ud_t *ud;
    TRACE_CREATE(image, "image");
    ud = newuserdata_nondispatchable(L, image, IMAGE_MT);
    ud->parent_ud = parent_ud;
    ud->device = device;
    ud->instance = UD(device)->instance;
    ud->allocator = allocator;
    ud->destructor = freeimage;
    ud->ddt = UD(device)->ddt;
    if(borrowed) MarkBorrowed(ud); 
    /* e.g. images got from a swapchain are borrowed, since they are owned by 
     * Vulkan and must not be destroyed by the application. */
    return 1;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movl %r9d, 0xc(%rsp)
movq 0xa4c7f(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x58331
movq 0x28(%rsp), %rsi
leaq 0x8a03c(%rip), %rdi     # 0xe2366
movb $0x0, %al
callq 0x189d0
jmp 0x58333
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x77656(%rip), %rdx     # 0xcf99a
xorl %ecx, %ecx
callq 0x18350
movq %rax, (%rsp)
movq 0x20(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x18(%rsp), %rdi
callq 0x19fd0
movq 0x18(%rax), %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x40(%rax)
movq (%rsp), %rax
leaq 0x89(%rip), %rcx        # 0x58420
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rcx
movq (%rsp), %rax
movq %rcx, 0x50(%rax)
cmpl $0x0, 0xc(%rsp)
je 0x583cd
jmp 0x583ba
movq (%rsp), %rax
movl 0x28(%rax), %ecx
orl $0x4, %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
jmp 0x583cd
movl $0x1, %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: stetre[P]moonvulkan/src/image.c
// Function: freeimage
static int freeimage(lua_State *L, ud_t *ud)
    {
    VkImage image = (VkImage)ud->handle;
    VkDevice device = ud->device;
    const VkAllocationCallbacks *allocator = ud->allocator;
    int borrowed = IsBorrowed(ud);

    /* delete all contained objects */
    freechildren(L, IMAGE_VIEW_MT, ud);

    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(image, "image");
    if(!borrowed)
        UD(device)->ddt->DestroyImage(device, image, allocator);
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl 0x28(%rax), %eax
andl $0x4, %eax
cmpl $0x4, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x78187(%rip), %rsi     # 0xd0609
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x584a5
movl $0x0, 0x34(%rsp)
jmp 0x584fd
jmp 0x584a7
movq 0xa4aea(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x584c6
movq 0x18(%rsp), %rsi
leaq 0x89ebe(%rip), %rdi     # 0xe237d
movb $0x0, %al
callq 0x189d0
jmp 0x584c8
cmpl $0x0, 0x4(%rsp)
jne 0x584f5
movq 0x10(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x130(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq *%rax
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/image.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkImage image;
    VkImageCreateInfo* info;

    VkDevice device = checkdevice(L, 1, &ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
#define CLEANUP zfreeVkImageCreateInfo(L, info, 1)
    info = zcheckVkImageCreateInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }

    ec = ud->ddt->CreateImage(device, info, allocator, &image);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return newimage(L, image, UD(device), device, allocator, 0);
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movl $0x1, %esi
leaq 0x48(%rsp), %rdx
leaq 0x7691c(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movl $0x3, %esi
callq 0x19260
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
movl $0x2, %esi
leaq 0x54(%rsp), %rdx
callq 0x188f0
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x587a9
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x64(%rsp)
jmp 0x58851
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x128(%rax), %rax
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq *%rax
movl %eax, 0x44(%rsp)
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
cmpl $0x0, 0x44(%rsp)
je 0x5880e
movq 0x58(%rsp), %rdi
movl 0x44(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x58(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x64(%rsp)
jmp 0x58851
jmp 0x58810
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x19fd0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
xorl %r9d, %r9d
callq 0x582f0
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)
// File: stetre[P]moonvulkan/src/image.c
// Function: GetImageSubresourceLayout
static int GetImageSubresourceLayout(lua_State *L)
    {
    int err;
    VkImageSubresource* subresource;
    VkSubresourceLayout layout;
    ud_t *ud;
    VkImage image = checkimage(L, 1, &ud);
    VkDevice device = ud->device;
#define CLEANUP zfreeVkImageSubresource(L, subresource, 1)
    subresource = zcheckVkImageSubresource(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ud->ddt->GetImageSubresourceLayout(device, image, subresource, &layout);
    zpushVkSubresourceLayout(L, &layout);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
leaq 0x770db(%rip), %rcx     # 0xcf99a
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
movl $0x2, %esi
leaq 0x54(%rsp), %rdx
callq 0x18850
movq %rax, 0x48(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x58942
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x19710
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq (%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x64(%rsp)
jmp 0x58997
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x138(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq *%rax
movq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x189a0
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x19710
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
// File: stetre[P]moonvulkan/src/image_view.c
// Function: freeimage_view
static int freeimage_view(lua_State *L, ud_t *ud)
    {
    VkImageView image_view = (VkImageView)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(image_view, "image_view");
    UD(device)->ddt->DestroyImageView(device, image_view, allocator);
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x58e55
movl $0x0, 0x34(%rsp)
jmp 0x58ea6
jmp 0x58e57
movq 0xa413a(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x58e76
movq 0x18(%rsp), %rsi
leaq 0x8959e(%rip), %rdi     # 0xe240d
movb $0x0, %al
callq 0x189d0
jmp 0x58e78
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x148(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq *%rax
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x2, %esi
callq 0x19260
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x34(%rsp), %rdx
callq 0x18840
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x59167
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq (%rsp), %rdi
movq %rax, %rdx
movl $0x1, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x59286
movq 0xa3e52(%rip), %rax     # 0xfcfc0
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0x591db
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
cmpl $0x0, 0x24(%rsp)
je 0x591cc
movq 0x38(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x59286
jmp 0x591ce
movl $0x0, 0x44(%rsp)
jmp 0x59286
jmp 0x591dd
movq 0xa3db4(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x591fc
movq 0x18(%rsp), %rsi
leaq 0x89291(%rip), %rdi     # 0xe2486
movb $0x0, %al
callq 0x189d0
jmp 0x591fe
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x774ba(%rip), %rdx     # 0xd06c9
movl $0x1, %ecx
callq 0x18350
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rax
leaq 0x578(%rip), %rcx       # 0x597b0
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x192a0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop
// File: 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:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x128(%rsp)
movq 0x128(%rsp), %rdi
movl $0x1, %esi
leaq 0x8(%rsp), %rdx
leaq 0x773d1(%rip), %rcx     # 0xd06c9
callq 0x1a640
movq %rax, (%rsp)
movq 0x128(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq (%rsp), %rdi
leaq 0x120(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movl %eax, 0x114(%rsp)
cmpl $0x0, 0x114(%rsp)
je 0x59371
movq 0x128(%rsp), %rdi
movl 0x114(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x128(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x134(%rsp)
jmp 0x594d6
jmp 0x59373
cmpl $0x0, 0x120(%rsp)
jne 0x5938d
movl $0x1, 0x134(%rsp)
jmp 0x594d6
movl $0x0, 0x11c(%rsp)
cmpl $0x20, 0x120(%rsp)
jbe 0x593c0
movl $0x20, 0x124(%rsp)
movl 0x120(%rsp), %eax
subl $0x20, %eax
movl %eax, 0x120(%rsp)
jmp 0x593d9
movl 0x120(%rsp), %eax
movl %eax, 0x124(%rsp)
movl $0x0, 0x120(%rsp)
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq (%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x124(%rsp), %rsi
callq *%rax
movl %eax, 0x114(%rsp)
cmpl $0x5, 0x114(%rsp)
je 0x59449
jmp 0x5940c
cmpl $0x0, 0x114(%rsp)
je 0x59445
movq 0x128(%rsp), %rdi
movl 0x114(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x128(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x134(%rsp)
jmp 0x594d6
jmp 0x59447
jmp 0x59449
movl $0x0, 0x118(%rsp)
movl 0x118(%rsp), %eax
cmpl 0x124(%rsp), %eax
jae 0x594bb
movq 0x128(%rsp), %rdi
movl 0x118(%rsp), %eax
movq 0x10(%rsp,%rax,8), %rsi
movq (%rsp), %rdx
callq 0x19fe0
movq 0x128(%rsp), %rdi
movl 0x11c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x11c(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl 0x118(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x118(%rsp)
jmp 0x59454
jmp 0x594bd
cmpl $0x0, 0x120(%rsp)
ja 0x59398
movl $0x1, 0x134(%rsp)
movl 0x134(%rsp), %eax
addq $0x138, %rsp            # imm = 0x138
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x597ff
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x76ff1(%rip), %rsi     # 0xd0801
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x76df9(%rip), %rsi     # 0xd061f
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x757ff(%rip), %rsi     # 0xcf03b
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x7765a(%rip), %rsi     # 0xd0eac
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x88c38(%rip), %rsi     # 0xe24a0
callq 0x18fa0
movq 0x20(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x5988c
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rsi
callq 0x18300
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x598aa
movl $0x0, 0x34(%rsp)
jmp 0x598ee
jmp 0x598ac
movq 0xa36e5(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x598cb
movq 0x18(%rsp), %rsi
leaq 0x88bef(%rip), %rdi     # 0xe24b3
movb $0x0, %al
callq 0x189d0
jmp 0x598cd
cmpq $0x0, 0x8(%rsp)
je 0x598e6
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq *%rax
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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 %rax
movq 0xa2798(%rip), %rax     # 0xfcfa0
cmpq $0x0, (%rax)
je 0x5a830
movq 0xa278b(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
callq 0x18370
callq 0x181d0
movq 0xa2777(%rip), %rax     # 0xfcfa0
movq $0x0, (%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0x5a87d
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movl $0x60, %esi
callq 0x18d00
movq %rax, (%rsp)
jmp 0x5a899
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rcx
movl $0x60, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x18d00
movq %rax, (%rsp)
movq (%rsp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x18bd0
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq (%rsp), %rax
movl 0x28(%rax), %ecx
orl $0x1, %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
movq (%rsp), %rax
movl $0xfffffffe, 0x38(%rax) # imm = 0xFFFFFFFE
movq (%rsp), %rax
movl $0xfffffffe, 0x34(%rax) # imm = 0xFFFFFFFE
movq (%rsp), %rax
movl $0xfffffffe, 0x30(%rax) # imm = 0xFFFFFFFE
movq (%rsp), %rax
movl $0xfffffffe, 0x2c(%rax) # imm = 0xFFFFFFFE
cmpl $0x0, 0xc(%rsp)
je 0x5a90e
jmp 0x5a8fb
movq (%rsp), %rax
movl 0x28(%rax), %ecx
orl $0x2, %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5a90e
movq (%rsp), %rax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq (%rsp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
je 0x5a949
movl $0x0, 0x14(%rsp)
jmp 0x5aa6d
jmp 0x5a94b
movq (%rsp), %rax
movl 0x28(%rax), %ecx
andl $-0x2, %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5a95e
movq (%rsp), %rax
cmpl $-0x2, 0x2c(%rax)
je 0x5a989
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movl 0x2c(%rax), %edx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a400
movq (%rsp), %rax
movl $0xfffffffe, 0x2c(%rax) # imm = 0xFFFFFFFE
jmp 0x5a98b
jmp 0x5a98d
movq (%rsp), %rax
cmpl $-0x2, 0x30(%rax)
je 0x5a9b8
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movl 0x30(%rax), %edx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a400
movq (%rsp), %rax
movl $0xfffffffe, 0x30(%rax) # imm = 0xFFFFFFFE
jmp 0x5a9ba
jmp 0x5a9bc
movq (%rsp), %rax
cmpl $-0x2, 0x34(%rax)
je 0x5a9e7
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movl 0x34(%rax), %edx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a400
movq (%rsp), %rax
movl $0xfffffffe, 0x34(%rax) # imm = 0xFFFFFFFE
jmp 0x5a9e9
jmp 0x5a9eb
movq (%rsp), %rax
cmpl $-0x2, 0x38(%rax)
je 0x5aa16
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movl 0x38(%rax), %edx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x1a400
movq (%rsp), %rax
movl $0xfffffffe, 0x38(%rax) # imm = 0xFFFFFFFE
jmp 0x5aa18
movq (%rsp), %rax
cmpq $0x0, 0x58(%rax)
je 0x5aa35
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movq 0x58(%rax), %rsi
callq 0x18300
movq (%rsp), %rax
movl 0x28(%rax), %eax
andl $0x2, %eax
cmpl $0x2, %eax
jne 0x5aa57
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movq (%rax), %rsi
callq 0x19110
jmp 0x5aa65
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x19110
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/objects.c
// Function: freeifchild
static int freeifchild(lua_State *L, const void *mem, const char *mt, const void *parent_ud)
/* callback for udata_scan */
    {
    ud_t *ud = (ud_t*)mem;
    (void)mt;
    if(IsValid(ud) && (ud->parent_ud == parent_ud))
        ud->destructor(L, ud);
    return 0;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x5ab12
movq (%rsp), %rax
movq 0x10(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x5ab12
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rdi
movq (%rsp), %rsi
callq *%rax
xorl %eax, %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_pushuserdata
int pushuserdata(lua_State *L, ud_t *ud)
    {
    if(!IsValid(ud)) return unexpected(L);
    if(IsDispatchable(ud))
        return udata_push(L, ud->handle);
    return udata_push(L, (uint64_t)(uintptr_t)ud);
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq (%rsp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
je 0x5ab61
movq 0x8(%rsp), %rdi
leaq 0x75a3f(%rip), %rsi     # 0xd0587
leaq 0x87a73(%rip), %rdx     # 0xe25c2
movl $0x59, %ecx
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x14(%rsp)
jmp 0x5ab99
movq (%rsp), %rax
movl 0x28(%rax), %eax
andl $0x2, %eax
cmpl $0x2, %eax
jne 0x5ab87
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movq (%rax), %rsi
callq 0x1a1a0
movl %eax, 0x14(%rsp)
jmp 0x5ab99
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x1a1a0
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/objects.c
// Function: moonvulkan_pushnondispatchable
int pushnondispatchable(lua_State *L, uint64_t handle, ud_t *parent_ud, const char *mt)
/* Search for an 'mt' nondispatchable object with the given handle and parent_ud and push it.
 * Returns 1 if the object is found and pushed, 0 otherwise.
 */
    {
    searchinfo_t info;
    info.parent_ud = parent_ud;
    info.handle = handle;
    if(udata_scan(L, mt, &info, searchnondispatchable))
        return 1;
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rsp, %rdx
leaq 0x31(%rip), %rcx        # 0x5ac20
callq 0x18ee0
cmpl $0x0, %eax
je 0x5ac03
movl $0x1, 0x34(%rsp)
jmp 0x5ac0b
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/objects.c
// Function: searchnondispatchable
static int searchnondispatchable(lua_State *L, const void *mem, const char *mt, const void *info)
/* callback for udata_scan */
    {
    ud_t *ud = (ud_t*)mem;
    searchinfo_t *searchinfo = (searchinfo_t *)info;
    (void)mt;
    if( IsValid(ud) && (ud->handle == searchinfo->handle) && (ud->parent_ud == searchinfo->parent_ud))
        {
        udata_push(L, (uint64_t)(uintptr_t)ud); 
        return 1;
        }
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x5ac98
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x5ac98
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rsp), %rcx
cmpq (%rcx), %rax
jne 0x5ac98
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1a1a0
movl $0x1, 0x34(%rsp)
jmp 0x5aca0
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movq 0x10(%rsp), %rdx
callq 0x1a2f0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x5ad6b
movq 0x8(%rsp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x5ad6b
cmpq $0x0, 0x18(%rsp)
je 0x5ad5c
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x5ad88
cmpq $0x0, 0x18(%rsp)
je 0x5ad7f
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
movq 0x20(%rsp), %rdx
callq 0x1a2f0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x5ae0b
movq 0x18(%rsp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x5ae0b
cmpq $0x0, 0x28(%rsp)
je 0x5adfc
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x5ae60
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x877b0(%rip), %rsi     # 0xe25cc
movb $0x0, %al
callq 0x18f50
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movq %rax, %rdx
callq 0x18460
cltq
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl $0x0, (%rax)
movq 0x20(%rsp), %rax
movl $0x0, (%rax)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x1a240
cmpl $0x0, %eax
jg 0x5aefe
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movq $0x0, 0x40(%rsp)
jmp 0x5b06f
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x1a240
cmpl $0x5, %eax
je 0x5af2a
movq 0x20(%rsp), %rax
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movq $0x0, 0x40(%rsp)
jmp 0x5b06f
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x1a270
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x5af64
movq 0x20(%rsp), %rax
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
movq $0x0, 0x40(%rsp)
jmp 0x5b06f
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x18050
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x5afac
movq 0x28(%rsp), %rax
movl $0x0, (%rax)
movq 0x20(%rsp), %rax
movl $0xfffffffa, (%rax)     # imm = 0xFFFFFFFA
movq $0x0, 0x40(%rsp)
jmp 0x5b06f
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x5b065
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x189e0
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x1a5f0
movq %rax, %rdx
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x5b046
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x18300
movq 0x28(%rsp), %rax
movl $0x0, (%rax)
movq 0x20(%rsp), %rax
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movq $0x0, 0x40(%rsp)
jmp 0x5b06f
movq 0x38(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x18170
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x5afb4
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x19fd0
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x5b49d
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
leaq 0x75a8f(%rip), %rdx     # 0xd0eac
movl $0x1, %ecx
callq 0x18350
movq %rax, (%rsp)
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rax
leaq 0x68(%rip), %rcx        # 0x5b4c0
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x48(%rax), %rcx
movq (%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0xa1b1f(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x5b491
movq 0x10(%rsp), %rsi
leaq 0x8714b(%rip), %rdi     # 0xe25d5
movb $0x0, %al
callq 0x189d0
jmp 0x5b493
movl $0x1, 0x24(%rsp)
jmp 0x5b4af
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
callq 0x196b0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x7611a(%rip), %rsi     # 0xd1606
callq 0x18fa0
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x5b50f
movl $0x0, 0x24(%rsp)
jmp 0x5b53a
jmp 0x5b511
movq 0xa1a80(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x5b530
movq 0x8(%rsp), %rsi
leaq 0x870cd(%rip), %rdi     # 0xe25f6
movb $0x0, %al
callq 0x189d0
jmp 0x5b532
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x358, %rsp            # imm = 0x358
movq %rdi, 0x348(%rsp)
movq 0x348(%rsp), %rdi
movl $0x1, %esi
leaq 0x340(%rsp), %rdx
leaq 0x75701(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, (%rsp)
movq 0x340(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xf0(%rax)
je 0x5b7ec
movq 0x348(%rsp), %rdi
movq (%rsp), %rsi
movq 0x340(%rsp), %rdx
callq 0x5d1f0
movl %eax, 0x354(%rsp)
jmp 0x5b824
movq 0x340(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x38(%rax), %rax
movq (%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq *%rax
movq 0x348(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x19430
movl $0x1, 0x354(%rsp)
movl 0x354(%rsp), %eax
addq $0x358, %rsp            # imm = 0x358
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0xf8(%rsp)
movq 0xf8(%rsp), %rdi
movl $0x1, %esi
leaq 0xf0(%rsp), %rdx
leaq 0x75641(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0xf0(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xe8(%rax)
je 0x5b8ae
movq 0xf8(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
callq 0x5d2a0
movl %eax, 0x104(%rsp)
jmp 0x5b8e7
movq 0xf0(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x20(%rax), %rax
movq 0x8(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq *%rax
movq 0xf8(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x18390
movl $0x1, 0x104(%rsp)
movl 0x104(%rsp), %eax
addq $0x108, %rsp            # imm = 0x108
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0x7558d(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0xf8(%rax)
je 0x5b956
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x5d350
movl %eax, 0x34(%rsp)
jmp 0x5b9a2
movq 0x28(%rsp), %rdi
movl $0x4, %esi
movl $0x2, %edx
callq 0x19d20
movl %eax, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %esi
leaq 0x1c(%rsp), %rdx
callq *%rax
movq 0x28(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x18da0
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceImageFormatProperties
static int GetPhysicalDeviceImageFormatProperties(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkPhysicalDeviceImageFormatInfo2* info;
    VkImageFormatProperties props;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    if(ud->idt->GetPhysicalDeviceImageFormatProperties2)
        return GetPhysicalDeviceImageFormatProperties2(L, physical_device, ud);
#define CLEANUP zfreeVkPhysicalDeviceImageFormatInfo2(L, info, 1)
    info = zcheckVkPhysicalDeviceImageFormatInfo2(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->idt->GetPhysicalDeviceImageFormatProperties(physical_device, 
            info->format, info->type, info->tiling, info->usage, info->flags, &props);
    if(ec) { CLEANUP; CheckError(L, ec); return 0; }
    zpushVkImageFormatProperties(L, &props);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movl $0x1, %esi
leaq 0x48(%rsp), %rdx
leaq 0x754dd(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x100(%rax)
je 0x5ba09
movq 0x58(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x5d410
movl %eax, 0x64(%rsp)
jmp 0x5bb39
movq 0x58(%rsp), %rdi
movl $0x2, %esi
leaq 0x54(%rsp), %rdx
callq 0x18820
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x5ba75
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x64(%rsp)
jmp 0x5bb39
movq 0x48(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x30(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rcx
movl 0x10(%rcx), %esi
movq 0x38(%rsp), %rcx
movl 0x14(%rcx), %edx
movq 0x38(%rsp), %rcx
movl 0x18(%rcx), %ecx
movq 0x38(%rsp), %r8
movl 0x1c(%r8), %r8d
movq 0x38(%rsp), %r9
movl 0x20(%r9), %r9d
leaq 0x18(%rsp), %r10
movq %r10, (%rsp)
callq *%rax
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
je 0x5bb0e
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
cmpl $0x0, 0x44(%rsp)
je 0x5bb02
movq 0x58(%rsp), %rdi
movl 0x44(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x58(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x64(%rsp)
jmp 0x5bb39
jmp 0x5bb04
movl $0x0, 0x64(%rsp)
jmp 0x5bb39
movq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x18ad0
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceQueueFamilyProperties
static int GetPhysicalDeviceQueueFamilyProperties(lua_State *L)
    {
    uint32_t i, count = 0;
    VkQueueFamilyProperties *props;
    ud_t *ud;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    
    if(ud->idt->GetPhysicalDeviceQueueFamilyProperties2)
        return GetPhysicalDeviceQueueFamilyProperties2(L, physical_device, ud);

    lua_newtable(L);
    ud->idt->GetPhysicalDeviceQueueFamilyProperties(physical_device, &count, NULL);
    if(count == 0) return 1;
    props = (VkQueueFamilyProperties*)Malloc(L, sizeof(VkQueueFamilyProperties)*count);
    ud->idt->GetPhysicalDeviceQueueFamilyProperties(physical_device, &count, props);
    for(i=0; i<count; i++)
        {
        zpushVkQueueFamilyProperties(L, &(props[i]), i);
        lua_rawseti(L, -2, i+1);
        }
    Free(L, props);
    return 1;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl $0x0, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0x75335(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x108(%rax)
je 0x5bbb1
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x5d5f0
movl %eax, 0x34(%rsp)
jmp 0x5bc93
movq 0x28(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x40(%rax), %rax
movq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
cmpl $0x0, 0x20(%rsp)
jne 0x5bbf0
movl $0x1, 0x34(%rsp)
jmp 0x5bc93
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %eax
imulq $0x18, %rax, %rsi
callq 0x192c0
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x40(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %rsi
callq *%rax
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jae 0x5bc7c
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x24(%rsp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rsi
movl 0x24(%rsp), %edx
callq 0x18c20
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x5bc2d
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x18300
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x218(%rsp)
movq 0x218(%rsp), %rdi
movl $0x1, %esi
leaq 0x8(%rsp), %rdx
leaq 0x751e4(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x110(%rax)
je 0x5bd03
movq 0x218(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x5d740
movl %eax, 0x224(%rsp)
jmp 0x5bd38
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x48(%rax), %rax
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq *%rax
movq 0x218(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x19580
movl $0x1, 0x224(%rsp)
movl 0x224(%rsp), %eax
addq $0x228, %rsp            # imm = 0x228
retq
nopw (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0x74edb(%rip), %rcx     # 0xd0eac
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x120(%rax)
jne 0x5c00a
movq 0x38(%rsp), %rdi
leaq 0x868e4(%rip), %rsi     # 0xe28de
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x5c143
jmp 0x5c00c
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x19620
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x5c08e
jmp 0x5c02e
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x5c143
movq 0x38(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x1a6f0
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x5c0e3
jmp 0x5c0ab
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x5c143
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x120(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq *%rax
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x19510
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)