LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::pa_connect()
bool Pa::pa_connect()
{
    if (pa_ctx) {
        return false;
    }

    pa_threaded_mainloop_lock(pa_ml);

    pa_proplist *proplist = pa_proplist_new();
    pa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, "ncpamixer");
    pa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "ncpamixer");
    pa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "audio-card");
    pa_ctx = pa_context_new_with_proplist(pa_api, NULL, proplist);
    pa_proplist_free(proplist);

    if (!pa_ctx) {
        fprintf(stderr, "Unable to create PA context.\n");
        pa_threaded_mainloop_unlock(pa_ml);
        pa_ctx = nullptr;
        exit(EXIT_FAILURE);
        return false;
    }

    pa_context_set_state_callback(pa_ctx, &Pa::ctx_state_cb, this);
    pa_context_set_subscribe_callback(pa_ctx, &Pa::subscribe_cb, this);

    if (pa_context_connect(pa_ctx, NULL, PA_CONTEXT_NOFAIL, NULL) < 0) {
        pa_context_disconnect(pa_ctx);
        pa_context_unref(pa_ctx); // Tror ej den behövs?
        pa_threaded_mainloop_unlock(pa_ml);
        pa_ctx = nullptr;

        connectionMtx.unlock();
        reconnect();
        return false;
    }

    pa_threaded_mainloop_unlock(pa_ml);

    connectionMtx.unlock();
    return true;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x150(%rdi)
je 0x822e
xorl %eax, %eax
jmp 0x8311
movq %rdi, %rbx
movq 0x158(%rdi), %rdi
callq 0x60c0
callq 0x6220
movq %rax, %r14
leaq 0x9014(%rip), %rsi      # 0x11260
leaq 0x901e(%rip), %r15      # 0x11271
movq %rax, %rdi
movq %r15, %rdx
callq 0x6ac0
leaq 0x9016(%rip), %rsi      # 0x1127b
movq %r14, %rdi
movq %r15, %rdx
callq 0x6ac0
leaq 0x9013(%rip), %rsi      # 0x1128a
leaq 0x9022(%rip), %rdx      # 0x112a0
movq %r14, %rdi
callq 0x6ac0
movq 0x160(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x67b0
movq %rax, 0x150(%rbx)
movq %r14, %rdi
callq 0x6760
movq 0x150(%rbx), %rdi
testq %rdi, %rdi
je 0x835f
leaq 0x10d(%rip), %rsi       # 0x83ca
movq %rbx, %rdx
callq 0x6a40
movq 0x150(%rbx), %rdi
leaq 0x1c5(%rip), %rsi       # 0x8498
movq %rbx, %rdx
callq 0x6030
movq 0x150(%rbx), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x6b50
testl %eax, %eax
js 0x8317
movq 0x158(%rbx), %rdi
callq 0x6180
addq $0x128, %rbx            # imm = 0x128
movq %rbx, %rdi
callq 0x64b0
movb $0x1, %al
popq %rbx
popq %r14
popq %r15
retq
movq 0x150(%rbx), %rdi
callq 0x6aa0
movq 0x150(%rbx), %rdi
callq 0x68b0
movq 0x158(%rbx), %rdi
callq 0x6180
movq $0x0, 0x150(%rbx)
leaq 0x128(%rbx), %rdi
callq 0x64b0
movq %rbx, %rdi
callq 0x8376
jmp 0x8227
leaq 0x150(%rbx), %rsi
addq $0x158, %rbx            # imm = 0x158
movq %rbx, %rdi
callq 0x6c68
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::ctx_state_cb(pa_context*, void*)
void Pa::ctx_state_cb(pa_context *ctx, void *instance)
{
    int state = pa_context_get_state(ctx);
    Pa *pa = reinterpret_cast<Pa *>(instance);

    switch (state) {
        case PA_CONTEXT_READY: {
            pa_operation *o = pa_context_subscribe(
                                  pa->pa_ctx,
                                  (pa_subscription_mask_t)
                                  (PA_SUBSCRIPTION_MASK_SINK |
                                   PA_SUBSCRIPTION_MASK_SOURCE |
                                   PA_SUBSCRIPTION_MASK_SINK_INPUT |
                                   PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT |
                                   PA_SUBSCRIPTION_MASK_CARD |
                                   PA_SUBSCRIPTION_MASK_SERVER
                                  ), &Pa::ctx_success_cb, instance);
            pa->wait_on_pa_operation(o);
            pa_operation_unref(o);
            pa->fetchPaobjects();

            pa->connectionMtx.lock();
            pa->connected = true;
            pa->connectionMtx.unlock();
            break;
        }

        case PA_CONTEXT_FAILED:
            pa->connectionMtx.lock();
            pa->connected = false;
            pa_context_unref(pa->pa_ctx);
            pa->pa_ctx = nullptr;
            pa->connectionMtx.unlock();
            pa->reconnect();
            break;


        case PA_CONTEXT_UNCONNECTED:
        case PA_CONTEXT_CONNECTING:
        case PA_CONTEXT_AUTHORIZING:
        case PA_CONTEXT_SETTING_NAME:
        case PA_CONTEXT_TERMINATED:
            break;
    }

    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x6970
cmpl $0x5, %eax
je 0x8443
cmpl $0x4, %eax
jne 0x8488
movq 0x150(%rbx), %rdi
leaq 0x24e(%rip), %rdx       # 0x8640
movl $0x28f, %esi            # imm = 0x28F
movq %rbx, %rcx
callq 0x6890
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
callq 0x6650
movq %rbx, %rdi
callq 0x864e
leaq 0x128(%rbx), %r14
movq %r14, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8490
movb $0x1, 0x1(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x64b0
leaq 0x128(%rbx), %r14
movq %r14, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8490
movb $0x0, 0x1(%rbx)
movq 0x150(%rbx), %rdi
callq 0x68b0
movq $0x0, 0x150(%rbx)
movq %r14, %rdi
callq 0x64b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8376
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x6430
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::fetchPaobjects()
void Pa::fetchPaobjects()
{

    //pa_threaded_mainloop_lock(pa_ml);
    pa_operation *o;

    // get cards
    o = pa_context_get_card_info_list(pa_ctx, &Pa::ctx_cardlist_cb, this);
    wait_on_pa_operation(o);
    pa_operation_unref(o);

    // source list cb
    o = pa_context_get_source_info_list(pa_ctx, &Pa::ctx_sourcelist_cb, this);
    wait_on_pa_operation(o);
    pa_operation_unref(o);

    // Sink devices list cb
    o = pa_context_get_sink_info_list(pa_ctx, &Pa::ctx_sinklist_cb, this);
    wait_on_pa_operation(o);
    pa_operation_unref(o);

    // Sink input list (application) cb
    o = pa_context_get_sink_input_info_list(pa_ctx, &Pa::ctx_inputlist_cb, this);
    wait_on_pa_operation(o);
    pa_operation_unref(o);

    // source outputs list cb
    o = pa_context_get_source_output_info_list(
            pa_ctx,
            &Pa::ctx_sourceoutputlist_cb,
            this
        );
    wait_on_pa_operation(o);
    pa_operation_unref(o);

    // Get server info
    o = pa_context_get_server_info(pa_ctx, &Pa::ctx_serverinfo_cb, this);
    wait_on_pa_operation(o);
    pa_operation_unref(o);

    //pa_threaded_mainloop_unlock(pa_ml);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x150(%rdi), %rdi
leaq 0x101(%rip), %rsi       # 0x8764
movq %rbx, %rdx
callq 0x6b90
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
callq 0x6650
movq 0x150(%rbx), %rdi
leaq 0x113(%rip), %rsi       # 0x87a2
movq %rbx, %rdx
callq 0x68e0
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
callq 0x6650
movq 0x150(%rbx), %rdi
leaq 0xf5(%rip), %rsi        # 0x87b0
movq %rbx, %rdx
callq 0x6470
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
callq 0x6650
movq 0x150(%rbx), %rdi
leaq 0xd7(%rip), %rsi        # 0x87be
movq %rbx, %rdx
callq 0x6b00
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
callq 0x6650
movq 0x150(%rbx), %rdi
leaq 0xb9(%rip), %rsi        # 0x87cc
movq %rbx, %rdx
callq 0x6a20
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
callq 0x6650
movq 0x150(%rbx), %rdi
leaq 0x9b(%rip), %rsi        # 0x87da
movq %rbx, %rdx
callq 0x6590
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8772
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6650
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::remove_paobject(std::map<unsigned int, PaObject*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, PaObject*>>>*, unsigned int)
void Pa::remove_paobject(std::map<uint32_t, PaObject *> *objects,
                         uint32_t index)
{
    std::lock_guard<std::mutex> lk(inputMtx);

    for (auto i = objects->begin(); i != objects->end(); i++) {
        if (i->first == index) {
            delete i->second;
            i = objects->erase(i);
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x100, %rbx            # imm = 0x100
movq %rbx, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8854
movq 0x18(%r14), %r15
leaq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x8844
cmpl %ebp, 0x20(%r15)
je 0x882a
movq %r15, %rdi
callq 0x6440
movq %rax, %r15
cmpq %r12, %rax
jne 0x8812
jmp 0x8844
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x8839
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x97a0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x64b0
movl %eax, %edi
callq 0x6430
movq %rax, %r14
movq %rbx, %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::set_defaults(pa_server_info const*)
void Pa::set_defaults(const pa_server_info *info)
{
    std::lock_guard<std::mutex> lk(inputMtx);

    for (auto &s : PA_SINKS) {
        if (!strcmp(s.second->pa_name, info->default_sink_name)) {
            s.second->is_default = true;
        } else {
            s.second->is_default = false;
        }
    }

    for (auto &s : PA_SOURCES) {
        if (!strcmp(s.second->pa_name, info->default_source_name)) {
            s.second->is_default = true;
        } else {
            s.second->is_default = false;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r14
leaq 0x100(%rdi), %rbx
movq %rbx, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8990
movq 0x50(%r14), %r12
leaq 0x40(%r14), %rbp
cmpq %rbp, %r12
je 0x8934
movq (%rsp), %rax
movq 0x30(%rax), %r13
movq 0x28(%r12), %r15
leaq 0x10f(%r15), %rdi
movq %r13, %rsi
callq 0x67f0
testl %eax, %eax
sete 0x20e(%r15)
movq %r12, %rdi
callq 0x6440
movq %rax, %r12
cmpq %rbp, %rax
jne 0x8906
movq 0x80(%r14), %r12
addq $0x70, %r14
cmpq %r14, %r12
je 0x897a
movq (%rsp), %rax
movq 0x38(%rax), %r15
movq 0x28(%r12), %r13
leaq 0x10f(%r13), %rdi
movq %r15, %rsi
callq 0x67f0
testl %eax, %eax
sete 0x20e(%r13)
movq %r12, %rdi
callq 0x6440
movq %rax, %r12
cmpq %r14, %rax
jne 0x894c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x64b0
movl %eax, %edi
callq 0x6430
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::create_monitor_stream_for_paobject(PaObject*)
void Pa::create_monitor_stream_for_paobject(PaObject *po)
{
    if (po->monitor_stream != nullptr) {
        pa_stream_disconnect(po->monitor_stream);
        po->monitor_stream = nullptr;
    }

	po->monitor_stream = create_monitor_stream_for_source
		(po->monitor_index, po->type == pa_object_t::INPUT ? po->index : -1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x220(%rsi), %rdi
testq %rdi, %rdi
je 0x8d8a
callq 0x6ae0
movq $0x0, 0x220(%rbx)
movl 0x21c(%rbx), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x1, 0x8(%rbx)
jne 0x8d9e
movl 0xc(%rbx), %edx
movq %r14, %rdi
callq 0x9510
movq %rax, 0x220(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::update_sink(pa_sink_info const*)
void Pa::update_sink(const pa_sink_info *info)
{
    std::lock_guard<std::mutex> lk(inputMtx);

    PaSink *p;

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

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

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

    p->updatePorts(info->ports, info->n_ports);

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

    notify_update();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %rbx
addq $0x100, %rdi            # imm = 0x100
movq %rdi, 0x8(%rsp)
callq 0x6870
testl %eax, %eax
jne 0x9115
leaq 0x38(%rbx), %rbp
leaq 0x8(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x9680
testq %rax, %rax
je 0x8fd8
movq %rbp, %rdi
movq %r13, %rsi
callq 0x96ca
movq (%rax), %r15
jmp 0x9006
movl $0x278, %edi            # imm = 0x278
callq 0x65b0
movq %rax, %r15
movq %rax, %rdi
callq 0x7a8c
movq %rbp, %rdi
movq %r13, %rsi
callq 0x96ca
movq %r15, (%rax)
movq $0x0, 0x220(%r15)
movl 0x8(%r12), %eax
movl %eax, 0xc(%r15)
movzbl 0x24(%r12), %eax
movl %eax, 0x210(%r15)
movl 0x134(%r12), %eax
movl %eax, 0x21c(%r15)
leaq 0xac(%r12), %rdi
callq 0x6a00
movl %eax, 0x214(%r15)
cmpl $0x0, 0x130(%r12)
setne 0x218(%r15)
leaq 0x10(%r15), %rdi
movq 0x10(%r12), %rsi
movl $0xfe, %edx
callq 0x6320
leaq 0x10f(%r15), %rdi
movq (%r12), %rsi
movl $0xfe, %edx
callq 0x6320
movq 0x180(%r12), %rsi
movl 0x178(%r12), %edx
movq %r15, %rdi
callq 0x7af0
movq %rbx, 0x10(%rsp)
movq 0x188(%r12), %rax
testq %rax, %rax
je 0x90ea
movq 0x238(%r15), %r13
movq 0x240(%r15), %rbp
subq %r13, %rbp
je 0x90ea
sarq $0x3, %rbp
movq (%rax), %r12
movl $0x1, %ebx
xorl %eax, %eax
movq (%r13,%rax,8), %r14
leaq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x67f0
testl %eax, %eax
je 0x90e3
movl %ebx, %eax
incl %ebx
cmpq %rax, %rbp
ja 0x90c3
jmp 0x90ea
movq %r14, 0x230(%r15)
movq 0x10(%rsp), %rax
movq 0xf8(%rax), %rax
testq %rax, %rax
je 0x90fd
callq *%rax
movq 0x8(%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 %r15, %rdi
callq 0x65c0
jmp 0x9131
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::update_input(pa_sink_input_info const*)
void Pa::update_input(const pa_sink_input_info *info)
{

    std::lock_guard<std::mutex> lk(inputMtx);

    PaInput *p;

    bool sink_changed = true;

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

        if (PA_INPUTS.count(info->index)) {
            sink_changed = info->sink != p->sink;
        }
    }


    p->index = info->index;
    p->channels = info->channel_map.channels;
    p->volume = (const pa_volume_t) pa_cvolume_avg(&info->volume);
    p->mute = info->mute;
    p->sink = info->sink;
    snprintf(p->name, sizeof(p->name), "%s", info->name);

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

    if (sink_changed) {
        create_monitor_stream_for_paobject(p);
    }

    notify_update();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r14
leaq 0x100(%rdi), %rbx
movq %rbx, %rdi
callq 0x6870
testl %eax, %eax
jne 0x92c4
leaq 0x8(%r14), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, (%rsp)
callq 0x9680
testq %rax, %rax
je 0x91b3
movq %r13, %rdi
movq %r12, %rsi
callq 0x96ca
movq (%rax), %r15
movq %r13, %rdi
movq %r12, %rsi
callq 0x9680
testq %rax, %rax
je 0x91e1
movl 0x18(%r12), %eax
cmpl 0x278(%r15), %eax
setne %bl
jmp 0x91e3
movl $0x2a0, %edi            # imm = 0x2A0
callq 0x65b0
movq %rax, %r15
movq %rax, %rdi
callq 0x7cc4
movq %r13, %rdi
movq %r12, %rsi
callq 0x96ca
movq %r15, (%rax)
movq $0x0, 0x220(%r15)
movb $0x1, %bl
movl (%r12), %eax
movl %eax, 0xc(%r15)
movzbl 0x28(%r12), %eax
movl %eax, 0x210(%r15)
leaq 0xac(%r12), %rdi
callq 0x6a00
movl %eax, 0x214(%r15)
cmpl $0x0, 0x150(%r12)
setne 0x218(%r15)
movl 0x18(%r12), %eax
movl %eax, 0x278(%r15)
leaq 0x10(%r15), %rdi
movq 0x8(%r12), %rcx
leaq 0x96bc(%rip), %rdx      # 0x128f5
movl $0xff, %esi
xorl %eax, %eax
callq 0x6990
movq 0x158(%r12), %rdi
leaq 0x800c(%rip), %rsi      # 0x11260
callq 0x6510
testq %rax, %rax
leaq 0x80e5(%rip), %r12      # 0x11348
cmovneq %rax, %r12
leaq 0x280(%r15), %r13
movq 0x288(%r15), %rbp
movq %r12, %rdi
callq 0x62b0
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x68c0
testb %bl, %bl
je 0x929f
movq %r14, %rdi
movq %r15, %rsi
callq 0x8d64
movq 0xf8(%r14), %rax
testq %rax, %rax
je 0x92ad
callq *%rax
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x64b0
movl %eax, %edi
callq 0x6430
movq %rax, %r14
movl $0x2a0, %esi            # imm = 0x2A0
movq %r15, %rdi
callq 0x65c0
jmp 0x92e2
jmp 0x92df
movq %rax, %r14
movq (%rsp), %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::read_callback(pa_stream*, unsigned long, void*)
void Pa::read_callback(pa_stream *s, size_t length, void *instance)
{
    Pa *pa = reinterpret_cast<Pa *>(instance);
    std::lock_guard<std::mutex> lk(pa->inputMtx);
    const void *data;
    float v;

    if (pa_stream_peek(s, &data, &length) < 0) {
        return;
    }

    if (!data) {
        /*  NULL data means either a hole or empty buffer.
            Only drop the stream when there is a hole (length > 0) */
        if (length) {
            pa_stream_drop(s);
        }

        return;
    }

    assert(length > 0);
    assert(length % sizeof(float) == 0);

    v = ((const float *) data)[length / sizeof(float) - 1];

    pa_stream_drop(s);

    if (v < 0) {
        v = 0;
    }

    if (v > 1) {
        v = 1;
    }

    uint32_t input_idx = pa_stream_get_monitor_stream(s);

    if (input_idx != PA_INVALID_INDEX && pa->PA_INPUTS.find(input_idx) != pa->PA_INPUTS.end()) {
        pa->PA_INPUTS[input_idx]->peak = v;
    } else {
        pa->updatePeakByDeviceId(pa_stream_get_device_index(s), v);
    }

    pa->notify_update();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rdi, %r15
movq %rsi, 0x10(%rsp)
leaq 0x100(%rdx), %rbx
movq %rbx, %rdi
callq 0x6870
testl %eax, %eax
jne 0x9439
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x6370
testl %eax, %eax
js 0x9427
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
testq %rax, %rax
je 0x941a
andq $-0x4, %rcx
movss -0x4(%rax,%rcx), %xmm0
movss %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x6930
movq %r15, %rdi
callq 0x6280
xorps %xmm0, %xmm0
maxss 0x8(%rsp), %xmm0
movss 0x7edf(%rip), %xmm1     # 0x1125c
minss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x93f2
movq 0x18(%r14), %rsi
leaq 0x10(%r14), %rcx
movq %rcx, %rdx
testq %rsi, %rsi
je 0x93ba
movq %rcx, %rdx
xorl %edi, %edi
cmpl %eax, 0x20(%rsi)
setb %dil
cmovaeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x93a3
movq %rcx, %rsi
cmpq %rcx, %rdx
je 0x93cc
cmpl 0x20(%rdx), %eax
cmovbq %rcx, %rdx
movq %rdx, %rsi
cmpq %rcx, %rsi
je 0x93f2
leaq 0x8(%r14), %rdi
leaq 0xc(%rsp), %rsi
callq 0x96ca
movq (%rax), %rax
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x228(%rax)
jmp 0x940a
movq %r15, %rdi
callq 0x6110
movq %r14, %rdi
movl %eax, %esi
movss 0x8(%rsp), %xmm0
callq 0x9456
movq 0xf8(%r14), %rax
testq %rax, %rax
je 0x9427
callq *%rax
jmp 0x9427
testq %rcx, %rcx
je 0x9427
movq %r15, %rdi
callq 0x6930
movq %rbx, %rdi
callq 0x64b0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x6430
jmp 0x9442
movq %rax, %r14
movq %rbx, %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::updatePeakByDeviceId(unsigned int, float)
void Pa::updatePeakByDeviceId(uint32_t index, float peak)
{
    for (auto &s : PA_SINKS) {
        if (s.second->monitor_index == index) {
            s.second->peak = peak;
        }
    }

    for (auto &s : PA_SOURCES) {
        if (s.second->monitor_index == index) {
            s.second->peak = peak;
        }
    }

    for (auto &s : PA_SOURCE_OUTPUTS) {
        if (s.second->monitor_index == index) {
            s.second->peak = peak;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss %xmm0, 0xc(%rsp)
movl %esi, %ebx
movq %rdi, %r14
movq 0x50(%rdi), %rax
leaq 0x40(%rdi), %r15
cmpq %r15, %rax
je 0x949b
movq 0x28(%rax), %rcx
cmpl %ebx, 0x21c(%rcx)
jne 0x9491
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x228(%rcx)
movq %rax, %rdi
callq 0x6440
jmp 0x9472
movq 0x80(%r14), %rax
leaq 0x70(%r14), %r15
cmpq %r15, %rax
je 0x94cf
movq 0x28(%rax), %rcx
cmpl %ebx, 0x21c(%rcx)
jne 0x94c5
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x228(%rcx)
movq %rax, %rdi
callq 0x6440
jmp 0x94a6
movq 0xb0(%r14), %rax
addq $0xa0, %r14
cmpq %r14, %rax
je 0x9506
movq 0x28(%rax), %rcx
cmpl %ebx, 0x21c(%rcx)
jne 0x94fc
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x228(%rcx)
movq %rax, %rdi
callq 0x6440
jmp 0x94dd
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::create_monitor_stream_for_source(unsigned int, unsigned int)
pa_stream *Pa::create_monitor_stream_for_source(uint32_t source_index,
        uint32_t stream_index = -1)
{
    pa_stream *s;
    char t[16];
    pa_buffer_attr attr;
    pa_sample_spec ss;
    pa_stream_flags_t flags;

    ss.channels = 1;
    ss.format = PA_SAMPLE_FLOAT32;
    ss.rate = 25;

    memset(&attr, 0, sizeof(attr));
    attr.fragsize = sizeof(float);
    attr.maxlength = (uint32_t) - 1;

    snprintf(t, sizeof(t), "%u", source_index);

    if (!(s = pa_stream_new(pa_ctx, "Peak detect", &ss, NULL))) {
        return NULL;
    }

    if (stream_index != (uint32_t) - 1) {
        pa_stream_set_monitor_stream(s, stream_index);
    }

    pa_stream_set_read_callback(s, &Pa::read_callback, this);

    flags = (pa_stream_flags_t)(PA_STREAM_DONT_MOVE | PA_STREAM_PEAK_DETECT |
                                PA_STREAM_ADJUST_LATENCY);

    if (pa_stream_connect_record(s, t, &attr, flags) < 0) {
        pa_stream_unref(s);
        return NULL;
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x3c(%rsp), %r14
movb $0x1, 0x8(%r14)
movabsq $0x1900000005, %rax     # imm = 0x1900000005
movq %rax, (%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movl $0x4, 0x10(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
leaq 0x7e0d(%rip), %rdx      # 0x11362
xorl %r15d, %r15d
leaq 0x20(%rsp), %rdi
movl $0x10, %esi
xorl %eax, %eax
callq 0x6990
movq 0x150(%rbx), %rdi
leaq 0x7dee(%rip), %rsi      # 0x11365
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x64e0
testq %rax, %rax
je 0x95d3
movq %rax, %r14
cmpl $-0x1, %ebp
je 0x9598
movq %r14, %rdi
movl %ebp, %esi
callq 0x6790
leaq -0x2ab(%rip), %rsi      # 0x92f4
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6520
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %r14, %rdi
movl $0x2a00, %ecx           # imm = 0x2A00
callq 0x6310
testl %eax, %eax
js 0x95c8
movq %r14, %r15
jmp 0x95d3
movq %r14, %rdi
callq 0x6730
xorl %r15d, %r15d
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/config.cpp
// Function: Config::getKeycodeNameEvents[abi:cxx11]() const
const config_map Config::getKeycodeNameEvents() const
{
    config_map keycodes{};

    for (const auto& it : config) {
        const auto kn{getKeycodeName(it.first.c_str())};
        if (kn.empty()) continue;
        keycodes[kn] = it.second;
    }
    return keycodes;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, (%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq $0x0, 0x28(%rdi)
movq 0x18(%rsi), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x9d79
leaq 0x10(%rsp), %r13
movq %rsp, %r12
movq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x99e4
cmpq $0x0, 0x8(%rsp)
je 0x9d53
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa950
leaq 0x40(%r15), %rsi
movq %rax, %rdi
callq 0x6340
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x9d69
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x65c0
movq %r15, %rdi
callq 0x66a0
movq %rax, %r15
cmpq %r14, %rax
jne 0x9d28
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
jmp 0x9da8
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x9da8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x65c0
movq %rbx, %rdi
callq 0xaf56
movq %r14, %rdi
callq 0x6a80
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/config.cpp
// Function: Config::getHomeDir()
const char *Config::getHomeDir()
{
    const char *homedir = getenv("HOME");
    if (homedir != nullptr) return homedir;
    passwd pwd = {nullptr}, *result{nullptr};
    size_t bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
    if (bufsize == static_cast<size_t>(-1)) bufsize = 16384;

    std::unique_ptr<char[]> buf = std::make_unique<char[]>(bufsize);
    getpwuid_r(getuid(), &pwd, buf.get(), bufsize, &result);
    if (result == nullptr) {
        fprintf(stderr, "Unable to find home-directory\n");
        exit(EXIT_FAILURE);
    }

    homedir = result->pw_dir;
    return homedir;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x7616(%rip), %rdi      # 0x113e0
callq 0x6700
movq %rax, %r14
testq %rax, %rax
jne 0x9e5b
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
movl $0x46, %edi
callq 0x6410
cmpq $-0x1, %rax
movl $0x4000, %r12d          # imm = 0x4000
cmovneq %rax, %r12
movq %r12, %rdi
callq 0x6040
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x6350
callq 0x6300
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x6bb0
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x9e6a
movq 0x20(%rax), %r14
movq %rbx, %rdi
callq 0x6770
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x6d1d
movq %rax, %r14
movq %rbx, %rdi
callq 0x6770
movq %r14, %rdi
callq 0x6a80
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/config.cpp
// Function: Config::getConfigFile(std::optional<std::filesystem::__cxx11::path>&)
bool Config::getConfigFile(std::optional<fs::path>& conf)
{
    if (!conf.has_value())
    {
        if (getDefaultConfigFile()) return true;
        return false;
    }

    std::error_code ec{};
    const auto config_file{conf.value()};
    if (!fs::exists(config_file, ec))
    {
        fprintf(stderr, "Unable to find config file '%s'.\n", config_file.c_str());
        return false;
    }

    full_path = fs::absolute(config_file, ec);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x28(%rsi)
je 0xa1e5
movq %rsi, %r15
leaq 0x8(%rsp), %r12
movl $0x0, (%r12)
callq 0x6390
movq %rax, %r14
movq %rax, 0x8(%r12)
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xab0c
movq %r13, %rdi
movq %r12, %rsi
callq 0x67e0
andq $0xff, %rax
je 0xa1fb
movl $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
cmpl $0xff, %eax
setne %bpl
jmp 0xa1fd
movq %rbx, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9e82
xorl %ebp, %ebp
testb %bpl, %bpl
je 0xa254
leaq 0x40(%rsp), %r14
leaq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x64a0
leaq 0x30(%rbx), %rdi
cmpq %rdi, %r14
je 0xa22f
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x6de8
leaq 0x40(%rsp), %rdi
callq 0x7324
leaq 0x18(%rsp), %rdi
callq 0x7324
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %rdi
callq 0x6dc4
jmp 0xa239
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x7324
movq %rbx, %rdi
callq 0x6a80
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/ui.cpp
// Function: Ui::switchTab(int)
void Ui::switchTab(int index)
{
    if (disconnect) {
        return;
    }

    delete current_tab;

    tab_index = index;

    switch (index) {
        default:
        case TAB_PLAYBACK:
            tab_index = TAB_PLAYBACK;
            current_tab = new Playback();
            break;

        case TAB_RECORDING:
            current_tab = new Recording();
            break;

        case TAB_OUTPUT:
            current_tab = new Output();
            break;

        case TAB_INPUT:
            current_tab = new Input();
            break;

        case -1:
        case TAB_CONFIGURATION:
            tab_index = TAB_CONFIGURATION;
            current_tab = new Configuration();
            break;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x105(%rdi)
jne 0xc80f
movl %esi, %r14d
movq %rdi, %rbx
movq 0x138(%rdi), %rdi
testq %rdi, %rdi
je 0xc763
movq (%rdi), %rax
callq *0x8(%rax)
movl %r14d, 0x130(%rbx)
incl %r14d
cmpl $0x5, %r14d
ja 0xc7a4
leaq 0x5ef2(%rip), %rax      # 0x1266c
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x4, 0x130(%rbx)
movl $0x28, %edi
callq 0x65b0
movq %rax, %r14
movq %rax, %rdi
callq 0x105f4
jmp 0xc808
movl $0x0, 0x130(%rbx)
movl $0x28, %edi
callq 0x65b0
movq %rax, %r14
movq %rax, %rdi
callq 0x103c0
jmp 0xc808
movl $0x28, %edi
callq 0x65b0
movq %rax, %r14
movq %rax, %rdi
callq 0x1044c
jmp 0xc808
movl $0x28, %edi
callq 0x65b0
movq %rax, %r14
movq %rax, %rdi
callq 0x104dc
jmp 0xc808
movl $0x28, %edi
callq 0x65b0
movq %rax, %r14
movq %rax, %rdi
callq 0x10568
movq %r14, 0x138(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0xc81f
jmp 0xc81f
jmp 0xc81f
jmp 0xc81f
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x65c0
movq %rbx, %rdi
callq 0x6a80
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/ui.cpp
// Function: Ui::checkPulseAudio()
void Ui::checkPulseAudio()
{
    if (!pulse.connected && !disconnect) {
        disconnect = true;
        delete current_tab;
        current_tab = new Fallback();
    } else if (pulse.connected && disconnect) {
        disconnect = false;
        switchTab(tab_index);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xbdc5(%rip), %rax      # 0x18608
movb 0x1(%rax), %al
testb %al, %al
je 0xc869
cmpb $0x1, 0x105(%rbx)
jne 0xc8ce
movb $0x0, 0x105(%rbx)
movl 0x130(%rbx), %esi
movq %rbx, %rdi
popq %rbx
jmp 0xc73a
cmpb $0x0, 0x105(%rbx)
je 0xc878
testb %al, %al
jne 0xc84a
jmp 0xc8ce
movb $0x1, 0x105(%rbx)
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0xc891
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x28, %edi
callq 0x65b0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movups %xmm0, 0xc(%rax)
movups %xmm0, 0x18(%rax)
movb $0x1, 0x8(%rax)
leaq 0xb3c0(%rip), %rcx      # 0x17c80
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rax, 0x138(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/ui.cpp
// Function: Ui::draw()
void Ui::draw()
{
    werase(window);
    current_tab->draw();
    wrefresh(window);

    statusBar();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x6080
movq 0x138(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x10(%rbx), %rdi
callq 0x6670
movq %rbx, %rdi
popq %rbx
jmp 0xd32c
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/ui.cpp
// Function: Ui::statusBar()
void Ui::statusBar()
{
    werase(statusbar);

    int len = 0;

    for (int i = 0; i < NUM_TABS; ++i) {
        if (tab_index == i) {
            wattron(statusbar, COLOR_PAIR(COLOR_SELECTED));
        } else {
            wattron(statusbar, COLOR_PAIR(COLOR_DEFAULT));
        }

        mvwaddstr(statusbar, 0, len, tabs[i]);
        len += strlen(tabs[i]) + 1;

        if (tab_index == i) {
            wattroff(statusbar, COLOR_PAIR(COLOR_SELECTED));
        } else {
            wattroff(statusbar, COLOR_PAIR(COLOR_DEFAULT));
        }
    }

    wrefresh(statusbar);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x6080
xorl %r15d, %r15d
xorl %r14d, %r14d
movl 0x130(%rbx), %eax
xorl %esi, %esi
cmpq %rax, %r15
sete %sil
movq 0x18(%rbx), %rdi
shll $0x8, %esi
addl $0x900, %esi            # imm = 0x900
xorl %edx, %edx
callq 0x62e0
movq 0x18(%rbx), %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xd38f
movq 0x18(%rbx), %rdi
movq 0x108(%rbx,%r15,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6200
movq 0x108(%rbx,%r15,8), %rdi
callq 0x62b0
addl %eax, %r14d
incl %r14d
movl 0x130(%rbx), %eax
xorl %esi, %esi
cmpq %rax, %r15
sete %sil
movq 0x18(%rbx), %rdi
shll $0x8, %esi
addl $0x900, %esi            # imm = 0x900
xorl %edx, %edx
callq 0x6750
incq %r15
cmpq $0x5, %r15
jne 0xd343
movq 0x18(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6670
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/ui.cpp
// Function: Ui::run()
void Ui::run()
{
    while (running) {
        checkPulseAudio();
        draw();

        usleep(20000);

        handleInput();
    }
}

// Assembly:
cmpb $0x1, 0x104(%rdi)
jne 0xd419
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
callq 0xc838
movq %rbx, %rdi
callq 0xd300
movl $0x4e20, %edi           # imm = 0x4E20
callq 0x6810
movq %rbx, %rdi
callq 0xc8d0
cmpb $0x0, 0x104(%rbx)
jne 0xd3ed
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/tab.cpp
// Function: Tab::borderBox(int, int, int, int)
void Tab::borderBox(int w, int h, int px, int py)
{
    wattron(ui.window, COLOR_PAIR(COLOR_BORDER));

    mvwvline(ui.window, py, px, ACS_VLINE, h);
    mvwvline(ui.window, py, px + w, ACS_VLINE, h);

    mvwhline(ui.window, py, px, ACS_HLINE, w);
    mvwhline(ui.window, py + h, px, ACS_HLINE, w);

    mvwhline(ui.window, py, px, ACS_ULCORNER, 1);
    mvwhline(ui.window, py, px + w, ACS_URCORNER, 1);

    mvwhline(ui.window, py + h, px, ACS_LLCORNER, 1);
    mvwhline(ui.window, py + h, px + w, ACS_LRCORNER, 1);

    wattroff(ui.window, COLOR_PAIR(COLOR_BORDER));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %r14d
movl %esi, %ebx
movl %edi, %r12d
leaq 0xa7b1(%rip), %r13      # 0x187f8
movq 0x10(%r13), %rdi
movl $0xd00, %esi            # imm = 0xD00
xorl %edx, %edx
callq 0x62e0
movq 0x10(%r13), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe083
movq 0x10(%r13), %rdi
movq 0x9eca(%rip), %rax      # 0x17f40
movl 0x1e0(%rax), %esi
movl %ebx, %edx
callq 0x6740
movq 0x10(%r13), %rdi
leal (%r14,%r12), %ebp
movl %r15d, %esi
movl %ebp, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe0b2
movq 0x10(%r13), %rdi
movq 0x9e9b(%rip), %rax      # 0x17f40
movl 0x1e0(%rax), %esi
movl %ebx, %edx
callq 0x6740
movq 0x10(%r13), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe0df
movq 0x10(%r13), %rdi
movq 0x9e6f(%rip), %rax      # 0x17f40
movl 0x1c4(%rax), %esi
movl %r12d, %edx
callq 0x6550
movq 0x10(%r13), %rdi
addl %r15d, %ebx
movl %ebx, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe10e
movq 0x10(%r13), %rdi
movq 0x9e40(%rip), %rax      # 0x17f40
movl 0x1c4(%rax), %esi
movl %r12d, %edx
callq 0x6550
movq 0x10(%r13), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe13d
movq 0x10(%r13), %rdi
movq 0x9e13(%rip), %rax      # 0x17f40
movl 0x1b0(%rax), %esi
movl $0x1, %edx
callq 0x6550
movq 0x10(%r13), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe16b
movq 0x10(%r13), %rdi
movq 0x9de5(%rip), %rax      # 0x17f40
movl 0x1ac(%rax), %esi
movl $0x1, %edx
callq 0x6550
movq 0x10(%r13), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe199
movq 0x10(%r13), %rdi
movq 0x9db7(%rip), %rax      # 0x17f40
movl 0x1b4(%rax), %esi
movl $0x1, %edx
callq 0x6550
movq 0x10(%r13), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xe1c6
movq 0x10(%r13), %rdi
movq 0x9d8a(%rip), %rax      # 0x17f40
movl 0x1a8(%rax), %esi
movl $0x1, %edx
callq 0x6550
movq 0x10(%r13), %rdi
movl $0xd00, %esi            # imm = 0xD00
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6750
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/tab.cpp
// Function: Tab::handleDropDown(PaObject*)
int Tab::getBlockSize()
{
    int BLOCK_SIZE = 5;

    if (has_volume) {
        if (ui.hide_top) {
            BLOCK_SIZE -= 1;
        }

        if (ui.hide_bottom) {
            BLOCK_SIZE -= 1;
        }
    }

    return BLOCK_SIZE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movb 0x8(%rdi), %r15b
leaq 0xa005(%rip), %rax      # 0x187f8
movzbl 0x101(%rax), %ecx
andl $0x1, %ecx
xorl $0x5, %ecx
movzbl 0x102(%rax), %edx
subl %edx, %ecx
testb %r15b, %r15b
movl $0x5, %r12d
cmovnel %ecx, %r12d
testq %rsi, %rsi
je 0xe925
movq %rsi, %rbx
movq 0x18(%rdi), %rsi
movl 0x20(%rdi), %r14d
movl 0x24(%rdi), %r13d
testq %rsi, %rsi
je 0xe896
leaq 0x18(%rsp), %rdi
callq 0xfb3e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
decl %r13d
imull %r12d, %r13d
imull %r12d, %r14d
cmpl %r14d, %r13d
cmovll %r13d, %r14d
leaq 0x18(%rsp), %rdx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r14d, %esi
movl %eax, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xee10
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
callq 0x972e
cmpl $-0x1, %ebp
je 0xe925
movq %rbx, %rdi
movl %ebp, %esi
callq 0x76c4
jmp 0xe925
movl 0x8(%rax), %ebp
leaq 0x238(%rbx), %rsi
movq %rsp, %rdi
callq 0xfa4e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
decl %r13d
imull %r12d, %r13d
imull %r12d, %r14d
cmpl %r14d, %r13d
cmovll %r13d, %r14d
leal 0x2(%r14), %esi
movzbl %r15b, %edi
negl %edi
orl $0x1, %edi
addl $-0x3, %ebp
xorl %ecx, %ecx
testb %r15b, %r15b
cmovnel %r14d, %esi
cmovnel %ecx, %ebp
movq %rsp, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0xef3a
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe907
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x65c0
cmpl $-0x1, %ebp
je 0xe925
movl %ebp, %eax
movq 0x238(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x76fa
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xe95c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x65c0
jmp 0xe95c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x972e
movq %rbx, %rdi
callq 0x6a80
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/tab.cpp
// Function: Tab::handleMouseVolumeBar(PaObject*, int, int, int, int, int, int, int)
bool Tab::handleMouseVolumeBar(
    PaObject* item,
    int mousex,
    int mousey,
    int w,
    int h,
    int x,
    int y, 
    int button
)
{
    if (mousex < x || mousex >= x + w || mousey < (y - 1) || mousey >= y + 2) {
        return false;
    }

    if (button == 4) {
        item->step_volume(1);
    } else if (button == 5) {
        item->step_volume(-1);
    } else {
        item->set_volume(((mousex - x + 1) / (float)(w - x)) * 1.5f);
    }
    return true;
}

// Assembly:
pushq %rbx
movl 0x18(%rsp), %r9d
movl 0x10(%rsp), %eax
movl %edx, %edi
subl %eax, %edi
setge %r10b
leal (%rax,%r8), %r11d
cmpl %edx, %r11d
setg %dl
andb %r10b, %dl
leal -0x1(%r9), %r10d
cmpl %ecx, %r10d
setle %r10b
addl $0x2, %r9d
cmpl %ecx, %r9d
setg %bl
andb %r10b, %bl
andb %dl, %bl
cmpb $0x1, %bl
jne 0xed4b
movl 0x20(%rsp), %ecx
cmpl $0x5, %ecx
je 0xed1a
cmpl $0x4, %ecx
jne 0xed29
movq %rsi, %rdi
movl $0x1, %esi
jmp 0xed22
movq %rsi, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x764e
jmp 0xed4b
incl %edi
cvtsi2ss %edi, %xmm0
subl %eax, %r8d
cvtsi2ss %r8d, %xmm1
divss %xmm1, %xmm0
mulss 0x3be5(%rip), %xmm0     # 0x12928
movq %rsi, %rdi
callq 0x75b0
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/tab.cpp
// Function: Tab::fillW(int, int, int, int, char const*)
void Tab::fillW(int w, int h, int offset_x, int offset_y, const char *str)
{
    int wo = (w - offset_x);

    wattron(ui.window, COLOR_PAIR(COLOR_BORDER));

    for (int i = 0; i < wo; i++) {
        mvwaddstr(ui.window, offset_y, offset_x + i, str);
    }

    wattroff(ui.window, COLOR_PAIR(COLOR_BORDER));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %edi, %r15d
movl %edi, %r13d
subl %edx, %r13d
leaq 0x8e97(%rip), %r12      # 0x187f8
movq 0x10(%r12), %rdi
movl $0xd00, %esi            # imm = 0xD00
xorl %edx, %edx
callq 0x62e0
testl %r13d, %r13d
jle 0xf9a5
movq 0x10(%r12), %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0x65f0
cmpl $-0x1, %eax
je 0xf99d
movq 0x10(%r12), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6200
incl %r14d
cmpl %r14d, %r15d
jne 0xf977
movq 0x10(%r12), %rdi
movl $0xd00, %esi            # imm = 0xD00
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6750
// File: /workspace/github_cpp_makefile_star2_O1/fulhax[P]ncpamixer/src/ui/tabs/configuration.cpp
// Function: Configuration::Configuration()
Configuration::Configuration()
{
    object = &pulse.PA_CARDS;
    toggle = nullptr;

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

    has_volume = false;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdi)
movups %xmm0, 0x18(%rdi)
movb $0x1, 0x8(%rdi)
leaq 0x763c(%rip), %rax      # 0x17c50
movq %rax, (%rdi)
movl $0xc8, %esi
addq 0x7985(%rip), %rsi      # 0x17fa8
movq %rsi, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xfb3e
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x886e
movl %eax, 0xc(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x972e
movb $0x0, 0x8(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x972e
movq %rbx, %rdi
callq 0x6a80
nop
// File: /workspace/github_cpp_makefile_star2_O1/miklhh[P]tetris/src/draw.cpp
// Function: draw_box(int, int, int, int, int, int, SDL_Renderer*, int)
void draw_box(
    int             x_px,
    int             y_px,
    int             w_px,
    int             h_px,
    color_t         color_forth,
    color_t         color_back,
    SDL_Renderer*   renderer,
    int             margin
)
{
	/* Create rectangles. */
	SDL_Rect rectangle_outer;
	SDL_Rect rectangle_inner;

	/* Set parameters. */
	rectangle_outer.h = h_px;
	rectangle_outer.w = w_px;
	rectangle_outer.x = x_px;
	rectangle_outer.y = y_px;

	rectangle_inner.h = h_px - 2 * margin;
	rectangle_inner.w = w_px - 2 * margin;
	rectangle_inner.x = x_px + margin;
	rectangle_inner.y = y_px + margin;

	/* Draw outer rectangle. */
	SetColor(color_back, renderer);
	SDL_RenderFillRect(renderer, &rectangle_outer);
	SDL_RenderDrawRect(renderer, &rectangle_outer);


	/* Draw inner rectangle. */
	SetColor(color_forth, renderer);
	SDL_RenderFillRect(renderer, &rectangle_inner);
	SDL_RenderDrawRect(renderer, &rectangle_inner);

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebp
movq 0x50(%rsp), %rbx
movl 0x58(%rsp), %eax
leaq 0x18(%rsp), %r15
movl %ecx, 0xc(%r15)
movl %edx, 0x8(%r15)
movl %edi, (%r15)
movl %esi, 0x4(%r15)
leal (%rax,%rax), %r8d
subl %r8d, %ecx
leaq 0x8(%rsp), %r14
movl %ecx, 0xc(%r14)
subl %r8d, %edx
movl %edx, 0x8(%r14)
addl %eax, %edi
movl %edi, (%r14)
addl %esi, %eax
movl %eax, 0x4(%r14)
movl %r9d, %edi
movq %rbx, %rsi
callq 0x24d4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2140
movl %ebp, %edi
movq %rbx, %rsi
callq 0x24d4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/miklhh[P]tetris/src/draw.cpp
// Function: SetColor(int, SDL_Renderer*)
static void SetColor(int color, SDL_Renderer* renderer)
{
	switch (color)
	{
	case COLOR_BLUE:
		SDL_SetRenderDrawColor(renderer, 0, 0, 255, 0);
		break;

	case COLOR_RED:
		SDL_SetRenderDrawColor(renderer, 255, 0, 0, 0);
		break;

	case COLOR_GREEN:
		SDL_SetRenderDrawColor(renderer, 0, 255, 0, 0);
		break;

	case COLOR_WHITE:
		SDL_SetRenderDrawColor(renderer, 255, 255, 255, 0);
		break;

	case COLOR_BLACK:
		SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
		break;

	case COLOR_GREY:
		SDL_SetRenderDrawColor(renderer, 110, 110, 80, 0);
		break;

	case COLOR_DARK_GREY:
		SDL_SetRenderDrawColor(renderer, 25, 25, 20, 0);
		break;

	case COLOR_TRANS_WHITE:
		SDL_SetRenderDrawColor(renderer, 240, 240, 240, 210);
		break;

	default:
		SDL_SetRenderDrawColor(renderer, 255, 255, 255, 0);
		break;
	}
}

// Assembly:
cmpl $0x8, %edi
ja 0x24eb
movl %edi, %eax
leaq 0x1b22(%rip), %rcx      # 0x4004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rsi, %rdi
movl $0xff, %esi
movl $0xff, %edx
jmp 0x2515
movq %rsi, %rdi
movl $0x6e, %esi
movl $0x6e, %edx
movl $0x50, %ecx
jmp 0x256c
movq %rsi, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0xff, %ecx
jmp 0x256c
movq %rsi, %rdi
movl $0x19, %esi
movl $0x19, %edx
movl $0x14, %ecx
jmp 0x256c
movq %rsi, %rdi
movl $0xf0, %esi
movl $0xf0, %edx
movl $0xf0, %ecx
movl $0xd2, %r8d
jmp 0x2210
movq %rsi, %rdi
movl $0xff, %esi
jmp 0x2568
movq %rsi, %rdi
xorl %esi, %esi
movl $0xff, %edx
jmp 0x256a
movq %rsi, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
jmp 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/miklhh[P]tetris/src/draw.cpp
// Function: draw_block(block_t, int, int)
void draw_block(block_t block, int tile_x, int tile_y)
{
	extern int block_width;
	extern int block_height;
	extern SDL_Renderer* renderer;

	for (int y = 0; y < MAX_BLOCK_HEIGHT; y++)
	{
		for (int x = 0; x < MAX_BLOCK_WIDTH; x++)
		{
			if (block.structure.tile[y][x] == FILLED)
			{
				draw_box(
					(tile_x + x) * block_width,
					(tile_y + y) * block_width,
					block_width,
					block_height,
					block.color,
					COLOR_BLOCK_BACKGROUND,
					renderer
				);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
leaq 0x60(%rsp), %r14
movl -0x10(%r14), %ebp
movl %edi, %r15d
xorl %ecx, %ecx
leaq 0x45d4(%rip), %r12      # 0x6b70
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rsp)
leal (%rcx,%rax), %r13d
xorl %ebx, %ebx
cmpl $0x1, (%r14,%rbx,4)
jne 0x25ea
leaq 0x45c6(%rip), %rax      # 0x6b80
movl (%rax), %edx
leal (%r15,%rbx), %edi
imull %edx, %edi
movl %edx, %esi
imull %r13d, %esi
leaq 0x45b4(%rip), %rax      # 0x6b84
movl (%rax), %ecx
movl %ebp, %r8d
movl $0x8, %r9d
pushq $0x2
pushq (%r12)
callq 0x243c
addq $0x10, %rsp
incq %rbx
cmpq $0x4, %rbx
jne 0x25ac
movq 0x10(%rsp), %rcx
incq %rcx
addq $0x10, %r14
cmpq $0x4, %rcx
jne 0x259c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq