// File: /workspace/github_cpp_makefile_star2_O1/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 0x4986c(%rip), %rcx     # 0x90ef4
movl $0x1, %ebp
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a520
movq %rax, %r14
movq (%r15), %r13
movq 0x48(%r13), %rax
cmpq $0x0, 0x108(%rax)
je 0x4772f
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
movq 0x48(%r13), %rax
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x108(%rax)
movl (%r15), %esi
testl %esi, %esi
je 0x47844
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1a240
movq %rax, %r15
cmpl $0x0, (%r12)
je 0x477d5
movl 0x4(%rsp), %ecx
movl $0x28, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x19800
movq %rbx, %rdi
callq 0x199e0
movl %eax, %ebp
jmp 0x47844
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187e0
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 0x47844
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
movq %rbx, %rdi
callq 0x19210
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 0x477c8
xorl %r14d, %r14d
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x18ba0
incq %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0x19140
movl (%rsp), %eax
addq $0x18, %r12
cmpq %rax, %r14
jb 0x4779b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x182e0
jmp 0x47844
movq 0x48(%r13), %rax
leaq 0x4(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x108(%rax)
movl (%r12), %ecx
testl %ecx, %ecx
je 0x47829
xorl %r14d, %r14d
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x19d40
incq %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0x19140
movl 0x4(%rsp), %ecx
addq $0x28, %r12
cmpq %rcx, %r14
jb 0x477fb
movl $0x1, %ebp
movl $0x28, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
callq 0x19800
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq