// File: stetre[P]moonvulkan/src/flags.c
// Function: checkpipelinecreateflags
static VkFlags checkpipelinecreateflags(lua_State *L, int arg)
    {
    const char *s;
    VkFlags flags = 0;

    while(lua_isstring(L, arg))
        {
        s = lua_tostring(L, arg++);
#define CASE(CODE,str) if((strcmp(s, str)==0)) do { flags |= CODE; goto done; } while(0)
    CASE(VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, "disable optimization");
    CASE(VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, "allow derivatives");
    CASE(VK_PIPELINE_CREATE_DERIVATIVE_BIT, "derivative");
    CASE(VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, "view index from device index");
    CASE(VK_PIPELINE_CREATE_DISPATCH_BASE, "dispatch base");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT, "ray tracing no null any hit shaders");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT, "ray tracing no null closest hit shaders");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT, "ray tracing no null miss shaders");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT, "ray tracing no null intersection shaders");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT, "ray tracing skip triangles");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT, "ray tracing skip aabbs");
    CASE(VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT, "ray tracing shader group handle capture replay");
    CASE(VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT, "capture statistics");
    CASE(VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT, "capture internal representations");
    CASE(VK_PIPELINE_CREATE_LIBRARY_BIT, "library");
    CASE(VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT, "fail on pipeline compile required");
    CASE(VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT, "early return on failure");
#undef CASE
        return (VkFlags)luaL_argerror(L, --arg, badvalue(L,s));
        done: ;
        }

    return flags;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a7a0
cmpl $0x0, %eax
je 0x494f1
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x94d7a(%rip), %rsi     # 0xddf72
callq 0x190a0
cmpl $0x0, %eax
jne 0x49214
jmp 0x49204
movl 0x14(%rsp), %eax
orl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d67(%rip), %rsi     # 0xddf87
callq 0x190a0
cmpl $0x0, %eax
jne 0x4923c
jmp 0x4922c
movl 0x14(%rsp), %eax
orl $0x2, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d51(%rip), %rsi     # 0xddf99
callq 0x190a0
cmpl $0x0, %eax
jne 0x49264
jmp 0x49254
movl 0x14(%rsp), %eax
orl $0x4, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d34(%rip), %rsi     # 0xddfa4
callq 0x190a0
cmpl $0x0, %eax
jne 0x4928c
jmp 0x4927c
movl 0x14(%rsp), %eax
orl $0x8, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d29(%rip), %rsi     # 0xddfc1
callq 0x190a0
cmpl $0x0, %eax
jne 0x492b4
jmp 0x492a4
movl 0x14(%rsp), %eax
orl $0x10, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d0f(%rip), %rsi     # 0xddfcf
callq 0x190a0
cmpl $0x0, %eax
jne 0x492de
jmp 0x492cc
movl 0x14(%rsp), %eax
orl $0x4000, %eax           # imm = 0x4000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d09(%rip), %rsi     # 0xddff3
callq 0x190a0
cmpl $0x0, %eax
jne 0x49308
jmp 0x492f6
movl 0x14(%rsp), %eax
orl $0x8000, %eax           # imm = 0x8000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94d07(%rip), %rsi     # 0xde01b
callq 0x190a0
cmpl $0x0, %eax
jne 0x49332
jmp 0x49320
movl 0x14(%rsp), %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94cfe(%rip), %rsi     # 0xde03c
callq 0x190a0
cmpl $0x0, %eax
jne 0x4935c
jmp 0x4934a
movl 0x14(%rsp), %eax
orl $0x20000, %eax          # imm = 0x20000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94cfd(%rip), %rsi     # 0xde065
callq 0x190a0
cmpl $0x0, %eax
jne 0x49386
jmp 0x49374
movl 0x14(%rsp), %eax
orl $0x1000, %eax           # imm = 0x1000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94cee(%rip), %rsi     # 0xde080
callq 0x190a0
cmpl $0x0, %eax
jne 0x493b0
jmp 0x4939e
movl 0x14(%rsp), %eax
orl $0x2000, %eax           # imm = 0x2000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94cdb(%rip), %rsi     # 0xde097
callq 0x190a0
cmpl $0x0, %eax
jne 0x493da
jmp 0x493c8
movl 0x14(%rsp), %eax
orl $0x80000, %eax          # imm = 0x80000
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94ce0(%rip), %rsi     # 0xde0c6
callq 0x190a0
cmpl $0x0, %eax
jne 0x49402
jmp 0x493f2
movl 0x14(%rsp), %eax
orl $0x40, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94ccb(%rip), %rsi     # 0xde0d9
callq 0x190a0
cmpl $0x0, %eax
jne 0x4942c
jmp 0x4941a
movl 0x14(%rsp), %eax
orl $0x80, %eax
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94cc2(%rip), %rsi     # 0xde0fa
callq 0x190a0
cmpl $0x0, %eax
jne 0x49456
jmp 0x49444
movl 0x14(%rsp), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94ca0(%rip), %rsi     # 0xde102
callq 0x190a0
cmpl $0x0, %eax
jne 0x4947d
jmp 0x4946e
movl 0x14(%rsp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x18(%rsp), %rdi
leaq 0x94c9b(%rip), %rsi     # 0xde124
callq 0x190a0
cmpl $0x0, %eax
jne 0x494a4
jmp 0x49495
movl 0x14(%rsp), %eax
orl $0x200, %eax            # imm = 0x200
movl %eax, 0x14(%rsp)
jmp 0x494ec
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x88502(%rip), %rsi     # 0xd19d0
movb $0x0, %al
callq 0x18f50
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
movq %rax, %rdx
callq 0x18460
movl %eax, 0x34(%rsp)
jmp 0x494f9
jmp 0x491b5
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)