// File: stetre[P]moonvulkan/src/flags.c
// Function: checkaccessflags
static VkFlags64 checkaccessflags(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_ACCESS_INDIRECT_COMMAND_READ_BIT, "indirect command read");
    CASE(VK_ACCESS_INDEX_READ_BIT, "index read");
    CASE(VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, "vertex attribute read");
    CASE(VK_ACCESS_UNIFORM_READ_BIT, "uniform read");
    CASE(VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, "input attachment read");
    CASE(VK_ACCESS_SHADER_READ_BIT, "shader read");
    CASE(VK_ACCESS_SHADER_WRITE_BIT, "shader write");
    CASE(VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, "color attachment read");
    CASE(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "color attachment write");
    CASE(VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, "depth stencil attachment read");
    CASE(VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, "depth stencil attachment write");
    CASE(VK_ACCESS_TRANSFER_READ_BIT, "transfer read");
    CASE(VK_ACCESS_TRANSFER_WRITE_BIT, "transfer write");
    CASE(VK_ACCESS_HOST_READ_BIT, "host read");
    CASE(VK_ACCESS_HOST_WRITE_BIT, "host write");
    CASE(VK_ACCESS_MEMORY_READ_BIT, "memory read");
    CASE(VK_ACCESS_MEMORY_WRITE_BIT, "memory write");
    CASE(VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT, "color attachment read noncoherent");
    CASE(VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT, "conditional rendering read");
    CASE(VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT, "transform feedback write");
    CASE(VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT, "transform feedback counter read");
    CASE(VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT, "transform feedback counter write");
    CASE(VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT, "fragment density map read");
    CASE(VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT, "acceleration structure read");
    CASE(VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT, "acceleration structure write");
    CASE(VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT, "fragment shading rate attachment read");
    CASE(VK_ACCESS_NONE, "none");
    CASE(VK_ACCESS_SHADER_SAMPLED_READ_BIT, "shader sampled read");
    CASE(VK_ACCESS_SHADER_STORAGE_READ_BIT, "shader storage read");
    CASE(VK_ACCESS_SHADER_STORAGE_WRITE_BIT, "shader storage write");
