// File: stetre[P]moonvulkan/src/flags.c
// Function: checkpipelinestageflags
static VkFlags64 checkpipelinestageflags(lua_State *L, int arg)
    {
    const char *s;
    VkFlags64 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_STAGE_TOP_OF_PIPE_BIT, "top of pipe");
        CASE(VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, "draw indirect");
        CASE(VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, "vertex input");
        CASE(VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, "vertex shader");
        CASE(VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT, "tessellation control shader");
        CASE(VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT, "tessellation evaluation shader");
        CASE(VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT, "geometry shader");
        CASE(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, "fragment shader");
        CASE(VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, "early fragment tests");
        CASE(VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, "late fragment tests");
        CASE(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, "color attachment output");
        CASE(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, "compute shader");
        CASE(VK_PIPELINE_STAGE_TRANSFER_BIT, "transfer");
        CASE(VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, "bottom of pipe");
        CASE(VK_PIPELINE_STAGE_HOST_BIT, "host");
        CASE(VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT, "conditional rendering");
        CASE(VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT, "transform feedback");
        CASE(VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT, "fragment density process");
        CASE(VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT, "acceleration structure build");
        CASE(VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT, "ray tracing shader");
        CASE(VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT, "fragment shading rate attachment");
        CASE(VK_PIPELINE_STAGE_NONE, "none");
        CASE(VK_PIPELINE_STAGE_COPY_BIT, "copy");
        CASE(VK_PIPELINE_STAGE_RESOLVE_BIT, "resolve");
        CASE(VK_PIPELINE_STAGE_BLIT_BIT, "blit");
        CASE(VK_PIPELINE_STAGE_CLEAR_BIT, "clear");
        CASE(VK_PIPELINE_STAGE_INDEX_INPUT_BIT, "index input");
        CASE(VK_PIPELINE_STAGE_VERTEX_ATTRIBUTE_INPUT_BIT, "vertex attribute input");
        CASE(VK_PIPELINE_STAGE_PRE_RASTERIZATION_SHADERS_BIT, "pre rasterization shaders");
    // These are not individual bits:
        CASE(VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "all graphics");
        CASE(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, "all commands");
#undef CASE
        return (VkFlags64)luaL_argerror(L, --arg, badvalue(L,s));
        done: ;
        }

    return flags;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x1a7a0
cmpl $0x0, %eax
je 0x4b904
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 0x93110(%rip), %rsi     # 0xde459
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b368
jmp 0x4b355
movq 0x10(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x930f1(%rip), %rsi     # 0xde465
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b393
jmp 0x4b380
movq 0x10(%rsp), %rax
orq $0x2, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x8b4ea(%rip), %rsi     # 0xd6889
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b3be
jmp 0x4b3ab
movq 0x10(%rsp), %rax
orq $0x4, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x930a9(%rip), %rsi     # 0xde473
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b3e9
jmp 0x4b3d6
movq 0x10(%rsp), %rax
orq $0x8, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x9308c(%rip), %rsi     # 0xde481
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b414
jmp 0x4b401
movq 0x10(%rsp), %rax
orq $0x10, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x9307d(%rip), %rsi     # 0xde49d
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b43f
jmp 0x4b42c
movq 0x10(%rsp), %rax
orq $0x20, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x93071(%rip), %rsi     # 0xde4bc
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b46a
jmp 0x4b457
movq 0x10(%rsp), %rax
orq $0x40, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x93056(%rip), %rsi     # 0xde4cc
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b497
jmp 0x4b482
movq 0x10(%rsp), %rax
orq $0x80, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x93039(%rip), %rsi     # 0xde4dc
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b4c4
jmp 0x4b4af
movq 0x10(%rsp), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x93021(%rip), %rsi     # 0xde4f1
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b4f1
jmp 0x4b4dc
movq 0x10(%rsp), %rax
orq $0x200, %rax            # imm = 0x200
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x93008(%rip), %rsi     # 0xde505
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b51e
jmp 0x4b509
movq 0x10(%rsp), %rax
orq $0x400, %rax            # imm = 0x400
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92ff3(%rip), %rsi     # 0xde51d
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b54b
jmp 0x4b536
movq 0x10(%rsp), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92fd5(%rip), %rsi     # 0xde52c
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b578
jmp 0x4b563
movq 0x10(%rsp), %rax
orq $0x1000, %rax           # imm = 0x1000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92fb1(%rip), %rsi     # 0xde535
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b5a5
jmp 0x4b590
movq 0x10(%rsp), %rax
orq $0x2000, %rax           # imm = 0x2000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x8de17(%rip), %rsi     # 0xd93c8
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b5d2
jmp 0x4b5bd
movq 0x10(%rsp), %rax
orq $0x4000, %rax           # imm = 0x4000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92b95(%rip), %rsi     # 0xde173
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b5ff
jmp 0x4b5ea
movq 0x10(%rsp), %rax
orq $0x40000, %rax          # imm = 0x40000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92f39(%rip), %rsi     # 0xde544
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b62c
jmp 0x4b617
movq 0x10(%rsp), %rax
orq $0x1000000, %rax        # imm = 0x1000000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92f1f(%rip), %rsi     # 0xde557
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b659
jmp 0x4b644
movq 0x10(%rsp), %rax
orq $0x800000, %rax         # imm = 0x800000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92f0b(%rip), %rsi     # 0xde570
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b686
jmp 0x4b671
movq 0x10(%rsp), %rax
orq $0x2000000, %rax        # imm = 0x2000000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92efb(%rip), %rsi     # 0xde58d
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b6b3
jmp 0x4b69e
movq 0x10(%rsp), %rax
orq $0x200000, %rax         # imm = 0x200000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92ee1(%rip), %rsi     # 0xde5a0
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b6e0
jmp 0x4b6cb
movq 0x10(%rsp), %rax
orq $0x400000, %rax         # imm = 0x400000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x9d1ca(%rip), %rsi     # 0xe88b6
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b70b
jmp 0x4b6f8
movq 0x10(%rsp), %rax
orq $0x0, %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x8a384(%rip), %rsi     # 0xd5a9b
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b73c
jmp 0x4b723
movabsq $0x100000000, %rax      # imm = 0x100000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x9d17f(%rip), %rsi     # 0xe88c7
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b76d
jmp 0x4b754
movabsq $0x200000000, %rax      # imm = 0x200000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92e48(%rip), %rsi     # 0xde5c1
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b79e
jmp 0x4b785
movabsq $0x400000000, %rax      # imm = 0x400000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x8a2ae(%rip), %rsi     # 0xd5a58
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b7cf
jmp 0x4b7b6
movabsq $0x800000000, %rax      # imm = 0x800000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92deb(%rip), %rsi     # 0xde5c6
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b800
jmp 0x4b7e7
movabsq $0x1000000000, %rax     # imm = 0x1000000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92dc6(%rip), %rsi     # 0xde5d2
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b831
jmp 0x4b818
movabsq $0x2000000000, %rax     # imm = 0x2000000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92dac(%rip), %rsi     # 0xde5e9
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b862
jmp 0x4b849
movabsq $0x4000000000, %rax     # imm = 0x4000000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x926f7(%rip), %rsi     # 0xddf65
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b88c
jmp 0x4b87a
movq 0x10(%rsp), %rax
orq $0x8000, %rax           # imm = 0x8000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x18(%rsp), %rdi
leaq 0x92d6b(%rip), %rsi     # 0xde603
callq 0x190a0
cmpl $0x0, %eax
jne 0x4b8b6
jmp 0x4b8a4
movq 0x10(%rsp), %rax
orq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x10(%rsp)
jmp 0x4b8ff
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movl 0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x860f1(%rip), %rsi     # 0xd19d0
movb $0x0, %al
callq 0x18f50
movq (%rsp), %rdi
movl 0xc(%rsp), %esi
movq %rax, %rdx
callq 0x18460
cltq
movq %rax, 0x30(%rsp)
jmp 0x4b90e
jmp 0x4b306
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)