// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/tab.cpp
// Function: Tab::handleEvents(char const* const&)
void Tab::handleEvents(const char* const &event)
{
    if (object == nullptr) {
        return;
    }

    selected_index = pulse.exists(*object, selected_index);

    if (selected_index == static_cast<uint32_t>(-1)) {
        return;
    }

    auto pai = object->find(selected_index);

    PaObject *selected_pobj = nullptr;

    if (pai != object->end()) {
        selected_pobj = pai->second;
    }

    if (!strcmp("mute", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->toggle_mute();
        }
    } else if (!strcmp("move_first", event)) {
        auto i = object->begin();

        if (i != object->end()) {
            selected_index = i->first;
            selected_block = 0;
        }

    } else if (!strcmp("move_last", event)) {
        auto i = object->rbegin();

        if (i != object->rend()) {
            selected_index = i->first;
            selected_block = object->size() - 1;
        }
    } else if (!strcmp("move_up", event)) {
        auto i = std::prev(object->find(selected_index), 1);

        if (i != object->end()) {
            selected_index = i->first;
            selected_block = (selected_block > 0) ? selected_block - 1 : 0;
        }
    } else if (!strcmp("move_down", event)) {
        auto i = std::next(object->find(selected_index), 1);

        if (i != object->end()) {
            selected_index = i->first;
            selected_block++;
        }
    } else if (!strcmp("toggle_static", event)) {
        ui.static_bar = !ui.static_bar;
    } else if (!strcmp("volume_up", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->step_volume(1);
        }
    } else if (!strcmp("volume_down", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->step_volume(-1);
        }
    } else if (!strcmp("set_volume_0", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(0);
        }
    } else if (!strcmp("set_volume_10", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.1f);
        }
    } else if (!strcmp("set_volume_20", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.2f);
        }
    } else if (!strcmp("set_volume_30", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.3f);
        }
    } else if (!strcmp("set_volume_40", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.4f);
        }
    } else if (!strcmp("set_volume_50", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.5f);
        }
    } else if (!strcmp("set_volume_60", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.6f);
        }
    } else if (!strcmp("set_volume_70", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.7f);
        }
    } else if (!strcmp("set_volume_80", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.8f);
        }
    } else if (!strcmp("set_volume_90", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(.9f);
        }
    } else if (!strcmp("set_volume_100", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_volume(1.0f);
        }
    } else if (!strcmp("set_default", event)) {
        if (selected_pobj != nullptr) {
            selected_pobj->set_default(selected_pobj->pa_name);
        }
    } else if (!strcmp("switch", event)) {
        if (selected_pobj != nullptr && toggle != nullptr) {
            auto current_toggle = toggle->find(selected_pobj->getRelation());
            current_toggle = std::next(current_toggle, 1);

            if (current_toggle == toggle->end()) {
                current_toggle = toggle->begin();
            }

            selected_pobj->move(current_toggle->first);
        } else if (selected_pobj != nullptr) {
            uint32_t current_attribute = selected_pobj->getRelation();

            if (current_attribute + 1 < selected_pobj->attributes.size()) {
                current_attribute++;
            } else {
                current_attribute = 0;
            }

            if (selected_pobj->attributes.size() > 0) {
                selected_pobj->set_active_attribute(
                    selected_pobj->attributes[current_attribute]->name
                );
            }
        }
    } else if (!strcmp("dropdown", event) || !strcmp("select", event)) {
        handleDropDown(selected_pobj);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq 0x10(%rdi), %rsi
testq %rsi, %rsi
je 0xe6eb
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xfb3e
movl 0xc(%rbx), %esi
movq %r14, %rdi
callq 0x886e
movl %eax, 0xc(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x972e
movl 0xc(%rbx), %ebp
cmpl $-0x1, %ebp
je 0xe6eb
movq 0x10(%rbx), %r14
movq 0x10(%r14), %r13
leaq 0x8(%r14), %r12
movq %r12, %rax
testq %r13, %r13
je 0xe266
movq %r13, %rcx
movq %r12, %rax
xorl %edx, %edx
cmpl %ebp, 0x20(%rcx)
setb %dl
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xe250
movq %r12, %rcx
cmpq %r12, %rax
je 0xe278
cmpl 0x20(%rax), %ebp
cmovbq %r12, %rax
movq %rax, %rcx
cmpq %r12, %rcx
je 0xe287
movq 0x28(%rcx), %rax
movq %rax, (%rsp)
jmp 0xe28f
movq $0x0, (%rsp)
movq (%r15), %r15
leaq 0x46d2(%rip), %rdi      # 0x1296b
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe4b4
leaq 0x46c0(%rip), %rdi      # 0x12970
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe4cb
leaq 0x46b4(%rip), %rdi      # 0x1297b
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe4ea
leaq 0x46a7(%rip), %rdi      # 0x12985
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe510
leaq 0x4698(%rip), %rdi      # 0x1298d
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe56d
leaq 0x468b(%rip), %rdi      # 0x12997
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5bd
leaq 0x4682(%rip), %rdi      # 0x129a5
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5d0
leaq 0x4675(%rip), %rdi      # 0x129af
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5e4
leaq 0x466a(%rip), %rdi      # 0x129bb
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe600
leaq 0x4660(%rip), %rdi      # 0x129c8
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe615
leaq 0x4657(%rip), %rdi      # 0x129d6
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe62f
leaq 0x464e(%rip), %rdi      # 0x129e4
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe649
leaq 0x4645(%rip), %rdi      # 0x129f2
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe663
leaq 0x463c(%rip), %rdi      # 0x12a00
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe676
leaq 0x4633(%rip), %rdi      # 0x12a0e
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe689
leaq 0x462a(%rip), %rdi      # 0x12a1c
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe69c
leaq 0x4621(%rip), %rdi      # 0x12a2a
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe6af
leaq 0x4618(%rip), %rdi      # 0x12a38
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe6c2
leaq 0x460f(%rip), %rdi      # 0x12a46
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe6d5
leaq 0x4607(%rip), %rdi      # 0x12a55
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe6fa
leaq 0x45fc(%rip), %rdi      # 0x12a61
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe711
leaq 0x45ec(%rip), %rdi      # 0x12a68
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
movq (%rsp), %rsi
je 0xe4a7
leaq 0x45de(%rip), %rdi      # 0x12a71
movq %r15, %rsi
callq 0x67f0
movq (%rsp), %rsi
testl %eax, %eax
jne 0xe6eb
movq %rbx, %rdi
callq 0xe7da
jmp 0xe6eb
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
callq 0x7686
jmp 0xe6eb
movq 0x18(%r14), %rax
cmpq %r12, %rax
je 0xe6eb
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
movl $0x0, 0x20(%rbx)
jmp 0xe6eb
cmpq 0x18(%r14), %r12
je 0xe6eb
movq %r12, %rdi
callq 0x6600
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
movl 0x28(%r14), %eax
decl %eax
movl %eax, 0x20(%rbx)
jmp 0xe6eb
movq %r12, %rax
testq %r13, %r13
je 0xe532
movq %r12, %rax
xorl %ecx, %ecx
cmpl %ebp, 0x20(%r13)
setb %cl
cmovaeq %r13, %rax
movq 0x10(%r13,%rcx,8), %r13
testq %r13, %r13
jne 0xe51b
movq %r12, %rdi
cmpq %r12, %rax
je 0xe544
cmpl 0x20(%rax), %ebp
cmovbq %r12, %rax
movq %rax, %rdi
callq 0x6600
cmpq %r12, %rax
je 0xe6eb
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
movl 0x20(%rbx), %eax
leal -0x1(%rax), %ecx
xorl %edx, %edx
testl %eax, %eax
cmovgl %ecx, %edx
movl %edx, 0x20(%rbx)
jmp 0xe6eb
movq %r12, %rax
testq %r13, %r13
je 0xe58f
movq %r12, %rax
xorl %ecx, %ecx
cmpl %ebp, 0x20(%r13)
setb %cl
cmovaeq %r13, %rax
movq 0x10(%r13,%rcx,8), %r13
testq %r13, %r13
jne 0xe578
movq %r12, %rdi
cmpq %r12, %rax
je 0xe5a1
cmpl 0x20(%rax), %ebp
cmovbq %r12, %rax
movq %rax, %rdi
callq 0x6440
cmpq %r12, %rax
je 0xe6eb
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
incl 0x20(%rbx)
jmp 0xe6eb
leaq 0xa234(%rip), %rax      # 0x187f8
xorb $0x1, 0x103(%rax)
jmp 0xe6eb
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movl $0x1, %esi
jmp 0xe5f6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x764e
jmp 0xe6eb
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
xorps %xmm0, %xmm0
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x42d6(%rip), %xmm0     # 0x12900
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x42e0(%rip), %xmm0     # 0x12924
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x42c2(%rip), %xmm0     # 0x12920
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x42a8(%rip), %xmm0     # 0x1291c
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x4291(%rip), %xmm0     # 0x12918
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x427a(%rip), %xmm0     # 0x12914
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x4263(%rip), %xmm0     # 0x12910
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x424c(%rip), %xmm0     # 0x1290c
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x4235(%rip), %xmm0     # 0x12908
jmp 0xe6e6
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movss 0x2b76(%rip), %xmm0     # 0x1125c
callq 0x75b0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
leaq 0x10f(%rdi), %rsi
callq 0x7730
jmp 0xe6eb
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe6eb
movq 0x18(%rbx), %r15
movq (%rdi), %rax
callq *0x18(%rax)
testq %r15, %r15
je 0xe789
movq 0x10(%r15), %rdx
addq $0x8, %r15
movq %r15, %rcx
testq %rdx, %rdx
je 0xe753
movq %r15, %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0xe73c
cmpq %r15, %rcx
je 0xe75f
cmpl 0x20(%rcx), %eax
cmovaeq %rcx, %r15
movq %r15, %rdi
callq 0x6440
movq 0x18(%rbx), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
jne 0xe778
movq 0x18(%rcx), %rax
movl 0x20(%rax), %esi
movq (%rsp), %rdi
callq 0x76c4
jmp 0xe6eb
movq (%rsp), %rdi
movq 0x238(%rdi), %rcx
movq 0x240(%rdi), %rdx
subq %rcx, %rdx
je 0xe6eb
sarq $0x3, %rdx
incl %eax
xorl %esi, %esi
cmpq %rax, %rdx
cmovaq %rax, %rsi
movq (%rcx,%rsi,8), %rsi
addq $0x8, %rsi
callq 0x76fa
jmp 0xe6eb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x972e
movq %rbx, %rdi
callq 0x6a80