// File: stetre[P]moonvulkan/src/flags.c
// Function: checksubgroupfeatureflags
static VkFlags checksubgroupfeatureflags(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_SUBGROUP_FEATURE_BASIC_BIT, "basic");
        CASE(VK_SUBGROUP_FEATURE_VOTE_BIT, "vote");
        CASE(VK_SUBGROUP_FEATURE_ARITHMETIC_BIT, "arithmetic");
        CASE(VK_SUBGROUP_FEATURE_BALLOT_BIT, "ballot");
        CASE(VK_SUBGROUP_FEATURE_SHUFFLE_BIT, "shuffle");
        CASE(VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT, "shuffle relative");
        CASE(VK_SUBGROUP_FEATURE_CLUSTERED_BIT, "clustered");
        CASE(VK_SUBGROUP_FEATURE_QUAD_BIT, "quad");
#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 0x4dc85
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 0x90ea1(%rip), %rsi     # 0xde9a9
callq 0x190a0
cmpl $0x0, %eax
jne 0x4db24
jmp 0x4db14
movl 0x14(%rsp), %eax
orl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90e7f(%rip), %rsi     # 0xde9af
callq 0x190a0
cmpl $0x0, %eax
jne 0x4db4c
jmp 0x4db3c
movl 0x14(%rsp), %eax
orl $0x2, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90e5c(%rip), %rsi     # 0xde9b4
callq 0x190a0
cmpl $0x0, %eax
jne 0x4db74
jmp 0x4db64
movl 0x14(%rsp), %eax
orl $0x4, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90e3f(%rip), %rsi     # 0xde9bf
callq 0x190a0
cmpl $0x0, %eax
jne 0x4db9c
jmp 0x4db8c
movl 0x14(%rsp), %eax
orl $0x8, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90e1e(%rip), %rsi     # 0xde9c6
callq 0x190a0
cmpl $0x0, %eax
jne 0x4dbc4
jmp 0x4dbb4
movl 0x14(%rsp), %eax
orl $0x10, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90dfe(%rip), %rsi     # 0xde9ce
callq 0x190a0
cmpl $0x0, %eax
jne 0x4dbec
jmp 0x4dbdc
movl 0x14(%rsp), %eax
orl $0x20, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90de7(%rip), %rsi     # 0xde9df
callq 0x190a0
cmpl $0x0, %eax
jne 0x4dc11
jmp 0x4dc04
movl 0x14(%rsp), %eax
orl $0x40, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
movq 0x18(%rsp), %rdi
leaq 0x90dcc(%rip), %rsi     # 0xde9e9
callq 0x190a0
cmpl $0x0, %eax
jne 0x4dc38
jmp 0x4dc29
movl 0x14(%rsp), %eax
orl $0x80, %eax
movl %eax, 0x14(%rsp)
jmp 0x4dc80
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 0x83d6e(%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 0x4dc8d
jmp 0x4dac5
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)