// File: /workspace/github_cpp_makefile_star2_O3/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 0x6ec54(%rip), %rcx     # 0x8c909
leaq 0x10(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x5c0(%rax)
je 0x1dd27
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1a0f0
cmpl $0x5, %eax
jne 0x1dd27
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19e10
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x1ddc3
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x1dd60
movq %rbx, %rdi
movl $0x21, %esi
movl $0x3, %edx
callq 0x19be0
movl %eax, %ebp
leaq 0xc(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x19e10
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x1dd8b
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x18410
jmp 0x1ddb4
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 0x19160
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 0x18240
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x1de1e
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19160
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x18680
movq %rbx, %rdi
movl $0x3, %esi
jmp 0x1dd81
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 0x19160
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x1dda8