LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/dinit.cc
// Function: close_control_socket()
static void close_control_socket() noexcept
{
    if (control_socket_open) {
        int fd = control_socket_io.get_watched_fd();
        control_socket_io.deregister(event_loop);
        close(fd);
        
        // Unlink the socket:
        unlink(control_socket_path);

        control_socket_open = false;
    }
}

// Assembly:
pushq %rbx
cmpb $0x1, 0x3bc1e(%rip)     # 0x46d23
jne 0xb13c
movl 0x3bb77(%rip), %ebx     # 0x46c84
leaq 0x3bb54(%rip), %rsi     # 0x46c68
leaq 0x3b915(%rip), %rdi     # 0x46a30
movl %ebx, %edx
callq 0xd520
movl %ebx, %edi
callq 0x8b60
movq 0x3b4b8(%rip), %rdi     # 0x465e8
callq 0x8250
movb $0x0, 0x3bbe7(%rip)     # 0x46d23
popq %rbx
retq
movq %rax, %rdi
callq 0xb74e
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/dinit.cc
// Function: rootfs_is_rw()
void rootfs_is_rw() noexcept
{
    open_control_socket(true);
    control_socket_ready();
    if (!log_is_syslog && !external_log_open) {
        // Try (again) to open log file if we couldn't do so earlier.
        setup_external_log();
    }
    if (!did_log_boot) {
        did_log_boot = log_boot();
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl $0x1, %edi
callq 0xaaea
callq 0xb09d
cmpb $0x1, 0x3bbac(%rip)     # 0x46d12
jne 0xb176
cmpb $0x0, 0x3ba29(%rip)     # 0x46b98
jne 0xb176
callq 0xae62
cmpb $0x0, 0x3bba4(%rip)     # 0x46d21
jne 0xb1f1
leaq 0x18(%rsp), %rbx
movl $0x180, %edx            # imm = 0x180
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8350
movw $0x2, (%rbx)
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x8a10
pshufd $0xe8, (%r14), %xmm0    # xmm0 = mem[0,2,2,3]
movq %xmm0, 0x154(%rbx)
leaq 0x28ab4(%rip), %rdi     # 0x33c6e
movq %rbx, %rsi
callq 0x89d0
leaq 0x28ab3(%rip), %rdi     # 0x33c7c
xorl %esi, %esi
callq 0x87f0
callq 0x8270
leaq 0x18(%rsp), %rdi
callq 0x80c0
movq %rax, %rbx
callq 0x8100
testq %rbx, %rbx
setne 0x3bb30(%rip)           # 0x46d21
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xb74e
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: log_service_load_failure(service_description_exc&)
inline void log_service_load_failure(service_description_exc &exc)
{
    if (exc.input_pos.get_line_num() != (unsigned)-1) {
        if (exc.setting_name == nullptr) {
            log(loglevel_t::ERROR, "Error in service description for '", exc.service_name,
                    "' (file ", exc.input_pos.get_file_name(), ", line ", exc.input_pos.get_line_num(), "): ",
                    exc.exc_description);
        }
        else {
            log(loglevel_t::ERROR, "Error in service description for '", exc.service_name, "': setting '", exc.setting_name, "' "
                    "(file ", exc.input_pos.get_file_name(), ", line ", exc.input_pos.get_line_num(), "): ",
                    exc.exc_description);
        }
    }
    else {
        // If no line number, setting name must be present
        log(loglevel_t::ERROR, "Error in service description for '", exc.service_name, "' setting '", exc.setting_name, "': ",
                exc.exc_description);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x40(%rdi), %ebp
cmpl $-0x1, %ebp
je 0xb703
movq 0x68(%rbx), %r14
leaq 0x284f7(%rip), %rsi     # 0x33b6a
movl $0x3, %edi
callq 0x2e412
movq (%rbx), %rdi
callq 0x2e520
testq %r14, %r14
je 0xb69f
leaq 0x2850d(%rip), %rdi     # 0x33b9e
callq 0x2e520
movq 0x68(%rbx), %rdi
callq 0x2e520
leaq 0x284e7(%rip), %rdi     # 0x33b8d
callq 0x2e520
movq 0x48(%rbx), %rdi
callq 0x2e520
leaq 0x284db(%rip), %rdi     # 0x33b96
callq 0x2e520
leaq 0x2b0e5(%rip), %rdx     # 0x367ac
leaq 0x4(%rsp), %r14
movl $0xc, %esi
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x89e0
movq %r14, %rdi
callq 0x2e520
leaq 0x2a55e(%rip), %rdi     # 0x35c4a
callq 0x2e520
movq 0x20(%rbx), %rdi
callq 0x2e53c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x28460(%rip), %rsi     # 0x33b6a
movl $0x3, %edi
callq 0x2e412
movq (%rbx), %rdi
callq 0x2e520
leaq 0x28488(%rip), %rdi     # 0x33bab
callq 0x2e520
movq 0x68(%rbx), %rdi
callq 0x2e520
leaq 0x2847f(%rip), %rdi     # 0x33bb7
callq 0x2e520
movq 0x20(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2e53c
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::bidi_fd_watcher_impl<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>, control_conn_watcher>::dispatch(void*)
void dispatch(void *loop_ptr) noexcept override
    {
        EventLoop &loop = *static_cast<EventLoop *>(loop_ptr);
        this->emulate_enabled = false;
        loop_access::get_base_lock(loop).unlock();

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

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

        if (rearm_type != rearm::REMOVED) {
            this->event_flags &= ~IN_EVENTS;
            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_primary_rearm(loop, this, rearm_type);

            auto &outwatcher = bidi_fd_watcher<EventLoop>::out_watcher;
            post_dispatch(loop, this, &outwatcher, rearm_type);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
andb $-0x9, 0xc(%rdi)
movl 0x1c(%rdi), %edx
callq 0xc096
cmpl $0x4, %eax
je 0xbfe3
andb $-0x2, 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 0xc63c
leaq 0x28(%rbx), %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %ecx
callq 0xc102
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xb74e
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::bidi_fd_watcher_impl<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>, control_conn_watcher>::dispatch_second(void*)
void dispatch_second(void *loop_ptr) noexcept override
    {
        auto &outwatcher = bidi_fd_watcher<EventLoop>::out_watcher;

        EventLoop &loop = *static_cast<EventLoop *>(loop_ptr);
        loop_access::get_base_lock(loop).unlock();

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

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

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

            rearm_type = loop_access::process_secondary_rearm(loop, this, &outwatcher, rearm_type);

            if (rearm_type == rearm::REQUEUE) {
                post_dispatch(loop, &outwatcher, rearm_type);
            }
            else {
                post_dispatch(loop, this, &outwatcher, rearm_type);
            }
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x1c(%rdi), %edx
callq 0xc784
cmpl $0x4, %eax
je 0xc07a
leaq 0x28(%rbx), %r15
andb $-0x3, 0x24(%rbx)
movb 0x34(%rbx), %cl
movl %ecx, %edx
andb $-0x2, %dl
movb %dl, 0x34(%rbx)
testb $0x2, %cl
movl $0x3, %ecx
cmovel %eax, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xc7f0
cmpl $0x5, %eax
jne 0xc06a
movl 0x40(%rbx), %eax
addq $0x38, %rbx
movq 0x20(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r14)
movq %rsp, %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc322
jmp 0xc07a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %eax, %ecx
callq 0xc102
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0xb74e
// File: /workspace/github_cpp_makefile_star2_O3/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::bidi_fd_watcher<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, bidi_fd_watcher<Loop> *bdfd_watcher,
            base_watcher *out_watcher, rearm rearm_type)
    {
        base_watcher *watcher = (base_watcher *)bdfd_watcher;
        if (rearm_type == rearm::REMOVE) {
            loop_access::get_base_lock(loop).unlock();
            loop_access::release_watcher(loop, watcher);
            loop_access::release_watcher(loop, out_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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x5, %ecx
je 0xc14b
cmpl $0x3, %ecx
jne 0xc172
movq %rdx, %r15
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xc75c
addq $0x10, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xc75c
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *0x20(%rax)
movl 0x18(%rbx), %eax
addq $0x10, %rbx
movq 0x20(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r14)
movq %rsp, %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc322
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::bidi_fd_watcher<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>>::set_watches(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int)
void set_watches(event_loop_t &eloop, int new_flags) noexcept
    {
        std::lock_guard<mutex_t> guard(eloop.get_base_lock());
        bool use_emulation = this->emulatefd || this->out_watcher.emulatefd;
        if (use_emulation || EventLoop::loop_traits_t::has_separate_rw_fd_watches) {
            set_watch_enabled(eloop, true, (new_flags & IN_EVENTS) != 0);
            set_watch_enabled(eloop, false, (new_flags & OUT_EVENTS) != 0);
        }
        else {
            this->watch_flags = (this->watch_flags & ~IO_EVENTS) | new_flags;
            eloop.set_fd_enabled_nolock((dprivate::base_watcher *) this, this->watch_fd, this->watch_flags & IO_EVENTS, true);
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movb 0x34(%rdi), %al
orb 0xc(%rdi), %al
testb $0x4, %al
je 0xc1c9
movl %ebx, %ecx
andl $0x1, %ecx
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xc210
andl $0x2, %ebx
shrl %ebx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebx, %ecx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xc210
movl 0x1c(%r15), %edx
movl 0x20(%r15), %eax
andl $-0x4, %eax
orl %ebx, %eax
movl %eax, 0x20(%r15)
leaq 0x4(%rsp), %rcx
movq %r15, 0x4(%rcx)
movl %ebx, %eax
andl $0x1, %eax
andl $0x2, %ebx
leal (%rax,%rbx,2), %eax
addl $0x40000000, %eax       # imm = 0x40000000
movl %eax, (%rcx)
movl 0xa0(%r14), %edi
movl $0x3, %esi
callq 0x8860
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::bidi_fd_watcher<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>>::set_watch_enabled(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, bool, bool)
void set_watch_enabled(EventLoop &eloop, bool in, bool b)
    {
        int events = in ? IN_EVENTS : OUT_EVENTS;
        auto orig_flags = this->watch_flags;
        
        if (b) {
            this->watch_flags |= events;
        }
        else {
            this->watch_flags &= ~events;
        }

        dprivate::base_watcher * watcher = in ? this : &this->out_watcher;

        if (! watcher->emulatefd) {
            if (EventLoop::loop_traits_t::has_separate_rw_fd_watches) {
                eloop.set_fd_enabled_nolock(this, this->watch_fd, events | ONE_SHOT, b);
            }
            else {
                eloop.set_fd_enabled_nolock(this, this->watch_fd,
                        (this->watch_flags & IO_EVENTS) | ONE_SHOT,
                        (this->watch_flags & IO_EVENTS) != 0);
            }
        }
        else {
            // emulation: if enabling a previously disabled watcher, must queue now:
            if (b && (orig_flags != this->watch_flags)) {
                this->watch_flags = orig_flags;
                loop_access::requeue_watcher(eloop, watcher);
            }
        }

        if (! b) {
            eloop.dequeue_watcher(watcher);
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebx
movq %rdi, %rax
movl $0x2, %edi
subl %edx, %edi
movl 0x20(%rax), %ecx
movl %edi, %r8d
notl %r8d
andl %ecx, %r8d
orl %ecx, %edi
testl %ebx, %ebx
cmovel %r8d, %edi
movq %rsi, %r14
movl %edi, 0x20(%rax)
leaq 0x28(%rax), %r15
testl %edx, %edx
cmovneq %rax, %r15
testb $0x4, 0xc(%r15)
jne 0xc26f
movl 0x1c(%rax), %edx
andl $0x3, %edi
leal 0x8(%rdi), %ecx
xorl %r8d, %r8d
testl %edi, %edi
setne %r8b
movq %r14, %rdi
movq %rax, %rsi
callq 0xc2c4
jmp 0xc2a3
cmpl %edi, %ecx
setne %dl
andb %bl, %dl
cmpb $0x1, %dl
jne 0xc2a3
movl %ecx, 0x20(%rax)
leaq 0x10(%r15), %rsi
movl 0x18(%r15), %eax
movq 0x20(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r14)
movq %rsp, %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %r14, %rdi
callq 0xc322
testb %bl, %bl
jne 0xc2b9
movq 0x10(%r15), %rsi
cmpq $-0x1, %rsi
je 0xc2b9
movq %r14, %rdi
callq 0xc4e8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::process_timer_rearm(dasynq::v2::dprivate::base_timer_watcher*, dasynq::rearm)
void process_timer_rearm(base_timer_watcher *btw, rearm rearm_type) noexcept
    {
        // Called with lock held
        if (rearm_type == rearm::REARM) {
            loop_mech.enable_timer_nolock(btw->timer_handle, true, btw->clock);
        }
        else if (rearm_type == rearm::REMOVE) {
            loop_mech.remove_timer_nolock(btw->timer_handle, btw->clock);
        }
        else if (rearm_type == rearm::DISARM) {
            loop_mech.enable_timer_nolock(btw->timer_handle, false, btw->clock);
        }
    }

// Assembly:
cmpl $0x3, %edx
je 0xcf02
cmpl $0x1, %edx
je 0xcefd
testl %edx, %edx
jne 0xcf01
movl 0x4c(%rsi), %ecx
addq $0x20, %rsi
movl $0x1, %edx
jmp 0xcf0e
movb $0x0, 0x34(%rsi)
retq
movl 0x4c(%rsi), %edx
addq $0x20, %rsi
jmp 0xcf60
// File: /workspace/github_cpp_makefile_star2_O3/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>>>>::enable_timer_nolock(dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::handle_t&, bool, dasynq::clock_type)
void enable_timer_nolock(timer_handle_t &timer_id, bool enable, clock_type clock = clock_type::MONOTONIC) noexcept
    {
        auto &timer_queue = this->queue_for_clock(clock);
        auto &node_data = timer_queue.node_data(timer_id);
        auto expiry_count = node_data.expiry_count;
        if (expiry_count != 0 && enable) {
            node_data.expiry_count = 0;
            Base::receive_timer_expiry(timer_id, node_data.userdata, expiry_count);
        }
        else {
            timer_queue.node_data(timer_id).enabled = enable;
        }
    }

// Assembly:
movl %edx, %ecx
xorb $0x1, %cl
movl 0x10(%rsi), %eax
testl %eax, %eax
sete %r8b
orb %cl, %r8b
jne 0xcf5b
subq $0x18, %rsp
movl $0x0, 0x10(%rsi)
movq 0x18(%rsi), %rsi
addl %eax, 0x48(%rsi)
movl 0x18(%rsi), %eax
addq $0x10, %rsi
movq 0x20(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rdi)
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movq %rcx, 0x8(%rdx)
callq 0xc322
addq $0x18, %rsp
retq
movb %dl, 0x14(%rsi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::process_signal_rearm(dasynq::v2::dprivate::base_signal_watcher<dasynq::v2::epoll_traits::sigdata_t>*, dasynq::rearm)
void process_signal_rearm(base_signal_watcher * bsw, rearm rearm_type) noexcept
    {
        // Called with lock held
        if (rearm_type == rearm::REARM) {
            loop_mech.rearm_signal_watch_nolock(bsw->siginfo.get_signo(), bsw);
            if (backend_traits_t::interrupt_after_signal_add) {
                interrupt_if_necessary();
            }
        }
        else if (rearm_type == rearm::REMOVE) {
            loop_mech.remove_signal_watch_nolock(bsw->siginfo.get_signo());
        }
        // Note that signal watchers cannot (currently) be disarmed
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, %edx
je 0xd34c
testl %edx, %edx
jne 0xd375
movl 0x20(%rsi), %esi
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0x8970
movl 0xa4(%rbx), %edi
movq %r14, %rsi
movl $0x80800, %edx          # imm = 0x80800
jmp 0xd369
movl 0x20(%rsi), %esi
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0x87a0
movl 0xa4(%rbx), %edi
movq %r14, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8360
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: service_set::process_queues()
void process_queues() noexcept
    {
        while (! stop_queue.is_empty() || ! prop_queue.is_empty()) {
            while (! prop_queue.is_empty()) {
                auto next = prop_queue.pop_front();
                next->do_propagation();
            }
            if (! stop_queue.is_empty()) {
                auto next = stop_queue.pop_front();
                next->execute_transition();
            }
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
movq 0x40(%rbx), %rax
movq %rax, %rcx
orq %rdi, %rcx
je 0xd3ee
testq %rdi, %rdi
je 0xd3bf
movq 0x1f8(%rdi), %rax
movq %rax, 0x38(%rbx)
movq $0x0, 0x1f8(%rdi)
callq 0x230f8
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
jne 0xd397
movq 0x40(%rbx), %rax
testq %rax, %rax
jne 0xd3ca
xorl %edi, %edi
xorl %eax, %eax
jmp 0xd38a
movq 0x200(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq $0x0, 0x200(%rax)
movq %rax, %rdi
callq 0x234c8
movq 0x38(%rbx), %rdi
jmp 0xd386
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: service_set::stop_all_services(shutdown_type_t)
void stop_all_services(shutdown_type_t type = shutdown_type_t::HALT) noexcept
    {
        restart_enabled = false;
        shutdown_type = type;
        for (std::list<service_record *>::iterator i = records.begin(); i != records.end(); ++i) {
            (*i)->stop(false);
            (*i)->unpin();
        }
        process_queues();
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x28(%rdi)
movb %sil, 0x29(%rdi)
leaq 0x10(%rdi), %r14
movq 0x10(%rdi), %r15
cmpq %r14, %r15
je 0xd478
movq 0x10(%r15), %rdi
xorl %esi, %esi
callq 0x237c8
movq 0x10(%r15), %rdi
callq 0x23b0e
movq (%r15), %r15
jmp 0xd45a
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xd37e
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>::register_signal(dasynq::v2::dprivate::base_signal_watcher<dasynq::v2::epoll_traits::sigdata_t>*, int)
void register_signal(base_signal_watcher *callBack, int signo)
    {
        std::lock_guard<mutex_t> guard(loop_mech.lock);

        loop_mech.prepare_watcher(callBack);
        try {
            loop_mech.add_signal_watch_nolock(signo, callBack);
            if (backend_traits_t::interrupt_after_signal_add) {
                interrupt_if_necessary();
            }
        }
        catch (...) {
            loop_mech.release_watcher(callBack);
            throw;
        }
    }

// 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 0xcb4e
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xdd62
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x8210
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc75c
callq 0x8920
movq %rax, %rbx
callq 0x8a50
movq %rbx, %rdi
callq 0x8ab0
movq %rax, %rdi
callq 0xb74e
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/load-service.cc
// Function: check_cycle(std::__cxx11::list<prelim_dep, std::allocator<prelim_dep>>&, service_record*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static void check_cycle(service_dep_list &deps, service_record *orig, const std::string &report_svc_name)
{
    linked_uo_set<service_record *> pending;
    for (auto &new_dep : deps) {
        if (new_dep.to == orig) {
            throw service_cyclic_dependency(report_svc_name);
        }
        pending.add_back(new_dep.to);
    }

    for (auto i = pending.begin(); i != pending.end(); ++i) {
        auto &dep_list = (*i)->get_dependencies();
        for (auto &dep : dep_list) {
            if (dep.get_to() == orig) {
                throw service_cyclic_dependency(report_svc_name);
            }
            pending.add_back(dep.get_to());
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x20(%rsp), %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbp)
movups %xmm0, 0x10(%rbp)
movups %xmm0, (%rbp)
movq $0x0, 0x30(%rbp)
leaq 0x18(%rsp), %r13
movq %rdi, %rbx
movq (%rbx), %rbx
cmpq %r12, %rbx
je 0x13e92
cmpq %r15, 0x10(%rbx)
je 0x13f39
leaq 0x10(%rbx), %rsi
movq %r13, %rdi
callq 0x1e8f6
jmp 0x13e72
movq %r14, 0x8(%rsp)
movq 0x48(%rsp), %rbp
testq %rbp, %rbp
je 0x13ee9
leaq 0x18(%rsp), %r12
leaq 0x10(%rsp), %r13
movq (%rbp), %r14
movq 0x118(%r14), %rbx
addq $0x118, %r14            # imm = 0x118
cmpq %r14, %rbx
je 0x13ee0
movq 0x18(%rbx), %rax
cmpq %r15, %rax
je 0x13f02
movq %rax, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1e8f6
movq (%rbx), %rbx
jmp 0x13ebd
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0x13eab
leaq 0x20(%rsp), %rdi
callq 0x1eee0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x40, %edi
callq 0x82c0
movq %rax, %r15
movq %rax, %rdi
movq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rbp
callq 0x1a47a
leaq 0x312e8(%rip), %rsi     # 0x45210
leaq 0x7401(%rip), %rdx      # 0x1b330
movq %r15, %rdi
callq 0x8aa0
jmp 0x13f67
movl $0x40, %edi
callq 0x82c0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1a47a
leaq 0x312b8(%rip), %rsi     # 0x45210
leaq 0x73d1(%rip), %rdx      # 0x1b330
movq %r15, %rdi
callq 0x8aa0
jmp 0x13f6d
jmp 0x13f72
jmp 0x13f6d
movq %rax, %r14
jmp 0x13f87
movq %rax, %r14
movq %r15, %rdi
callq 0x8440
jmp 0x13f87
movq %rax, %r14
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x1eee0
movq %r14, %rdi
callq 0x8ab0
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/load-service.cc
// Function: update_command_and_dependencies(base_process_service*, dinit_load::service_settings_wrapper<prelim_dep>&, std::__cxx11::list<service_dep, std::allocator<service_dep>>&)
static void update_command_and_dependencies(base_process_service *service,
        dinit_load::service_settings_wrapper<prelim_dep> &settings,
        std::list<service_dep> &before_deps)
{
    // Get the current command parts
    ha_string orig_cmd; std::vector<const char *> orig_arg_parts;
    service->get_command(orig_cmd, orig_arg_parts);

    // Separate the new command parts and set
    std::vector<const char *> cmd_arg_parts = separate_args(settings.command, settings.command_offsets);
    service->set_command(std::move(settings.command), std::move(cmd_arg_parts));

    try {
        update_depenencies(service, settings, before_deps);
    }
    catch (...) {
        // restore original command
        service->set_command(std::move(orig_cmd), std::move(orig_arg_parts));

        // re-throw the exception
        throw;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x208(%rbx), %rsi
callq 0x1f2fc
leaq 0x218(%rbx), %rsi
movq %rsp, %rdi
callq 0x1f356
leaq 0x10(%r15), %rdx
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x23d74
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1f2aa
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x14e48
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x14da1
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x14db7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14dc6
callq 0x87c0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x8210
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x1f2aa
callq 0x8920
movq %rax, %rbx
callq 0x8a50
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x14e1b
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
jmp 0x14e1b
movq %rax, %rdi
callq 0xb74e
jmp 0x14e18
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x14e31
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x8620
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14e40
callq 0x87c0
movq %rbx, %rdi
callq 0x8ab0
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/proc-service.h
// Function: base_process_service::set_log_mode(log_type_id)
void set_log_mode(log_type_id log_type) noexcept
    {
        if (this->log_type == log_type) {
            return;
        }
        if (log_output_fd != -1) {
            if (this->log_type == log_type_id::BUFFER) {
                log_output_listener.deregister(event_loop);
            }
            if (!value(log_type).is_in(log_type_id::BUFFER, log_type_id::PIPE)) {
                bp_sys::close(log_output_fd);
                bp_sys::close(log_input_fd);
                log_output_fd = log_input_fd = -1;
            }
        }
        this->log_type = log_type;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x298(%rdi), %eax
cmpl %esi, %eax
je 0x1b9fd
movl %esi, %ebx
movq %rdi, %r14
cmpl $-0x1, 0x4ec(%rdi)
je 0x1b9f6
cmpl $0x2, %eax
jne 0x1b9c9
leaq 0x408(%r14), %rsi
movl 0x424(%r14), %edx
leaq 0x2b06c(%rip), %rdi     # 0x46a30
callq 0xd520
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
je 0x1b9f6
movl 0x4ec(%r14), %edi
callq 0x8b60
movl 0x4f0(%r14), %edi
callq 0x8b60
movq $-0x1, 0x4ec(%r14)
movl %ebx, 0x298(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xb74e
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: service_record::service_record(service_set*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, service_type_t, std::__cxx11::list<prelim_dep, std::allocator<prelim_dep>> const&)
service_record(service_set *set, const string &name, service_type_t record_type_p,
            const std::list<prelim_dep> &deplist_p)
        : service_record(set, name)
    {
        services = set;
        service_name = name;
        this->record_type = record_type_p;

        try {
            for (auto & pdep : deplist_p) {
                auto b = depends_on.emplace(depends_on.end(), this, pdep.to, pdep.dep_type);
                try {
                    pdep.to->dependents.push_back(&(*b));
                }
                catch (...) {
                    // we'll roll back one now and re-throw:
                    depends_on.pop_back();
                    throw;
                }
            }
        }
        catch (...) {
            for (auto & dep : depends_on) {
                dep.get_to()->dependents.pop_back();
            }
            throw;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
callq 0x1c43e
movq %r12, 0x148(%rbx)
leaq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x8340
movl %ebp, 0x28(%rbx)
movq (%r15), %r13
cmpq %r15, %r13
je 0x1bb86
leaq 0x118(%rbx), %r14
movl $0x28, %edi
callq 0x8600
movq %rax, %r12
movq 0x10(%r13), %rax
movl 0x18(%r13), %ecx
movq %rbx, 0x10(%r12)
movq %rax, 0x18(%r12)
movw $0x0, 0x20(%r12)
movl %ecx, 0x24(%r12)
movq %r12, %rdi
movq %r14, %rsi
callq 0x8060
incq 0x128(%rbx)
movq 0x10(%r13), %rbp
movl $0x18, %edi
callq 0x8600
addq $0x10, %r12
leaq 0x130(%rbp), %rsi
movq %r12, 0x10(%rax)
movq %rax, %rdi
callq 0x8060
incq 0x140(%rbp)
movq (%r13), %r13
cmpq %r15, %r13
jne 0x1bb13
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x1bc09
movq %rax, %r15
jmp 0x1bbbe
movq %rax, %rdi
callq 0x8210
movq %r14, %rdi
callq 0x1e76a
callq 0x8920
jmp 0x1bc01
movq %rax, %r15
callq 0x8a50
movq %r15, %rdi
callq 0x8210
movq (%r14), %r12
cmpq %r14, %r12
je 0x1bbfc
movq 0x18(%r12), %rax
movq 0x138(%rax), %r15
decq 0x140(%rax)
movq %r15, %rdi
callq 0x8a40
movl $0x18, %esi
movq %r15, %rdi
callq 0x8620
movq (%r12), %r12
jmp 0x1bbc9
callq 0x8920
movq %rax, %r14
callq 0x8a50
movq %rbx, %rdi
callq 0x1e78a
movq %r14, %rdi
callq 0x8ab0
movq %rax, %rdi
callq 0xb74e
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: placeholder_service::get_output_pipe_fd()
int get_output_pipe_fd() noexcept override
    {
        if (log_input_fd != -1) {
            return log_input_fd;
        }

        int pipefds[2];
        if (bp_sys::pipe2(pipefds, O_CLOEXEC) == -1) {
            log(loglevel_t::ERROR, get_name(), " (placeholder): Can't open output pipe: ", std::strerror(errno));
            return -1;
        }
        log_input_fd = pipefds[0];
        log_output_fd = pipefds[1];
        return log_input_fd;
    }

// Assembly:
movl 0x20c(%rdi), %eax
cmpl $-0x1, %eax
je 0x1e6d4
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x80000, %esi          # imm = 0x80000
callq 0x83e0
cmpl $-0x1, %eax
je 0x1e702
movl (%rsp), %eax
movl %eax, 0x20c(%rbx)
movl 0x4(%rsp), %ecx
movl %ecx, 0x208(%rbx)
jmp 0x1e738
callq 0x8050
movl (%rax), %edi
callq 0x81d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movl $0x3, %edi
callq 0x2e412
leaq 0x164a3(%rip), %rdi     # 0x34bc9
callq 0x2e520
movq %r14, %rdi
callq 0x2e53c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/dinit-util.h
// Function: linked_uo_set<service_record*, std::hash<service_record*>, std::equal_to<service_record*>>::add_back(service_record* const&)
bool add_back(const value_type &value)
    {
        auto it_b = backing.insert({value, nullptr});
        if (it_b.second) {
            auto *new_ent = &(*it_b.first);
            if (last != nullptr) {
                last->next = new_ent;
            }
            last = new_ent;
            if (first == nullptr) {
                first = new_ent;
            }
            return true;
        }
        return false;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq $0x0, 0x8(%rdx)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1e958
movb 0x18(%r14), %al
cmpb $0x1, %al
jne 0x1e950
movq 0x20(%rsp), %rcx
addq $0x10, %rcx
movq 0x38(%rbx), %rdx
testq %rdx, %rdx
je 0x1e941
movq %rcx, 0x8(%rdx)
movq %rcx, 0x38(%rbx)
cmpq $0x0, 0x30(%rbx)
jne 0x1e950
movq %rcx, 0x30(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: service_record::add_dep(service_record*, dependency_type, std::_List_iterator<service_dep>)
service_dep &add_dep(service_record *to, dependency_type dep_type, dep_list::iterator i)
    {
        auto pre_i = depends_on.emplace(i, this, to, dep_type);
        try {
            to->dependents.push_back(&(*pre_i));
        }
        catch (...) {
            depends_on.erase(pre_i);
            throw;
        }

        if (dep_type != dependency_type::BEFORE && dep_type != dependency_type::AFTER) {
            if (dep_type == dependency_type::REGULAR
                    || to->get_state() == service_state_t::STARTED
                    || to->get_state() == service_state_t::STARTING) {
                if (service_state == service_state_t::STARTING
                        || service_state == service_state_t::STARTED) {
                    to->require();
                    pre_i->holding_acq = true;
                }
            }
        }

        return *pre_i;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbp
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %r14
movl $0x28, %edi
callq 0x8600
movq %rax, %r12
movq %rax, %rbx
movq %r14, 0x10(%rax)
movq %r15, 0x18(%rax)
movw $0x0, 0x20(%rax)
movl %r13d, 0x24(%rax)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8060
incq 0x128(%r14)
movl $0x18, %edi
callq 0x8600
addq $0x10, %r12
leaq 0x130(%r15), %rsi
movq %r12, 0x10(%rax)
movq %rax, %rdi
callq 0x8060
incq 0x140(%r15)
leal -0x6(%r13), %eax
cmpl $-0x2, %eax
jae 0x1f62b
testl %r13d, %r13d
je 0x1f615
movb 0x2c(%r15), %al
decb %al
cmpb $0x1, %al
ja 0x1f62b
movb 0x2c(%r14), %al
decb %al
cmpb $0x1, %al
ja 0x1f62b
movq %r15, %rdi
callq 0x22c46
movb $0x1, 0x21(%rbx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x118, %r14            # imm = 0x118
movq %rax, %rdi
callq 0x8210
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f6fa
callq 0x8920
movq %rax, %rbx
callq 0x8a50
movq %rbx, %rdi
callq 0x8ab0
movq %rax, %rdi
callq 0xb74e
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: service_record::rm_dep(std::_List_iterator<service_dep>)
dep_list::iterator rm_dep(dep_list::iterator i) noexcept
    {
        auto to = i->get_to();
        for (auto j = to->dependents.begin(); ; ++j) {
            if (*j == &(*i)) {
                to->dependents.erase(j);
                break;
            }
        }
        if (i->holding_acq) {
            to->release();
        }
        return depends_on.erase(i);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsi), %rax
movq 0x18(%rsi), %r15
leaq 0x130(%r15), %r12
movq (%r12), %r12
cmpq %rax, 0x10(%r12)
jne 0x1f691
decq 0x140(%r15)
movq %r12, %rdi
callq 0x8a40
movl $0x18, %esi
movq %r12, %rdi
callq 0x8620
cmpb $0x1, 0x21(%rbx)
jne 0x1f6cb
movq %r15, %rdi
movl $0x1, %esi
callq 0x22a24
movq (%rbx), %r15
decq 0x128(%r14)
movq %rbx, %rdi
callq 0x8a40
movl $0x28, %esi
movq %rbx, %rdi
callq 0x8620
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/service.h
// Function: service_set::load_service(char const*)
virtual service_record *load_service(const char *name)
    {
        auto r = find_service(name);
        if (r == nullptr) {
            throw service_not_found(name);
        }
        return r;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x1a43c
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x225e4
movq %rax, %rbx
movq (%r15), %rdi
leaq 0x18(%rsp), %r15
cmpq %r15, %rdi
je 0x1faea
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8620
testq %rbx, %rbx
je 0x1fafd
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x40, %edi
callq 0x82c0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r14, %rsi
callq 0x1a43c
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1a862
xorl %ebp, %ebp
leaq 0x2535b(%rip), %rsi     # 0x44e90
leaq -0x480c(%rip), %rdx     # 0x1b330
movq %rbx, %rdi
callq 0x8aa0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fb5e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8620
testb %bpl, %bpl
jne 0x1fb68
jmp 0x1fb70
movq %rax, %r14
movq %rbx, %rdi
callq 0x8440
movq %r14, %rdi
callq 0x8ab0
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_set::find_service(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
service_record * service_set::find_service(const std::string &name, bool find_placeholders) noexcept
{
    service_record *r = ::find_service(records, name.c_str());
    if (r != nullptr && !find_placeholders && r->get_type() == service_type_t::PLACEHOLDER) {
        return nullptr;
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %r14
addq $0x10, %r14
movq (%rsi), %r15
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0x2262a
movq 0x10(%r12), %rbx
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x8880
testl %eax, %eax
jne 0x225fb
testb %bpl, %bpl
jne 0x2262c
xorl %eax, %eax
cmpl $0x0, 0x28(%rbx)
cmoveq %rax, %rbx
jmp 0x2262c
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::prepare_for_unload()
void service_record::prepare_for_unload() noexcept
{
    // Remove all dependencies:
    for (auto &dep : depends_on) {
        service_record *dependency = dep.get_to();
        auto &dep_dpts = dependency->dependents;
        dep_dpts.erase(std::find(dep_dpts.begin(), dep_dpts.end(), &dep));
        if (dep.dep_type == dependency_type::AFTER) {
            if (dependency->get_type() == service_type_t::PLACEHOLDER) {
                if (dependency->is_unrefd()) {
                    services->remove_service(dependency);
                    delete dependency;
                }
            }
        }
    }
    depends_on.clear();

    // Also remove all dependents. This should not be necessary except for "before" links.
    for (auto i = dependents.begin(); i != dependents.end();) {
        service_record *before_svc = (*i)->get_from();
        before_svc->rm_dep(**i++);
        if (before_svc->get_type() == service_type_t::PLACEHOLDER && before_svc->is_unrefd()) {
            services->remove_service(before_svc);
            delete before_svc;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x118(%rdi), %r14
movq 0x118(%rdi), %r13
cmpq %r14, %r13
je 0x226f5
movq 0x18(%r13), %r15
leaq 0x130(%r15), %rbp
movq 0x130(%r15), %r12
cmpq %rbp, %r12
je 0x22688
leaq 0x10(%r13), %rax
cmpq %rax, 0x10(%r12)
je 0x22688
movq (%r12), %r12
cmpq %rbp, %r12
jne 0x22678
decq 0x140(%r15)
movq %r12, %rdi
callq 0x8a40
movl $0x18, %esi
movq %r12, %rdi
callq 0x8620
cmpl $0x5, 0x24(%r13)
jne 0x226b2
cmpl $0x0, 0x28(%r15)
je 0x226b8
movq (%r13), %r13
jmp 0x22654
leaq 0x118(%r15), %rax
cmpq %rax, 0x118(%r15)
jne 0x226b2
cmpq %rbp, 0x130(%r15)
jne 0x226b2
cmpq $0x0, 0x188(%r15)
jne 0x226b2
movq 0x148(%rbx), %rdi
movq %r15, %rsi
callq 0x1b7b8
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
jmp 0x226b2
movq %r14, %rdi
callq 0x23c50
leaq 0x130(%rbx), %r15
movq 0x130(%rbx), %r12
cmpq %r15, %r12
je 0x22783
movq 0x10(%r12), %rax
movq (%r12), %r12
movq (%rax), %r14
leaq 0x118(%r14), %r13
movq %r13, %rsi
movq (%rsi), %rsi
cmpq %r13, %rsi
je 0x2273f
leaq 0x10(%rsi), %rcx
cmpq %rax, %rcx
jne 0x22726
movq %r14, %rdi
callq 0x1f674
cmpl $0x0, 0x28(%r14)
jne 0x2270b
cmpq %r13, 0x118(%r14)
jne 0x2270b
leaq 0x130(%r14), %rax
cmpq %rax, 0x130(%r14)
jne 0x2270b
cmpq $0x0, 0x188(%r14)
jne 0x2270b
movq 0x148(%rbx), %rdi
movq %r14, %rsi
callq 0x1b7b8
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
jmp 0x2270b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::dependency_started()
void service_record::dependency_started() noexcept
{
    // Note that we check for STARTED state here in case the service is in smooth recovery while pinned.
    // In that case it will wait for dependencies to start before restarting the process.
    if ((service_state == service_state_t::STARTING || service_state == service_state_t::STARTED)
            && waiting_for_deps) {
        services->add_transition_queue(this);
    }
}

// Assembly:
movb 0x2c(%rdi), %al
decb %al
cmpb $0x1, %al
ja 0x22a23
testb $0x10, 0x10c(%rdi)
je 0x22a23
movq 0x148(%rdi), %rax
cmpq $0x0, 0x200(%rdi)
setne %dl
movq 0x40(%rax), %rcx
cmpq %rdi, %rcx
sete %sil
orb %dl, %sil
jne 0x22a23
movq %rcx, 0x200(%rdi)
movq %rdi, 0x40(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::release(bool)
void service_record::release(bool issue_stop) noexcept
{
    if (--required_by == 0) {
        if (service_state == service_state_t::STOPPING) {
            // If we are stopping but would have restarted, we now need to notify that the restart
            // has been cancelled. Other start-cancelled cases are handled by do_stop() (called
            // below).
            if (desired_state == service_state_t::STARTED && !is_start_pinned()) {
                notify_listeners(service_event_t::STARTCANCELLED);
            }
        }
        desired_state = service_state_t::STOPPED;

        if (is_start_pinned()) return;

        // Can stop, and can release dependencies now. We don't need to issue a release if
        // a require was pending though:
        prop_release = !prop_require;
        prop_require = false;
        if (prop_release) {
            services->add_prop_queue(this);
        }

        if (service_state != service_state_t::STOPPED && service_state != service_state_t::STOPPING
                && issue_stop) {
            stop_reason = stopped_reason_t::NORMAL;
            do_stop();
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
decl 0x110(%rdi)
jne 0x22a83
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x3, 0x2c(%rdi)
jne 0x22a75
cmpb $0x2, 0x2d(%rbx)
jne 0x22a75
testb $0xc, 0x10c(%rbx)
setne %al
movq 0x160(%rbx), %r14
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x22a75
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
movl $0x3, %edx
callq *(%rax)
movq (%r14), %r14
testq %r14, %r14
jne 0x22a5c
movb $0x0, 0x2d(%rbx)
movl 0x10c(%rbx), %eax
testb $0xc, %al
je 0x22a88
popq %rbx
popq %r14
popq %rbp
retq
leal (%rax,%rax), %ecx
movl $0x400, %edx            # imm = 0x400
andl %edx, %ecx
andl $0xfffff9f3, %eax       # imm = 0xFFFFF9F3
orl %ecx, %eax
xorl %edx, %eax
movl %eax, 0x10c(%rbx)
testl %ecx, %ecx
jne 0x22ad2
movq 0x148(%rbx), %rax
cmpq $0x0, 0x1f8(%rbx)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
jne 0x22ad2
movq %rcx, 0x1f8(%rbx)
movq %rbx, 0x38(%rax)
movzbl 0x2c(%rbx), %eax
testl %eax, %eax
je 0x22a83
cmpl $0x3, %eax
je 0x22a83
testb %bpl, %bpl
je 0x22a83
movl $0x0, 0x1c4(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x22c98
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::initiate_start()
void service_record::initiate_start() noexcept
{
    start_failed = false;
    start_skipped = false;
    service_state = service_state_t::STARTING;
    waiting_for_deps = true;

    if (start_check_dependencies()) {
        // Note: we can't set waiting_for_deps false here since ordering dependencies might still kick in
        services->add_transition_queue(this);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x2c(%rdi)
movl $0xfffe7fef, %eax       # imm = 0xFFFE7FEF
andl 0x10c(%rdi), %eax
orl $0x10, %eax
movl %eax, 0x10c(%rdi)
callq 0x23076
testb %al, %al
je 0x22b8c
movq 0x148(%rbx), %rax
cmpq $0x0, 0x200(%rbx)
setne %dl
movq 0x40(%rax), %rcx
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
jne 0x22b8c
movq %rcx, 0x200(%rbx)
movq %rbx, 0x40(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::require()
void service_record::require() noexcept
{
    if (required_by++ == 0) {
        if (service_state != service_state_t::STARTING && service_state != service_state_t::STARTED) {
            prop_start = true;
            services->add_prop_queue(this);
            // Note: pin is checked in start().
            // Require will be propagated to dependencies if/when the service actually starts.
        }
    }
}

// Assembly:
movl 0x110(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x110(%rdi)
testl %eax, %eax
je 0x22c5a
retq
movb 0x2c(%rdi), %al
decb %al
cmpb $0x2, %al
jb 0x22c59
orb $0x10, 0x10d(%rdi)
movq 0x148(%rdi), %rax
cmpq $0x0, 0x1f8(%rdi)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rdi, %rcx
sete %sil
orb %dl, %sil
jne 0x22c59
movq %rcx, 0x1f8(%rdi)
movq %rdi, 0x38(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::release_dependencies()
void service_record::release_dependencies() noexcept
{
    for (auto & dependency : depends_on) {
        service_record * dep_to = dependency.get_to();
        if (dependency.holding_acq) {
            // We must clear holding_acq before calling release, otherwise the dependency
            // may decide to stop, check this link and release itself a second time.
            dependency.holding_acq = false;
            dep_to->release();
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x118(%rdi), %r14
addq $0x118, %rbx            # imm = 0x118
cmpq %rbx, %r14
je 0x22f39
cmpb $0x1, 0x21(%r14)
jne 0x22f34
movq 0x18(%r14), %rdi
movb $0x0, 0x21(%r14)
movl $0x1, %esi
callq 0x22a24
movq (%r14), %r14
jmp 0x22f15
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/service.cc
// Function: service_record::start_check_dependencies()
bool service_record::start_check_dependencies() noexcept
{
    bool all_deps_started = true;

    for (auto & dep : depends_on) {
        service_record * to = dep.get_to();
        if (dep.is_only_ordering()
                && to->service_state != service_state_t::STARTING) continue;
        if (to->service_state != service_state_t::STARTED) {
            dep.waiting_on = true;
            all_deps_started = false;
        }
    }

    for (auto * dept : dependents) {
        if (!dept->waiting_on && dept->is_only_ordering()) {
            service_record *from = dept->get_from();
            if (from->get_state() == service_state_t::STARTING) {
                dept->waiting_on = true;
            }
        }
    }

    return all_deps_started;
}

// Assembly:
leaq 0x118(%rdi), %rcx
movq 0x118(%rdi), %rdx
movb $0x1, %al
cmpq %rcx, %rdx
je 0x230ba
movq 0x18(%rdx), %rsi
movl 0x24(%rdx), %r8d
andl $-0x2, %r8d
movb 0x2c(%rsi), %sil
cmpl $0x4, %r8d
jne 0x230a9
cmpb $0x1, %sil
je 0x230af
jmp 0x230b5
cmpb $0x2, %sil
je 0x230b5
movb $0x1, 0x20(%rdx)
xorl %eax, %eax
movq (%rdx), %rdx
jmp 0x23086
movq 0x130(%rdi), %rcx
addq $0x130, %rdi            # imm = 0x130
cmpq %rdi, %rcx
je 0x230f4
movq 0x10(%rcx), %rdx
cmpb $0x0, 0x10(%rdx)
jne 0x230ef
movl 0x14(%rdx), %esi
andl $-0x2, %esi
cmpl $0x4, %esi
jne 0x230ef
movq (%rdx), %rsi
cmpb $0x1, 0x2c(%rsi)
jne 0x230ef
movb $0x1, 0x10(%rdx)
movq (%rcx), %rcx
jmp 0x230c8
andb $0x1, %al
retq
nop