LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::fd_watcher_impl<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>, subproc_out_watch>::dispatch(void*)
void dispatch(void *loop_ptr) noexcept override
    {
        EventLoop &loop = *static_cast<EventLoop *>(loop_ptr);

        // In case emulating, clear enabled here; REARM or explicit set_enabled will re-enable.
        this->emulate_enabled = false;

        loop_access::get_base_lock(loop).unlock();

        auto rearm_type = static_cast<Derived *>(this)->fd_event(loop, this->watch_fd, this->event_flags);

        loop_access::get_base_lock(loop).lock();

        if (rearm_type != rearm::REMOVED) {
            this->event_flags = 0;
            this->active = false;
            if (this->deleteme) {
                // We don't want a watch that is marked "deleteme" to re-arm itself.
                rearm_type = rearm::REMOVE;
            }

            rearm_type = loop_access::process_fd_rearm(loop, this, rearm_type);

            post_dispatch(loop, this, rearm_type);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andb $-0x9, 0xc(%rdi)
movq %rsi, %r14
movl 0x1c(%rdi), %edx
movl 0x24(%rdi), %ecx
callq 0x612a
cmpl $0x4, %eax
jne 0x60dc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x0, 0x24(%rbx)
movb 0xc(%rbx), %cl
movl %ecx, %edx
andb $-0x2, %dl
movb %dl, 0xc(%rbx)
testb $0x2, %cl
movl $0x3, %edx
cmovel %eax, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4e2a
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4bf2
movq %rax, %rdi
callq 0x4904
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: void dasynq::v2::dprivate::post_dispatch<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>>(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, dasynq::v2::dprivate::base_watcher*, dasynq::rearm)
void post_dispatch(Loop &loop, base_watcher *watcher, rearm rearm_type)
    {
        if (rearm_type == rearm::REMOVE) {
            loop_access::get_base_lock(loop).unlock();
            loop_access::release_watcher(loop, watcher);
            watcher->watch_removed();
            loop_access::get_base_lock(loop).lock();
        }
        else if (rearm_type == rearm::REQUEUE) {
            loop_access::requeue_watcher(loop, watcher);
        }
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
cmpl $0x5, %edx
je 0x4c1b
cmpl $0x3, %edx
jne 0x4c3f
leaq 0x10(%rbx), %rsi
callq 0x4f6a
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
jmpq *0x20(%rax)
movl 0x18(%rbx), %eax
addq $0x10, %rbx
movq 0x20(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rdi)
movq %rsp, %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %rbx, %rsi
callq 0x5004
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::process_fd_rearm(dasynq::v2::dprivate::base_fd_watcher*, dasynq::rearm)
rearm process_fd_rearm(base_fd_watcher * bfw, rearm rearm_type) noexcept
    {
        bool emulatedfd = static_cast<base_watcher *>(bfw)->emulatefd;

        if (emulatedfd) {
            if (rearm_type == rearm::REARM) {
                bfw->emulate_enabled = true;
                rearm_type = rearm::REQUEUE;
            }
            else if (rearm_type == rearm::DISARM) {
                bfw->emulate_enabled = false;
            }
            else if (rearm_type == rearm::NOOP) {
                if (bfw->emulate_enabled) {
                    rearm_type = rearm::REQUEUE;
                }
            }
        }
        else  if (rearm_type == rearm::REARM) {
            set_fd_enabled_nolock(bfw, bfw->watch_fd,
                    bfw->watch_flags & (IN_EVENTS | OUT_EVENTS), true);
        }
        else if (rearm_type == rearm::DISARM) {
            loop_mech.disable_fd_watch_nolock(bfw->watch_fd, bfw->watch_flags);
        }
        else if (rearm_type == rearm::REMOVE) {
            loop_mech.remove_fd_watch_nolock(bfw->watch_fd, bfw->watch_flags);
        }
        return rearm_type;
    }

// Assembly:
subq $0x18, %rsp
movl %edx, %eax
movq %rsi, %rdx
movb 0xc(%rsi), %cl
testb $0x4, %cl
jne 0x4e62
cmpl $0x3, %eax
je 0x4eb2
cmpl $0x1, %eax
je 0x4e7d
testl %eax, %eax
jne 0x4edd
movl 0x1c(%rdx), %esi
movl 0x20(%rdx), %ecx
andl $0x3, %ecx
orl $0x8, %ecx
callq 0x4f24
xorl %eax, %eax
jmp 0x4edd
cmpl $0x2, %eax
je 0x4ece
cmpl $0x1, %eax
je 0x4ea5
testl %eax, %eax
jne 0x4edd
orb $0x8, %cl
movb %cl, 0xc(%rdx)
movl $0x5, %eax
jmp 0x4edd
movl 0x1c(%rdx), %edx
leaq 0xc(%rsp), %rcx
movq $0x0, 0x4(%rcx)
movl $0x0, (%rcx)
movl 0xa0(%rdi), %edi
movl $0x3, %esi
callq 0x3360
jmp 0x4eab
andb $-0x9, %cl
movb %cl, 0xc(%rdx)
movl $0x1, %eax
jmp 0x4edd
movl 0x1c(%rdx), %edx
movl 0xa0(%rdi), %edi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x3360
movl $0x3, %eax
jmp 0x4edd
andb $0x8, %cl
shrb $0x3, %cl
movzbl %cl, %eax
leal (%rax,%rax,2), %eax
addl $0x2, %eax
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::set_fd_enabled_nolock(dasynq::v2::dprivate::base_watcher*, int, int, bool)
void set_fd_enabled_nolock(base_watcher *watcher, int fd, int watch_flags, bool enabled) noexcept
    {
        if (enabled) {
            loop_mech.enable_fd_watch_nolock(fd, watcher, watch_flags | ONE_SHOT);
            if (backend_traits_t::interrupt_after_fd_add) {
                interrupt_if_necessary();
            }
        }
        else {
            loop_mech.disable_fd_watch_nolock(fd, watch_flags);
        }
    }

// Assembly:
testl %r8d, %r8d
je 0x4ef7
movq %rsi, %rax
orl $0x8, %ecx
movl %edx, %esi
movq %rax, %rdx
jmp 0x4f24
subq $0x18, %rsp
leaq 0xc(%rsp), %rcx
movq $0x0, 0x4(%rcx)
movl $0x0, (%rcx)
movl 0xa0(%rdi), %edi
movl $0x3, %esi
callq 0x3360
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/epoll.h
// Function: dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>::enable_fd_watch(int, void*, int)
void enable_fd_watch(int fd, void *userdata, int flags) noexcept
    {
        struct epoll_event epevent;
        // epevent.data.fd = fd;
        epevent.data.ptr = userdata;
        epevent.events = 0;
        
        if (flags & ONE_SHOT) {
            epevent.events = EPOLLONESHOT;
        }
        if (flags & IN_EVENTS) {
            epevent.events |= EPOLLIN;
        }
        if (flags & OUT_EVENTS) {
            epevent.events |= EPOLLOUT;
        }
        
        if (epoll_ctl(epfd, EPOLL_CTL_MOD, fd, &epevent) == -1) {
            // Shouldn't be able to fail
            // throw std::system_error(errno, std::system_category());
        }
    }

// Assembly:
subq $0x18, %rsp
movq %rdx, %rax
movl %esi, %edx
movq %rax, 0x10(%rsp)
movl %ecx, %eax
andl $0x8, %eax
shll $0x1b, %eax
movl %ecx, %esi
andl $0x1, %esi
orl %eax, %esi
movl %esi, 0xc(%rsp)
testb $0x2, %cl
je 0x4f4f
orb $0x4, 0xc(%rsp)
movl 0xa0(%rdi), %edi
leaq 0xc(%rsp), %rcx
movl $0x3, %esi
callq 0x3360
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/svec.h
// Function: dasynq::svector<dasynq::dary_heap<dasynq::v2::dprivate::empty_node, dasynq::stable_prio<int>, dasynq::compare_stable_prio<int, std::less<int>>, 4>::heap_node>::change_capacity(unsigned long)
bool change_capacity(size_type c)
            noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value)
    {
        _Pragma ("GCC diagnostic push")
        _Pragma ("GCC diagnostic ignored \"-Walloc-size-larger-than=\"")

        T *new_storage = (T *)(new (std::nothrow) char[c * sizeof(T)]);
        if (new_storage == nullptr) return false;

        _Pragma ("GCC diagnostic pop")

        // To transfer, we prefer move unless it is throwing and copy exists
        svec_helper::move_helper<T>::move(array, new_storage, size_v);

        delete[] (char *)array;
        array = new_storage;
        capacity_v = c;

        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%rsi,8), %rax
leaq (%rax,%rax,2), %rdi
movq 0x8fd0(%rip), %rsi      # 0xdf80
callq 0x3410
movq %rax, %r15
testq %rax, %rax
je 0x4ff8
movq (%r14), %rdi
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x4fe7
xorl %ecx, %ecx
movq 0x10(%rdi,%rcx), %rdx
movq %rdx, 0x10(%r15,%rcx)
movups (%rdi,%rcx), %xmm0
movups %xmm0, (%r15,%rcx)
addq $0x18, %rcx
decq %rax
jne 0x4fcb
testq %rdi, %rdi
je 0x4ff1
callq 0x3330
movq %r15, (%r14)
movq %rbx, 0x10(%r14)
testq %r15, %r15
setne %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/daryheap.h
// Function: dasynq::dary_heap<dasynq::v2::dprivate::empty_node, dasynq::stable_prio<int>, dasynq::compare_stable_prio<int, std::less<int>>, 4>::insert(dasynq::dary_heap<dasynq::v2::dprivate::empty_node, dasynq::stable_prio<int>, dasynq::compare_stable_prio<int, std::less<int>>, 4>::handle_t&, dasynq::stable_prio<int> const&)
bool insert(handle_t & hnd, const P &pval) noexcept
    {
        hnd.heap_index = hvec.size();
        // emplace an empty node; data/prio will be stored via bubble_down.
        hvec.emplace_back();
        return bubble_down(hvec.size() - 1, &hnd, pval);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rax
movq %rax, (%rsi)
callq 0x5040
movq 0x8(%r15), %rsi
decq %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x50c4
movq %rax, %rdi
callq 0x4904
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/svec.h
// Function: void dasynq::svector<dasynq::dary_heap<dasynq::v2::dprivate::empty_node, dasynq::stable_prio<int>, dasynq::compare_stable_prio<int, std::less<int>>, 4>::heap_node>::emplace_back<>()
void emplace_back(U... args)
    {
        if (!ensure_capacity(size_v + 1)) {
            throw std::bad_alloc();
        }
        new (&array[size_v]) T(args...);
        size_v++;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rax
incq %rcx
cmpq %rcx, %rax
jae 0x5090
movabsq $0xaaaaaaaaaaaaaaa, %rsi # imm = 0xAAAAAAAAAAAAAAA
cmpq %rsi, %rcx
ja 0x5096
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x4, %edx
cmovneq %rcx, %rdx
movabsq $0x555555555555555, %rcx # imm = 0x555555555555555
cmpq %rcx, %rax
cmovbq %rdx, %rsi
movq %rbx, %rdi
callq 0x4f92
testb %al, %al
je 0x5096
incq 0x8(%rbx)
popq %rbx
retq
movl $0x8, %edi
callq 0x3130
movq 0x8f01(%rip), %rcx      # 0xdfa8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8f0b(%rip), %rsi      # 0xdfc0
movq 0x8edc(%rip), %rdx      # 0xdf98
movq %rax, %rdi
callq 0x3430
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/daryheap.h
// Function: dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::bubble_down(unsigned long, dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::handle_t*, dasynq::time_val const&)
bool bubble_down(hindex_t pos, handle_t * ohndl, const P &op) noexcept
    {
        Compare lt;
        while (pos > 0) {
            hindex_t parent = (pos - 1) / N;
            if (! lt(op, hvec[parent].prio)) {
                break;
            }

            hvec[pos] = std::move(hvec[parent]);
            hvec[pos].hnd->heap_index = pos;
            pos = parent;
        }

        hvec[pos].hnd = ohndl;
        hvec[pos].prio = std::move(op);
        ohndl->heap_index = pos;

        return pos == 0;
    }

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x7684
leaq -0x1(%rsi), %rax
shrq $0x2, %rax
movq (%rcx), %r11
movq (%rdi), %r9
leaq (%rax,%rax,2), %r8
leaq (%r9,%r8,8), %r10
movq (%r10), %rbx
cmpq %rbx, %r11
jl 0x7648
xorl %r8d, %r8d
cmpq %rbx, %r11
jne 0x7677
movq 0x8(%r10), %r11
cmpq %r11, 0x8(%rcx)
jge 0x7677
leaq (,%rsi,8), %r8
leaq (%r8,%r8,2), %r8
movq 0x10(%r10), %r11
movq %r11, 0x10(%r9,%r8)
movups (%r10), %xmm0
movups %xmm0, (%r9,%r8)
movq (%rdi), %r9
movq 0x10(%r9,%r8), %r8
movq %rsi, 0x20(%r8)
movb $0x1, %r8b
jmp 0x767a
movq %rsi, %rax
movq %rax, %rsi
testb %r8b, %r8b
jne 0x7613
jmp 0x7686
xorl %eax, %eax
movq (%rdi), %rsi
leaq (%rax,%rax,2), %rdi
movq %rdx, 0x10(%rsi,%rdi,8)
movups (%rcx), %xmm0
movups %xmm0, (%rsi,%rdi,8)
movq %rax, 0x20(%rdx)
testq %rax, %rax
sete %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::register_fd(dasynq::v2::dprivate::base_fd_watcher*, int, int, bool, bool)
void register_fd(base_fd_watcher *callback, int fd, int eventmask, bool enabled, bool emulate = false)
    {
        std::lock_guard<mutex_t> guard(loop_mech.lock);

        loop_mech.prepare_watcher(callback);

        try {
            if (! loop_mech.add_fd_watch(fd, callback, eventmask | ONE_SHOT, enabled, emulate)) {
                callback->emulatefd = true;
                callback->emulate_enabled = enabled;
                if (enabled) {
                    callback->event_flags = eventmask & IO_EVENTS;
                    if (eventmask & IO_EVENTS) {
                        requeue_watcher(callback);
                    }
                }
            }
            else if (enabled && backend_traits_t::interrupt_after_fd_add) {
                interrupt_if_necessary();
            }
        }
        catch (...) {
            loop_mech.release_watcher(callback);
            throw;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r13d
movl %r8d, %r12d
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
addq $0x10, %rsi
movq %rsi, (%rsp)
callq 0x52ec
movl %ebp, %ecx
orl $0x8, %ecx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x5224
testb %al, %al
jne 0x51e3
movb 0xc(%r15), %al
andb $-0xd, %al
leal (,%r12,8), %ecx
orb %al, %cl
orb $0x4, %cl
movb %cl, 0xc(%r15)
testb %r12b, %r12b
je 0x51e3
andl $0x3, %ebp
movl %ebp, 0x24(%r15)
je 0x51e3
movl 0x18(%r15), %eax
movq 0x20(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r14)
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x5004
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x30e0
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x4f6a
callq 0x33b0
movq %rax, %rbx
callq 0x3400
movq %rbx, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/epoll.h
// Function: dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>::add_fd_watch(int, void*, int, bool, bool)
bool add_fd_watch(int fd, void *userdata, int flags, bool enabled = true, bool soft_fail = false)
    {
        struct epoll_event epevent;
        // epevent.data.fd = fd;
        epevent.data.ptr = userdata;
        epevent.events = 0;
        
        if (flags & ONE_SHOT) {
            epevent.events = EPOLLONESHOT;
        }
        if ((flags & IN_EVENTS) && enabled) {
            epevent.events |= EPOLLIN;
        }
        if ((flags & OUT_EVENTS) && enabled) {
            epevent.events |= EPOLLOUT;
        }

        if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &epevent) == -1) {
            if (soft_fail && errno == EPERM) {
                return false;
            }
            throw std::system_error(errno, std::system_category());
        }
        return true;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r9d, %ebx
movq %rdx, %rax
movl %esi, %edx
movl %r8d, %esi
xorb $0x1, %sil
movq %rax, 0x8(%rsp)
movl %ecx, %eax
andl $0x8, %eax
shll $0x1b, %eax
andl %ecx, %r8d
orl %eax, %r8d
movl %r8d, 0x4(%rsp)
testb $0x2, %cl
sete %al
orb %sil, %al
jne 0x5263
orb $0x4, 0x4(%rsp)
movl 0xa0(%rdi), %edi
leaq 0x4(%rsp), %rcx
movl $0x1, %esi
callq 0x3360
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x528d
testb %bl, %bl
je 0x529c
callq 0x3040
cmpl $0x1, (%rax)
jne 0x529c
cmpl $-0x1, %ebp
setne %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x20, %edi
callq 0x3130
movq %rax, %rbx
callq 0x3040
movl (%rax), %ebp
callq 0x3160
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x540c
movq 0x8cbf(%rip), %rsi      # 0xdf88
movq 0x8ce0(%rip), %rdx      # 0xdfb0
movq %rbx, %rdi
callq 0x3430
movq %rax, %r14
movq %rbx, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/daryheap.h
// Function: void dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::allocate<void*&>(dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::handle_t&, void*&)
void allocate(handle_t & hnd, U&&... u)
    {
        // Note: this can be constexpr in C++20
        const hindex_t max_allowed = hvec.max_size();

        if (num_nodes == max_allowed) {
            throw std::bad_alloc();
        }

        num_nodes++;

        if (DASYNQ_EXPECT(hvec.capacity() < num_nodes, 0)) {
            hindex_t half_point = max_allowed / 2;
            try {
                if (DASYNQ_EXPECT(num_nodes < half_point, 1)) {
                    hvec.reserve(num_nodes * 2);
                }
                else {
                    hvec.reserve(max_allowed);
                }
            }
            catch (...) {
                // try with just the needed number of nodes:
                try {
                    hvec.reserve(num_nodes);
                }
                catch (...) {
                    num_nodes--;
                    throw;
                }
            }
        }

        new (& hnd.hd_u.hd) T(std::forward<U>(u)...);
        hnd.heap_index = -1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movabsq $0xaaaaaaaaaaaaaaa, %rsi # imm = 0xAAAAAAAAAAAAAAA
movq 0x18(%rdi), %rax
cmpq %rsi, %rax
je 0x72d9
movq %rdx, %r14
movq %rdi, %r15
incq %rax
movq %rax, 0x18(%rdi)
cmpq %rax, 0x10(%rdi)
jb 0x72ba
movq (%r14), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x0, 0x10(%rbx)
movb $0x1, 0x14(%rbx)
movq %rax, 0x18(%rbx)
movq $-0x1, 0x20(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq (%rax,%rax), %rcx
movabsq $0x555555555555555, %rdx # imm = 0x555555555555555
cmpq %rdx, %rax
cmovbq %rcx, %rsi
movq %r15, %rdi
callq 0x7354
jmp 0x7294
movl $0x8, %edi
callq 0x3130
movq 0x6cbe(%rip), %rcx      # 0xdfa8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x6cc8(%rip), %rsi      # 0xdfc0
movq 0x6c99(%rip), %rdx      # 0xdf98
movq %rax, %rdi
callq 0x3430
movq %rax, %rdi
callq 0x30e0
movq 0x18(%r15), %rsi
movq %r15, %rdi
callq 0x7354
callq 0x3400
jmp 0x7294
movq %rax, %rdi
callq 0x30e0
decq 0x18(%r15)
callq 0x33b0
movq %rax, %rbx
callq 0x3400
callq 0x3400
movq %rbx, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/svec.h
// Function: dasynq::svector<dasynq::dary_heap<dasynq::v2::dprivate::empty_node, dasynq::stable_prio<int>, dasynq::compare_stable_prio<int, std::less<int>>, 4>::heap_node>::reserve(unsigned long)
void reserve(size_t amount)
    {
        // Note that std::vector would throw length_error if amount > max_size(). We don't bother;
        // allocation will certainly fail in that case, so we'll throw bad_alloc instead.
        if (!ensure_capacity(amount, true)) {
            throw std::bad_alloc();
        }
    }

// Assembly:
pushq %rax
cmpq %rsi, 0x10(%rdi)
jae 0x53db
movabsq $0xaaaaaaaaaaaaaaa, %rax # imm = 0xAAAAAAAAAAAAAAA
cmpq %rax, %rsi
ja 0x53dd
callq 0x4f92
testb %al, %al
je 0x53dd
popq %rax
retq
movl $0x8, %edi
callq 0x3130
movq 0x8bba(%rip), %rcx      # 0xdfa8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8bc4(%rip), %rsi      # 0xdfc0
movq 0x8b95(%rip), %rdx      # 0xdf98
movq %rax, %rdi
callq 0x3430
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::fd_watcher<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>>::set_enabled(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, bool)
void set_enabled(event_loop_t &eloop, bool enable) noexcept
    {
        std::lock_guard<mutex_t> guard(eloop.get_base_lock());
        if (this->emulatefd) {
            if (enable && ! this->emulate_enabled) {
                loop_access::requeue_watcher(eloop, this);
            }
            this->emulate_enabled = enable;
        }
        else {
            eloop.set_fd_enabled_nolock(this, this->watch_fd, this->watch_flags, enable);
        }

        if (! enable) {
            eloop.dequeue_watcher(this);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movb 0xc(%rdi), %al
testb $0x4, %al
jne 0x54d0
movl 0x1c(%r14), %edx
movl 0x20(%r14), %ecx
movzbl %bpl, %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4ee2
jmp 0x5515
testb %bpl, %bpl
je 0x5505
movb $0x8, %r15b
testb $0x8, %al
jne 0x5508
leaq 0x10(%r14), %rsi
movl 0x18(%r14), %eax
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rbx)
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %rbx, %rdi
callq 0x5004
jmp 0x5508
xorl %r15d, %r15d
movb 0xc(%r14), %al
andb $-0x9, %al
orb %r15b, %al
movb %al, 0xc(%r14)
testb %bpl, %bpl
jne 0x552c
movq 0x10(%r14), %rsi
cmpq $-0x1, %rsi
je 0x552c
movq %rbx, %rdi
callq 0x56d8
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/daryheap.h
// Function: dasynq::dary_heap<dasynq::v2::dprivate::empty_node, dasynq::stable_prio<int>, dasynq::compare_stable_prio<int, std::less<int>>, 4>::remove_h(unsigned long)
void remove_h(hindex_t hidx) noexcept
    {
        hvec[hidx].hnd->heap_index = -1;
        if (hvec.size() != hidx + 1) {
            bubble_up(hidx, *(hvec.back().hnd), hvec.back().prio);
            hvec.pop_back();
        }
        else {
            hvec.pop_back();
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
leaq (%rsi,%rsi,2), %rax
movq 0x10(%rcx,%rax,8), %rax
movq $-0x1, (%rax)
movq 0x8(%rdi), %rax
leaq 0x1(%rsi), %rdx
cmpq %rdx, %rax
je 0x5718
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rcx
addq $-0x18, %rcx
movq 0x10(%rcx), %rdx
movq %rbx, %rdi
callq 0x5722
movq 0x8(%rbx), %rax
decq %rax
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::deregister(dasynq::v2::dprivate::base_fd_watcher*, int)
void deregister(base_fd_watcher *callback, int fd) noexcept
    {
        if (callback->emulatefd) {
            auto & ed = (dispatch_t &) loop_mech;
            ed.issue_delete(callback);
            return;
        }
        
        loop_mech.remove_fd_watch(fd, callback->watch_flags);

        waitqueue_node<T_Mutex> qnode;
        get_attn_lock(qnode);
        
        auto & ed = (dispatch_t &) loop_mech;
        ed.issue_delete(callback);
        
        release_lock(qnode);        
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testb $0x4, 0xc(%rsi)
jne 0x589f
movl 0xa0(%rbx), %edi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x3360
leaq 0xf(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5900
movq %rbx, %rdi
movq %r14, %rsi
callq 0x58b4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x592c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %r14, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x58b4
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>::issue_delete(dasynq::v2::dprivate::base_watcher*)
void issue_delete(base_watcher *watcher) noexcept
        {
            // This is only called when the attention lock is held, so if the watcher is not
            // active/queued now, it cannot become active (and will not be reported with an event)
            // during execution of this function.
            
            lock.lock();
            
            if (watcher->active) {
                // If the watcher is active, set deleteme true; the watcher will be removed
                // at the end of current processing (i.e. when active is set false).
                watcher->deleteme = true;
                lock.unlock();
            }
            else {
                // Actually do the delete.
                dequeue_watcher(watcher);
                release_watcher(watcher);
                
                lock.unlock();
                watcher->watch_removed();
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movb 0xc(%rsi), %al
testb $0x1, %al
jne 0x58f5
movq %rdi, %r14
leaq 0x10(%rbx), %r15
movq 0x10(%rbx), %rsi
cmpq $-0x1, %rsi
je 0x58dc
movq %r14, %rdi
callq 0x56d8
movq %r14, %rdi
movq %r15, %rsi
callq 0x4f6a
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0x20(%rax)
orb $0x2, %al
movb %al, 0xc(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/epoll.h
// Function: dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>::~epoll_loop()
~epoll_loop() noexcept
    {
        if (epfd != -1) {
            Base::cleanup();
            close(epfd);
            if (sigfd != -1) {
                close(sigfd);
            }
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, 0xa0(%rdi)
je 0x59c4
movq %rbx, %rdi
callq 0x5a0e
movl 0xa0(%rbx), %edi
callq 0x3470
movl 0xa4(%rbx), %edi
cmpl $-0x1, %edi
je 0x59c4
callq 0x3470
leaq 0x128(%rbx), %rdi
callq 0x5a6c
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x59de
callq 0x3330
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x59ec
callq 0x3330
leaq 0x28(%rbx), %rdi
callq 0x5adc
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x5a03
popq %rbx
jmp 0x3330
popq %rbx
retq
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/btree_set.h
// Function: dasynq::btree_set<void*, int, std::less<int>, 8>::~btree_set()
~btree_set()
    {
        while (left_sept != nullptr) {
            remove(*(left_sept->hn_p[0]));
        }

        while (sn_reserve != nullptr) {
            auto *next = sn_reserve->parent;
            delete sn_reserve;
            sn_reserve = next;
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x5afe
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x5b2c
movq 0x8(%rbx), %rax
jmp 0x5ae7
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x5b24
movq 0xa8(%rdi), %r14
movl $0xb0, %esi
callq 0x32b0
movq %r14, 0x10(%rbx)
movq %r14, %rdi
testq %r14, %r14
jne 0x5b07
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/shutdown.cc
// Function: subproc_out_watch::fd_event(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int, int)
rearm fd_event(loop_t &, int fd, int flags)
    {
        // if current status is reading overflow, read and discard until newline
        if (in_overflow) {
            return read_overflow(fd);
        }

        auto r = sub_buf.fill(fd);
        if (r == subproc_buffer::fill_status::FULL) {
            sub_buf.mark_overflow();
            in_overflow = true;
            return read_overflow(fd);
        }
        else if (r == subproc_buffer::fill_status::ENDFILE) {
            return rearm::NOOP;
        }

        return rearm::REARM;  // re-enable watcher
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
cmpb $0x1, 0x30(%rdi)
je 0x615c
movq 0x28(%r14), %rdi
movl %ebx, %esi
callq 0x622c
cmpl $0x1, %eax
je 0x616d
cmpl $0x2, %eax
jne 0x6174
movq 0x28(%r14), %rdi
callq 0x5538
movb $0x1, 0x30(%r14)
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x617e
movl $0x2, %eax
jmp 0x6176
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/shutdown.cc
// Function: subproc_out_watch::read_overflow(int)
rearm read_overflow(int fd)
    {
        char buf[128];
        int r = read(fd, buf, 128);
        if (r == 0 || (r == -1 && errno != EAGAIN)) {
            return rearm::NOOP; // leave disarmed
        }
        if (r == -1) {
            return rearm::REARM;
        }

        // How much space is available?
        int fr = sub_buf.get_free();
        for (int b = r - std::min(r, fr); b < r; b++) {
            if (buf[b] == '\n') {
                // Copy the (partial) line into sub_buf and leave overflow mode
                sub_buf.append(buf + b, r - b);
                in_overflow = false;
            }
        }
        return rearm::REARM;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %esi, %eax
movq %rdi, %rbx
movq %rsp, %rsi
movl $0x80, %edx
movl %eax, %edi
callq 0x33a0
movq %rax, %r15
movl $0x2, %ebp
testl %r15d, %r15d
je 0x6215
cmpl $-0x1, %r15d
jne 0x61c4
callq 0x3040
cmpl $0xb, (%rax)
jne 0x6215
cmpl $-0x1, %r15d
je 0x6227
movq 0x28(%rbx), %rax
movl $0x1000, %r14d          # imm = 0x1000
subl 0x1004(%rax), %r14d
cmpl %r15d, %r14d
cmovgel %r15d, %r14d
xorl %ebp, %ebp
testl %r14d, %r14d
jle 0x6215
movl %r15d, %eax
subl %r14d, %eax
movslq %eax, %r12
movslq %r15d, %r15
cmpb $0xa, (%rsp,%r12)
jne 0x620a
movq 0x28(%rbx), %rdi
leaq (%rsp,%r12), %rsi
movl %r14d, %edx
callq 0x628a
movb $0x0, 0x30(%rbx)
incq %r12
decl %r14d
cmpq %r15, %r12
jl 0x61ef
movl %ebp, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x6215
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/includes/cpbuffer.h
// Function: cpbuffer<4096u>::fill(int, unsigned int)
int fill(int fd, unsigned limit) noexcept
    {
        unsigned pos = cur_idx + length;
        if (pos >= SIZE) pos -= SIZE;
        unsigned max_count = std::min(SIZE - pos, SIZE - length);
        max_count = std::min(max_count, limit);
        ssize_t r = bp_sys::read(fd, buf + pos, max_count);
        if (r >= 0) {
            length += r;
        }
        return r;
    }

// Assembly:
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
movl 0x1000(%rdi), %ecx
movl 0x1004(%rdi), %edi
leal (%rdi,%rcx), %r8d
movl $0x1000, %r9d           # imm = 0x1000
cmpl %r9d, %r8d
leal -0x1000(%rdi,%rcx), %esi
cmovbl %r8d, %esi
movl $0x1000, %ecx           # imm = 0x1000
subl %esi, %ecx
subl %edi, %r9d
cmpl %ecx, %r9d
cmovael %ecx, %r9d
cmpl %edx, %r9d
cmovbl %r9d, %edx
addq %rbx, %rsi
movl %eax, %edi
callq 0x33a0
testq %rax, %rax
js 0x6373
addl %eax, 0x1004(%rbx)
popq %rbx
retq
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::reserve_child_watch(dasynq::v2::dprivate::base_child_watcher<dasynq::v2::dprivate::proc_status>*)
void reserve_child_watch(base_child_watcher *callback)
    {
        std::lock_guard<mutex_t> guard(loop_mech.lock);

        loop_mech.prepare_watcher(callback);
        try {
            loop_mech.reserve_child_watch_nolock(callback->watch_handle);
        }
        catch (...) {
            loop_mech.release_watcher(callback);
            throw;
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsi), %rbx
movq %rbx, %rsi
callq 0x52ec
leaq 0x28(%r14), %rdi
callq 0x63dc
movq $0x0, 0x20(%r15)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x30e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4f6a
callq 0x33b0
movq %rax, %rbx
callq 0x3400
movq %rbx, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x4904
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/btree_set.h
// Function: dasynq::btree_set<void*, int, std::less<int>, 8>::alloc_slot()
void alloc_slot()
    {
        num_alloced++;
        // No need to be concerned for overflow in num_alloced: if we've maxed out size_t then
        // allocation would have failed much earlier on.

        if (DASYNQ_EXPECT(num_alloced == next_sept, 0)) {
            if (++num_septs_needed > num_septs) {
                try {
                    septnode *new_res = new septnode();
                    new_res->parent = sn_reserve;
                    sn_reserve = new_res;
                    num_septs++;
                }
                catch (...) {
                    num_septs_needed--;
                    num_alloced--;
                    throw;
                }
            }
            if (num_septs_needed == 0) {
                // wrapped around
                num_septs_needed--;
                num_alloced--;
                throw std::bad_alloc();
            }
            next_sept += N/2;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x18(%rdi), %r14
leaq 0x1(%r14), %rax
movq %rax, 0x18(%rdi)
movl 0x28(%rdi), %r15d
cmpq %r15, %rax
je 0x6402
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movl 0x20(%rdi), %r12d
movl 0x24(%rdi), %ebp
incl %ebp
movl %ebp, 0x24(%rdi)
cmpl %r12d, %ebp
jbe 0x6436
movl $0xb0, %edi
callq 0x32a0
movq 0x10(%rbx), %rcx
movq %rcx, 0xa8(%rax)
movq %rax, 0x10(%rbx)
incl %r12d
movl %r12d, 0x20(%rbx)
testl %ebp, %ebp
je 0x6444
addl $0x4, %r15d
movl %r15d, 0x28(%rbx)
jmp 0x63f9
movl $0xffffffff, 0x24(%rbx) # imm = 0xFFFFFFFF
movq %r14, 0x18(%rbx)
movl $0x8, %edi
callq 0x3130
movq 0x7b48(%rip), %rcx      # 0xdfa8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x7b52(%rip), %rsi      # 0xdfc0
movq 0x7b23(%rip), %rdx      # 0xdf98
movq %rax, %rdi
callq 0x3430
movq %rax, %rdi
callq 0x30e0
decl 0x24(%rbx)
decq 0x18(%rbx)
callq 0x33b0
movq %rax, %rbx
callq 0x3400
movq %rbx, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/epoll.h
// Function: dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>::init()
void init()
    {
        epfd = epoll_create1(EPOLL_CLOEXEC);
        if (epfd == -1) {
            throw std::system_error(errno, std::system_category());
        }
        sigemptyset(&sigmask);
        try {
            Base::init(this);
        }
        catch (...) {
            close(epfd);
            throw;
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x80000, %edi          # imm = 0x80000
callq 0x3340
movl %eax, 0xa0(%rbx)
cmpl $-0x1, %eax
je 0x6944
leaq 0xa8(%rbx), %rdi
callq 0x32f0
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x69be
popq %rbx
popq %r14
popq %rbp
retq
movl $0x20, %edi
callq 0x3130
movq %rax, %rbx
callq 0x3040
movl (%rax), %ebp
callq 0x3160
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x540c
movq 0x7617(%rip), %rsi      # 0xdf88
movq 0x7638(%rip), %rdx      # 0xdfb0
movq %rbx, %rdi
callq 0x3430
movq %rax, %r14
movq %rbx, %rdi
callq 0x31b0
jmp 0x69ad
movq %rax, %rdi
callq 0x30e0
movl 0xa0(%rbx), %edi
callq 0x3470
callq 0x33b0
movq %rax, %r14
callq 0x3400
movq %r14, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/timerfd.h
// Function: void dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>::init<dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>>(dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>*)
void init(T *loop_mech)
    {
        timerfd_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
        if (timerfd_fd == -1) {
            throw std::system_error(errno, std::system_category());
        }
        systemtime_fd = timerfd_create(CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK);
        if (systemtime_fd == -1) {
            close (timerfd_fd);
            throw std::system_error(errno, std::system_category());
        }

        try {
            loop_mech->add_fd_watch(timerfd_fd, &timerfd_fd, IN_EVENTS);
            loop_mech->add_fd_watch(systemtime_fd, &systemtime_fd, IN_EVENTS);
            Base::init(loop_mech);
        }
        catch (...) {
            close(timerfd_fd);
            close(systemtime_fd);
            throw;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0x3450
movl %eax, 0x98(%r14)
cmpl $-0x1, %eax
je 0x6a5d
xorl %edi, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0x3450
movl %eax, 0x9c(%r14)
movl 0x98(%r14), %esi
cmpl $-0x1, %eax
je 0x6a85
leaq 0x98(%r14), %r12
leaq 0x9c(%r14), %r15
movq %rbx, %rdi
movq %r12, %rdx
movl $0x1, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x5224
movl (%r15), %esi
movq %rbx, %rdi
movq %r15, %rdx
movl $0x1, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x5224
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6b0e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3130
movq %rax, %rbx
callq 0x3040
movl (%rax), %ebp
callq 0x3160
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x540c
jmp 0x6ab2
movl %esi, %edi
callq 0x3470
movl $0x20, %edi
callq 0x3130
movq %rax, %rbx
callq 0x3040
movl (%rax), %ebp
callq 0x3160
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x540c
movq 0x74cf(%rip), %rsi      # 0xdf88
movq 0x74f0(%rip), %rdx      # 0xdfb0
movq %rbx, %rdi
callq 0x3430
jmp 0x6aca
movq %rax, %r14
movq %rbx, %rdi
callq 0x31b0
jmp 0x6afd
movq %rax, %rdi
callq 0x30e0
movl (%r12), %edi
callq 0x3470
movl (%r15), %edi
callq 0x3470
callq 0x33b0
movq %rax, %r14
callq 0x3400
movq %r14, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x4904
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/childproc.h
// Function: void dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>::init<dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>>(dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>*)
void init(T *loop_mech)
    {
        // Mask SIGCHLD:
        sigset_t sigmask;
        this->sigmaskf(SIG_UNBLOCK, nullptr, &sigmask);
        sigaddset(&sigmask, SIGCHLD);
        this->sigmaskf(SIG_SETMASK, &sigmask, nullptr);

        // On some systems a SIGCHLD handler must be established, or SIGCHLD will not be
        // generated:
        struct sigaction chld_action;
        chld_action.sa_handler = dasynq::dprivate::sigchld_handler;
        sigemptyset(&chld_action.sa_mask);
        chld_action.sa_flags = 0;
        sigaction(SIGCHLD, &chld_action, nullptr);

        // Specify a dummy user data value - sigchld_handler
        loop_mech->add_signal_watch(SIGCHLD, (void *) dasynq::dprivate::sigchld_handler);
        Base::init(loop_mech);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rsi, %rbx
leaq 0xa0(%rsp), %r14
movl $0x1, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3100
movq %r14, %rdi
movl $0x11, %esi
callq 0x33c0
movl $0x2, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3100
leaq 0x4a(%rip), %r14        # 0x6ba1
leaq 0x10(%rsp), %r15
movq %r14, -0x8(%r15)
movq %r15, %rdi
callq 0x32f0
movl $0x0, 0x80(%r15)
leaq 0x8(%rsp), %rsi
movl $0x11, %edi
xorl %edx, %edx
callq 0x3310
movq %rbx, %rdi
movl $0x11, %esi
movq %r14, %rdx
callq 0x6ba2
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/epoll.h
// Function: dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>::add_signal_watch_nolock(int, void*)
void add_signal_watch_nolock(int signo, void *userdata)
    {
        sigdataMap[signo] = userdata;

        // Modify the signal fd to watch the new signal
        bool was_no_sigfd = (sigfd == -1);
        sigaddset(&sigmask, signo);
        sigfd = signalfd(sigfd, &sigmask, SFD_NONBLOCK | SFD_CLOEXEC);
        if (sigfd == -1) {
            throw std::system_error(errno, std::system_category());
        }
        
        if (was_no_sigfd) {
            // Add the signalfd to the epoll set.
            struct epoll_event epevent;
            epevent.data.ptr = &sigfd;
            epevent.events = EPOLLIN;
            // No need for EPOLLONESHOT - we can pull the signals out
            // as we see them.
            if (epoll_ctl(epfd, EPOLL_CTL_ADD, sigfd, &epevent) == -1) {
                close(sigfd);
                sigfd = -1;
                throw std::system_error(errno, std::system_category());
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movl %esi, (%r15)
addq $0x128, %rdi            # imm = 0x128
movq %r15, %rsi
callq 0x6cc8
movq %r14, (%rax)
movl 0xa4(%rbx), %ebp
leaq 0xa8(%rbx), %r14
movl (%r15), %esi
movq %r14, %rdi
callq 0x33c0
movl 0xa4(%rbx), %edi
movq %r14, %rsi
movl $0x80800, %edx          # imm = 0x80800
callq 0x3150
movl %eax, 0xa4(%rbx)
cmpl $-0x1, %eax
je 0x6c3f
cmpl $-0x1, %ebp
jne 0x6c34
leaq 0xa4(%rbx), %r14
leaq 0xc(%rsp), %rcx
movq %r14, 0x4(%rcx)
movl $0x1, (%rcx)
movl 0xa0(%rbx), %edi
movl $0x1, %esi
movl %eax, %edx
callq 0x3360
cmpl $-0x1, %eax
je 0x6c67
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3130
movq %rax, %rbx
callq 0x3040
movl (%rax), %ebp
callq 0x3160
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x540c
jmp 0x6c9c
movl (%r14), %edi
callq 0x3470
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movl $0x20, %edi
callq 0x3130
movq %rax, %rbx
callq 0x3040
movl (%rax), %ebp
callq 0x3160
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x540c
movq 0x72e5(%rip), %rsi      # 0xdf88
movq 0x7306(%rip), %rdx      # 0xdfb0
movq %rbx, %rdi
callq 0x3430
jmp 0x6cb4
movq %rax, %r14
movq %rbx, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/timerbase.h
// Function: dasynq::timer_base<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>::remove_timer_nolock(dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::handle_t&, dasynq::clock_type)
void remove_timer_nolock(timer_handle_t &timer_id, clock_type clock = clock_type::MONOTONIC) noexcept
    {
        auto &timer_queue = this->queue_for_clock(clock);
        if (timer_queue.is_queued(timer_id)) {
            timer_queue.remove(timer_id);
        }
        timer_queue.deallocate(timer_id);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %eax, %eax
cmpl $0x1, %edx
sete %al
shll $0x5, %eax
leaq (%rdi,%rax), %r14
addq $0x58, %r14
movq 0x20(%rsi), %rsi
cmpq $-0x1, %rsi
je 0x6fd6
movq %r14, %rdi
callq 0x7010
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6fe8
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::register_timer(dasynq::v2::dprivate::base_timer_watcher*, dasynq::clock_type)
void register_timer(base_timer_watcher *callback, clock_type clock)
    {
        std::lock_guard<mutex_t> guard(loop_mech.lock);
    
        loop_mech.prepare_watcher(callback);
        try {
            loop_mech.add_timer_nolock(callback->timer_handle, callback, clock);
        }
        catch (...) {
            loop_mech.release_watcher(callback);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsi), %rbx
movq %rbx, %rsi
callq 0x52ec
movq %rsp, %rdx
movq %r15, (%rdx)
addq $0x20, %r15
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
shll $0x5, %eax
leaq (%r14,%rax), %rdi
addq $0x58, %rdi
movq %r15, %rsi
callq 0x7266
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x30e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4f6a
callq 0x3400
jmp 0x7240
nop
// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/timerfd.h
// Function: dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>::set_timer_rel(dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::handle_t&, dasynq::time_val const&, dasynq::time_val const&, bool, dasynq::clock_type)
void set_timer_rel(timer_handle_t & timer_id, const time_val &timeout, const time_val &interval,
            bool enable, clock_type clock = clock_type::MONOTONIC) noexcept
    {
        time_val alarmtime;
        this->get_time(alarmtime, clock, false);
        alarmtime += timeout;

        set_timer(timer_id, alarmtime, interval, enable, clock);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebx
movl %r8d, 0x4(%rsp)
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
xorl %edi, %edi
cmpl $0x1, %r9d
sete %dil
leaq 0x8(%rsp), %rbp
movq %rbp, %rsi
callq 0x3240
movq 0x8(%rbp), %rax
movq (%r13), %rcx
movq 0x8(%r13), %rdx
leaq (%rdx,%rax), %rsi
addq (%rbp), %rcx
xorl %edi, %edi
cmpq $0x3b9aca00, %rsi       # imm = 0x3B9ACA00
leaq -0x3b9aca00(%rdx,%rax), %rax
cmovlq %rsi, %rax
setge %dil
addq %rcx, %rdi
movq %rdi, (%rbp)
movq %rax, 0x8(%rbp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movl 0x4(%rsp), %r8d
movl %ebx, %r9d
callq 0x743e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop