LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0xcc4e
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1e1b0
movq %rax, %rbx
movq %r15, %rdi
callq 0x8b98
testq %rbx, %rbx
je 0xcbaf
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x40
popq %rdi
callq 0x82c0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r14, %rsi
callq 0xcc4e
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xcc8a
xorl %ebp, %ebp
leaq 0x3729b(%rip), %rsi     # 0x43e80
leaq 0xfe(%rip), %rdx        # 0xccea
movq %rbx, %rdi
callq 0x8a80
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x8b98
testb %bpl, %bpl
jne 0xcc0b
jmp 0xcc13
movq %rax, %r14
movq %rbx, %rdi
callq 0x8440
movq %r14, %rdi
callq 0x8a90
nop
// File: /workspace/github_cpp_makefile_star2_O2/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(%rbx), %rdi
movq 0x40(%rbx), %rax
orq %rdi, %rax
je 0xce29
testq %rdi, %rdi
je 0xce06
movq 0x1f8(%rdi), %rax
movq %rax, 0x38(%rbx)
andq $0x0, 0x1f8(%rdi)
callq 0x1eb2c
movq 0x38(%rbx), %rdi
jmp 0xcde3
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xcdd6
movq 0x200(%rdi), %rax
movq %rax, 0x40(%rbx)
andq $0x0, 0x200(%rdi)
callq 0x1ee80
jmp 0xcdd6
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0xcf4f
movq 0x10(%r15), %rdi
xorl %esi, %esi
callq 0x1f12e
movq 0x10(%r15), %rdi
callq 0x1f440
jmp 0xcf31
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xcdd2
// File: /workspace/github_cpp_makefile_star2_O2/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 0xc232
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xda16
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x8200
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbf34
callq 0x8910
movq %rax, %rbx
callq 0x8a40
movq %rbx, %rdi
callq 0x8a90
movq %rax, %rdi
callq 0xaebb
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x20(%rsp), %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbp)
andq $0x0, 0x30(%rbp)
movups %xmm0, 0x10(%rbp)
movups %xmm0, (%rbp)
leaq 0x18(%rsp), %r13
movq %rdi, %rbx
movq (%rbx), %rbx
cmpq %r12, %rbx
je 0x120ef
cmpq %r15, 0x10(%rbx)
je 0x1218d
leaq 0x10(%rbx), %rsi
movq %r13, %rdi
callq 0x1a3ce
jmp 0x120cf
leaq 0x48(%rsp), %rbp
leaq 0x18(%rsp), %r12
leaq 0x10(%rsp), %r13
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x1213f
movq (%rbp), %r14
movl $0x118, %eax            # imm = 0x118
addq %rax, %r14
movq %r14, %rbx
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0x12139
movq 0x18(%rbx), %rax
cmpq %r15, %rax
je 0x12158
movq %rax, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1a3ce
jmp 0x12116
addq $0x8, %rbp
jmp 0x120fe
leaq 0x20(%rsp), %rdi
callq 0x1ab24
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x40
popq %rdi
callq 0x82c0
movq %rax, %r15
movq %rax, %rdi
movq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rbp
callq 0x163b6
leaq 0x320cc(%rip), %rsi     # 0x44248
leaq -0x5499(%rip), %rdx     # 0xccea
movq %r15, %rdi
callq 0x8a80
jmp 0x121bb
pushq $0x40
popq %rdi
callq 0x82c0
movq %rax, %r15
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x163b6
leaq 0x3209c(%rip), %rsi     # 0x44248
leaq -0x54c9(%rip), %rdx     # 0xccea
movq %r15, %rdi
callq 0x8a80
jmp 0x121c1
jmp 0x121c6
jmp 0x121c1
movq %rax, %r14
jmp 0x121db
movq %rax, %r14
movq %r15, %rdi
callq 0x8440
jmp 0x121db
movq %rax, %r14
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x1ab24
movq %r14, %rdi
callq 0x8a90
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
callq 0x1b10c
leaq 0x10(%r15), %rdx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x1f79c
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b142
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12ae1
leaq 0x28(%rsp), %rdi
callq 0xcefc
leaq 0x10(%rsp), %rdi
callq 0xcefc
movq %rsp, %rdi
callq 0x17d3e
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x8200
movq %rsp, %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x1b142
callq 0x8910
movq %rax, %rbx
callq 0x8a40
leaq 0x28(%rsp), %rdi
callq 0xcefc
jmp 0x12ac7
movq %rax, %rdi
callq 0xaebb
jmp 0x12ac4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xcefc
movq %rsp, %rdi
callq 0x17d3e
movq %rbx, %rdi
callq 0x8a90
// File: /workspace/github_cpp_makefile_star2_O2/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 0x17251
movl %esi, %ebx
movq %rdi, %r14
cmpl $-0x1, 0x4ec(%rdi)
je 0x1724a
cmpl $0x2, %eax
jne 0x17220
leaq 0x408(%r14), %rdi
leaq 0x2e815(%rip), %rsi     # 0x45a30
callq 0xd002
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
je 0x1724a
movl 0x4ec(%r14), %edi
callq 0x8b50
movl 0x4f0(%r14), %edi
callq 0x8b50
orq $-0x1, 0x4ec(%r14)
movl %ebx, 0x298(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xaebb
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
callq 0x17d76
movq %r12, 0x148(%r15)
leaq 0x8(%r15), %rdi
movq %r14, %rsi
movq %r15, 0x8(%rsp)
callq 0x8340
movl %ebp, 0x28(%r15)
leaq 0x118(%r15), %r14
leaq 0x10(%rsp), %r12
movl $0x130, %ebp            # imm = 0x130
movq %rbx, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0x173f2
leaq 0x10(%r15), %r13
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x18(%r15), %r8
movq %r14, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x1a138
movq (%r13), %rdi
addq %rbp, %rdi
addq $0x10, %rax
movq %rax, 0x10(%rsp)
movq %r12, %rsi
callq 0x17498
jmp 0x173ad
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x1745d
movq %rax, %r15
jmp 0x1742a
movq %rax, %rdi
callq 0x8200
movq %r14, %rdi
callq 0x1a16c
callq 0x8910
jmp 0x17455
movq %rax, %r15
callq 0x8a40
movq %r15, %rdi
callq 0x8200
movl $0x130, %ebx            # imm = 0x130
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x17450
movq 0x18(%r15), %rdi
addq %rbx, %rdi
callq 0x174a4
jmp 0x1743a
callq 0x8910
movq %rax, %r14
callq 0x8a40
movq 0x8(%rsp), %rdi
callq 0x1a176
movq %r14, %rdi
callq 0x8a90
movq %rax, %rdi
callq 0xaebb
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/service.h
// Function: service_record::rm_dep(service_dep&)
void rm_dep(service_dep &dep) noexcept
    {
        for (auto i = depends_on.begin(); i != depends_on.end(); ++i) {
            if (&(*i) == &dep) {
                rm_dep(i);
                return;
            }
        }
    }

// Assembly:
leaq 0x118(%rdi), %rcx
movq %rcx, %rax
movq (%rax), %rax
cmpq %rcx, %rax
je 0x1750d
leaq 0x10(%rax), %rdx
cmpq %rsi, %rdx
jne 0x174f4
movq %rax, %rsi
jmp 0x1b58c
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1a0ac
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x80000, %esi          # imm = 0x80000
callq 0x83e0
cmpl $-0x1, %eax
je 0x1a0da
movl (%rsp), %eax
movl %eax, 0x20c(%rbx)
movl 0x4(%rsp), %ecx
movl %ecx, 0x208(%rbx)
jmp 0x1a10c
callq 0x8040
movl (%rax), %edi
callq 0x81c0
movq %rax, %r14
movq 0x8(%rbx), %rsi
pushq $0x3
popq %rdi
callq 0x28e0a
leaq 0x14ac3(%rip), %rdi     # 0x2ebbf
callq 0x28f17
movq %r14, %rdi
callq 0x28f31
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x8(%rdx)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1a42e
movb 0x18(%r14), %al
cmpb $0x1, %al
jne 0x1a425
movq 0x20(%rsp), %rcx
addq $0x10, %rcx
movq 0x38(%rbx), %rdx
testq %rdx, %rdx
je 0x1a416
movq %rcx, 0x8(%rdx)
movq %rcx, 0x38(%rbx)
cmpq $0x0, 0x30(%rbx)
jne 0x1a425
movq %rcx, 0x30(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::child_proc_watcher_impl<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>, stop_child_watcher>::dispatch(void*)
void dispatch(void *loop_ptr) noexcept override
    {
        EventLoop &loop = *static_cast<EventLoop *>(loop_ptr);
        loop_access::get_base_lock(loop).unlock();

        auto rearm_type = static_cast<Derived *>(this)->status_change(loop, this->watch_pid, this->child_status);

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

        if (rearm_type != rearm::REMOVED) {

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

            loop_access::process_child_watch_rearm(loop, this, rearm_type);

            // rearm_type = loop.process??;
            post_dispatch(loop, this, rearm_type);
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x30(%rdi), %edx
movq 0x34(%rdi), %rcx
callq 0x1fcaa
cmpl $0x4, %eax
jne 0x1b008
popq %rbx
popq %r14
popq %rbp
retq
movb 0xc(%rbx), %cl
movl %ecx, %edx
andb $-0x2, %dl
movb %dl, 0xc(%rbx)
testb $0x2, %cl
pushq $0x3
popq %rbp
cmovel %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x1b042
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0xb616
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-util.h
// Function: ha_string::operator=(ha_string const&)
ha_string &operator=(const ha_string &other)
    {
        char *new_str_data = new char[other.str_len + 1];
        delete[] str_data;
        memcpy(new_str_data, other.str_data, other.str_len + 1);
        str_data = new_str_data;
        str_len = other.str_len;
        return *this;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r13
leaq 0x1(%r13), %r12
movq %r12, %rdi
callq 0x8030
movq %rax, %r15
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1b1a9
callq 0x87b0
movq 0x8(%r14), %r13
leaq 0x1(%r13), %r12
movq (%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x84d0
movq %r15, (%rbx)
movq %r13, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-util.h
// Function: ha_string::operator=(ha_string&&)
ha_string &operator=(ha_string &&other) noexcept
    {
        delete[] str_data;
        str_data = other.str_data;
        str_len = other.str_len;
        other.str_data = nullptr;
        other.str_len = 0;
        return *this;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1b2df
callq 0x87b0
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x10(%rsp), %rbx
movq %rsi, (%rbx)
leaq 0xc(%rsp), %r8
movl %edx, (%r8)
leaq 0x118(%rdi), %r12
leaq 0x18(%rsp), %r13
movq %rdi, (%r13)
movq %r12, %rdi
movq %rcx, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1b6a0
movl $0x130, %edi            # imm = 0x130
addq (%rbx), %rdi
movq %rax, %rbx
movq %rax, %r15
addq $0x10, %r15
movq %r15, (%r13)
leaq 0x18(%rsp), %rsi
callq 0x17498
movl 0xc(%rsp), %eax
leal -0x6(%rax), %ecx
cmpl $-0x2, %ecx
jae 0x1b53d
testl %eax, %eax
je 0x1b525
movq 0x10(%rsp), %rax
movb 0x2c(%rax), %al
decb %al
cmpb $0x1, %al
ja 0x1b53d
movb 0x2c(%r14), %al
decb %al
cmpb $0x1, %al
ja 0x1b53d
movq 0x10(%rsp), %rdi
callq 0x1e708
movb $0x1, 0x21(%rbx)
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x8200
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1b6d4
callq 0x8910
movq %rax, %rbx
callq 0x8a40
movq %rbx, %rdi
callq 0x8a90
movq %rax, %rdi
callq 0xaebb
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsi), %rax
movq 0x18(%rsi), %r15
leaq 0x130(%r15), %rdi
movq %rdi, %rsi
movq (%rsi), %rsi
cmpq %rax, 0x10(%rsi)
jne 0x1b5a9
callq 0x1b75a
cmpb $0x1, 0x21(%rbx)
jne 0x1b5c8
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x1e58e
addq $0x118, %r14            # imm = 0x118
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1b6d4
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1e1f6
movq 0x10(%r12), %rbx
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x8880
testl %eax, %eax
jne 0x1e1c7
testb %bpl, %bpl
jne 0x1e1f8
xorl %eax, %eax
cmpl $0x0, 0x28(%rbx)
cmoveq %rax, %rbx
jmp 0x1e1f8
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rsp, %r15
movq %r14, %rbp
movq (%rbp), %rbp
cmpq %r14, %rbp
je 0x1e28f
leaq 0x10(%rbp), %rax
movq 0x18(%rbp), %r12
leaq 0x130(%r12), %r13
movq 0x130(%r12), %rdi
movq %rax, (%rsp)
movq %r13, %rsi
movq %r15, %rdx
callq 0x1f766
movq %r13, %rdi
movq %rax, %rsi
callq 0x1b75a
cmpl $0x5, 0x24(%rbp)
jne 0x1e21f
cmpl $0x0, 0x28(%r12)
jne 0x1e21f
movq %r12, %rdi
callq 0x17004
testb %al, %al
je 0x1e21f
movq 0x148(%rbx), %rdi
movq %r12, %rsi
callq 0x17032
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
jmp 0x1e21f
movq %r14, %rdi
callq 0x1f586
leaq 0x130(%rbx), %r15
movq 0x130(%rbx), %rcx
cmpq %r15, %rcx
je 0x1e2f2
movq (%rcx), %r12
movq 0x10(%rcx), %rsi
movq (%rsi), %r14
movq %r14, %rdi
callq 0x174ea
cmpl $0x0, 0x28(%r14)
movq %r12, %rcx
jne 0x1e2a5
movq %r14, %rdi
callq 0x17004
movq %r12, %rcx
testb %al, %al
je 0x1e2a5
movq 0x148(%rbx), %rdi
movq %r14, %rsi
callq 0x17032
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
movq %r12, %rcx
jmp 0x1e2a5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xaebb
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1e58d
testb $0x10, 0x10c(%rdi)
je 0x1e58d
movq 0x148(%rdi), %rax
cmpq $0x0, 0x200(%rdi)
setne %dl
movq 0x40(%rax), %rcx
cmpq %rdi, %rcx
sete %sil
orb %dl, %sil
jne 0x1e58d
movq %rcx, 0x200(%rdi)
movq %rdi, 0x40(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
pushq %rax
decl 0x110(%rdi)
jne 0x1e5cc
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x3, 0x2c(%rdi)
jne 0x1e5be
cmpb $0x2, 0x2d(%rbx)
jne 0x1e5be
testb $0xc, 0x10c(%rbx)
jne 0x1e5be
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1f59e
movb $0x0, 0x2d(%rbx)
movl 0x10c(%rbx), %eax
testb $0xc, %al
je 0x1e5d3
addq $0x8, %rsp
popq %rbx
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 0x1e61d
movq 0x148(%rbx), %rax
cmpq $0x0, 0x1f8(%rbx)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
jne 0x1e61d
movq %rcx, 0x1f8(%rbx)
movq %rbx, 0x38(%rax)
movzbl 0x2c(%rbx), %eax
testl %eax, %eax
je 0x1e5cc
cmpl $0x3, %eax
je 0x1e5cc
testb %bpl, %bpl
je 0x1e5cc
andl $0x0, 0x1c4(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1e75a
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1eab2
testb %al, %al
je 0x1e6d6
movq 0x148(%rbx), %rax
cmpq $0x0, 0x200(%rbx)
setne %dl
movq 0x40(%rax), %rcx
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
jne 0x1e6d6
movq %rcx, 0x200(%rbx)
movq %rbx, 0x40(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1e71c
retq
movb 0x2c(%rdi), %al
decb %al
cmpb $0x2, %al
jb 0x1e71b
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 0x1e71b
movq %rcx, 0x1f8(%rdi)
movq %rdi, 0x38(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x118, %rbx            # imm = 0x118
pushq $0x1
popq %rbp
movq %rbx, %r14
movq (%r14), %r14
cmpq %rbx, %r14
je 0x1e9af
cmpb $0x1, 0x21(%r14)
jne 0x1e98e
movq 0x18(%r14), %rdi
movb $0x0, 0x21(%r14)
movl %ebp, %esi
callq 0x1e58e
jmp 0x1e98e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::do_start()
void service_record::do_start() noexcept
{
    bool was_active = service_state != service_state_t::STOPPED;

    desired_state = service_state_t::STARTED;

    if (pinned_stopped) {
        if (!was_active) {
            failed_to_start(false, false);
        }
        return;
    }

    // re-attach any soft dependents, now that we are starting again
    if (!was_active) {
        for (auto dept : dependents) {
            if (!dept->is_hard()) {
                service_state_t dept_state = dept->get_from()->service_state;
                if (!dept->holding_acq
                        && (dept_state == service_state_t::STARTED || dept_state == service_state_t::STARTING)) {
                    dept->holding_acq = true;
                    ++required_by;
                }
            }
        }
    }

    if (was_active) {
        // We're already starting/started, or we are stopping and need to wait for
        // that the complete.
        if (service_state != service_state_t::STOPPING) {
            return;
        }

        if (! can_interrupt_stop()) {
            return;
        }

        // We're STOPPING, and that can be interrupted. Our dependencies might be STOPPING,
        // but if so they are waiting (for us), so they too can be instantly returned to
        // STARTING state.
        notify_listeners(service_event_t::STOPCANCELLED);
    }
    else { // !was_active
        services->service_active(this);
        prop_require = !prop_release;
        prop_release = false;
        if (prop_require) {
            services->add_prop_queue(this);
        }
    }

    initiate_start();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb 0x2c(%rdi), %cl
movb $0x2, 0x2d(%rdi)
movl 0x10c(%rdi), %eax
testb $0x2, %al
jne 0x1e9ef
testb %cl, %cl
je 0x1e9f5
cmpb $0x3, %cl
jne 0x1e9f3
testb $0x10, %al
je 0x1e9f3
testb $0x1, 0x190(%rbx)
jne 0x1e9f3
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x1f59e
jmp 0x1eaa9
testb %cl, %cl
je 0x1ea47
popq %rbx
retq
leaq 0x130(%rbx), %rax
movl 0x110(%rbx), %ecx
movq %rax, %rdx
movq (%rdx), %rdx
cmpq %rax, %rdx
je 0x1ea54
movq 0x10(%rdx), %rsi
movl 0x14(%rsi), %edi
testl %edi, %edi
je 0x1ea05
cmpl $0x3, %edi
jne 0x1ea23
cmpb $0x0, 0x10(%rsi)
jne 0x1ea05
cmpb $0x0, 0x11(%rsi)
jne 0x1ea05
movq (%rsi), %rdi
movb 0x2c(%rdi), %dil
decb %dil
cmpb $0x1, %dil
ja 0x1ea05
movb $0x1, 0x11(%rsi)
incl %ecx
movl %ecx, 0x110(%rbx)
jmp 0x1ea05
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
popq %rbx
jmp 0x1ed2e
movq 0x148(%rbx), %rax
incl 0x8(%rax)
movl 0x10c(%rbx), %ecx
movl %ecx, %edx
shrl %edx
movl $0x200, %esi            # imm = 0x200
andl %esi, %edx
andl $0xfffff9ff, %ecx       # imm = 0xFFFFF9FF
orl %edx, %ecx
xorl %esi, %ecx
movl %ecx, 0x10c(%rbx)
testl %edx, %edx
jne 0x1eaa9
cmpq $0x0, 0x1f8(%rbx)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
jne 0x1eaa9
movq %rcx, 0x1f8(%rbx)
movq %rbx, 0x38(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x1e684
// File: /workspace/github_cpp_makefile_star2_O2/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
movb $0x1, %al
movq %rcx, %rdx
movq (%rdx), %rdx
cmpq %rcx, %rdx
je 0x1eaf2
movq 0x18(%rdx), %rsi
movl 0x24(%rdx), %r8d
andl $-0x2, %r8d
movb 0x2c(%rsi), %sil
cmpl $0x4, %r8d
jne 0x1eae4
cmpb $0x1, %sil
jne 0x1eabe
jmp 0x1eaea
cmpb $0x2, %sil
je 0x1eabe
movb $0x1, 0x20(%rdx)
xorl %eax, %eax
jmp 0x1eabe
addq $0x130, %rdi            # imm = 0x130
movq %rdi, %rcx
movq (%rcx), %rcx
cmpq %rdi, %rcx
je 0x1eb28
movq 0x10(%rcx), %rdx
cmpb $0x0, 0x10(%rdx)
jne 0x1eafc
movl 0x14(%rdx), %esi
andl $-0x2, %esi
cmpl $0x4, %esi
jne 0x1eafc
movq (%rdx), %rsi
cmpb $0x1, 0x2c(%rsi)
jne 0x1eafc
movb $0x1, 0x10(%rdx)
jmp 0x1eafc
andb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::execute_transition()
void service_record::execute_transition() noexcept
{
    if (service_state == service_state_t::STARTING) {
        if (check_deps_started()) {
            waiting_for_deps = false;
            all_deps_started();
        }
    }
    else if (service_state == service_state_t::STOPPING) {
        if (stop_check_dependents()) {
            waiting_for_deps = false;
            if (onstart_flags.kill_all_on_stop) {
                log(loglevel_t::NOTICE, true, "Sending TERM/KILL to all processes...\n");
                kill(-1, SIGTERM);
                sleep(1);
                kill(-1, SIGKILL);
            }
            bring_down();
        }
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl 0x2c(%rdi), %eax
cmpl $0x3, %eax
je 0x1eeb5
cmpl $0x1, %eax
jne 0x1ef0d
movq %rbx, %rdi
callq 0x1ef1c
testb %al, %al
je 0x1ef0d
andb $-0x11, 0x10c(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1ef3c
movq %rbx, %rdi
callq 0x1ef8a
testb %al, %al
je 0x1ef0d
andb $-0x11, 0x10c(%rbx)
testb $0x8, 0x2f(%rbx)
je 0x1eefe
leaq 0x10b16(%rip), %rdx     # 0x2f9eb
pushq $0x1
popq %rbp
movl %ebp, %edi
movl %ebp, %esi
callq 0x28e05
pushq $-0x1
popq %rdi
pushq $0xf
popq %rsi
callq 0x88c0
movl %ebp, %edi
callq 0x8470
pushq $-0x1
popq %rdi
pushq $0x9
popq %rsi
callq 0x88c0
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rdi
callq 0xaebb
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::check_deps_started()
bool service_record::check_deps_started() noexcept
{
    for (auto & dep : depends_on) {
        if (dep.waiting_on) {
            return false;
        }
    }

    return true;
}

// Assembly:
addq $0x118, %rdi            # imm = 0x118
movq %rdi, %rax
movq (%rax), %rax
cmpq %rdi, %rax
je 0x1ef34
cmpb $0x1, 0x20(%rax)
jne 0x1ef26
cmpq %rdi, %rax
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::all_deps_started()
void service_record::all_deps_started() noexcept
{
    if (onstart_flags.starts_on_console && !have_console) {
        queue_for_console();
        return;
    }

    waiting_for_deps = false;

    if (!bring_up()) {
        service_state = service_state_t::STOPPING;
        failed_to_start();
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb 0x2e(%rdi), %cl
shrb $0x3, %cl
movl 0x10c(%rdi), %eax
testb $0x40, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1ef61
movq %rbx, %rdi
popq %rbx
jmp 0x1efca
andl $-0x11, %eax
movl %eax, 0x10c(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testb %al, %al
je 0x1ef78
popq %rbx
retq
movb $0x3, 0x2c(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x1ed2e
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::stop_check_dependents()
bool service_record::stop_check_dependents() noexcept
{
    bool all_deps_stopped = true;
    for (auto dept : dependents) {
        // Note if the dependent is waiting on us, it must be restarting (since the
        // waiting_on flag gets cleared when we stop, and would only be set if the
        // service tries to restart). We can treat that as "stopped" for purposes of
        // checking whether we can transition to stopped state.
        if (dept->is_hard() && dept->holding_acq && !dept->waiting_on) {
            all_deps_stopped = false;
            break;
        }
    }

    return all_deps_stopped;
}

// Assembly:
addq $0x130, %rdi            # imm = 0x130
movq %rdi, %rax
movq (%rax), %rax
cmpq %rdi, %rax
je 0x1efbe
movq 0x10(%rax), %rcx
movl 0x14(%rcx), %edx
testl %edx, %edx
je 0x1efb2
cmpl $0x3, %edx
jne 0x1ef94
cmpb $0x1, 0x10(%rcx)
jne 0x1ef94
cmpb $0x1, 0x11(%rcx)
jne 0x1ef94
cmpb $0x0, 0x10(%rcx)
jne 0x1ef94
cmpq %rdi, %rax
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::acquired_console()
void service_record::acquired_console() noexcept
{
    waiting_for_console = false;
    have_console = true;

    if (service_state != service_state_t::STARTING) {
        // We got the console but no longer want it.
        release_console();
    }
    else if (check_deps_started()) {
        all_deps_started();
    }
    else {
        // We got the console but can't use it yet.
        release_console();
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10c(%rdi), %eax
andl $-0x61, %eax
orl $0x40, %eax
movl %eax, 0x10c(%rdi)
cmpb $0x1, 0x2c(%rdi)
jne 0x1f011
movq %rbx, %rdi
callq 0x1ef1c
testb %al, %al
je 0x1f011
movq %rbx, %rdi
popq %rbx
jmp 0x1ef3c
movq %rbx, %rdi
popq %rbx
jmp 0x1e53a
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::started()
void service_record::started() noexcept
{
    // If we start on console but don't keep it, release it now:
    if (have_console && !onstart_flags.runs_on_console) {
        bp_sys::tcsetpgrp(0, bp_sys::getpgrp());
        release_console();
    }

    log_service_started(get_name());
    service_state = service_state_t::STARTED;
    notify_listeners(service_event_t::STARTED);

    if (onstart_flags.rw_ready) {
        rootfs_is_rw();
    }
    if (onstart_flags.log_ready) {
        setup_external_log();
    }

    if (force_stop || desired_state == service_state_t::STOPPED) {
        // We must now stop.
        do_stop();
        return;
    }

    // Notify any dependents whose desired state is STARTED:
    for (auto dept : dependents) {
        if (dept->waiting_on) {
            dept->get_from()->dependency_started();
            dept->waiting_on = false;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testb $0x40, 0x10c(%rdi)
je 0x1f047
testb $0x4, 0x2e(%rbx)
jne 0x1f047
callq 0x8180
xorl %edi, %edi
movl %eax, %esi
callq 0x88b0
movq %rbx, %rdi
callq 0x1e53a
movq 0x8(%rbx), %rdi
callq 0x28f96
movb $0x2, 0x2c(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1f59e
movzwl 0x2e(%rbx), %eax
testb $0x1, %al
je 0x1f06f
callq 0xa8f0
movzwl 0x2e(%rbx), %eax
testb $0x2, %al
je 0x1f078
callq 0xa657
cmpb $0x0, 0x190(%rbx)
jne 0x1f0b3
cmpb $0x0, 0x2d(%rbx)
je 0x1f0b3
addq $0x130, %rbx            # imm = 0x130
movq %rbx, %r14
movq (%r14), %r14
cmpq %rbx, %r14
je 0x1f0c2
movq 0x10(%r14), %r15
cmpb $0x1, 0x10(%r15)
jne 0x1f091
movq (%r15), %rdi
callq 0x1e54e
movb $0x0, 0x10(%r15)
jmp 0x1f091
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x1e75a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::forced_stop()
void service_record::forced_stop() noexcept
{
    if (service_state != service_state_t::STOPPED) {
        force_stop = true;
        if (!is_start_pinned()) {
            prop_stop = true;
            services->add_prop_queue(this);
        }
    }
}

// Assembly:
cmpb $0x0, 0x2c(%rdi)
je 0x1f0e9
movb $0x1, 0x190(%rdi)
movl 0x10c(%rdi), %eax
testb $0xc, %al
je 0x1f0ea
retq
orl $0x2000, %eax           # imm = 0x2000
movl %eax, 0x10c(%rdi)
movq 0x148(%rdi), %rax
cmpq $0x0, 0x1f8(%rdi)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rdi, %rcx
sete %sil
orb %dl, %sil
jne 0x1f0e9
movq %rcx, 0x1f8(%rdi)
movq %rdi, 0x38(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::stop(bool)
void service_record::stop(bool bring_down) noexcept
{
    // Stop; remove activation, and don't self-restart.

    if (start_explicit) {
        start_explicit = false;
        required_by--;
    }

    if (bring_down || required_by == 0) {
        // Set desired state to STOPPED, this will inhibit automatic restart (and will be
        // propagated to dependents)
        desired_state = service_state_t::STOPPED;
    }

    if (is_start_pinned()) {
        return;
    }

    // If our required_by count is 0, we should treat this as a full manual stop regardless
    if (required_by == 0) {
        bring_down = true;
        prop_release = !prop_require;
        if (prop_release) {
            services->add_prop_queue(this);
        }
    }

    if (bring_down && service_state != service_state_t::STOPPED) {
        // Note even if we are already STOPPING we should call do_stop for the case where we need
        // to interrupt any currently ongoing restart of dependents.
        stop_reason = stopped_reason_t::NORMAL;
        do_stop();
    }
}

// Assembly:
movl 0x10c(%rdi), %eax
btl $0x8, %eax
jb 0x1f142
movl 0x110(%rdi), %ecx
jmp 0x1f15b
andl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
movl %eax, 0x10c(%rdi)
movl 0x110(%rdi), %ecx
decl %ecx
movl %ecx, 0x110(%rdi)
testl %ecx, %ecx
sete %dl
orb %sil, %dl
cmpb $0x1, %dl
jne 0x1f16c
movb $0x0, 0x2d(%rdi)
testb $0xc, %al
je 0x1f171
retq
testl %ecx, %ecx
je 0x1f17c
testb %sil, %sil
jne 0x1f1c6
jmp 0x1f170
leal (%rax,%rax), %ecx
movl $0x400, %edx            # imm = 0x400
andl %edx, %ecx
andl $0xfffffaf3, %eax       # imm = 0xFFFFFAF3
orl %ecx, %eax
xorl %edx, %eax
movl %eax, 0x10c(%rdi)
testl %ecx, %ecx
jne 0x1f1c6
movq 0x148(%rdi), %rax
cmpq $0x0, 0x1f8(%rdi)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rdi, %rcx
sete %sil
orb %dl, %sil
jne 0x1f1c6
movq %rcx, 0x1f8(%rdi)
movq %rdi, 0x38(%rax)
cmpb $0x0, 0x2c(%rdi)
je 0x1f170
andl $0x0, 0x1c4(%rdi)
xorl %esi, %esi
jmp 0x1e75a
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::restart()
bool service_record::restart() noexcept
{
    // Re-start without affecting dependency links/activation. Hard dependents will be similarly
    // restarted.

    if (service_state == service_state_t::STARTED) {
        stop_reason = stopped_reason_t::NORMAL;
        force_stop = true;
        do_stop(true);
        return true;
    }

    // Wrong state
    return false;
}

// Assembly:
pushq %rbx
movb 0x2c(%rdi), %bl
cmpb $0x2, %bl
jne 0x1f1f9
andl $0x0, 0x1c4(%rdi)
movb $0x1, 0x190(%rdi)
pushq $0x1
popq %rsi
callq 0x1e75a
cmpb $0x2, %bl
sete %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::pin_start()
void service_record::pin_start() noexcept
{
    if (!pinned_started) {
        if (!dept_pinned_started) {
            for (auto &dep : depends_on) {
                if (dep.is_hard() && !dep.get_to()->dept_pinned_started) {
                    dep.get_to()->prop_pin_dpt = true;
                    services->add_prop_queue(dep.get_to());
                }
            }
        }
        pinned_started = true;
    }
}

// Assembly:
movl 0x10c(%rdi), %eax
testb $0x4, %al
jne 0x1f43f
testb $0x8, %al
jne 0x1f436
leaq 0x118(%rdi), %rax
movq %rax, %rcx
movq (%rcx), %rcx
cmpq %rax, %rcx
je 0x1f430
movl 0x24(%rcx), %edx
testl %edx, %edx
je 0x1f3e0
cmpl $0x3, %edx
jne 0x1f3c6
cmpb $0x1, 0x20(%rcx)
jne 0x1f3c6
movq 0x18(%rcx), %rdx
movl 0x10c(%rdx), %esi
testb $0x8, %sil
jne 0x1f3c6
orl $0x4000, %esi           # imm = 0x4000
movl %esi, 0x10c(%rdx)
movq 0x148(%rdi), %rdx
movq 0x18(%rcx), %rsi
cmpq $0x0, 0x1f8(%rsi)
setne %r9b
movq 0x38(%rdx), %r8
cmpq %rsi, %r8
sete %r10b
orb %r9b, %r10b
jne 0x1f3c6
movq %r8, 0x1f8(%rsi)
movq %rsi, 0x38(%rdx)
jmp 0x1f3c6
movl 0x10c(%rdi), %eax
orl $0x4, %eax
movl %eax, 0x10c(%rdi)
retq