LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: stetre[P]moonvulkan/src/debug_report_callback.c
// Function: Callback
static VkBool32 Callback(VkDebugReportFlagsEXT flags,
    VkDebugReportObjectTypeEXT objectType, uint64_t object,
    size_t location,
    int32_t messageCode,
    const char* pLayerPrefix,
    const char* pMessage,
    void* pUserData)
    {
#define ud ((ud_info_t*)pUserData)->ud
#define L moonvulkan_L
    int top = lua_gettop(L);
    /* retrieve and push the callback */
    if(lua_rawgeti(L, LUA_REGISTRYINDEX, ud->ref1) != LUA_TFUNCTION)
        return unexpected(L);
    /* push args */
    pushinstance(L, ud->instance);
    pushflags(L, flags);
    pushdebugreportobjecttype(L, objectType);
    lua_pushinteger(L, object);
    lua_pushinteger(L, location);
    lua_pushinteger(L, messageCode);
    if(pLayerPrefix) lua_pushstring(L, pLayerPrefix);
    if(pMessage) lua_pushstring(L, pMessage);
    /* execute the callback */
    if(lua_pcall(L, 8, 0, 0) != LUA_OK)
        { lua_error(L); return 0; }
    lua_settop(L, top);
    return 0;
#undef L
#undef ud
    }

