// File: /workspace/github_cpp_makefile_star2_O1/stetre[P]moonvulkan/src/validation_cache.c
// Function: Create
static int Create(lua_State *L)
    {
    int err;
    ud_t *ud, *device_ud;
    VkResult ec;
    VkValidationCacheEXT validation_cache;
    VkValidationCacheCreateInfoEXT* info;
    VkDevice device = checkdevice(L, 1, &device_ud);
    const VkAllocationCallbacks *allocator = optallocator(L, 3);
    CheckDevicePfn(L, device_ud, CreateValidationCacheEXT);
#define CLEANUP zfreeVkValidationCacheCreateInfoEXT(L, info, 1)
    info = zcheckVkValidationCacheCreateInfoEXT(L, 2, &err);
    if(err) { CLEANUP;  return argerror(L, 2); }
    lua_getfield(L, 2, "initial_data");
    info->pInitialData = (void*)luaL_optlstring(L, -1, NULL, &info->initialDataSize);
    ec = device_ud->ddt->CreateValidationCacheEXT(device, info, allocator, &validation_cache);
    CLEANUP;
#undef CLEANUP
    CheckError(L, ec);
    TRACE_CREATE(validation_cache, "validation_cache");
    ud = newuserdata_nondispatchable(L, validation_cache, VALIDATION_CACHE_MT);
    ud->parent_ud = device_ud;
    ud->device = device;
    ud->instance = device_ud->instance;
    ud->allocator = allocator;
    ud->destructor = freevalidation_cache;
    ud->ddt = device_ud->ddt;
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x3e980(%rip), %rcx     # 0x8f03b
leaq 0x8(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdx
callq 0x1a520
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
callq 0x191c0
movq %rax, %r15
movq (%r12), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x4e8(%rax)
je 0x50745
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x1a410
movq %rax, %r12
cmpl $0x0, (%r13)
je 0x5075b
movq %rbx, %rdi
movq %r12, %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 0x50835
leaq 0x5355b(%rip), %rsi     # 0xa3ca7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19be0
jmp 0x50835
leaq 0x525fd(%rip), %rdx     # 0xa2d5f
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1a480
movq %r12, %rcx
addq $0x18, %rcx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x188b0
movq %rax, 0x20(%r12)
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rsp, %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x4e8(%rax)
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x19170
testl %ebp, %ebp
je 0x507d1
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18990
movq %rbx, %rdi
callq 0x199e0
jmp 0x50835
movq 0x727f0(%rip), %rax     # 0xc2fc8
cmpl $0x0, (%rax)
je 0x507ef
movq (%rsp), %rsi
leaq 0x534ed(%rip), %rdi     # 0xa3cd5
xorl %eax, %eax
callq 0x18970
movq (%rsp), %rsi
leaq 0x40751(%rip), %rdx     # 0x90f4b
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x18330
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r14, 0x20(%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x40(%rax)
leaq 0x247(%rip), %rdx       # 0x50a6b
movq %rdx, 0x8(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq