LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/service.cc
// Function: service_record::unpin()
void service_record::unpin() noexcept
{
    if (pinned_started) {
        pinned_started = false;

        if (dept_pinned_started) return;

        // unpin dependencies
        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());
            }
        }

        // We only need special handling here if service was in STARTED state
        if (service_state == service_state_t::STARTED) {
            // If any dependents are stopping, then force_stop should already be set.

            // If we reached required_by 0, we need to propagate release now (since it wasn't
            // propagated as it normally would be when we hit 0, due to the pin)
            if (required_by == 0) {
                prop_release = true;
                services->add_prop_queue(this);
            }

            if (desired_state == service_state_t::STOPPED || force_stop) {
                do_stop();
                services->process_queues();
            }
        }
    }
    if (pinned_stopped) {
        pinned_stopped = false;
        // We don't need to check state. If we're pinned stopped we can't be required and so desired
        // state should always be stopped.
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10c(%rdi), %eax
testb $0x4, %al
jne 0x1f46a
movl 0x10c(%rbx), %eax
testb $0x2, %al
je 0x1f4ed
andl $-0x3, %eax
movl %eax, 0x10c(%rbx)
jmp 0x1f4ed
movl %eax, %ecx
andl $-0x5, %ecx
movl %ecx, 0x10c(%rbx)
testb $0x8, %al
jne 0x1f4ed
leaq 0x118(%rbx), %rax
movq %rax, %rcx
movq (%rcx), %rcx
cmpq %rax, %rcx
je 0x1f4ef
movl 0x24(%rcx), %edx
testl %edx, %edx
je 0x1f49d
cmpl $0x3, %edx
jne 0x1f483
cmpb $0x1, 0x20(%rcx)
jne 0x1f483
movq 0x18(%rcx), %rdx
movl 0x10c(%rdx), %esi
testb $0x8, %sil
je 0x1f483
orl $0x4000, %esi           # imm = 0x4000
movl %esi, 0x10c(%rdx)
movq 0x148(%rbx), %rdx
movq 0x18(%rcx), %rsi
cmpq $0x0, 0x1f8(%rsi)
setne %r8b
movq 0x38(%rdx), %rdi
cmpq %rsi, %rdi
sete %r9b
orb %r8b, %r9b
jne 0x1f483
movq %rdi, 0x1f8(%rsi)
movq %rsi, 0x38(%rdx)
jmp 0x1f483
popq %rbx
retq
cmpb $0x2, 0x2c(%rbx)
jne 0x1f44e
cmpl $0x0, 0x110(%rbx)
jne 0x1f536
orb $0x4, 0x10d(%rbx)
movq 0x148(%rbx), %rax
cmpq $0x0, 0x1f8(%rbx)
setne %dl
movq 0x38(%rax), %rcx
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
jne 0x1f536
movq %rcx, 0x1f8(%rbx)
movq %rbx, 0x38(%rax)
cmpb $0x0, 0x2d(%rbx)
je 0x1f549
cmpb $0x1, 0x190(%rbx)
jne 0x1f44e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e75a
movq 0x148(%rbx), %rdi
callq 0xcdd2
jmp 0x1f44e
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/service.h
// Function: service_set::pull_console_queue()
void pull_console_queue() noexcept
    {
        if (console_queue.is_empty()) {
            // Discard the log buffer now, because we've potentially blocked output for a while
            // and allowed it to fill with stale messages. (If not much time has passed, the
            // request to discard will be ignored anyway).
            discard_console_log_buffer();
            enable_console_log(true);
        }
        else {
            service_record * front = console_queue.pop_front();
            front->acquired_console();
        }
    }

// Assembly:
pushq %rax
cmpq $0x0, 0x30(%rdi)
je 0x1f658
addq $0x30, %rdi
callq 0x1f726
movq %rax, %rdi
popq %rax
jmp 0x1efe0
callq 0x28cff
pushq $0x1
popq %rdi
popq %rax
jmp 0x28bb7
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-ll.h
// Function: dlist<service_record, &extract_console_queue(service_record*)>::append(service_record*)
void append(T *e) noexcept
    {
        auto &node = E(e);
        if (first == nullptr) {
            first = e;
            node.next = e;
            node.prev = e;
        }
        else {
            node.next = first;
            node.prev = E(first).prev;
            E(E(first).prev).next = e;
            E(first).prev = e;
        }
    }

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x1f710
movq %rax, 0x1e8(%rsi)
movq 0x1f0(%rax), %rcx
addq $0x1f0, %rax            # imm = 0x1F0
movq %rcx, 0x1f0(%rsi)
movq %rsi, 0x1e8(%rcx)
jmp 0x1f721
movq %rsi, (%rdi)
movq %rsi, 0x1e8(%rsi)
leaq 0x1f0(%rsi), %rax
movq %rsi, (%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: separate_args(ha_string&, std::__cxx11::list<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>> const&)
std::vector<const char *> separate_args(ha_string &s,
        const std::list<std::pair<unsigned,unsigned>> &arg_indices)
{
    std::vector<const char *> r;
    r.reserve(arg_indices.size() + 1);

    // First store nul terminator for each part:
    for (auto index_pair : arg_indices) {
        if (index_pair.second < s.length()) {
            s[index_pair.second] = 0;
        }
    }

    // Now we can get the C string (c_str) and store offsets into it:
    const char * cstr = s.c_str();
    for (auto index_pair : arg_indices) {
        r.push_back(cstr + index_pair.first);
    }
    r.push_back(nullptr);
    return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq 0x10(%rdx), %rsi
incq %rsi
callq 0x20efc
movq %r14, %rax
movq (%rax), %rax
cmpq %r14, %rax
je 0x1f7e6
movl 0x14(%rax), %ecx
cmpq %rcx, 0x8(%r15)
jbe 0x1f7cc
movq (%r15), %rdx
movb $0x0, (%rdx,%rcx)
jmp 0x1f7cc
movq (%r15), %r12
leaq 0x8(%rsp), %r15
movq %r14, %r13
movq (%r13), %r13
cmpq %r14, %r13
je 0x1f813
movl 0x10(%r13), %eax
addq %r12, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18f74
jmp 0x1f7f1
leaq 0x8(%rsp), %rsi
andq $0x0, (%rsi)
movq %rbx, %rdi
callq 0x18f74
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1f839
jmp 0x1f839
movq %rax, %r14
movq %rbx, %rdi
callq 0xcefc
movq %r14, %rdi
callq 0x8a90
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: process_service::exec_succeeded()
void process_service::exec_succeeded() noexcept
{
    tracking_child = true;

    // This could be a smooth recovery (state already STARTED). No need to do anything here in
    // that case. Otherwise, we are STARTING or STOPPING:

    if (get_state() == service_state_t::STARTING) {
        if (force_notification_fd != -1 || !notification_var.empty()) {
            // Wait for readiness notification:
            readiness_watcher.set_enabled(event_loop, true);
        }
        else {
            if (waiting_stopstart_timer) {
                process_timer.stop_timer(event_loop);
                waiting_stopstart_timer = false;
            }
            started();
        }
    }
    else if (get_state() == service_state_t::STARTED) {
        // Smooth recovery (is now complete, if we don't need readiness notification)
        if (waiting_stopstart_timer && notification_fd == -1) {
            process_timer.stop_timer(event_loop);
            waiting_stopstart_timer = false;
        }
    }
    else if (get_state() == service_state_t::STOPPING) {
        // stopping, but smooth recovery was in process. That's now over so we can
        // commence normal stop. Note that if pid == -1 the process already stopped,
        // that is correctly handled by bring_down().
        if (stop_check_dependents()) {
            bring_down();
        }
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb 0x4f4(%rdi), %al
movl %eax, %ecx
orb $0x8, %cl
movb %cl, 0x4f4(%rdi)
movzbl 0x2c(%rdi), %ecx
cmpl $0x3, %ecx
je 0x1f8d7
cmpl $0x2, %ecx
je 0x1f8ae
cmpl $0x1, %ecx
jne 0x1f8ed
cmpl $-0x1, 0x4b0(%rbx)
jne 0x1f8ef
cmpq $0x0, 0x4c0(%rbx)
jne 0x1f8ef
testb $0x2, %al
je 0x1f8a5
leaq 0x3b0(%rbx), %rdi
leaq 0x26197(%rip), %rsi     # 0x45a30
callq 0x20f92
andb $-0x3, 0x4f4(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x1f01a
testb $0x2, %al
je 0x1f8ed
cmpl $-0x1, 0x4e8(%rbx)
jne 0x1f8ed
leaq 0x3b0(%rbx), %rdi
leaq 0x26167(%rip), %rsi     # 0x45a30
callq 0x20f92
andb $-0x3, 0x4f4(%rbx)
jmp 0x1f8ed
movq %rbx, %rdi
callq 0x1ef8a
testb %al, %al
je 0x1f8ed
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0x8(%rax)
popq %rbx
retq
addq $0x510, %rbx            # imm = 0x510
leaq 0x26133(%rip), %rsi     # 0x45a30
pushq $0x1
popq %rdx
movq %rbx, %rdi
popq %rbx
jmp 0xcf5c
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: exec_status_pipe_watcher::fd_event(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int, int)
rearm exec_status_pipe_watcher::fd_event(eventloop_t &loop, int fd, int flags) noexcept
{
    base_process_service *sr = service;
    sr->waiting_for_execstat = false;

    run_proc_err exec_status;
    int r = read(get_watched_fd(), &exec_status, sizeof(exec_status));
    deregister(loop);
    close(get_watched_fd());

    if (r > 0) {
        // We read an errno code; exec() failed, and the service startup failed.
        if (sr->pid != -1) {
            sr->child_listener.deregister(event_loop, sr->pid);
            sr->reserved_child_watch = false;
            if (sr->waiting_stopstart_timer) {
                sr->process_timer.stop_timer(loop);
                sr->waiting_stopstart_timer = false;
            }
        }
        sr->pid = -1;
        sr->exec_err_info = exec_status;
        sr->exec_failed(exec_status);
    }
    else {
        sr->exec_succeeded();

        if (sr->pid == -1) {
            // Somehow the process managed to complete before we even saw the exec() status.
            sr->handle_exit_status();
        }
    }

    sr->services->process_queues();

    return rearm::REMOVED;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq 0x28(%rdi), %rbx
andl $0xffffff7f, 0x10c(%rbx) # imm = 0xFFFFFF7F
movl 0x1c(%rdi), %edi
movq %rsp, %rsi
pushq $0x8
popq %rdx
callq 0x88e0
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0xd002
movl 0x1c(%r15), %edi
callq 0x8b50
testl %r12d, %r12d
jle 0x1f9ba
movl 0x4d8(%rbx), %edx
cmpl $-0x1, %edx
je 0x1f99d
leaq 0x338(%rbx), %rsi
leaq 0x260c3(%rip), %rdi     # 0x45a30
callq 0x21744
movb 0x4f4(%rbx), %al
movl %eax, %ecx
andb $-0x5, %cl
movb %cl, 0x4f4(%rbx)
testb $0x2, %al
je 0x1f99d
leaq 0x3b0(%rbx), %rdi
movq %r14, %rsi
callq 0x20f92
andb $-0x3, 0x4f4(%rbx)
orl $-0x1, 0x4d8(%rbx)
movq (%rsp), %rsi
movq %rsi, 0x4f8(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x70(%rax)
jmp 0x1f9d5
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
cmpl $-0x1, 0x4d8(%rbx)
jne 0x1f9d5
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
movq 0x148(%rbx), %rdi
callq 0xcdd2
pushq $0x4
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0xaebb
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: stop_status_pipe_watcher::fd_event(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int, int)
rearm stop_status_pipe_watcher::fd_event(eventloop_t &loop, int fd, int flags) noexcept
{
    process_service *sr = service;
    sr->waiting_for_execstat = false;

    run_proc_err exec_status;
    int r = read(get_watched_fd(), &exec_status, sizeof(exec_status));
    deregister(loop);
    close(get_watched_fd());

    if (r > 0) {
        // We read an errno code; exec() failed, and the service startup failed.
        if (sr->stop_pid != -1) {
            log(loglevel_t::ERROR, "Service ", sr->get_name(), ": could not fork for stop command: ",
                    exec_stage_descriptions[static_cast<int>(exec_status.stage)], ": ",
                    strerror(exec_status.st_errno));

            sr->stop_watcher.deregister(event_loop, sr->stop_pid);
            sr->reserved_child_watch = false;
            sr->stop_pid = -1;
            if (sr->pid != -1) {
                if (sr->term_signal != 0) {
                    sr->kill_pg(sr->term_signal);
                }
                if (!sr->tracking_child) {
                    sr->stop_issued = false;
                    sr->stopped();
                }
            }
        }
    }
    else {
        // Nothing to do really but wait for termination - unless it's already happened, so let's
        // check that now:
        if (sr->stop_pid == -1) {
            sr->handle_stop_exit();
        }
    }

    sr->services->process_queues();

    return rearm::REMOVED;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r15
movq 0x28(%rdi), %rbx
andl $0xffffff7f, 0x10c(%rbx) # imm = 0xFFFFFF7F
movl 0x1c(%rdi), %edi
leaq 0x8(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x88e0
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0xd002
movl 0x1c(%r15), %edi
callq 0x8b50
movl 0x504(%rbx), %eax
testl %r14d, %r14d
jle 0x1fb0e
cmpl $-0x1, %eax
je 0x1fb1b
leaq 0x8(%rbx), %r14
movslq 0x8(%rsp), %rax
leaq 0x24c4a(%rip), %rcx     # 0x446b0
leaq (%rcx,%rax,8), %r15
movl 0xc(%rsp), %edi
callq 0x81c0
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
leaq 0xffb4(%rip), %rsi      # 0x2fa37
pushq $0x3
popq %rdi
callq 0x28e0a
movq %r14, %rdi
callq 0x20e5b
leaq 0xffa6(%rip), %rdi      # 0x2fa40
callq 0x28f17
movq %r15, %rdi
movq %r12, %rsi
callq 0x20eb0
leaq 0x540(%rbx), %rsi
movl 0x504(%rbx), %edx
leaq 0x25f72(%rip), %rdi     # 0x45a30
callq 0x21744
movb 0x4f4(%rbx), %al
andb $-0x5, %al
movb %al, 0x4f4(%rbx)
orl $-0x1, 0x504(%rbx)
cmpl $-0x1, 0x4d8(%rbx)
je 0x1fb1b
movl 0x194(%rbx), %esi
testl %esi, %esi
je 0x1faf9
movq %rbx, %rdi
callq 0x22e4c
movb 0x4f4(%rbx), %al
testb $0x8, %al
jne 0x1fb1b
andb $-0x3, 0x500(%rbx)
movq %rbx, %rdi
callq 0x1e30a
jmp 0x1fb1b
cmpl $-0x1, %eax
jne 0x1fb1b
movq %rbx, %rdi
callq 0x20fa4
movq 0x148(%rbx), %rdi
callq 0xcdd2
pushq $0x4
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0xaebb
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: ready_notify_watcher::fd_event(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int, int)
rearm ready_notify_watcher::fd_event(eventloop_t &, int fd, int flags) noexcept
{
    char buf[128];
    if (service->get_state() == service_state_t::STARTING) {
        // can we actually read anything from the notification pipe?
        int r = bp_sys::read(fd, buf, sizeof(buf));
        if (r > 0) {
            if (service->waiting_stopstart_timer) {
                service->process_timer.stop_timer(event_loop);
                service->waiting_stopstart_timer = false;
            }
            service->started();
        }
        else if (r == 0 || errno != EAGAIN) {
            if (service->waiting_stopstart_timer) {
                service->process_timer.stop_timer(event_loop);
                service->waiting_stopstart_timer = false;
            }
            service->set_state(service_state_t::STOPPING);
            service->failed_to_start(false, false);
            service->bring_down();
        }
        service->services->process_queues();
    }
    else {
        // Just keep consuming data from the pipe:
        int r = bp_sys::read(fd, buf, sizeof(buf));
        if (r == 0) {
            // Process closed write end or terminated
            close(fd);
            service->notification_fd = -1;
            return rearm::DISARM;
        }
    }

    return rearm::REARM;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpb $0x1, 0x2c(%rax)
jne 0x1fba2
movq %rsp, %rsi
movl $0x80, %edx
movl %ebp, %edi
callq 0x88e0
testl %eax, %eax
jle 0x1fbd1
movq 0x28(%rbx), %rdi
testb $0x2, 0x4f4(%rdi)
je 0x1fb98
addq $0x3b0, %rdi            # imm = 0x3B0
leaq 0x25eac(%rip), %rsi     # 0x45a30
callq 0x20f92
movq 0x28(%rbx), %rax
andb $-0x3, 0x4f4(%rax)
movq 0x28(%rbx), %rdi
callq 0x1f01a
jmp 0x1fc23
movq %rsp, %rsi
movl $0x80, %edx
movl %ebp, %edi
callq 0x88e0
movq %rax, %rcx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x1fc35
movl %ebp, %edi
callq 0x8b50
movq 0x28(%rbx), %rax
orl $-0x1, 0x4e8(%rax)
pushq $0x1
popq %rax
jmp 0x1fc35
je 0x1fbdd
callq 0x8040
cmpl $0xb, (%rax)
je 0x1fc23
movq 0x28(%rbx), %rdi
testb $0x2, 0x4f4(%rdi)
je 0x1fc0c
addq $0x3b0, %rdi            # imm = 0x3B0
leaq 0x25e38(%rip), %rsi     # 0x45a30
callq 0x20f92
movq 0x28(%rbx), %rax
andb $-0x3, 0x4f4(%rax)
movq 0x28(%rbx), %rdi
movb $0x3, 0x2c(%rdi)
xorl %esi, %esi
xorl %edx, %edx
callq 0x1ed2e
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rax
movq 0x148(%rax), %rdi
callq 0xcdd2
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rdi
callq 0xaebb
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: stop_child_watcher::status_change(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int, dasynq::dprivate::proc_status)
dasynq::rearm stop_child_watcher::status_change(eventloop_t &loop, pid_t child,
        stop_child_watcher::proc_status_t status) noexcept
{
    process_service *sr = service;

    sr->stop_pid = -1;
    sr->stop_status = status;
    stop_watch(loop);

    if (sr->waiting_for_execstat) {
        // no exec status yet, wait for that first
        return dasynq::rearm::NOOP;
    }

    sr->handle_stop_exit();
    sr->services->process_queues();
    return dasynq::rearm::NOOP;
}

// Assembly:
pushq %rbx
movq 0x40(%rdi), %rbx
orl $-0x1, 0x504(%rbx)
movq %rcx, 0x508(%rbx)
leaq 0x20(%rdi), %rax
leaq 0x28(%rsi), %rdi
movq %rax, %rsi
callq 0x217b4
testb $-0x80, 0x10c(%rbx)
jne 0x1fcea
movq %rbx, %rdi
callq 0x20fa4
movq 0x148(%rbx), %rdi
callq 0xcdd2
pushq $0x2
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: process_service::exec_failed(run_proc_err)
void process_service::exec_failed(run_proc_err errcode) noexcept
{
    log(loglevel_t::ERROR, get_name(), ": execution failed - ",
            exec_stage_descriptions[static_cast<int>(errcode.stage)], ": ", strerror(errcode.st_errno));

    if (waiting_stopstart_timer) {
        process_timer.stop_timer(event_loop);
        waiting_stopstart_timer = false;
    }

    if (notification_fd != -1) {
        readiness_watcher.deregister(event_loop);
        bp_sys::close(notification_fd);
        notification_fd = -1;
    }

    if (get_state() == service_state_t::STARTING) {
        stop_reason = stopped_reason_t::EXECFAILED;
        set_state(service_state_t::STOPPING);
        failed_to_start();
    }
    else {
        // Process service in smooth recovery:
        doing_smooth_recovery = false;
        stop_reason = stopped_reason_t::TERMINATED;
        unrecoverable_stop();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq %esi, %rax
movq %rsi, %rdi
shrq $0x20, %rdi
leaq 0x8(%rbx), %r14
leaq 0x24611(%rip), %rcx     # 0x446b0
leaq (%rcx,%rax,8), %r15
callq 0x81c0
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x20160
testb $0x2, 0x4f4(%rbx)
je 0x200de
leaq 0x3b0(%rbx), %rdi
leaq 0x2595e(%rip), %rsi     # 0x45a30
callq 0x20f92
andb $-0x3, 0x4f4(%rbx)
cmpl $-0x1, 0x4e8(%rbx)
je 0x2010c
leaq 0x510(%rbx), %rdi
leaq 0x2593b(%rip), %rsi     # 0x45a30
callq 0xd002
movl 0x4e8(%rbx), %edi
callq 0x8b50
orl $-0x1, 0x4e8(%rbx)
cmpb $0x1, 0x2c(%rbx)
jne 0x20136
movl $0x4, 0x1c4(%rbx)
movb $0x3, 0x2c(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1ed2e
movb $0x0, 0x5b8(%rbx)
movl $0x6, 0x1c4(%rbx)
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1f0c8
movq %rax, %rdi
callq 0xaebb
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: bgproc_service::exec_failed(run_proc_err)
void bgproc_service::exec_failed(run_proc_err errcode) noexcept
{
    log(loglevel_t::ERROR, get_name(), ": execution failed - ",
            exec_stage_descriptions[static_cast<int>(errcode.stage)], ": ", strerror(errcode.st_errno));

    if (waiting_stopstart_timer) {
        process_timer.stop_timer(event_loop);
        waiting_stopstart_timer = false;
    }

    if (doing_smooth_recovery) {
        doing_smooth_recovery = false;
        stop_reason = stopped_reason_t::TERMINATED;
        unrecoverable_stop();
    }
    else {
        // Only time we execute is for startup:
        stop_reason = stopped_reason_t::EXECFAILED;
        set_state(service_state_t::STOPPING);
        failed_to_start();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq %esi, %rax
movq %rsi, %rdi
shrq $0x20, %rdi
leaq 0x8(%rbx), %r14
leaq 0x24061(%rip), %rcx     # 0x446b0
leaq (%rcx,%rax,8), %r15
callq 0x81c0
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x20160
testb $0x2, 0x4f4(%rbx)
je 0x2068e
leaq 0x3b0(%rbx), %rdi
leaq 0x253ae(%rip), %rsi     # 0x45a30
callq 0x20f92
andb $-0x3, 0x4f4(%rbx)
cmpb $0x1, 0x5b8(%rbx)
jne 0x206b9
movb $0x0, 0x5b8(%rbx)
movl $0x6, 0x1c4(%rbx)
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1f0c8
movl $0x4, 0x1c4(%rbx)
movb $0x3, 0x2c(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1ed2e
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: scripted_service::exec_failed(run_proc_err)
void scripted_service::exec_failed(run_proc_err errcode) noexcept
{
    log(loglevel_t::ERROR, get_name(), ": execution failed - ",
            exec_stage_descriptions[static_cast<int>(errcode.stage)], ": ", strerror(errcode.st_errno));
    auto current_state = get_state();
    if (current_state == service_state_t::STARTING) {
        stop_reason = stopped_reason_t::EXECFAILED;
        failed_to_start();
    }
    else if (current_state == service_state_t::STOPPING) {
        // We've logged the failure, but it's probably better not to leave the service in
        // STOPPING state:
        stopped();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq %esi, %rax
movq %rsi, %rdi
shrq $0x20, %rdi
leaq 0x8(%rbx), %r14
leaq 0x23d4f(%rip), %rcx     # 0x446b0
leaq (%rcx,%rax,8), %r15
callq 0x81c0
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x20160
movzbl 0x2c(%rbx), %eax
cmpl $0x3, %eax
je 0x209ab
cmpl $0x1, %eax
jne 0x209bc
movl $0x4, 0x1c4(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1ed2e
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1e30a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: process_service::kill_with_fire()
void process_service::kill_with_fire() noexcept
{
    base_process_service::kill_with_fire();

    if (stop_pid != -1) {
        log(loglevel_t::WARN, "Service ", get_name(), " stop command, with pid ", pid,
                ", exceeded allowed stop time; killing.");
        pid_t pgid = bp_sys::getpgid(stop_pid);
        if (pgid == -1) {
            // On OpenBSD, not allowed to query pgid of a process in another session, but in that
            // case we know the group anyway:
            pgid = stop_pid;
        }
        bp_sys::kill(-pgid, SIGKILL);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x22e84
cmpl $-0x1, 0x504(%rbx)
je 0x20dc4
leaq 0x8(%rbx), %r14
leaq 0xeccf(%rip), %rsi      # 0x2fa37
pushq $0x2
popq %rdi
callq 0x28e0a
movq %r14, %rdi
callq 0x20e5b
leaq 0xee41(%rip), %rdi      # 0x2fbc0
callq 0x28f17
movl 0x4d8(%rbx), %edi
callq 0x20ece
leaq 0xee43(%rip), %rdi      # 0x2fbd9
callq 0x28f31
movl 0x504(%rbx), %edi
callq 0x8ad0
cmpl $-0x1, %eax
jne 0x20db1
movl 0x504(%rbx), %eax
negl %eax
pushq $0x9
popq %rsi
movl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x88c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/proc-service.cc
// Function: scripted_service::bring_down()
void scripted_service::bring_down() noexcept
{
    if (pid != -1) {
        // We're already running the stop script; nothing to do.
        return;
    }

    if (stop_command.length() == 0) {
        stopped();
    }
    else if (! start_ps_process(stop_arg_parts, false)) {
        // Couldn't execute stop script, but there's not much we can do:
        stopped();
    }
    else {
        // successfully started stop script: start kill timer:
        if (stop_timeout != time_val(0,0)) {
            process_timer.arm_timer_rel(event_loop, stop_timeout);
            waiting_stopstart_timer = true;
        }
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpl $-0x1, 0x4d8(%rdi)
je 0x20de0
addq $0x10, %rsp
popq %rbx
retq
movq %rdi, %rbx
cmpq $0x0, 0x238(%rdi)
je 0x20e3e
leaq 0x240(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x22070
testb %al, %al
je 0x20e3e
movq 0x488(%rbx), %rax
movq 0x490(%rbx), %rcx
movq %rax, %rdx
orq %rcx, %rdx
je 0x20dda
leaq 0x3b0(%rbx), %rdi
movq %rsp, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq 0x24c00(%rip), %rsi     # 0x45a30
callq 0xd186
orb $0x2, 0x4f4(%rbx)
jmp 0x20dda
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x1e30a
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/proc-service.h
// Function: process_service::handle_stop_exit()
void handle_stop_exit() noexcept
    {
        if (!stop_status.did_exit_clean()) {
            if (stop_status.did_exit()) {
                log(loglevel_t::ERROR, "Service ", get_name(), " stop command terminated with exit code ",
                        stop_status.get_exit_status());
            }
            else if (stop_status.was_signalled()) {
                log(loglevel_t::ERROR, "Service ", get_name(), " stop command terminated due to signal ",
                        stop_status.get_signal());
            }
        }

        if (pid == -1 || !tracking_child) {
            // If service process has already finished, we were just waiting for the stop command
            // process:
            stop_issued = false; // reset for next time
            stopped();
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x50c(%rdi), %eax
testl %eax, %eax
je 0x2100e
leaq 0x8(%rbx), %r14
cmpl $0x1, 0x508(%rbx)
jne 0x20ffc
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
leaq 0xea61(%rip), %rsi      # 0x2fa37
pushq $0x3
popq %rdi
callq 0x28e0a
movq %r14, %rdi
callq 0x20e5b
leaq 0xeda2(%rip), %rdi      # 0x2fd8f
callq 0x28f17
movq %r15, %rdi
callq 0x20e63
jmp 0x2100e
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
pushq $0x3
popq %rdi
movq %r14, %rsi
callq 0x2090b
cmpl $-0x1, 0x4d8(%rbx)
je 0x21020
testb $0x8, 0x4f4(%rbx)
jne 0x21038
andb $-0x3, 0x500(%rbx)
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1e30a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-utmp.h
// Function: clear_utmp_entry(char const*, char const*)
inline void clear_utmp_entry(const char *utmp_id, const char *utmp_line)
{
    struct utmpx record;
    memset(&record, 0, sizeof(record));

    record.ut_type = DEAD_PROCESS;
    set_current_time(&record);
    strncpy(record.ut_id, utmp_id, sizeof(record.ut_id));
    strncpy(record.ut_line, utmp_line, sizeof(record.ut_line));

    struct utmpx *result;

    setutxent();

    // Try to find an existing entry by id/line and copy the process ID:
    if (*utmp_id) {
        result = getutxid(&record);
    }
    else {
        result = getutxline(&record);
    }

    if (result) {
        record.ut_pid = result->ut_pid;
    }

    pututxline(&record);
    endutxent();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movl $0x180, %edx            # imm = 0x180
movq %r15, %rdi
xorl %esi, %esi
callq 0x8350
movw $0x8, (%r15)
movq %r15, %rdi
callq 0xcfd5
leaq 0x28(%rsp), %rdi
pushq $0x4
popq %rdx
movq %rbx, %rsi
callq 0x8310
leaq 0x8(%rsp), %rdi
pushq $0x20
popq %rdx
movq %r14, %rsi
callq 0x8310
callq 0x8270
cmpb $0x0, (%rbx)
je 0x210a8
movq %rsp, %rdi
callq 0x89a0
jmp 0x210b0
movq %rsp, %rdi
callq 0x8ab0
testq %rax, %rax
je 0x210bc
movl 0x4(%rax), %eax
movl %eax, 0x4(%rsp)
movq %rsp, %rdi
callq 0x80a0
callq 0x80f0
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-util.h
// Function: complete_read(int, void*, unsigned long)
inline ssize_t complete_read(int fd, void * buf, size_t n)
{
    char * cbuf = static_cast<char *>(buf);
    ssize_t r = 0;
    while ((size_t)r < n) {
        ssize_t res = bp_sys::read(fd, cbuf + r, n - r);
        if (res == 0) {
            return r;
        }
        if (res < 0) {
            if (errno == EINTR) {
                continue;
            }

            // If any other error, and we have successfully read some, return it:
            if (r == 0) {
                return -1;
            }
            else {
                return r;
            }
        }
        r += res;
    }
    return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r13d, %r13d
leaq (%r14,%r13), %r15
movq %rbx, %r12
subq %r13, %r12
cmpq %r13, %rbx
jbe 0x21131
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x88e0
testq %rax, %rax
je 0x21120
jns 0x2111b
callq 0x8040
cmpl $0x4, (%rax)
je 0x210f6
jmp 0x21125
addq %rax, %r13
jmp 0x210ec
movq %r13, %rbx
jmp 0x21131
xorl %ebx, %ebx
cmpq $0x1, %r13
sbbq %rbx, %rbx
orq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/../dasynq/include/dasynq.h
// Function: dasynq::v2::dprivate::child_proc_watcher<dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>>::add_reserved(dasynq::v2::event_loop<dasynq::null_mutex, dasynq::v2::default_traits<dasynq::null_mutex>>&, int, int)
void add_reserved(event_loop_t &eloop, pid_t child, int prio = DEFAULT_PRIORITY) noexcept
    {
        base_watcher::init();
        this->watch_pid = child;
        this->priority = prio;
        eloop.register_reserved_child(this, child);
    }

// Assembly:
movq %rdi, %rax
andb $-0x20, 0xc(%rdi)
movl %edx, 0x30(%rdi)
movl %ecx, 0x18(%rdi)
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x217c0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/proc-service.h
// Function: process_service::check_restart()
virtual bool check_restart() noexcept override
    {
        if (max_restart_interval_count != 0) {
            // Check whether we're still in the most recent restart check interval:
            time_val current_time;
            event_loop.get_time(current_time, clock_type::MONOTONIC);
            time_val int_diff = current_time - restart_interval_time;
            if (int_diff < restart_interval) {
                // Within the restart limiting interval; check number of restarts
                if (restart_interval_count >= max_restart_interval_count) {
                    log(loglevel_t::ERROR, "Service ", get_name(), " restarting too quickly; stopping.");
                    set_target_state(service_state_t::STOPPED);
                    return false;
                }
                ++restart_interval_count;
            }
            else {
                // Not within the last limiting interval; start a new interval
                restart_interval_time = current_time;
                restart_interval_count = 1;
            }
        }

        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movb $0x1, %bpl
cmpl $0x0, 0x470(%rdi)
je 0x212c7
movq %rdi, %rbx
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x8560
leaq 0x448(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xe931
cmpq 0x460(%rbx), %rax
jl 0x2126d
jne 0x212b4
cmpq 0x468(%rbx), %rdx
jge 0x212b4
movl 0x458(%rbx), %eax
cmpl 0x470(%rbx), %eax
jge 0x21285
incl %eax
movl %eax, 0x458(%rbx)
jmp 0x212c7
leaq 0x8(%rbx), %r14
leaq 0xe7a7(%rip), %rsi      # 0x2fa37
pushq $0x3
popq %rdi
callq 0x28e0a
movq %r14, %rdi
callq 0x20e5b
leaq 0xeb11(%rip), %rdi      # 0x2fdb8
callq 0x28f31
movb $0x0, 0x2d(%rbx)
xorl %ebp, %ebp
jmp 0x212c7
movups 0x8(%rsp), %xmm0
movups %xmm0, (%r14)
movl $0x1, 0x458(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/proc-service.h
// Function: process_service::~process_service()
~process_service() noexcept
    {
        if (reserved_stop_watch) {
            stop_watcher.unreserve(event_loop);
        }
        if (consumer_for != nullptr) {
            consumer_for->set_log_consumer(nullptr);
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x23479(%rip), %rax     # 0x44758
movq %rax, (%rdi)
testb $0x1, 0x500(%rdi)
je 0x212fe
leaq 0x540(%rbx), %rsi
leaq 0x24737(%rip), %rdi     # 0x45a30
callq 0x215ce
movq 0x5c0(%rbx), %rax
testq %rax, %rax
je 0x21312
andq $0x0, 0x188(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x214d2
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/proc-service.h
// Function: base_process_service::transfer_output_pipe()
std::pair<int,int> transfer_output_pipe() noexcept override
    {
        std::pair<int,int> r { log_input_fd, log_output_fd };
        if (log_type == log_type_id::BUFFER && log_output_fd != -1) {
            log_output_listener.deregister(event_loop);
        }
        log_input_fd = log_output_fd = -1;
        return r;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x4f0(%rdi), %r15d
movl 0x4ec(%rdi), %eax
movl %eax, %ebx
cmpl $0x2, 0x298(%rdi)
setne %cl
cmpl $-0x1, %eax
sete %al
orb %cl, %al
jne 0x213fa
leaq 0x408(%r14), %rdi
leaq 0x2463b(%rip), %rsi     # 0x45a30
callq 0xd002
orq $-0x1, 0x4ec(%r14)
shlq $0x20, %rbx
orq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/proc-service.h
// Function: base_process_service::~base_process_service()
~base_process_service() noexcept
    {
        if (reserved_child_watch) {
            child_listener.unreserve(event_loop);
        }
        process_timer.deregister(event_loop);
        set_log_mode(log_type_id::NONE);
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x234ab(%rip), %rax     # 0x44988
addq $0x10, %rax
movq %rax, (%rdi)
testb $0x4, 0x4f4(%rdi)
je 0x21500
leaq 0x338(%rbx), %rsi
leaq 0x24535(%rip), %rdi     # 0x45a30
callq 0x215ce
leaq 0x3b0(%rbx), %rdi
leaq 0x24522(%rip), %rsi     # 0x45a30
callq 0x215fc
movq %rbx, %rdi
xorl %esi, %esi
callq 0x171ec
leaq 0x4b8(%rbx), %rdi
callq 0x8b98
leaq 0x318(%rbx), %rdi
callq 0x8b98
leaq 0x300(%rbx), %rdi
callq 0x1b352
leaq 0x2d8(%rbx), %rdi
callq 0xd5d0
leaq 0x2a0(%rbx), %rdi
callq 0x8b98
leaq 0x278(%rbx), %rdi
callq 0x8b98
leaq 0x258(%rbx), %rdi
callq 0x8b98
leaq 0x240(%rbx), %rdi
callq 0xcefc
leaq 0x230(%rbx), %rdi
callq 0x17d3e
leaq 0x218(%rbx), %rdi
callq 0xcefc
leaq 0x208(%rbx), %rdi
callq 0x17d3e
movq %rbx, %rdi
popq %rbx
jmp 0x1a176
// 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>>::deregister(dasynq::v2::dprivate::base_timer_watcher*, dasynq::clock_type)
void deregister(base_timer_watcher *callback, clock_type clock) noexcept
    {
        loop_mech.remove_timer(callback->timer_handle, clock);
        
        waitqueue_node<T_Mutex> qnode;
        get_attn_lock(qnode);
        
        loop_mech.issue_delete(callback);
        
        release_lock(qnode);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x20, %rsi
callq 0xc5e8
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd07e
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0ec
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/includes/dinit-utmp.h
// Function: create_utmp_entry(char const*, char const*, int)
inline bool create_utmp_entry(const char *utmp_id, const char *utmp_line, pid_t pid)
{
    struct utmpx record;
    memset(&record, 0, sizeof(record));

    record.ut_type = INIT_PROCESS;
    record.ut_pid = pid;
    set_current_time(&record);
    strncpy(record.ut_id, utmp_id, sizeof(record.ut_id));
    strncpy(record.ut_line, utmp_line, sizeof(record.ut_line));

    setutxent();
    bool success = (pututxline(&record) != NULL);
    endutxent();

    return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rbx
movl $0x180, %edx            # imm = 0x180
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8350
movw $0x5, (%rbx)
movl %ebp, 0x4(%rbx)
movq %rbx, %rdi
callq 0xcfd5
leaq 0x30(%rsp), %rdi
pushq $0x4
popq %rdx
movq %r15, %rsi
callq 0x8310
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rdx
movq %r14, %rsi
callq 0x8310
callq 0x8270
movq %rbx, %rdi
callq 0x80a0
testq %rax, %rax
setne %bl
callq 0x80f0
movl %ebx, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/../dasynq/include/dasynq/timerfd.h
// Function: dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>::stop_timer_nolock(dasynq::dary_heap<dasynq::timer_data, dasynq::time_val, dasynq::compare_timespec, 4>::handle_t&, dasynq::clock_type)
void stop_timer_nolock(timer_handle_t &timer_id, clock_type clock = clock_type::MONOTONIC) noexcept
    {
        timer_queue_t &queue = this->queue_for_clock(clock);
        int fd = (clock == clock_type::MONOTONIC) ? timerfd_fd : systemtime_fd;
        if (queue.is_queued(timer_id)) {
            bool was_first = (&queue.get_root()) == &timer_id;
            queue.remove(timer_id);
            if (was_first) {
                set_timer_from_queue(fd, queue);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %eax, %eax
xorl %esi, %esi
cmpl $0x1, %edx
setne %cl
sete %dl
cmpq $-0x1, 0x20(%rbx)
je 0x21724
movb %dl, %sil
shll $0x5, %esi
leaq (%rdi,%rsi), %r14
addq $0x58, %r14
movb %cl, %al
movl 0x98(%rdi,%rax,4), %ebp
movq (%r14), %rax
movq 0x10(%rax), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc632
cmpq %rbx, %r15
je 0x2172f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd396
nop
// 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>>::deregister(dasynq::v2::dprivate::base_child_watcher<dasynq::v2::dprivate::proc_status>*, int)
void deregister(base_child_watcher *callback, pid_t child) noexcept
    {
        loop_mech.remove_child_watch(callback->watch_handle);

        waitqueue_node<T_Mutex> qnode;
        get_attn_lock(qnode);
        
        loop_mech.issue_delete(callback);
        
        release_lock(qnode);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x20, %rsi
callq 0x2178c
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd07e
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0ec
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::restart_ps_process()
bool base_process_service::restart_ps_process() noexcept
{
    using time_val = dasynq::time_val;

    time_val current_time;
    event_loop.get_time(current_time, clock_type::MONOTONIC);

    // Check if enough time has lapsed since the previous restart. If not, start a timer:
    time_val tdiff = current_time - last_start_time;
    if (restart_delay <= tdiff) {
        // > restart delay (normally 200ms)
        do_restart();
    }
    else {
        time_val timeout = restart_delay - tdiff;
        process_timer.arm_timer_rel(event_loop, timeout);
        waiting_restart_timer = true;
    }
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x8560
leaq 0x438(%rbx), %rsi
movq %r14, %rdi
callq 0xe931
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
leaq 0x478(%rbx), %rdi
cmpq %rax, 0x478(%rbx)
jl 0x21ce0
jne 0x21cea
cmpq %rdx, 0x480(%rbx)
jg 0x21cea
movq %rbx, %rdi
callq 0x22ca0
jmp 0x21d1d
leaq 0x8(%rsp), %rsi
callq 0xe931
leaq 0x3b0(%rbx), %rdi
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq 0x23d22(%rip), %rsi     # 0x45a30
movq %rcx, %rdx
callq 0xd186
orb $0x1, 0x4f4(%rbx)
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::bring_up()
bool base_process_service::bring_up() noexcept
{
    if (!open_socket()) {
        return false;
    }

    bool start_success;
    if (in_auto_restart) {
        start_success = restart_ps_process();
    }
    else {
        restart_interval_count = 0;
        start_success = start_ps_process(exec_arg_parts,
                onstart_flags.starts_on_console || onstart_flags.shares_console);
        // start_ps_process updates last_start_time, use it also for restart_interval_time:
        restart_interval_time = last_start_time;

        // Arm start timer. (For restarts, this is only done once the restart interval expires).
        if (start_success) {
            if (start_timeout != time_val(0,0)) {
                process_timer.arm_timer_rel(event_loop, start_timeout);
                waiting_stopstart_timer = true;
            }
            else if (waiting_stopstart_timer) {
                process_timer.stop_timer(event_loop);
                waiting_stopstart_timer = false;
            }
        }
    }

    return start_success;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x21df4
testb %al, %al
je 0x21db4
testb $0x2, 0x10e(%rbx)
jne 0x21db8
andl $0x0, 0x458(%rbx)
leaq 0x218(%rbx), %rsi
movzwl 0x2e(%rbx), %eax
xorl %edx, %edx
testb $0x18, %al
setne %dl
movq %rbx, %rdi
callq 0x22070
movups 0x438(%rbx), %xmm0
movups %xmm0, 0x448(%rbx)
testb %al, %al
je 0x21db4
movq 0x498(%rbx), %rax
movq 0x4a0(%rbx), %rcx
movq %rax, %rdx
orq %rcx, %rdx
je 0x21dcc
leaq 0x3b0(%rbx), %rdi
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq 0x23c8a(%rip), %rsi     # 0x45a30
callq 0xd186
orb $0x2, 0x4f4(%rbx)
jmp 0x21dc0
xorl %ebp, %ebp
jmp 0x21dc3
movq %rbx, %rdi
callq 0x21c92
movb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movb $0x1, %bpl
testb $0x2, 0x4f4(%rbx)
je 0x21dc3
leaq 0x3b0(%rbx), %rdi
leaq 0x23c4a(%rip), %rsi     # 0x45a30
callq 0x20f92
andb $-0x3, 0x4f4(%rbx)
jmp 0x21dc3
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::do_restart()
void base_process_service::do_restart() noexcept
{
    // Actually perform process restart. We may be in smooth recovery (state = STARTED) or this may
    // be a regular restart.

    waiting_restart_timer = false;
    auto service_state = get_state();

    if (!start_ps_process(exec_arg_parts, have_console || onstart_flags.shares_console)) {
        if (service_state == service_state_t::STARTING) {
            failed_to_start();
        }
        else {
            // smooth recovery failure
            unrecoverable_stop();
        }
        services->process_queues();
    }
    else {
        // started process successfully (at least as far as fork)
        if (start_timeout != time_val(0,0)) {
            process_timer.arm_timer_rel(event_loop, start_timeout);
            waiting_stopstart_timer = true;
        }
    }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
andb $-0x2, 0x4f4(%rdi)
movb 0x2c(%rdi), %bpl
leaq 0x218(%rdi), %rsi
movl 0x10c(%rdi), %eax
andl $0x40, %eax
shrl $0x6, %eax
movzwl 0x2e(%rdi), %edx
andl $0x10, %edx
shrl $0x4, %edx
orl %eax, %edx
callq 0x22070
testb %al, %al
je 0x22d1f
movq 0x498(%rbx), %rax
movq 0x4a0(%rbx), %rcx
movq %rax, %rdx
orq %rcx, %rdx
je 0x22d18
leaq 0x3b0(%rbx), %rdi
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq 0x22d24(%rip), %rsi     # 0x45a30
callq 0xd186
orb $0x2, 0x4f4(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
cmpb $0x1, %bpl
jne 0x22d34
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ed2e
jmp 0x22d3c
movq %rbx, %rdi
callq 0x1f0c8
movq 0x148(%rbx), %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0xcdd2
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::interrupt_start()
bool base_process_service::interrupt_start() noexcept
{
    if (waiting_restart_timer) {
        process_timer.stop_timer(event_loop);
        waiting_restart_timer = false;
        return service_record::interrupt_start();
    }
    else {
        log(loglevel_t::WARN, "Interrupting start of service ", get_name(), " with pid ", pid,
                " (with SIGINT).");
        kill_pg(SIGINT);

        if (stop_timeout != time_val(0,0)) {
            process_timer.arm_timer_rel(event_loop, stop_timeout);
            waiting_stopstart_timer = true;
        }
        else if (waiting_stopstart_timer) {
            process_timer.stop_timer(event_loop);
            waiting_stopstart_timer = false;
        }

        set_state(service_state_t::STOPPING);
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testb $0x1, 0x4f4(%rdi)
je 0x22d8c
leaq 0x3b0(%rbx), %rdi
leaq 0x22cc0(%rip), %rsi     # 0x45a30
callq 0x20f92
andb $-0x2, 0x4f4(%rbx)
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1f564
leaq 0x8(%rbx), %r14
leaq 0xd1db(%rip), %rsi      # 0x2ff72
pushq $0x2
popq %rbp
movl %ebp, %edi
callq 0x28e0a
movq %r14, %rdi
callq 0x23011
leaq 0xce1e(%rip), %rdi      # 0x2fbce
callq 0x28f17
movl 0x4d8(%rbx), %edi
callq 0x23019
leaq 0xd1ca(%rip), %rdi      # 0x2ff91
callq 0x28f31
movq %rbx, %rdi
movl %ebp, %esi
callq 0x22e4c
movq 0x488(%rbx), %rax
movq 0x490(%rbx), %rcx
movq %rax, %rdx
orq %rcx, %rdx
je 0x22e13
leaq 0x3b0(%rbx), %rdi
movq %rsp, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq 0x22c2c(%rip), %rsi     # 0x45a30
callq 0xd186
movb 0x4f4(%rbx), %al
orb $0x2, %al
jmp 0x22e37
testb $0x2, 0x4f4(%rbx)
je 0x22e3d
leaq 0x3b0(%rbx), %rdi
leaq 0x22c06(%rip), %rsi     # 0x45a30
callq 0x20f92
movb 0x4f4(%rbx), %al
andb $-0x3, %al
movb %al, 0x4f4(%rbx)
movb $0x3, 0x2c(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::kill_pg(int)
void base_process_service::kill_pg(int signo) noexcept
{
    if (onstart_flags.signal_process_only) {
        bp_sys::kill(pid, signo);
    }
    else {
        pid_t pgid = bp_sys::getpgid(pid);
        if (pgid == -1) {
            // On some OSes (eg OpenBSD) we aren't allowed to get the pgid of a process in a different
            // session. If the process is in a different session, however, it must be a process group
            // leader and the pgid must equal the process id.
            pgid = pid;
        }
        bp_sys::kill(-pgid, signo);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testb $0x2, 0x2f(%rdi)
movl 0x4d8(%rdi), %edi
jne 0x22e76
callq 0x8ad0
movl %eax, %edi
cmpl $-0x1, %eax
jne 0x22e74
movl 0x4d8(%r14), %edi
negl %edi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x88c0