#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 0x48127
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 0x9609c(%rip), %rsi     # 0xddc45
callq 0x190a0
cmpl $0x0, %eax
jne 0x47bc8
jmp 0x47bb5
movq 0x10(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x96087(%rip), %rsi     # 0xddc5b
callq 0x190a0
cmpl $0x0, %eax
jne 0x47bf3
jmp 0x47be0
movq 0x10(%rsp), %rax
orq $0x2, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x96067(%rip), %rsi     # 0xddc66
callq 0x190a0
cmpl $0x0, %eax
jne 0x47c1e
jmp 0x47c0b
movq 0x10(%rsp), %rax
orq $0x4, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x96052(%rip), %rsi     # 0xddc7c
callq 0x190a0
cmpl $0x0, %eax
jne 0x47c49
jmp 0x47c36
movq 0x10(%rsp), %rax
orq $0x8, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x96034(%rip), %rsi     # 0xddc89
callq 0x190a0
cmpl $0x0, %eax
jne 0x47c74
jmp 0x47c61
movq 0x10(%rsp), %rax
orq $0x10, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x9601f(%rip), %rsi     # 0xddc9f
callq 0x190a0
cmpl $0x0, %eax
jne 0x47c9f
jmp 0x47c8c
movq 0x10(%rsp), %rax
orq $0x20, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x96000(%rip), %rsi     # 0xddcab
callq 0x190a0
cmpl $0x0, %eax
jne 0x47cca
jmp 0x47cb7
movq 0x10(%rsp), %rax
orq $0x40, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95fe2(%rip), %rsi     # 0xddcb8
callq 0x190a0
cmpl $0x0, %eax
jne 0x47cf7
jmp 0x47ce2
movq 0x10(%rsp), %rax
orq $0x80, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95fcb(%rip), %rsi     # 0xddcce
callq 0x190a0
cmpl $0x0, %eax
jne 0x47d24
jmp 0x47d0f
movq 0x10(%rsp), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95fb5(%rip), %rsi     # 0xddce5
callq 0x190a0
cmpl $0x0, %eax
jne 0x47d51
jmp 0x47d3c
movq 0x10(%rsp), %rax
orq $0x200, %rax            # imm = 0x200
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95fa6(%rip), %rsi     # 0xddd03
callq 0x190a0
cmpl $0x0, %eax
jne 0x47d7e
jmp 0x47d69
movq 0x10(%rsp), %rax
orq $0x400, %rax            # imm = 0x400
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95f98(%rip), %rsi     # 0xddd22
callq 0x190a0
cmpl $0x0, %eax
jne 0x47dab
jmp 0x47d96
movq 0x10(%rsp), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95f79(%rip), %rsi     # 0xddd30
callq 0x190a0
cmpl $0x0, %eax
jne 0x47dd8
jmp 0x47dc3
movq 0x10(%rsp), %rax
orq $0x1000, %rax           # imm = 0x1000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95f5b(%rip), %rsi     # 0xddd3f
callq 0x190a0
cmpl $0x0, %eax
jne 0x47e05
jmp 0x47df0
movq 0x10(%rsp), %rax
orq $0x2000, %rax           # imm = 0x2000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95f38(%rip), %rsi     # 0xddd49
callq 0x190a0
cmpl $0x0, %eax
jne 0x47e32
jmp 0x47e1d
movq 0x10(%rsp), %rax
orq $0x4000, %rax           # imm = 0x4000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95f16(%rip), %rsi     # 0xddd54
callq 0x190a0
cmpl $0x0, %eax
jne 0x47e5f
jmp 0x47e4a
movq 0x10(%rsp), %rax
orq $0x8000, %rax           # imm = 0x8000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95ef5(%rip), %rsi     # 0xddd60
callq 0x190a0
cmpl $0x0, %eax
jne 0x47e8c
jmp 0x47e77
movq 0x10(%rsp), %rax
orq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95ed5(%rip), %rsi     # 0xddd6d
callq 0x190a0
cmpl $0x0, %eax
jne 0x47eb9
jmp 0x47ea4
movq 0x10(%rsp), %rax
orq $0x80000, %rax          # imm = 0x80000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95eca(%rip), %rsi     # 0xddd8f
callq 0x190a0
cmpl $0x0, %eax
jne 0x47ee6
jmp 0x47ed1
movq 0x10(%rsp), %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95eb8(%rip), %rsi     # 0xdddaa
callq 0x190a0
cmpl $0x0, %eax
jne 0x47f13
jmp 0x47efe
movq 0x10(%rsp), %rax
orq $0x2000000, %rax        # imm = 0x2000000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95ea4(%rip), %rsi     # 0xdddc3
callq 0x190a0
cmpl $0x0, %eax
jne 0x47f40
jmp 0x47f2b
movq 0x10(%rsp), %rax
orq $0x4000000, %rax        # imm = 0x4000000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e97(%rip), %rsi     # 0xddde3
callq 0x190a0
cmpl $0x0, %eax
jne 0x47f6d
jmp 0x47f58
movq 0x10(%rsp), %rax
orq $0x8000000, %rax        # imm = 0x8000000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e8b(%rip), %rsi     # 0xdde04
callq 0x190a0
cmpl $0x0, %eax
jne 0x47f9a
jmp 0x47f85
movq 0x10(%rsp), %rax
orq $0x1000000, %rax        # imm = 0x1000000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e78(%rip), %rsi     # 0xdde1e
callq 0x190a0
cmpl $0x0, %eax
jne 0x47fc7
jmp 0x47fb2
movq 0x10(%rsp), %rax
orq $0x200000, %rax         # imm = 0x200000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e67(%rip), %rsi     # 0xdde3a
callq 0x190a0
cmpl $0x0, %eax
jne 0x47ff4
jmp 0x47fdf
movq 0x10(%rsp), %rax
orq $0x400000, %rax         # imm = 0x400000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e57(%rip), %rsi     # 0xdde57
callq 0x190a0
cmpl $0x0, %eax
jne 0x48021
jmp 0x4800c
movq 0x10(%rsp), %rax
orq $0x800000, %rax         # imm = 0x800000
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0xa0889(%rip), %rsi     # 0xe88b6
callq 0x190a0
cmpl $0x0, %eax
jne 0x4804c
jmp 0x48039
movq 0x10(%rsp), %rax
orq $0x0, %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e25(%rip), %rsi     # 0xdde7d
callq 0x190a0
cmpl $0x0, %eax
jne 0x4807d
jmp 0x48064
movabsq $0x100000000, %rax      # imm = 0x100000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95e08(%rip), %rsi     # 0xdde91
callq 0x190a0
cmpl $0x0, %eax
jne 0x480ab
jmp 0x48095
movabsq $0x200000000, %rax      # imm = 0x200000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
movq 0x18(%rsp), %rdi
leaq 0x95dee(%rip), %rsi     # 0xddea5
callq 0x190a0
cmpl $0x0, %eax
jne 0x480d9
jmp 0x480c3
movabsq $0x400000000, %rax      # imm = 0x400000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x48122
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 0x898ce(%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 0x48131
jmp 0x47b66
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)