// File: /workspace/github_c_makefile_star2_O0/lukexi[P]eglstreams-mini/src/kms.c
// Function: AssignPropertyIDsOneType
static void AssignPropertyIDsOneType(int drmFd,
                                     uint32_t objectID,
                                     uint32_t objectType,
                                     struct PropertyIDAddresses *table,
                                     size_t tableLen)
{
    uint32_t i;
    drmModeObjectPropertiesPtr pModeObjectProperties =
        drmModeObjectGetProperties(drmFd, objectID, objectType);

    if (pModeObjectProperties == NULL) {
        Fatal("Unable to query mode object properties.\n");
    }

    for (i = 0; i < pModeObjectProperties->count_props; i++) {

        uint32_t j;
        drmModePropertyPtr pProperty =
            drmModeGetProperty(drmFd, pModeObjectProperties->props[i]);

        if (pProperty == NULL) {
            Fatal("Unable to query property.\n");
        }
        for (j = 0; j < tableLen; j++) {
            if (strcmp(table[j].name, pProperty->name) == 0) {
                *(table[j].ptr) = pProperty->prop_id;
                break;
            }
        }

        drmModeFreeProperty(pProperty);
    }

    drmModeFreeObjectProperties(pModeObjectProperties);

    for (i = 0; i < tableLen; i++) {
        if (*(table[i].ptr) == 0) {
            Fatal("Unable to find property ID for \'%s\'.\n", table[i].name);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x2170
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4bd0
leaq 0x24da(%rip), %rdi      # 0x70a3
movb $0x0, %al
callq 0x4cf0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x4c88
movl -0x4(%rbp), %edi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x2150
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x4c15
leaq 0x22fa(%rip), %rdi      # 0x6f08
movb $0x0, %al
callq 0x4cf0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpq -0x20(%rbp), %rax
jae 0x4c71
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
callq 0x2330
cmpl $0x0, %eax
jne 0x4c64
movq -0x40(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
movl %ecx, (%rax)
jmp 0x4c71
jmp 0x4c66
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4c1c
movq -0x40(%rbp), %rdi
callq 0x2240
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4bd7
movq -0x30(%rbp), %rdi
callq 0x2130
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpq -0x20(%rbp), %rax
jae 0x4ce4
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cmpl $0x0, (%rax)
jne 0x4cd7
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
leaq 0x23fc(%rip), %rdi      # 0x70cc
movb $0x0, %al
callq 0x4cf0
jmp 0x4cd9
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4c98
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)