// File: /workspace/github_cpp_makefile_star2_O1/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 0x6fa7b(%rip), %rcx     # 0x8f909
leaq 0x10(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1a520
movq %rax, %r12
movq (%r14), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x810(%rax)
je 0x1ff1e
leaq 0x4(%rsp), %rdx
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rcx
callq 0x19e60
movq %rax, %r14
movl (%r15), %eax
testl %eax, %eax
setns %cl
cmpl $-0x5, %eax
sete %al
orb %cl, %al
jne 0x1ff34
testq %r14, %r14
je 0x1ff02
movl 0x4(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x19800
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x1ffb9
leaq 0x70269(%rip), %rsi     # 0x9018e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x1ffc1
leaq 0x8(%rsp), %rdx
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movl $0x3, %esi
movq %r13, %rcx
callq 0x18610
movq %rax, %r15
movl (%r13), %eax
testl %eax, %eax
setns %cl
cmpl $-0x5, %eax
sete %al
orb %cl, %al
jne 0x1ffd4
testq %r14, %r14
je 0x1ff83
movl 0x4(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x19800
testq %r15, %r15
je 0x1ffa2
movl 0x8(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x19800
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18420
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 0x20013
movl 0x4(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %r8d
callq 0x19800
xorl %ebp, %ebp
testq %r15, %r15
je 0x1ffc3
movl 0x8(%rsp), %ecx
movl $0x20, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x19800
jmp 0x1ffc3