// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::update_source_output(pa_source_output_info const*)
void Pa::update_source_output(const pa_source_output_info *info)
{
    std::lock_guard<std::mutex> lk(inputMtx);

    // https://github.com/pulseaudio/pavucontrol/blob/master/src/mainwindow.cc#L802
    const char *app;

    if ((app = pa_proplist_gets(info->proplist, PA_PROP_APPLICATION_ID))) {
        if (strcmp(app, "org.PulseAudio.pavucontrol") == 0
            || strcmp(app, "org.gnome.VolumeControl") == 0
            || strcmp(app, "org.kde.kmixd") == 0
            || strcmp(app, "ncpamixer") == 0) {
            return;
        }
    }

    PaSourceOutput *p;

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

    p->index = info->index;
    p->source = info->source;
    p->channels = info->channel_map.channels;
    p->monitor_index = info->source;
    p->volume = (const pa_volume_t) pa_cvolume_avg(&info->volume);
    p->mute = info->mute;

    strncpy(p->name, info->name, sizeof(p->name) - 1);

    const auto app_name = pa_proplist_gets(info->proplist, PA_PROP_APPLICATION_NAME);
    p->app_name = (app_name != NULL) ? app_name : "Module";

    notify_update();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x100(%rdi), %rbx
movq %rbx, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8b1e
movq 0xd0(%r15), %rdi
leaq 0x88e7(%rip), %rsi      # 0x1127b
callq 0x6510
movq %rax, %r12
testq %rax, %rax
je 0x89fd
leaq 0x895f(%rip), %rsi      # 0x11307
movq %r12, %rdi
callq 0x67f0
testl %eax, %eax
je 0x8b0d
leaq 0x8963(%rip), %rsi      # 0x11322
movq %r12, %rdi
callq 0x67f0
testl %eax, %eax
je 0x8b0d
leaq 0x8964(%rip), %rsi      # 0x1133a
movq %r12, %rdi
callq 0x67f0
testl %eax, %eax
je 0x8b0d
leaq 0x8884(%rip), %rsi      # 0x11271
movq %r12, %rdi
callq 0x67f0
testl %eax, %eax
je 0x8b0d
leaq 0x98(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x9630
testq %rax, %rax
je 0x8a24
movq %r13, %rdi
movq %r15, %rsi
callq 0x9678
movq (%rax), %r12
jmp 0x8a53
movl $0x2a8, %edi            # imm = 0x2A8
callq 0x65b0
movq %rax, %r12
movq %rax, %rdi
callq 0x7ec8
movq %r13, %rdi
movq %r15, %rsi
callq 0x9678
movq %r12, (%rax)
movq $0x0, 0x220(%r12)
movl (%r15), %eax
movl %eax, 0xc(%r12)
movl 0x18(%r15), %eax
movl %eax, 0x2a0(%r12)
movzbl 0x28(%r15), %ecx
movl %ecx, 0x210(%r12)
movl %eax, 0x21c(%r12)
leaq 0xdc(%r15), %rdi
callq 0x6a00
movl %eax, 0x214(%r12)
cmpl $0x0, 0x160(%r15)
setne 0x218(%r12)
leaq 0x10(%r12), %rdi
movq 0x8(%r15), %rsi
movl $0xfe, %edx
callq 0x6320
movq 0xd0(%r15), %rdi
leaq 0x879e(%rip), %rsi      # 0x11260
callq 0x6510
testq %rax, %rax
leaq 0x8877(%rip), %r15      # 0x11348
cmovneq %rax, %r15
movq 0x288(%r12), %r13
addq $0x280, %r12            # imm = 0x280
movq %r15, %rdi
callq 0x62b0
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x68c0
movq 0xf8(%r14), %rax
testq %rax, %rax
je 0x8b0d
callq *%rax
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x64b0
movl %eax, %edi
callq 0x6430
movq %rax, %r14
movl $0x2a8, %esi            # imm = 0x2A8
movq %r12, %rdi
callq 0x65c0
jmp 0x8b3e
jmp 0x8b3b
jmp 0x8b3b
movq %rax, %r14
movq %rbx, %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80