// File: 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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movl 0x10c(%rax), %eax
shrl $0x9, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x4cc4c
movq -0x78(%rbp), %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30240
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30270
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x302a0
testb $0x1, %al
jne 0x4cbe9
jmp 0x4cc33
leaq -0x18(%rbp), %rdi
callq 0x302d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4e3f0
movb %al, -0x79(%rbp)
jmp 0x4cc04
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x4cc26
jmp 0x4cc0d
movq -0x28(%rbp), %rdi
callq 0x3cda0
movq %rax, %rdi
callq 0x4c3d0
movq -0x28(%rbp), %rax
movb $0x1, 0x11(%rax)
jmp 0x4cc28
leaq -0x18(%rbp), %rdi
callq 0x30330
jmp 0x4cbd6
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %ecx
andl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
orl $0x0, %ecx
movl %ecx, 0x10c(%rax)
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0xa, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x4cc85
movq -0x78(%rbp), %rdi
callq 0x4c7a0
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
orl $0x0, %ecx
movl %ecx, 0x10c(%rax)
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0xb, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x4ccce
movq -0x78(%rbp), %rdi
movl 0x10c(%rdi), %eax
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
orl $0x0, %eax
movl %eax, 0x10c(%rdi)
movl $0x2, 0x1c4(%rdi)
movb $0x0, 0x2c(%rdi)
movl $0x1, %edx
movl %edx, %esi
callq 0x4cf90
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0xc, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x4cd02
movq -0x78(%rbp), %rdi
movl 0x10c(%rdi), %eax
andl $0xffffefff, %eax       # imm = 0xFFFFEFFF
orl $0x0, %eax
movl %eax, 0x10c(%rdi)
callq 0x4c840
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0xd, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x4cd45
movq -0x78(%rbp), %rdi
movl 0x10c(%rdi), %eax
andl $0xffffdfff, %eax       # imm = 0xFFFFDFFF
orl $0x0, %eax
movl %eax, 0x10c(%rdi)
movl 0x10c(%rdi), %esi
shrl $0x12, %esi
andl $0x1, %esi
andl $0x1, %esi
callq 0x4c440
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0xe, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x4cf7a
movq -0x78(%rbp), %rax
movb $0x0, -0x29(%rbp)
addq $0x130, %rax            # imm = 0x130
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x304d0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x30530
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x30500
testb $0x1, %al
jne 0x4cd9f
jmp 0x4cdf0
leaq -0x40(%rbp), %rdi
callq 0x30590
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x4e1f0
movb %al, -0x7a(%rbp)
jmp 0x4cdbd
movb -0x7a(%rbp), %al
testb $0x1, %al
jne 0x4cdc6
jmp 0x4cde3
movq -0x50(%rbp), %rdi
callq 0x30420
movq %rax, %rdi
callq 0x4e360
testb $0x1, %al
jne 0x4cddd
jmp 0x4cde3
movb $0x1, -0x29(%rbp)
jmp 0x4cdf0
jmp 0x4cde5
leaq -0x40(%rbp), %rdi
callq 0x306a0
jmp 0x4cd8c
movq -0x78(%rbp), %rcx
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl 0x10c(%rcx), %ecx
shrl $0x3, %ecx
andl $0x1, %ecx
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x4cf78
movq -0x78(%rbp), %rax
movb -0x29(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %edx
movl 0x10c(%rax), %ecx
shll $0x3, %edx
andl $-0x9, %ecx
orl %edx, %ecx
movl %ecx, 0x10c(%rax)
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x30240
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0x30270
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x302a0
testb $0x1, %al
jne 0x4ce71
jmp 0x4cf1a
leaq -0x60(%rbp), %rdi
callq 0x302d0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x4e1f0
movb %al, -0x7b(%rbp)
jmp 0x4ce8c
movb -0x7b(%rbp), %al
testb $0x1, %al
jne 0x4ce95
jmp 0x4cf0a
movq -0x70(%rbp), %rdi
callq 0x3cda0
movl 0x10c(%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
andb $0x1, %al
movzbl %al, %eax
movb -0x29(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x4cf0a
movq -0x70(%rbp), %rdi
callq 0x3cda0
movq %rax, %rcx
movq -0x78(%rbp), %rax
movl 0x10c(%rcx), %edx
andl $0xffffbfff, %edx       # imm = 0xFFFFBFFF
orl $0x4000, %edx           # imm = 0x4000
movl %edx, 0x10c(%rcx)
movq 0x148(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x70(%rbp), %rdi
callq 0x3cda0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x4e320
jmp 0x4cf0c
leaq -0x60(%rbp), %rdi
callq 0x30330
jmp 0x4ce5b
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
testl $0x1, %eax
jne 0x4cf76
movq -0x78(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
testl $0x1, %eax
jne 0x4cf76
movq -0x78(%rbp), %rax
cmpb $0x0, 0x2d(%rax)
je 0x4cf5f
movq -0x78(%rbp), %rax
testb $0x1, 0x190(%rax)
je 0x4cf74
movq -0x78(%rbp), %rax
cmpb $0x2, 0x2c(%rax)
jne 0x4cf74
movq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x4c440
jmp 0x4cf76
jmp 0x4cf78
jmp 0x4cf7a
addq $0x90, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0xfa30
nopl (%rax,%rax)