// File: 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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3df20
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x3c750
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
callq 0x3c780
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3c7b0
testb $0x1, %al
jne 0x23578
jmp 0x23626
leaq -0x68(%rbp), %rdi
callq 0x3c7e0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x23607
movl $0x40, %edi
callq 0xa320
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rsi
callq 0x2d4d0
jmp 0x235b4
movq -0xd0(%rbp), %rdi
leaq 0x83a5e(%rip), %rsi     # 0xa7020
leaq 0x9fb7(%rip), %rdx      # 0x2d580
callq 0xac90
jmp 0x237ef
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0xa510
jmp 0x237dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x237dd
movq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x3df60
jmp 0x23616
jmp 0x23618
leaq -0x68(%rbp), %rdi
callq 0x3c860
jmp 0x23562
leaq -0x58(%rbp), %rdi
callq 0x3e000
movq %rax, -0xd8(%rbp)
jmp 0x23638
movq -0xd8(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3e060
movq %rax, -0xe0(%rbp)
jmp 0x23658
movq -0xe0(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3e030
testb $0x1, %al
jne 0x23682
jmp 0x237cb
leaq -0x90(%rbp), %rdi
callq 0x3e090
movq (%rax), %rdi
callq 0x30440
movq %rax, -0xe8(%rbp)
jmp 0x2369f
movq -0xe8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x30240
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x30270
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x302a0
testb $0x1, %al
jne 0x236fd
jmp 0x237b8
leaq -0xb0(%rbp), %rdi
callq 0x302d0
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0x3cda0
cmpq -0x10(%rbp), %rax
jne 0x23780
movl $0x40, %edi
callq 0xa320
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rsi
callq 0x2d4d0
jmp 0x23744
movq -0xf0(%rbp), %rdi
leaq 0x838ce(%rip), %rsi     # 0xa7020
leaq 0x9e27(%rip), %rdx      # 0x2d580
callq 0xac90
jmp 0x237ef
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0xa510
jmp 0x237dd
movq -0xc0(%rbp), %rdi
callq 0x3cda0
movq %rax, -0xc8(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3df60
jmp 0x237a5
jmp 0x237a7
leaq -0xb0(%rbp), %rdi
callq 0x30330
jmp 0x236e1
jmp 0x237ba
leaq -0x90(%rbp), %rdi
callq 0x3e0b0
jmp 0x23646
leaq -0x58(%rbp), %rdi
callq 0x3e0d0
addq $0xf0, %rsp
popq %rbp
retq
leaq -0x58(%rbp), %rdi
callq 0x3e0d0
movq -0x80(%rbp), %rdi
callq 0xacc0
nop