// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/cmd.c
// Function: CmdBeginRenderPass
static int CmdBeginRenderPass(lua_State *L)
    {
    int err;
    ud_t *ud;
    VkCommandBuffer cb = checkcommand_buffer(L, 1, &ud);
    if(ud->ddt->CmdBeginRenderPass2 && lua_type(L, 3) == LUA_TTABLE)
        {
#define CLEANUP do {                                    \
            zfreeVkRenderPassBeginInfo(L, info, 1);     \
            zfreeVkSubpassBeginInfo(L, binfo, 1);    \
} while(0)
        VkRenderPassBeginInfo* info=NULL;
        VkSubpassBeginInfo* binfo=NULL;
        info = zcheckVkRenderPassBeginInfo(L, 2, &err);
        if(err) { CLEANUP; return argerror(L, 2); }
        binfo = zcheckVkSubpassBeginInfo(L, 3, &err);
        if(err) { CLEANUP; return argerror(L, 3); }
        ud->ddt->CmdBeginRenderPass2(cb, info, binfo);
        CLEANUP;
#undef CLEANUP
        }
    else
        {
        VkSubpassContents contents = checksubpasscontents(L, 3);
#define CLEANUP zfreeVkRenderPassBeginInfo(L, info, 1)
        VkRenderPassBeginInfo* info = zcheckVkRenderPassBeginInfo(L, 2, &err);
        if(err) { CLEANUP; return argerror(L, 2); }
        ud->ddt->CmdBeginRenderPass(cb, info, contents);
        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 0x71c01(%rip), %rcx     # 0x8f909
leaq 0x10(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5c0(%rax)
je 0x1dda1
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1a130
cmpl $0x5, %eax
jne 0x1dda1
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19e50
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x1de44
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
jmp 0x1de9d
movq %rbx, %rdi
movl $0x21, %esi
movl $0x3, %edx
callq 0x19c20
movl %eax, %ebp
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19e50
movq %rax, %r15
movl (%r12), %r12d
testl %r12d, %r12d
je 0x1de07
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18420
jmp 0x1de2e
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq *0x410(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
testl %r12d, %r12d
jne 0x1de35
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
movl $0x3, %esi
movq %r13, %rdx
callq 0x18250
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x1deac
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18690
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rdx
callq 0x18420
testb %r14b, %r14b
jne 0x1de33
jmp 0x1de35
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x5c0(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19170
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
movb $0x1, %r14b
jmp 0x1dea5