// File: /workspace/github_cpp_makefile_star2_O3/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 0xe62e
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xf9e8
movl 0xc(%rbx), %esi
movq %r14, %rdi
callq 0x8846
movl %eax, 0xc(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x96de
movl 0xc(%rbx), %ebp
cmpl $-0x1, %ebp
je 0xe62e
movq 0x10(%rbx), %r14
movq 0x10(%r14), %r13
leaq 0x8(%r14), %r12
testq %r13, %r13
je 0xe1bd
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 0xe199
cmpq %r12, %rax
je 0xe1bd
cmpl 0x20(%rax), %ebp
jae 0xe420
movq $0x0, (%rsp)
movq (%r15), %r15
leaq 0x479c(%rip), %rdi      # 0x1296b
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe3ea
leaq 0x478a(%rip), %rdi      # 0x12970
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe401
leaq 0x477e(%rip), %rdi      # 0x1297b
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe42d
leaq 0x4771(%rip), %rdi      # 0x12985
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe453
leaq 0x4762(%rip), %rdi      # 0x1298d
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe4b0
leaq 0x4755(%rip), %rdi      # 0x12997
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe500
leaq 0x474c(%rip), %rdi      # 0x129a5
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe513
leaq 0x473f(%rip), %rdi      # 0x129af
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe527
leaq 0x4734(%rip), %rdi      # 0x129bb
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe543
leaq 0x472a(%rip), %rdi      # 0x129c8
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe558
leaq 0x4721(%rip), %rdi      # 0x129d6
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe572
leaq 0x4718(%rip), %rdi      # 0x129e4
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe58c
leaq 0x470f(%rip), %rdi      # 0x129f2
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5a6
leaq 0x4706(%rip), %rdi      # 0x12a00
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5b9
leaq 0x46fd(%rip), %rdi      # 0x12a0e
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5cc
leaq 0x46f4(%rip), %rdi      # 0x12a1c
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5df
leaq 0x46eb(%rip), %rdi      # 0x12a2a
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe5f2
leaq 0x46e2(%rip), %rdi      # 0x12a38
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe605
leaq 0x46d9(%rip), %rdi      # 0x12a46
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe618
leaq 0x46d1(%rip), %rdi      # 0x12a55
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe63d
leaq 0x46c6(%rip), %rdi      # 0x12a61
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
je 0xe654
leaq 0x46b6(%rip), %rdi      # 0x12a68
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
movq (%rsp), %rsi
je 0xe3dd
leaq 0x46a8(%rip), %rdi      # 0x12a71
movq %r15, %rsi
callq 0x67f0
movq (%rsp), %rsi
testl %eax, %eax
jne 0xe62e
movq %rbx, %rdi
callq 0xe71a
jmp 0xe62e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
callq 0x768a
jmp 0xe62e
movq 0x18(%r14), %rax
cmpq %r12, %rax
je 0xe62e
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
movl $0x0, 0x20(%rbx)
jmp 0xe62e
movq 0x28(%rax), %rax
movq %rax, (%rsp)
jmp 0xe1c5
cmpq 0x18(%r14), %r12
je 0xe62e
movq %r12, %rdi
callq 0x6600
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
movl 0x28(%r14), %eax
decl %eax
movl %eax, 0x20(%rbx)
jmp 0xe62e
movq %r12, %rdi
testq %r13, %r13
je 0xe487
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 0xe45e
movq %r12, %rdi
cmpq %r12, %rax
je 0xe487
cmpl 0x20(%rax), %ebp
cmovbq %r12, %rax
movq %rax, %rdi
callq 0x6600
cmpq %r12, %rax
je 0xe62e
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 0xe62e
movq %r12, %rdi
testq %r13, %r13
je 0xe4e4
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 0xe4bb
movq %r12, %rdi
cmpq %r12, %rax
je 0xe4e4
cmpl 0x20(%rax), %ebp
cmovbq %r12, %rax
movq %rax, %rdi
callq 0x6440
cmpq %r12, %rax
je 0xe62e
movl 0x20(%rax), %eax
movl %eax, 0xc(%rbx)
incl 0x20(%rbx)
jmp 0xe62e
leaq 0xa2f1(%rip), %rax      # 0x187f8
xorb $0x1, 0x103(%rax)
jmp 0xe62e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movl $0x1, %esi
jmp 0xe539
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x7652
jmp 0xe62e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
xorps %xmm0, %xmm0
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x4393(%rip), %xmm0     # 0x12900
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x439d(%rip), %xmm0     # 0x12924
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x437f(%rip), %xmm0     # 0x12920
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x4365(%rip), %xmm0     # 0x1291c
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x434e(%rip), %xmm0     # 0x12918
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x4337(%rip), %xmm0     # 0x12914
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x4320(%rip), %xmm0     # 0x12910
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x4309(%rip), %xmm0     # 0x1290c
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x42f2(%rip), %xmm0     # 0x12908
jmp 0xe629
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movss 0x2c33(%rip), %xmm0     # 0x1125c
callq 0x75b4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
leaq 0x10f(%rdi), %rsi
callq 0x7734
jmp 0xe62e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe62e
movq 0x18(%rbx), %r15
movq (%rdi), %rax
callq *0x18(%rax)
testq %r15, %r15
je 0xe6c9
movq 0x10(%r15), %rcx
addq $0x8, %r15
testq %rcx, %rcx
je 0xe69f
movq %r15, %rdx
xorl %esi, %esi
cmpl %eax, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0xe67c
cmpq %r15, %rdx
je 0xe69f
cmpl 0x20(%rdx), %eax
cmovaeq %rdx, %r15
movq %r15, %rdi
callq 0x6440
movq 0x18(%rbx), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
jne 0xe6b8
movq 0x18(%rcx), %rax
movl 0x20(%rax), %esi
movq (%rsp), %rdi
callq 0x76c8
jmp 0xe62e
movq (%rsp), %rdi
movq 0x238(%rdi), %rcx
movq 0x240(%rdi), %rdx
subq %rcx, %rdx
je 0xe62e
sarq $0x3, %rdx
incl %eax
xorl %esi, %esi
cmpq %rax, %rdx
cmovaq %rax, %rsi
movq (%rcx,%rsi,8), %rsi
addq $0x8, %rsi
callq 0x76fe
jmp 0xe62e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96de
movq %rbx, %rdi
callq 0x6a80