// File: stetre[P]moonvulkan/src/versions.c
// Function: AddVersions
static int AddVersions(lua_State *L)
    {
    int i = 0;
    lua_pushstring(L, "_VERSION");
    lua_pushstring(L, "MoonVulkan "MOONVULKAN_VERSION);
    lua_settable(L, -3);

    lua_pushstring(L, "HEADER_VERSION");
    lua_pushinteger(L, VK_HEADER_VERSION);
    lua_settable(L, -3);

    /* supported versions --------------------------- */
    lua_pushstring(L, "API_VERSIONS");
    lua_newtable(L);
#define ADD(ver) do {           \
    lua_pushstring(L, ""#ver);  \
    lua_rawseti(L, -2, ++i);    \
    lua_pushstring(L, ""#ver);  \
    lua_pushinteger(L, VK_##ver);\
    lua_settable(L, -5);        \
} while(0)

#ifdef VK_API_VERSION_1_0
    ADD(API_VERSION_1_0);
#endif
#ifdef VK_API_VERSION_1_1
    ADD(API_VERSION_1_1);
#endif
#ifdef VK_API_VERSION_1_2
    ADD(API_VERSION_1_2);
#endif
/* @@ Add future versions like so:
#ifdef VK_API_VERSION_2_0
    ADD(API_VERSION_2_0);
#endif
...
*/
    lua_settable(L, -3);
#undef ADD
    return 0;
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x797ce(%rip), %rsi     # 0xe3d5b
callq 0x1a420
movq 0x10(%rsp), %rdi
leaq 0x797a8(%rip), %rsi     # 0xe3d46
callq 0x1a420
movq 0x10(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x19420
movq 0x10(%rsp), %rdi
leaq 0x79797(%rip), %rsi     # 0xe3d55
callq 0x1a420
movq 0x10(%rsp), %rdi
movl $0xc6, %esi
callq 0x18be0
movq 0x10(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x19420
movq 0x10(%rsp), %rdi
leaq 0x79777(%rip), %rsi     # 0xe3d64
callq 0x1a420
movq 0x10(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x18830
movq 0x10(%rsp), %rdi
leaq 0x79765(%rip), %rsi     # 0xe3d71
callq 0x1a420
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movq 0x10(%rsp), %rdi
leaq 0x79737(%rip), %rsi     # 0xe3d71
callq 0x1a420
movq 0x10(%rsp), %rdi
movl $0x400000, %esi         # imm = 0x400000
callq 0x18be0
movq 0x10(%rsp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x19420
jmp 0x6a65f
movq 0x10(%rsp), %rdi
leaq 0x79716(%rip), %rsi     # 0xe3d81
callq 0x1a420
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movq 0x10(%rsp), %rdi
leaq 0x796e8(%rip), %rsi     # 0xe3d81
callq 0x1a420
movq 0x10(%rsp), %rdi
movl $0x401000, %esi         # imm = 0x401000
callq 0x18be0
movq 0x10(%rsp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x19420
jmp 0x6a6be
movq 0x10(%rsp), %rdi
leaq 0x796c7(%rip), %rsi     # 0xe3d91
callq 0x1a420
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x191e0
movq 0x10(%rsp), %rdi
leaq 0x79699(%rip), %rsi     # 0xe3d91
callq 0x1a420
movq 0x10(%rsp), %rdi
movl $0x402000, %esi         # imm = 0x402000
callq 0x18be0
movq 0x10(%rsp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x19420
movq 0x10(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x19420
xorl %eax, %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)