// File: /workspace/github_cpp_makefile_star2_O2/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
movl 0x10c(%rdi), %esi
btl $0x9, %esi
jae 0x1eb7f
leaq 0x118(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x1eb6e
movl 0x24(%r15), %eax
andl $-0x2, %eax
cmpl $0x4, %eax
je 0x1eb4a
movq 0x18(%r15), %rdi
callq 0x1e708
movb $0x1, 0x21(%r15)
jmp 0x1eb4a
movl $0xfffffdff, %esi       # imm = 0xFFFFFDFF
andl 0x10c(%rbx), %esi
movl %esi, 0x10c(%rbx)
btl $0xa, %esi
jae 0x1eb9e
movq %rbx, %rdi
callq 0x1e97a
movl $0xfffffbff, %esi       # imm = 0xFFFFFBFF
andl 0x10c(%rbx), %esi
movl %esi, 0x10c(%rbx)
btl $0xb, %esi
jae 0x1ebd1
andl $0xfffff7ff, %esi       # imm = 0xFFFFF7FF
movl %esi, 0x10c(%rbx)
movl $0x2, 0x1c4(%rbx)
movb $0x0, 0x2c(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %edx, %esi
callq 0x1ed2e
movl 0x10c(%rbx), %esi
btl $0xc, %esi
jae 0x1ebf1
andl $0xffffefff, %esi       # imm = 0xFFFFEFFF
movl %esi, 0x10c(%rbx)
movq %rbx, %rdi
callq 0x1e9b4
movl 0x10c(%rbx), %esi
btl $0xd, %esi
jae 0x1ec18
movl %esi, %eax
andl $0xffffdfff, %eax       # imm = 0xFFFFDFFF
movl %eax, 0x10c(%rbx)
shrl $0x12, %esi
andl $0x1, %esi
movq %rbx, %rdi
callq 0x1e75a
movl 0x10c(%rbx), %esi
btl $0xe, %esi
jae 0x1ed03
pushq $0x1
popq %rax
leaq 0x130(%rbx), %rcx
movq %rcx, %rdx
movq (%rdx), %rdx
cmpq %rcx, %rdx
je 0x1ec5e
movq 0x10(%rdx), %rdi
movl 0x14(%rdi), %r8d
testl %r8d, %r8d
je 0x1ec50
cmpl $0x3, %r8d
jne 0x1ec2f
cmpb $0x1, 0x10(%rdi)
jne 0x1ec2f
movq (%rdi), %rdi
testb $0xc, 0x10c(%rdi)
je 0x1ec2f
jmp 0x1ec60
xorl %eax, %eax
movl %esi, %ecx
shrl $0x3, %ecx
andl $0x1, %ecx
cmpl %eax, %ecx
je 0x1ed03
andl $-0x9, %esi
leal (%rsi,%rax,8), %ecx
movl %ecx, 0x10c(%rbx)
leaq 0x118(%rbx), %rcx
movq %rcx, %rdx
movq (%rdx), %rdx
cmpq %rcx, %rdx
je 0x1ecfa
movl 0x24(%rdx), %esi
testl %esi, %esi
je 0x1eca0
cmpl $0x3, %esi
jne 0x1ec86
cmpb $0x1, 0x20(%rdx)
jne 0x1ec86
movq 0x18(%rdx), %rsi
movl 0x10c(%rsi), %edi
movl %edi, %r8d
shrl $0x3, %r8d
andl $0x1, %r8d
cmpl %eax, %r8d
je 0x1ec86
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 0x1ec86
movq %r8, 0x1f8(%rdi)
movq %rdi, 0x38(%rsi)
jmp 0x1ec86
testb $0xc, 0x10c(%rbx)
je 0x1ed09
popq %rbx
popq %r14
popq %r15
retq
cmpb $0x0, 0x2d(%rbx)
je 0x1ed18
cmpb $0x1, 0x190(%rbx)
jne 0x1ed03
cmpb $0x2, 0x2c(%rbx)
jne 0x1ed03
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x1e75a
nop