// File: stetre[P]moonvulkan/src/cmd.c
// Function: CmdClearColorImage
static int CmdClearColorImage(lua_State *L)
    {
    int err;
    ud_t *ud;
    uint32_t count=0;
    VkImageSubresourceRange* ranges=NULL;
    VkClearColorValue* color=NULL;
    VkCommandBuffer cb = checkcommand_buffer(L, 1, &ud);
    VkImage image = checkimage(L, 2, NULL);
    VkImageLayout imageLayout = checkimagelayout(L, 3);
#define CLEANUP do {                                            \
    zfreeVkClearColorValue(L, color, 1);                        \
    zfreearrayVkImageSubresourceRange(L, ranges, count, 1);     \
} while(0)
    color = zcheckVkClearColorValue(L, 4, &err);
    if(err) { CLEANUP; return argerror(L, 4); }
    ranges = zcheckarrayVkImageSubresourceRange(L, 5, &count, &err);
    if(err) { CLEANUP; return argerror(L, 5); }
    ud->ddt->CmdClearColorImage(cb, image, imageLayout, color, count, ranges);
    CLEANUP;
#undef CLEANUP
    return 0;
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movl $0x0, 0x44(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x58(%rsp), %rdi
movl $0x1, %esi
leaq 0x48(%rsp), %rdx
leaq 0xb23f0(%rip), %rcx     # 0xcf909
callq 0x1a640
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
leaq 0xb2462(%rip), %rcx     # 0xcf99a
callq 0x1a640
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
movl $0xa, %esi
movl $0x3, %edx
callq 0x19d20
movl %eax, 0x1c(%rsp)
movq 0x58(%rsp), %rdi
movl $0x4, %esi
leaq 0x54(%rsp), %rdx
callq 0x18600
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x1d5ef
jmp 0x1d57c
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x19710
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x44(%rsp), %ecx
movl $0x14, %edx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x18dd0
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
movl $0x4, %esi
callq 0x18460
movl %eax, 0x64(%rsp)
jmp 0x1d6f8
movq 0x58(%rsp), %rdi
movl $0x5, %esi
leaq 0x44(%rsp), %rdx
leaq 0x54(%rsp), %rcx
callq 0x19b70
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x1d686
jmp 0x1d616
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x19710
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x44(%rsp), %ecx
movl $0x14, %edx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x18dd0
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x186d0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movl $0x5, %esi
callq 0x18460
movl %eax, 0x64(%rsp)
jmp 0x1d6f8
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x3a0(%rax), %rax
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
movq 0x30(%rsp), %rcx
movl 0x44(%rsp), %r8d
movq 0x38(%rsp), %r9
callq *%rax
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x19710
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x44(%rsp), %ecx
movl $0x14, %edx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x18dd0
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)