// Assembly:
subq $0x38, %rsp
movq 0x48(%rsp), %rax
movq 0x40(%rsp), %rax
movl %edi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movl %r8d, 0x14(%rsp)
movq %r9, 0x8(%rsp)
movq 0xd6fdf(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
callq 0x180a0
movl %eax, 0x4(%rsp)
movq 0xd6fcc(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x48(%rsp), %rax
movq (%rax), %rax
movslq 0x2c(%rax), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x189e0
cmpl $0x6, %eax
je 0x2601f
movq 0xd6fa7(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
leaq 0xaa584(%rip), %rsi     # 0xd0587
leaq 0xaa72c(%rip), %rdx     # 0xd0736
movl $0x36, %ecx
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x26134
movq 0xd6f7a(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rsi
callq 0x19270
movq 0xd6f5f(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl 0x30(%rsp), %eax
movl %eax, %esi
callq 0x19520
movq 0xd6f4a(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl 0x2c(%rsp), %edx
movl $0x24, %esi
callq 0x18a00
movq 0xd6f32(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x18be0
movq 0xd6f1e(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x18be0
movq 0xd6f0a(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movslq 0x14(%rsp), %rsi
callq 0x18be0
cmpq $0x0, 0x8(%rsp)
je 0x260bf
movq 0xd6eee(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x1a420
cmpq $0x0, 0x40(%rsp)
je 0x260db
movq 0xd6ed2(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x1a420
movq 0xd6ebe(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl $0x8, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl %ecx, %edx
movq %r9, %r8
callq 0x1a600
cmpl $0x0, %eax
je 0x26119
movq 0xd6e99(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
callq 0x19ad0
movl $0x0, 0x34(%rsp)
jmp 0x26134
movq 0xd6e80(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl 0x4(%rsp), %esi
callq 0x18170
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: stetre[P]moonvulkan/src/debug_report_callback.c
// Function: freedebug_report_callback
static int freedebug_report_callback(lua_State *L, ud_t *ud)
    {
    VkDebugReportCallbackEXT debug_report_callback = (VkDebugReportCallbackEXT)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkInstance instance = ud->instance;
    if(!freeuserdata(L, ud)) return 0; /* double call */
    TRACE_DELETE(debug_report_callback, "debug_report_callback");
    UD(instance)->idt->DestroyDebugReportCallbackEXT(instance, debug_report_callback, 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 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x26195
movl $0x0, 0x34(%rsp)
jmp 0x261e6
jmp 0x26197
movq 0xd6dfa(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x261b6
movq 0x18(%rsp), %rsi
leaq 0xaa59f(%rip), %rdi     # 0xd074e
movb $0x0, %al
callq 0x189d0
jmp 0x261b8
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x48(%rax), %rax
movq 0xd8(%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/debug_utils_messenger.c
// Function: QueueBeginDebugUtilsLabel
static int QueueBeginDebugUtilsLabel(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDebugUtilsLabelEXT* label;
    VkQueue queue = checkqueue(L, 1, &ud);
    CheckInstancePfn(L, ud, QueueBeginDebugUtilsLabelEXT);
#define CLEANUP zfreeVkDebugUtilsLabelEXT(L, label, 1)
    label = zcheckVkDebugUtilsLabelEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ud->idt->QueueBeginDebugUtilsLabelEXT(queue, label);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
leaq 0xaa211(%rip), %rcx     # 0xd09a0
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x158(%rax)
jne 0x267c8
movq 0x28(%rsp), %rdi
leaq 0xaa1f9(%rip), %rsi     # 0xd09b1
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x26869
jmp 0x267ca
movq 0x28(%rsp), %rdi
movl $0x2, %esi
leaq 0x24(%rsp), %rdx
callq 0x18380
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0x26831
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%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, 0x34(%rsp)
jmp 0x26869
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x158(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq *%rax
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: QueueEndDebugUtilsLabel
static int QueueEndDebugUtilsLabel(lua_State *L)
    {
    ud_t *ud;
    VkQueue queue = checkqueue(L, 1, &ud);
    CheckInstancePfn(L, ud, QueueEndDebugUtilsLabelEXT);
    ud->idt->QueueEndDebugUtilsLabelEXT(queue);
    return 0;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0xaa101(%rip), %rcx     # 0xd09a0
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x160(%rax)
jne 0x268d5
movq 0x18(%rsp), %rdi
leaq 0xaa11b(%rip), %rsi     # 0xd09e3
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x268f6
jmp 0x268d7
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x160(%rax), %rax
movq 0x8(%rsp), %rdi
callq *%rax
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: QueueInsertDebugUtilsLabel
static int QueueInsertDebugUtilsLabel(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDebugUtilsLabelEXT* label;
    VkQueue queue = checkqueue(L, 1, &ud);
    CheckInstancePfn(L, ud, QueueInsertDebugUtilsLabelEXT);
#define CLEANUP zfreeVkDebugUtilsLabelEXT(L, label, 1)
    label = zcheckVkDebugUtilsLabelEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ud->idt->QueueInsertDebugUtilsLabelEXT(queue, label);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
leaq 0xaa081(%rip), %rcx     # 0xd09a0
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x168(%rax)
jne 0x26958
movq 0x28(%rsp), %rdi
leaq 0xaa0cb(%rip), %rsi     # 0xd0a13
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x269f9
jmp 0x2695a
movq 0x28(%rsp), %rdi
movl $0x2, %esi
leaq 0x24(%rsp), %rdx
callq 0x18380
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0x269c1
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%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, 0x34(%rsp)
jmp 0x269f9
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x168(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq *%rax
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: SetDebugUtilsObjectName
static int SetDebugUtilsObjectName(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkDebugUtilsObjectNameInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckInstancePfn(L, ud, SetDebugUtilsObjectNameEXT);
#define CLEANUP zfreeVkDebugUtilsObjectNameInfoEXT(L, info, 1)
    info = zcheckVkDebugUtilsObjectNameInfoEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->idt->SetDebugUtilsObjectNameEXT(device, info);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0xa860c(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x148(%rax)
jne 0x26a68
movq 0x38(%rsp), %rdi
leaq 0xa9fee(%rip), %rsi     # 0xd0a46
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x26b38
jmp 0x26a6a
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x18230
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x26ad3
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 0x26b38
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x148(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq *%rax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
cmpl $0x0, 0x24(%rsp)
je 0x26b2e
movq 0x38(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x26b38
jmp 0x26b30
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: SetDebugUtilsObjectTag
static int SetDebugUtilsObjectTag(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkDebugUtilsObjectTagInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckInstancePfn(L, ud, SetDebugUtilsObjectTagEXT);
#define CLEANUP zfreeVkDebugUtilsObjectTagInfoEXT(L, info, 1)
    info = zcheckVkDebugUtilsObjectTagInfoEXT(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->idt->SetDebugUtilsObjectTagEXT(device, info);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0xa84cc(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x150(%rax)
jne 0x26ba8
movq 0x38(%rsp), %rdi
leaq 0xa9ede(%rip), %rsi     # 0xd0a76
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x26c78
jmp 0x26baa
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x192d0
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x26c13
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 0x26c78
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x150(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq *%rax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
cmpl $0x0, 0x24(%rsp)
je 0x26c6e
movq 0x38(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x26c78
jmp 0x26c70
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: SubmitDebugUtilsMessage
static int SubmitDebugUtilsMessage(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDebugUtilsMessageSeverityFlagBitsEXT severity;
    VkDebugUtilsMessageTypeFlagsEXT types;
    VkDebugUtilsMessengerCallbackDataEXT* cbdata;
    VkInstance instance = checkinstance(L, 1, &ud);
    CheckInstancePfn(L, ud, SubmitDebugUtilsMessageEXT);
    severity = checkflags(L, 2);
    types = checkflags(L, 3);
#define CLEANUP zfreeVkDebugUtilsMessengerCallbackDataEXT(L, cbdata, 1)
    cbdata = zcheckVkDebugUtilsMessengerCallbackDataEXT(L, 4, &err);
    if(err) { CLEANUP; return argerror(L, 4); }
    ud->idt->SubmitDebugUtilsMessageEXT(instance, severity, types, cbdata);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0xa9a1a(%rip), %rcx     # 0xd06c9
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x198(%rax)
jne 0x26ce8
movq 0x38(%rsp), %rdi
leaq 0xa9dcd(%rip), %rsi     # 0xd0aa5
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x26db9
jmp 0x26cea
movq 0x38(%rsp), %rdi
movl $0x2, %esi
callq 0x19010
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rdi
movl $0x3, %esi
callq 0x19010
movl %eax, 0x20(%rsp)
movq 0x38(%rsp), %rdi
movl $0x4, %esi
leaq 0x34(%rsp), %rdx
callq 0x19000
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x26d79
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 $0x4, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x26db9
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x198(%rax), %rax
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %edx
movq 0x18(%rsp), %rcx
callq *%rax
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: Callback
static VkBool32 Callback(
        VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
        VkDebugUtilsMessageTypeFlagsEXT messageType,
        const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, 
        void* pUserData)
    {
#define ud ((ud_info_t*)pUserData)->ud
#define L moonvulkan_L
    int top = lua_gettop(L);
    /* retrieve and push the callback */
    if(lua_rawgeti(L, LUA_REGISTRYINDEX, ud->ref1) != LUA_TFUNCTION)
        return unexpected(L);
    /* push args */
    pushinstance(L, ud->instance);
    pushflags(L, messageSeverity);
    pushflags(L, messageType);
    if(pCallbackData) zpushVkDebugUtilsMessengerCallbackDataEXT(L, pCallbackData);
    /* execute the callback */
    if(lua_pcall(L, 4, 0, 0) != LUA_OK)
        { lua_error(L); return 0; }
    lua_settop(L, top);
    return 0;
#undef L
#undef ud
    }

// Assembly:
subq $0x28, %rsp
movl %edi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0xd61b3(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
callq 0x180a0
movl %eax, 0x4(%rsp)
movq 0xd61a0(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movslq 0x2c(%rax), %rdx
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x189e0
cmpl $0x6, %eax
je 0x26e4b
movq 0xd617b(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
leaq 0xa9758(%rip), %rsi     # 0xd0587
leaq 0xa9b2b(%rip), %rdx     # 0xd0961
movl $0x34, %ecx
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x26f05
movq 0xd614e(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rsi
callq 0x19270
movq 0xd6133(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl 0x20(%rsp), %eax
movl %eax, %esi
callq 0x19520
movq 0xd611e(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x19520
cmpq $0x0, 0x10(%rsp)
je 0x26eac
movq 0xd6101(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movq 0x10(%rsp), %rsi
callq 0x19fa0
movq 0xd60ed(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl $0x4, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl %ecx, %edx
movq %r9, %r8
callq 0x1a600
cmpl $0x0, %eax
je 0x26eea
movq 0xd60c8(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
callq 0x19ad0
movl $0x0, 0x24(%rsp)
jmp 0x26f05
movq 0xd60af(%rip), %rax     # 0xfcfa0
movq (%rax), %rdi
movl 0x4(%rsp), %esi
callq 0x18170
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: stetre[P]moonvulkan/src/debug_utils_messenger.c
// Function: freedebug_utils_messenger
static int freedebug_utils_messenger(lua_State *L, ud_t *ud)
    {
    VkDebugUtilsMessengerEXT debug_utils_messenger = (VkDebugUtilsMessengerEXT)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkInstance instance = ud->instance;
    if(!freeuserdata(L, ud)) return 0; /* double call */
    TRACE_DELETE(debug_utils_messenger, "debug_utils_messenger");
    UD(instance)->idt->DestroyDebugUtilsMessengerEXT(instance, debug_utils_messenger, 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 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x26f65
movl $0x0, 0x34(%rsp)
jmp 0x26fb6
jmp 0x26f67
movq 0xd602a(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x26f86
movq 0x18(%rsp), %rsi
leaq 0xa99fa(%rip), %rdi     # 0xd0979
movb $0x0, %al
callq 0x189d0
jmp 0x26f88
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x48(%rax), %rax
movq 0x190(%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/descriptor_pool.c
// Function: ResetDescriptorPool
static int ResetDescriptorPool(lua_State *L)
    {
    ud_t *ud;
    VkDescriptorPool descriptor_pool = checkdescriptor_pool(L, 1, &ud);
    VkDevice device = ud->device;
    VkDescriptorPoolResetFlags flags = optflags(L, 2, 0);
    VkResult ec = ud->ddt->ResetDescriptorPool(device, descriptor_pool, flags);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x20(%rsp), %rdx
leaq 0xa9556(%rip), %rcx     # 0xd0ad5
callq 0x1a640
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x19370
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x1d8(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %edx
callq *%rax
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x275f9
movq 0x28(%rsp), %rdi
movl 0x8(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x28(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x34(%rsp)
jmp 0x27603
jmp 0x275fb
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: stetre[P]moonvulkan/src/descriptor_pool.c
// Function: freedescriptor_pool
static int freedescriptor_pool(lua_State *L, ud_t *ud)
    {
    VkDescriptorPool descriptor_pool = (VkDescriptorPool)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    freechildren(L, DESCRIPTOR_SET_MT, ud);
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(descriptor_pool, "descriptor_pool");
    UD(device)->ddt->DestroyDescriptorPool(device, descriptor_pool, 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), %rdx
leaq 0xa82fa(%rip), %rsi     # 0xcf952
callq 0x18fa0
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
jne 0x2767b
movl $0x0, 0x34(%rsp)
jmp 0x276cc
jmp 0x2767d
movq 0xd5914(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x2769c
movq 0x18(%rsp), %rsi
leaq 0xa94c1(%rip), %rdi     # 0xd0b56
movb $0x0, %al
callq 0x189d0
jmp 0x2769e
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x1d0(%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
nopw %cs:(%rax,%rax)
nop
// File: stetre[P]moonvulkan/src/descriptor_set.c
// Function: freedescriptor_set
static int freedescriptor_set(lua_State *L, ud_t *ud)
    {
    VkResult ec;
    VkDescriptorSet descriptor_set = (VkDescriptorSet)ud->handle;
    VkDevice device = ud->device;
    VkDescriptorPool descriptor_pool = (VkDescriptorPool)ud->parent_ud->handle;
    int free_allowed = IsFreeDescriptorSetAllowed(ud->parent_ud);
    freeuserdata(L, ud);
    TRACE_DELETE(descriptor_set, "descriptor_set");
    if(!free_allowed)
        return 0;
    ec = UD(device)->ddt->FreeDescriptorSets(device, descriptor_pool, 1, &descriptor_set);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x28(%rax), %eax
andl $0x8, %eax
cmpl $0x8, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x18dc0
movq 0xd4d8a(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x28226
movq 0x20(%rsp), %rsi
leaq 0xa89de(%rip), %rdi     # 0xd0bfd
movb $0x0, %al
callq 0x189d0
jmp 0x28228
cmpl $0x0, 0xc(%rsp)
jne 0x28239
movl $0x0, 0x44(%rsp)
jmp 0x28299
movq 0x18(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x1e8(%rax), %rax
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
leaq 0x20(%rsp), %rcx
callq *%rax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
je 0x2828f
movq 0x38(%rsp), %rdi
movl 0x2c(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x28299
jmp 0x28291
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: stetre[P]moonvulkan/src/descriptor_set_layout.c
// Function: GetDescriptorSetLayoutSupport
static int GetDescriptorSetLayoutSupport(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkDescriptorSetLayoutCreateInfo *info=NULL;
    VkDescriptorSetLayoutSupport *support=NULL;
    VkDevice device = checkdevice(L, 1, &ud);
#define CLEANUP do { zfreeVkDescriptorSetLayoutCreateInfo(L, info, 1); \
                    zfreeVkDescriptorSetLayoutSupport(L, support, 1); } while(0);
    CheckDevicePfn(L, ud, GetDescriptorSetLayoutSupport);
    info = zcheckVkDescriptorSetLayoutCreateInfo(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    support = znewchainVkDescriptorSetLayoutSupport(L, &err);
    if(err) { CLEANUP; return lua_error(L); }
    ud->ddt->GetDescriptorSetLayoutSupport(device, info, support);
    zpushVkDescriptorSetLayoutSupport(L, support);
    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 0xa681a(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x528(%rax)
jne 0x2885a
movq 0x38(%rsp), %rdi
leaq 0xa847e(%rip), %rsi     # 0xd0cc8
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x28993
jmp 0x2885c
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x198c0
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x288de
jmp 0x2887e
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 0x28993
movq 0x38(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x19c30
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x28933
jmp 0x288fb
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 0x28993
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x528(%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 0x198e0
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)
// File: stetre[P]moonvulkan/src/descriptor_set_layout.c
// Function: freedescriptor_set_layout
static int freedescriptor_set_layout(lua_State *L, ud_t *ud)
    {
    VkDescriptorSetLayout descriptor_set_layout = (VkDescriptorSetLayout)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(descriptor_set_layout, "descriptor_set_layout");
    UD(device)->ddt->DestroyDescriptorSetLayout(device, descriptor_set_layout, 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 0x289f5
movl $0x0, 0x34(%rsp)
jmp 0x28a46
jmp 0x289f7
movq 0xd459a(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x28a16
movq 0x18(%rsp), %rsi
leaq 0xa8292(%rip), %rdi     # 0xd0ca1
movb $0x0, %al
callq 0x189d0
jmp 0x28a18
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x1c0(%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/descriptor_update_template.c
// Function: UpdateDescriptorSetWithTemplate
static int UpdateDescriptorSetWithTemplate(lua_State *L)
    {
    size_t len;
    ud_t *ud1, *ud2;
    VkDescriptorSet descriptor_set = checkdescriptor_set(L, 1, &ud1);
    VkDescriptorUpdateTemplate du_template = checkdescriptor_update_template(L, 2, &ud2);
    const void* data = luaL_checklstring(L, 3, &len);
    CheckDevicePfn(L, ud1, UpdateDescriptorSetWithTemplate);
    ud1->ddt->UpdateDescriptorSetWithTemplate(ud1->device, descriptor_set, du_template, data);
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0xa6a73(%rip), %rcx     # 0xcf952
callq 0x1a640
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x20(%rsp), %rdx
leaq 0xa6bd6(%rip), %rcx     # 0xcfad5
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
movl $0x3, %esi
leaq 0x30(%rsp), %rdx
callq 0x18df0
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x468(%rax)
jne 0x28f4e
movq 0x38(%rsp), %rdi
leaq 0xa7eaf(%rip), %rsi     # 0xd0df0
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x28f82
jmp 0x28f50
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x468(%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
callq *%rax
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: stetre[P]moonvulkan/src/descriptor_update_template.c
// Function: freedescriptor_update_template
static int freedescriptor_update_template(lua_State *L, ud_t *ud)
    {
    VkDescriptorUpdateTemplate du_template = (VkDescriptorUpdateTemplate)ud->handle;
    const VkAllocationCallbacks *allocator = ud->allocator;
    VkDevice device = ud->device;
    if(!freeuserdata(L, ud))
        return 0; /* double call */
    TRACE_DELETE(du_template, "descriptor_update_template");
    UD(device)->ddt->DestroyDescriptorUpdateTemplate(device, du_template, 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 0x28fe5
movl $0x0, 0x34(%rsp)
jmp 0x29036
jmp 0x28fe7
movq 0xd3faa(%rip), %rax     # 0xfcf98
cmpl $0x0, (%rax)
je 0x29006
movq 0x18(%rsp), %rsi
leaq 0xa7dc5(%rip), %rdi     # 0xd0dc4
movb $0x0, %al
callq 0x189d0
jmp 0x29008
movq 0x8(%rsp), %rdi
callq 0x19fd0
movq 0x50(%rax), %rax
movq 0x460(%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/device.c
// Function: DeviceWaitIdle
static int DeviceWaitIdle(lua_State *L)
    {
    ud_t *ud;
    VkDevice device = checkdevice(L, 1, &ud);
    VkResult ec = ud->ddt->DeviceWaitIdle(device);
    CheckError(L, ec);
    return 0;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0xa594c(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x20(%rax), %rax
movq 0x8(%rsp), %rdi
callq *%rax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
je 0x29738
movq 0x18(%rsp), %rdi
movl 0x4(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x18(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x24(%rsp)
jmp 0x29742
jmp 0x2973a
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: stetre[P]moonvulkan/src/device.c
// Function: AcquireProfilingLock
static int AcquireProfilingLock(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkResult ec;
    VkAcquireProfilingLockInfoKHR *info = NULL;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, AcquireProfilingLockKHR);
#define CLEANUP zfreeVkAcquireProfilingLockInfoKHR(L, info, 1)
    info = zcheckVkAcquireProfilingLockInfoKHR(L, 2, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->AcquireProfilingLockKHR(device, info);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0xa5463(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x610(%rax)
jne 0x29c11
movq 0x38(%rsp), %rdi
leaq 0xa7431(%rip), %rsi     # 0xd1032
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x29ce1
jmp 0x29c13
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x34(%rsp), %rdx
callq 0x1a470
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x29c7c
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 0x29ce1
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x610(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq *%rax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x19210
cmpl $0x0, 0x24(%rsp)
je 0x29cd7
movq 0x38(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x29ce1
jmp 0x29cd9
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: stetre[P]moonvulkan/src/device.c
// Function: ReleaseProfilingLock
static int ReleaseProfilingLock(lua_State *L)
    {
    ud_t *ud;
    VkDevice device = checkdevice(L, 1, &ud);
    CheckDevicePfn(L, ud, ReleaseProfilingLockKHR);
    ud->ddt->ReleaseProfilingLockKHR(device);
    return 0;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0xa532c(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x618(%rax)
jne 0x29d45
movq 0x18(%rsp), %rdi
leaq 0xa7327(%rip), %rsi     # 0xd105f
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x24(%rsp)
jmp 0x29d66
jmp 0x29d47
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x618(%rax), %rax
movq 0x8(%rsp), %rdi
callq *%rax
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: MapMemory
static int MapMemory(lua_State *L)
    {
    VkResult ec;
    void *data;
    ud_t *ud;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    ud_info_t *ud_info = (ud_info_t*)ud->info;
    VkDevice device = ud->device;
    VkDeviceSize offset = luaL_checkinteger(L, 2);
    VkDeviceSize size = checksizeorwholesize(L, 3);
    VkMemoryMapFlags flags = optflags(L, 4, 0);

    if(ud_info->memp)
        return luaL_error(L, "memory is already mapped");

    ec = ud->ddt->MapMemory(device, memory, offset, size, flags, &data);
    CheckError(L, ec);
    ud_info->memp = (char*)data;
    ud_info->memsz = (size == VK_WHOLE_SIZE) ? ud_info->maxsz - offset : size;
    lua_pushlightuserdata(L, data);
    return 1;
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movl $0x1, %esi
leaq 0x40(%rsp), %rdx
leaq 0xa6955(%rip), %rcx     # 0xd0f74
callq 0x1a640
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movl $0x2, %esi
callq 0x19190
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
movl $0x3, %esi
callq 0x1a770
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
movl $0x4, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x19370
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rax
cmpq $0x0, (%rax)
je 0x2a6ab
movq 0x58(%rsp), %rdi
leaq 0xa6cb7(%rip), %rsi     # 0xd1352
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x64(%rsp)
jmp 0x2a75e
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x38(%rax), %rax
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl 0x14(%rsp), %r8d
leaq 0x48(%rsp), %r9
callq *%rax
movl %eax, 0x54(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x2a703
movq 0x58(%rsp), %rdi
movl 0x54(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x58(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x64(%rsp)
jmp 0x2a75e
jmp 0x2a705
movq 0x48(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
cmpq $-0x1, 0x18(%rsp)
jne 0x2a72f
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
subq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x2a739
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x19610
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: UnmapMemory
static int UnmapMemory(lua_State *L)
    {
    ud_t *ud;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    ud_info_t *ud_info = (ud_info_t*)ud->info;
    VkDevice device = ud->device;

    if(ud_info->memp == NULL)
        return luaL_error(L, "memory is not mapped");

    ud->ddt->UnmapMemory(device, memory);
    ud_info->memp = NULL;
    ud_info->memsz = 0;
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x20(%rsp), %rdx
leaq 0xa67e5(%rip), %rcx     # 0xd0f74
callq 0x1a640
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x2a7d9
movq 0x28(%rsp), %rdi
leaq 0xa6b9f(%rip), %rsi     # 0xd136b
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x2a813
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x40(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq *%rax
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x8(%rax)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: GetDeviceMemoryCommitment
static int GetDeviceMemoryCommitment(lua_State *L)
    {
    VkDeviceSize bytes;
    ud_t *ud;
    VkDeviceMemory memory = checkdevice_memory(L, 1, &ud);
    VkDevice device = ud->device;
    ud->ddt->GetDeviceMemoryCommitment(device, memory, &bytes);
    lua_pushinteger(L, bytes);
    return 1;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
leaq 0xa6735(%rip), %rcx     # 0xd0f74
callq 0x1a640
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x58(%rax), %rax
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq *%rax
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x18be0
movl $0x1, %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: FlushMappedMemoryRanges
static int FlushMappedMemoryRanges(lua_State *L)
    {
    int err;
    uint32_t count;
    VkResult ec;
    ud_t *ud;
    VkDevice device = checkdevice(L, 1, &ud);
#define CLEANUP zfreearrayVkMappedMemoryRange(L, ranges, count, 1)
    VkMappedMemoryRange* ranges = zcheckarrayVkMappedMemoryRange(L, 2, &count, &err);
    if(err) { CLEANUP; return argerror(L, 2); }
    ec = ud->ddt->FlushMappedMemoryRanges(device, count, ranges);
    CLEANUP;
    CheckError(L, ec);
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x20(%rsp), %rdx
leaq 0xa478c(%rip), %rcx     # 0xcf03b
callq 0x1a640
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x30(%rsp), %rdx
leaq 0x34(%rsp), %rcx
callq 0x19c10
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x2a931
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x30(%rsp), %ecx
movl $0x28, %edx
movl $0x1, %r8d
callq 0x198d0
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 0x2a9a1
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x48(%rax), %rax
movq 0x18(%rsp), %rdi
movl 0x30(%rsp), %esi
movq 0x10(%rsp), %rdx
callq *%rax
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x30(%rsp), %ecx
movl $0x28, %edx
movl $0x1, %r8d
callq 0x198d0
cmpl $0x0, 0x2c(%rsp)
je 0x2a997
movq 0x38(%rsp), %rdi
movl 0x2c(%rsp), %edx
xorl %esi, %esi
callq 0x18a00
movq 0x38(%rsp), %rdi
callq 0x19ad0
movl %eax, 0x44(%rsp)
jmp 0x2a9a1
jmp 0x2a999
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: Write
static int Write(lua_State *L) /* NONVK */
    {
    size_t size;
    ud_t *ud;
    ud_info_t *ud_info;
    VkDeviceSize offset;
    const char *data;

    (void)checkdevice_memory(L, 1, &ud);
    ud_info = (ud_info_t*)ud->info;
    offset = luaL_checkinteger(L, 2);
    data = luaL_tolstring(L, 3, &size);
    if(!ud_info->memp)
        return luaL_error(L, "memory is not mapped");
    /* boundary checks */
    if(size > (ud_info->memsz - offset))
        return argerrorc(L, 3, ERR_LENGTH);
    memcpy(ud_info->memp + offset, data, size);
    return 0;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x28(%rsp), %rdx
leaq 0xa6485(%rip), %rcx     # 0xd0f74
callq 0x1a640
movq 0x28(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rdi
movl $0x2, %esi
callq 0x19190
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movl $0x3, %esi
leaq 0x30(%rsp), %rdx
callq 0x18500
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x2ab53
movq 0x38(%rsp), %rdi
leaq 0xa6825(%rip), %rsi     # 0xd136b
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x44(%rsp)
jmp 0x2abbb
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
subq 0x18(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x2ab97
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
callq 0x19a60
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movl $0x3, %esi
callq 0x18460
movl %eax, 0x44(%rsp)
jmp 0x2abbb
movq 0x20(%rsp), %rax
movq (%rax), %rdi
addq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x19290
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: Read
static int Read(lua_State *L) /* NONVK */
    {
    ud_t *ud;
    ud_info_t *ud_info;
    VkDeviceSize offset, size;

    (void)checkdevice_memory(L, 1, &ud);
    ud_info = (ud_info_t*)ud->info;
    offset = luaL_checkinteger(L, 2);
    size = checksizeorwholesize(L, 3);
    if(!ud_info->memp)
        return luaL_error(L, "memory is not mapped");
    /* boundary checks */
    if(size == VK_WHOLE_SIZE)
        size = ud_info->memsz - offset;
    else if(size > (ud_info->memsz - offset))
        return argerrorc(L, 3, ERR_LENGTH);
    lua_pushlstring(L, ud_info->memp + offset, size);
    return 1;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x20(%rsp), %rdx
leaq 0xa6385(%rip), %rcx     # 0xd0f74
callq 0x1a640
movq 0x20(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x19190
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x3, %esi
callq 0x1a770
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x2ac51
movq 0x28(%rsp), %rdi
leaq 0xa672a(%rip), %rsi     # 0xd136b
movb $0x0, %al
callq 0x19ce0
movl %eax, 0x34(%rsp)
jmp 0x2acd6
cmpq $-0x1, 0x8(%rsp)
jne 0x2ac6e
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
subq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x2acb2
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rcx
subq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x2acb0
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
callq 0x19a60
movq (%rsp), %rdi
movq %rax, %rdx
movl $0x3, %esi
callq 0x18460
movl %eax, 0x34(%rsp)
jmp 0x2acd6
jmp 0x2acb2
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rsi
addq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x19860
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: GetBufferMemoryRequirements
static int GetBufferMemoryRequirements(lua_State *L)
    {
    ud_t *ud;
    VkBuffer buffer = checkbuffer(L, 1, &ud);
    VkDevice device = ud->device;
    VkMemoryRequirements req;

    if(ud->ddt->GetBufferMemoryRequirements2)
        return GetBufferMemoryRequirements2(L, buffer, ud);

    ud->ddt->GetBufferMemoryRequirements(device, buffer, &req);
    zpushVkMemoryRequirements(L, &req);
    return 1;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x30(%rsp), %rdx
leaq 0xa4301(%rip), %rcx     # 0xcf000
callq 0x1a640
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4b0(%rax)
je 0x2ad44
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x2bdc0
movl %eax, 0x44(%rsp)
jmp 0x2ad79
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x70(%rax), %rax
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq *%rax
movq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x19730
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: stetre[P]moonvulkan/src/device_memory.c
// Function: GetImageMemoryRequirements
static int GetImageMemoryRequirements(lua_State *L)
    {
    ud_t *ud;
    VkImage image = checkimage(L, 1, &ud);
    VkDevice device = ud->device;
    VkMemoryRequirements req;
    if(ud->ddt->GetImageMemoryRequirements2)
        return GetImageMemoryRequirements2(L, image, ud);
    ud->ddt->GetImageMemoryRequirements(device, image, &req);
    zpushVkMemoryRequirements(L, &req);
    return 1;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x30(%rsp), %rdx
leaq 0xa4beb(%rip), %rcx     # 0xcf99a
callq 0x1a640
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4a8(%rax)
je 0x2adf4
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x2bfc0
movl %eax, 0x44(%rsp)
jmp 0x2ae29
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x78(%rax), %rax
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq *%rax
movq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x19730
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)