// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/cmd.c
// Function: CmdSetVertexInput
static int CmdSetVertexInput(lua_State *L)
    {
    int err;
    ud_t *ud;
    uint32_t bcount, acount;
    const VkVertexInputBindingDescription2EXT *bdescr = NULL;
    const VkVertexInputAttributeDescription2EXT *adescr = NULL;
    VkCommandBuffer cb = checkcommand_buffer(L, 1, &ud);
    CheckDevicePfn(L, ud, CmdSetVertexInputEXT);
#define CLEANUP do {                                                                    \
    if(bdescr) zfreearrayVkVertexInputBindingDescription2EXT(L, bdescr, bcount, 1);     \
    if(adescr) zfreearrayVkVertexInputAttributeDescription2EXT(L, adescr, acount, 1);   \
} while(0)
    bdescr = zcheckarrayVkVertexInputBindingDescription2EXT(L, 2, &bcount, &err);
    if(err < 0 && err != ERR_EMPTY) { CLEANUP; return argerror(L, 2); }
    adescr = zcheckarrayVkVertexInputAttributeDescription2EXT(L, 3, &acount, &err);
    if(err < 0 && err != ERR_EMPTY) { CLEANUP; return argerror(L, 3); }
    ud->ddt->CmdSetVertexInputEXT(cb, bcount, bdescr, acount, adescr);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x6cb21(%rip), %rcx     # 0x8c909
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a4e0
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x810(%rax)
je 0x1fe78
leaq 0x4(%rsp), %rdx
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rcx
callq 0x19e20
movq %rax, %r14
movl (%r15), %eax
testl %eax, %eax
setns %cl
cmpl $-0x5, %eax
sete %al
orb %cl, %al
jne 0x1fe8e
testq %r14, %r14
je 0x1fe5c
movl 0x4(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x1ff13
leaq 0x6d30f(%rip), %rsi     # 0x8d18e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
jmp 0x1ff1b
leaq 0x8(%rsp), %rdx
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movl $0x3, %esi
movq %r13, %rcx
callq 0x18600
movq %rax, %r15
movl (%r13), %eax
testl %eax, %eax
setns %cl
cmpl $-0x5, %eax
sete %al
orb %cl, %al
jne 0x1ff2e
testq %r14, %r14
je 0x1fedd
movl 0x4(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
testq %r15, %r15
je 0x1fefc
movl 0x8(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18410
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x4(%rsp), %esi
movl 0x8(%rsp), %ecx
movq %r12, %rdi
movq %r14, %rdx
movq %r15, %r8
callq *0x810(%rax)
testq %r14, %r14
je 0x1ff6d
movl 0x4(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x197d0
xorl %ebp, %ebp
testq %r15, %r15
je 0x1ff1d
movl 0x8(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x197d0
jmp 0x1ff1d