// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/physical_device.c
// Function: GetPhysicalDeviceQueueFamilyProperties
static int GetPhysicalDeviceQueueFamilyProperties(lua_State *L)
    {
    uint32_t i, count = 0;
    VkQueueFamilyProperties *props;
    ud_t *ud;
    VkPhysicalDevice physical_device = checkphysical_device(L, 1, &ud);
    
    if(ud->idt->GetPhysicalDeviceQueueFamilyProperties2)
        return GetPhysicalDeviceQueueFamilyProperties2(L, physical_device, ud);

    lua_newtable(L);
    ud->idt->GetPhysicalDeviceQueueFamilyProperties(physical_device, &count, NULL);
    if(count == 0) return 1;
    props = (VkQueueFamilyProperties*)Malloc(L, sizeof(VkQueueFamilyProperties)*count);
    ud->idt->GetPhysicalDeviceQueueFamilyProperties(physical_device, &count, props);
    for(i=0; i<count; i++)
        {
        zpushVkQueueFamilyProperties(L, &(props[i]), i);
        lua_rawseti(L, -2, i+1);
        }
    Free(L, props);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x0, (%rsp)
leaq 0x46b14(%rip), %rcx     # 0x8def4
movl $0x1, %ebp
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %r13
movq 0x48(%r13), %rax
cmpq $0x0, 0x108(%rax)
je 0x47487
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movq 0x48(%r13), %rax
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x108(%rax)
movl (%r15), %esi
testl %esi, %esi
je 0x4759f
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1a200
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x4752d
movl 0x4(%rsp), %ecx
movl $0x28, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
callq 0x199a0
movl %eax, %ebp
jmp 0x4759f
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x40(%rax)
movl (%r15), %eax
movl $0x1, %ebp
testq %rax, %rax
je 0x4759f
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
movq %rbx, %rdi
callq 0x19200
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x40(%rax)
cmpl $0x0, (%r12)
je 0x47520
xorl %r14d, %r14d
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x18b90
incq %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0x19130
movl (%rsp), %eax
addq $0x18, %r12
cmpq %rax, %r14
jb 0x474f3
movq %rbx, %rdi
movq %r15, %rsi
callq 0x182d0
jmp 0x4759f
movq 0x48(%r13), %rax
leaq 0x4(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x108(%rax)
cmpl $0x0, (%r12)
je 0x47582
xorl %r14d, %r14d
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x19d00
incq %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0x19130
movl 0x4(%rsp), %ecx
addq $0x28, %r12
cmpq %rcx, %r14
jb 0x47552
jmp 0x47584
xorl %ecx, %ecx
movl $0x1, %ebp
movl $0x28, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x197d0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq