// File: stetre[P]moonvulkan/src/flags.c
// Function: checkquerypipelinestatisticflags
static VkFlags checkquerypipelinestatisticflags(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_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT, "input assembly vertices");
    CASE(VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT, "input assembly primitives");
    CASE(VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, "vertex shader invocations");
    CASE(VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT, "geometry shader invocations");
    CASE(VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT, "geometry shader primitives");
    CASE(VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT, "clipping invocations");
    CASE(VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT, "clipping primitives");
    CASE(VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, "fragment shader invocations");
    CASE(VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT, "tessellation control shader patches");
    CASE(VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT, "tessellation evaluation shader invocations");
    CASE(VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT, "compute shader invocations");
#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 0x4a433
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 0x9406b(%rip), %rsi     # 0xde2a3
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a254
jmp 0x4a244
movl 0x14(%rsp), %eax
orl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x9405b(%rip), %rsi     # 0xde2bb
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a27c
jmp 0x4a26c
movl 0x14(%rsp), %eax
orl $0x2, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x9404d(%rip), %rsi     # 0xde2d5
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a2a4
jmp 0x4a294
movl 0x14(%rsp), %eax
orl $0x4, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x9403f(%rip), %rsi     # 0xde2ef
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a2cc
jmp 0x4a2bc
movl 0x14(%rsp), %eax
orl $0x8, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x94033(%rip), %rsi     # 0xde30b
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a2f4
jmp 0x4a2e4
movl 0x14(%rsp), %eax
orl $0x10, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x94026(%rip), %rsi     # 0xde326
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a31c
jmp 0x4a30c
movl 0x14(%rsp), %eax
orl $0x20, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x94013(%rip), %rsi     # 0xde33b
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a344
jmp 0x4a334
movl 0x14(%rsp), %eax
orl $0x40, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x93fff(%rip), %rsi     # 0xde34f
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a36e
jmp 0x4a35c
movl 0x14(%rsp), %eax
orl $0x80, %eax
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x93ff1(%rip), %rsi     # 0xde36b
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a398
jmp 0x4a386
movl 0x14(%rsp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x93feb(%rip), %rsi     # 0xde38f
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a3bf
jmp 0x4a3b0
movl 0x14(%rsp), %eax
orl $0x200, %eax            # imm = 0x200
movl %eax, 0x14(%rsp)
jmp 0x4a42e
movq 0x18(%rsp), %rdi
leaq 0x93fef(%rip), %rsi     # 0xde3ba
callq 0x190a0
cmpl $0x0, %eax
jne 0x4a3e6
jmp 0x4a3d7
movl 0x14(%rsp), %eax
orl $0x400, %eax            # imm = 0x400
movl %eax, 0x14(%rsp)
jmp 0x4a42e
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 0x875c0(%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 0x4a43b
jmp 0x4a1f5
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)