// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::update_card(pa_card_info const*)
void Pa::update_card(const pa_card_info *info)
{
    std::lock_guard<std::mutex> lk(inputMtx);
    PaCard *p;

    if (PA_CARDS.count(info->index) == 0) {
        p = new PaCard;
        PA_CARDS[info->index] = p;
        p->monitor_index = info->index;
        p->monitor_stream = nullptr;
    } else {
        p = reinterpret_cast<PaCard *>(PA_CARDS[info->index]);
    }

    p->index = info->index;
    p->channels = 0;
    p->volume = 0;
    p->mute = false;
    p->updateProfiles(info->profiles, info->n_profiles);
    p->active_attribute = nullptr;

    if (info->active_profile != nullptr) {
        for (uint32_t i = 0; i < p->attributes.size(); i++) {
            if (strcmp(p->attributes[i]->name, info->active_profile->name) == 0) {
                p->active_attribute = p->attributes[i];
                break;
            }
        }
    }

    const char *description;
    description = pa_proplist_gets(info->proplist, PA_PROP_DEVICE_DESCRIPTION);

    if (description) {
        snprintf(p->name, sizeof(p->name), "%s", description);
    } else {
        snprintf(p->name, sizeof(p->name), "%s", info->name);
    }

    notify_update();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x100, %rdi            # imm = 0x100
movq %rdi, (%rsp)
callq 0x6870
testl %eax, %eax
jne 0x8f53
leaq 0xc8(%rbx), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x9680
testq %rax, %rax
je 0x8e09
movq %r13, %rdi
movq %r14, %rsi
callq 0x96ca
movq (%rax), %r12
jmp 0x8e43
movl $0x278, %edi            # imm = 0x278
callq 0x65b0
movq %rax, %r12
movq %rax, %rdi
callq 0x77fc
movq %r13, %rdi
movq %r14, %rsi
callq 0x96ca
movq %r12, (%rax)
movl (%r14), %eax
movl %eax, 0x21c(%r12)
movq $0x0, 0x220(%r12)
movl (%r14), %eax
movl %eax, 0xc(%r12)
movq $0x0, 0x210(%r12)
movb $0x0, 0x218(%r12)
movq 0x28(%r14), %rsi
movl 0x20(%r14), %edx
movq %r12, %rdi
callq 0x784e
movq %rbx, 0x8(%rsp)
movq $0x0, 0x230(%r12)
movq %r14, 0x10(%rsp)
movq 0x30(%r14), %rax
testq %rax, %rax
je 0x8edd
movq 0x238(%r12), %rbp
movq 0x240(%r12), %rbx
subq %rbp, %rbx
je 0x8edd
sarq $0x3, %rbx
movq (%rax), %r13
movl $0x1, %r14d
xorl %eax, %eax
movq (%rbp,%rax,8), %r15
leaq 0x8(%r15), %rdi
movq %r13, %rsi
callq 0x67f0
testl %eax, %eax
je 0x8ed5
movl %r14d, %eax
incl %r14d
cmpq %rax, %rbx
ja 0x8eb3
jmp 0x8edd
movq %r15, 0x230(%r12)
movq 0x10(%rsp), %r14
movq 0x38(%r14), %rdi
leaq 0x8462(%rip), %rsi      # 0x1134f
callq 0x6510
addq $0x10, %r12
testq %rax, %rax
movq 0x8(%rsp), %rbx
je 0x8f14
leaq 0x99ee(%rip), %rdx      # 0x128f5
movl $0xff, %esi
movq %r12, %rdi
movq %rax, %rcx
jmp 0x8f27
movq 0x8(%r14), %rcx
leaq 0x99d6(%rip), %rdx      # 0x128f5
movl $0xff, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x6990
movq 0xf8(%rbx), %rax
testq %rax, %rax
je 0x8f3c
callq *%rax
movq (%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x64b0
movl %eax, %edi
callq 0x6430
movq %rax, %r14
movl $0x278, %esi            # imm = 0x278
movq %r12, %rdi
callq 0x65c0
jmp 0x8f71
jmp 0x8f6e
movq %rax, %r14
movq (%rsp), %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80