// File: stetre[P]moonvulkan/src/flags.c
// Function: pushbufferusageflags
static int pushbufferusageflags(lua_State *L, VkFlags flags)
    {
    int n = 0;

#define CASE(CODE,str) do { if( flags & CODE) { lua_pushstring(L, str); n++; } } while(0)
    CASE(VK_BUFFER_USAGE_TRANSFER_SRC_BIT, "transfer src");
    CASE(VK_BUFFER_USAGE_TRANSFER_DST_BIT, "transfer dst");
    CASE(VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, "uniform texel buffer");
    CASE(VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, "storage texel buffer");
    CASE(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, "uniform buffer");
    CASE(VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, "storage buffer");
    CASE(VK_BUFFER_USAGE_INDEX_BUFFER_BIT, "index buffer");
    CASE(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, "vertex buffer");
    CASE(VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, "indirect buffer");
    CASE(VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT, "conditional rendering");
    CASE(VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT, "transform feedback buffer");
    CASE(VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT, "transform feedback counter buffer");
    CASE(VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, "shader device address");
    CASE(VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT, "acceleration structure build input read only");
    CASE(VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT, "acceleration structure storage");
    CASE(VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT, "shader binding table");
#undef CASE

    return n;
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0xc(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4954d
movq 0x10(%rsp), %rdi
leaq 0x94bff(%rip), %rsi     # 0xde13c
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4954f
jmp 0x49551
movl 0xc(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x49579
movq 0x10(%rsp), %rdi
leaq 0x94be0(%rip), %rsi     # 0xde149
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4957b
jmp 0x4957d
movl 0xc(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x495a5
movq 0x10(%rsp), %rdi
leaq 0x8d7df(%rip), %rsi     # 0xd6d74
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x495a7
jmp 0x495a9
movl 0xc(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x495d1
movq 0x10(%rsp), %rdi
leaq 0x8d7ed(%rip), %rsi     # 0xd6dae
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x495d3
jmp 0x495d5
movl 0xc(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x495fd
movq 0x10(%rsp), %rdi
leaq 0x8d7fb(%rip), %rsi     # 0xd6de8
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x495ff
jmp 0x49601
movl 0xc(%rsp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x49629
movq 0x10(%rsp), %rdi
leaq 0x8d7fd(%rip), %rsi     # 0xd6e16
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4962b
jmp 0x4962d
movl 0xc(%rsp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x49655
movq 0x10(%rsp), %rdi
leaq 0x94b11(%rip), %rsi     # 0xde156
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x49657
jmp 0x49659
movl 0xc(%rsp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x49683
movq 0x10(%rsp), %rdi
leaq 0x952d0(%rip), %rsi     # 0xde943
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x49685
jmp 0x49687
movl 0xc(%rsp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x496b1
movq 0x10(%rsp), %rdi
leaq 0x94ac2(%rip), %rsi     # 0xde163
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x496b3
jmp 0x496b5
movl 0xc(%rsp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x496df
movq 0x10(%rsp), %rdi
leaq 0x94aa4(%rip), %rsi     # 0xde173
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x496e1
jmp 0x496e3
movl 0xc(%rsp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4970d
movq 0x10(%rsp), %rdi
leaq 0x94a8c(%rip), %rsi     # 0xde189
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4970f
jmp 0x49711
movl 0xc(%rsp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x4973b
movq 0x10(%rsp), %rdi
leaq 0x94a78(%rip), %rsi     # 0xde1a3
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4973d
jmp 0x4973f
movl 0xc(%rsp), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x49769
movq 0x10(%rsp), %rdi
leaq 0x94a6c(%rip), %rsi     # 0xde1c5
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4976b
jmp 0x4976d
movl 0xc(%rsp), %eax
andl $0x80000, %eax          # imm = 0x80000
cmpl $0x0, %eax
je 0x49797
movq 0x10(%rsp), %rdi
leaq 0x94a54(%rip), %rsi     # 0xde1db
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x49799
jmp 0x4979b
movl 0xc(%rsp), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
je 0x497c5
movq 0x10(%rsp), %rdi
leaq 0x94a53(%rip), %rsi     # 0xde208
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x497c7
jmp 0x497c9
movl 0xc(%rsp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x497f3
movq 0x10(%rsp), %rdi
leaq 0x94a44(%rip), %rsi     # 0xde227
callq 0x1a420
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x497f5
movl 0x8(%rsp), %eax
addq $0x18, %rsp
retq
nop