// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/service.cc
// Function: service_record::do_propagation()
void service_record::do_propagation() noexcept
{
    if (prop_require) {
        // Need to require all our dependencies
        for (auto & dep : depends_on) {
            if (!dep.is_only_ordering()) {
                dep.get_to()->require();
                dep.holding_acq = true;
            }
        }
        prop_require = false;
    }

    if (prop_release) {
        release_dependencies();
        prop_release = false;
    }

    if (prop_failure) {
        prop_failure = false;
        stop_reason = stopped_reason_t::DEPFAILED;
        service_state = service_state_t::STOPPED;
        failed_to_start(true);
    }

    if (prop_start) {
        prop_start = false;
        do_start();
    }

    if (prop_stop) {
        prop_stop = false;
        do_stop(in_user_restart);
    }

    if (prop_pin_dpt) {
        bool dept_pin = false;
        for (auto *dept : dependents) {
            if (dept->is_hard() && dept->get_from()->is_start_pinned()) {
                dept_pin = true;
                break;
            }
        }
        if (dept_pin != dept_pinned_started) {
            dept_pinned_started = dept_pin;
            for (auto &dep : depends_on) {
                if (dep.is_hard() && dep.get_to()->dept_pinned_started != dept_pin) {
                    dep.get_to()->prop_pin_dpt = true;
                    services->add_prop_queue(dep.get_to());
                }
            }

            if (!dept_pinned_started && !pinned_started) {
                // No longer pinned at all
                if ((desired_state == service_state_t::STOPPED || force_stop)
                        && service_state == service_state_t::STARTED) {
                    do_stop();
                }
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testb $0x2, 0x10d(%rdi)
je 0x22e54
leaq 0x118(%rbx), %r14
movq 0x118(%rbx), %r15
cmpq %r14, %r15
je 0x22e4d
movl 0x24(%r15), %eax
andl $-0x2, %eax
cmpl $0x4, %eax
je 0x22e48
movq 0x18(%r15), %rdi
callq 0x22962
movb $0x1, 0x21(%r15)
movq (%r15), %r15
jmp 0x22e29
andb $-0x3, 0x10d(%rbx)
testb $0x4, 0x10d(%rbx)
je 0x22e6c
movq %rbx, %rdi
callq 0x22c14
andb $-0x5, 0x10d(%rbx)
movl 0x10c(%rbx), %eax
btl $0xb, %eax
jae 0x22ea3
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %eax, 0x10c(%rbx)
movl $0x2, 0x1c4(%rbx)
movb $0x0, 0x2c(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x23018
movl 0x10c(%rbx), %eax
btl $0xc, %eax
jae 0x22ec2
andl $0xffffefff, %eax       # imm = 0xFFFFEFFF
movl %eax, 0x10c(%rbx)
movq %rbx, %rdi
callq 0x22c56
movl 0x10c(%rbx), %esi
btl $0xd, %esi
jae 0x22ee9
movl %esi, %eax
andl $0xffffdfff, %eax       # imm = 0xFFFFDFFF
movl %eax, 0x10c(%rbx)
shrl $0x12, %esi
andl $0x1, %esi
movq %rbx, %rdi
callq 0x229b4
movl 0x10c(%rbx), %eax
btl $0xe, %eax
jae 0x22fed
leaq 0x130(%rbx), %rdx
xorl %ecx, %ecx
movq %rdx, %rsi
movq (%rsi), %rsi
cmpq %rdx, %rsi
je 0x22f40
movq 0x10(%rsi), %rdi
movl 0x14(%rdi), %r8d
testl %r8d, %r8d
je 0x22f26
cmpl $0x3, %r8d
jne 0x22f38
cmpb $0x1, 0x10(%rdi)
jne 0x22f38
movq (%rdi), %rdi
testb $0xc, 0x10c(%rdi)
je 0x22f38
movb $0x1, %cl
xorl %edi, %edi
jmp 0x22f3b
movb $0x1, %dil
testb %dil, %dil
jne 0x22f05
andb $0x1, %cl
movzbl %cl, %ecx
movl %eax, %edx
shrl $0x3, %edx
andl $0x1, %edx
cmpl %ecx, %edx
je 0x22fed
andl $-0x9, %eax
leal (%rax,%rcx,8), %eax
movl %eax, 0x10c(%rbx)
leaq 0x118(%rbx), %rax
movq 0x118(%rbx), %rdx
cmpq %rax, %rdx
je 0x22fe4
movl 0x24(%rdx), %esi
testl %esi, %esi
je 0x22f87
cmpl $0x3, %esi
jne 0x22fdf
cmpb $0x1, 0x20(%rdx)
jne 0x22fdf
movq 0x18(%rdx), %rsi
movl 0x10c(%rsi), %edi
movl %edi, %r8d
shrl $0x3, %r8d
andl $0x1, %r8d
cmpl %ecx, %r8d
je 0x22fdf
orl $0x4000, %edi           # imm = 0x4000
movl %edi, 0x10c(%rsi)
movq 0x148(%rbx), %rsi
movq 0x18(%rdx), %rdi
cmpq $0x0, 0x1f8(%rdi)
setne %r9b
movq 0x38(%rsi), %r8
cmpq %rdi, %r8
sete %r10b
orb %r9b, %r10b
jne 0x22fdf
movq %r8, 0x1f8(%rdi)
movq %rdi, 0x38(%rsi)
movq (%rdx), %rdx
jmp 0x22f70
testb $0xc, 0x10c(%rbx)
je 0x22ff3
popq %rbx
popq %r14
popq %r15
retq
cmpb $0x0, 0x2d(%rbx)
je 0x23002
cmpb $0x1, 0x190(%rbx)
jne 0x22fed
cmpb $0x2, 0x2c(%rbx)
jne 0x22fed
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x229b4
nop