// File: stetre[P]moonvulkan/src/flags.c
// Function: checkformatfeatureflags
static VkFlags64 checkformatfeatureflags(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_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, "sampled image");
        CASE(VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, "storage image");
        CASE(VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT, "storage image atomic");
        CASE(VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT, "uniform texel buffer");
        CASE(VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT, "storage texel buffer");
        CASE(VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT, "storage texel buffer atomic");
        CASE(VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT, "vertex buffer");
        CASE(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, "color attachment");
        CASE(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, "color attachment blend");
        CASE(VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, "depth stencil attachment");
        CASE(VK_FORMAT_FEATURE_BLIT_SRC_BIT, "blit src");
        CASE(VK_FORMAT_FEATURE_BLIT_DST_BIT, "blit dst");
        CASE(VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, "transfer src");
        CASE(VK_FORMAT_FEATURE_TRANSFER_DST_BIT, "transfer dst");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "sampled image filter linear");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT, "sampled image filter minmax");
        CASE(VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT,"midpoint chroma samples");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT,"sampled image ycbcr conversion linear filter");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT,"sampled image ycbcr conversion separate reconstruction filter");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT,"sampled image ycbcr conversion chroma reconstruction explicit");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT,"sampled image ycbcr conversion chroma reconstruction explicit forceable");
        CASE(VK_FORMAT_FEATURE_DISJOINT_BIT,"disjoint");
        CASE(VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT,"cosited chroma samples");
        CASE(VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT, "fragment density map");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT, "sampled image filter cubic");
        CASE(VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT, "acceleration structure vertex buffer");
        CASE(VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT, "fragment shading rate attachment");
        CASE(VK_FORMAT_FEATURE_STORAGE_READ_WITHOUT_FORMAT_BIT, "storage read without format");
        CASE(VK_FORMAT_FEATURE_STORAGE_WRITE_WITHOUT_FORMAT_BIT, "storage write without format");
        CASE(VK_FORMAT_FEATURE_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT, "sampled image depth comparison");
#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 0x4d7f9
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 0x89aa3(%rip), %rsi     # 0xd6d1c
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d298
jmp 0x4d285
movq 0x10(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x89aa4(%rip), %rsi     # 0xd6d48
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d2c3
jmp 0x4d2b0
movq 0x10(%rsp), %rax
orq $0x2, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91490(%rip), %rsi     # 0xde75f
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d2ee
jmp 0x4d2db
movq 0x10(%rsp), %rax
orq $0x4, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x89a7a(%rip), %rsi     # 0xd6d74
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d319
jmp 0x4d306
movq 0x10(%rsp), %rax
orq $0x8, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x89a89(%rip), %rsi     # 0xd6dae
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d344
jmp 0x4d331
movq 0x10(%rsp), %rax
orq $0x10, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91424(%rip), %rsi     # 0xde774
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d36f
jmp 0x4d35c
movq 0x10(%rsp), %rax
orq $0x20, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x915c8(%rip), %rsi     # 0xde943
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d39a
jmp 0x4d387
movq 0x10(%rsp), %rax
orq $0x40, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91365(%rip), %rsi     # 0xde70b
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d3c7
jmp 0x4d3b2
movq 0x10(%rsp), %rax
orq $0x80, %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x913bd(%rip), %rsi     # 0xde790
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d3f4
jmp 0x4d3df
movq 0x10(%rsp), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x9131c(%rip), %rsi     # 0xde71c
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d421
jmp 0x4d40c
movq 0x10(%rsp), %rax
orq $0x200, %rax            # imm = 0x200
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x9137a(%rip), %rsi     # 0xde7a7
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d44e
jmp 0x4d439
movq 0x10(%rsp), %rax
orq $0x400, %rax            # imm = 0x400
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91356(%rip), %rsi     # 0xde7b0
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d47b
jmp 0x4d466
movq 0x10(%rsp), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x90cb5(%rip), %rsi     # 0xde13c
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d4a8
jmp 0x4d493
movq 0x10(%rsp), %rax
orq $0x4000, %rax           # imm = 0x4000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x90c95(%rip), %rsi     # 0xde149
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d4d5
jmp 0x4d4c0
movq 0x10(%rsp), %rax
orq $0x8000, %rax           # imm = 0x8000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912d8(%rip), %rsi     # 0xde7b9
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d502
jmp 0x4d4ed
movq 0x10(%rsp), %rax
orq $0x1000, %rax           # imm = 0x1000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912c7(%rip), %rsi     # 0xde7d5
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d52f
jmp 0x4d51a
movq 0x10(%rsp), %rax
orq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912b6(%rip), %rsi     # 0xde7f1
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d55c
jmp 0x4d547
movq 0x10(%rsp), %rax
orq $0x20000, %rax          # imm = 0x20000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912a1(%rip), %rsi     # 0xde809
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d589
jmp 0x4d574
movq 0x10(%rsp), %rax
orq $0x40000, %rax          # imm = 0x40000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912a1(%rip), %rsi     # 0xde836
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d5b6
jmp 0x4d5a1
movq 0x10(%rsp), %rax
orq $0x80000, %rax          # imm = 0x80000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912b2(%rip), %rsi     # 0xde874
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d5e3
jmp 0x4d5ce
movq 0x10(%rsp), %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912c3(%rip), %rsi     # 0xde8b2
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d610
jmp 0x4d5fb
movq 0x10(%rsp), %rax
orq $0x200000, %rax         # imm = 0x200000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x8a73b(%rip), %rsi     # 0xd7d57
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d63d
jmp 0x4d628
movq 0x10(%rsp), %rax
orq $0x400000, %rax         # imm = 0x400000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x912b1(%rip), %rsi     # 0xde8fa
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d66a
jmp 0x4d655
movq 0x10(%rsp), %rax
orq $0x800000, %rax         # imm = 0x800000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x910d4(%rip), %rsi     # 0xde74a
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d697
jmp 0x4d682
movq 0x10(%rsp), %rax
orq $0x1000000, %rax        # imm = 0x1000000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x9126e(%rip), %rsi     # 0xde911
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d6c4
jmp 0x4d6af
movq 0x10(%rsp), %rax
orq $0x2000, %rax           # imm = 0x2000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x9125c(%rip), %rsi     # 0xde92c
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d6f1
jmp 0x4d6dc
movq 0x10(%rsp), %rax
orq $0x20000000, %rax       # imm = 0x20000000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x90ea3(%rip), %rsi     # 0xde5a0
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d71e
jmp 0x4d709
movq 0x10(%rsp), %rax
orq $0x40000000, %rax       # imm = 0x40000000
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91227(%rip), %rsi     # 0xde951
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d74f
jmp 0x4d736
movabsq $0x80000000, %rax       # imm = 0x80000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91212(%rip), %rsi     # 0xde96d
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d77d
jmp 0x4d767
movabsq $0x100000000, %rax      # imm = 0x100000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
movq 0x18(%rsp), %rdi
leaq 0x91201(%rip), %rsi     # 0xde98a
callq 0x190a0
cmpl $0x0, %eax
jne 0x4d7ab
jmp 0x4d795
movabsq $0x200000000, %rax      # imm = 0x200000000
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x4d7f4
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 0x841fc(%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 0x4d803
jmp 0x4d236
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)