// File: night-shift[P]Srl/src/lib/Node.cpp
// Function: Srl::Lib::Link<Srl::Value>* (anonymous namespace)::find_link<(unsigned char)82, std::pair<unsigned long, Srl::String const*>, Srl::Value>(std::pair<unsigned long, Srl::String const*>, std::__cxx11::list<Srl::Lib::Link<Srl::Value>, Srl::Lib::HeapAllocator<Srl::Lib::Link<Srl::Value>>>&, Srl::String const&, Srl::String const&)
Link<T>* find_link(TKey key, Cont<T>& links, const String& field_name = Environment::EmptyString,
                                                 const String& node_name = Environment::EmptyString)
    {
        Itr<T> end    = links.end();
        Link<T>* rslt = nullptr;

        for(auto itr = links.begin(); itr != end; itr++) {
            if(compare<Opt, T>(itr, key)) {

                if(enabled(Opt, Throw) && rslt) {
                    auto msg = tp_name<T>() + " duplication: <" + field_name.unwrap(false) + "> in <" + node_name.unwrap(false) + ">";
                    throw Exception(msg);
                }

                rslt = &*itr;

                if(enabled(Opt, Remove)) {
                    links.erase(itr);
                    rslt = nullptr;
                    break;
                }

                if(!enabled(Opt, Check_Duplicate)) {
                    break;
                }
            }
        }

        if(enabled(Opt, Throw) && !rslt) {
            throw field_name_not_found_ex(field_name, node_name);
        }

        return rslt;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x344b0
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x34cb0
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x337f0
testb $0x1, %al
jne 0x451b7
jmp 0x45433
leaq -0x40(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x49280
testb $0x1, %al
jne 0x451cd
jmp 0x4541a
cmpq $0x0, -0x38(%rbp)
je 0x4540b
callq 0x492e0
movq %rax, %rsi
leaq 0x243ce(%rip), %rdx     # 0x695b5
leaq -0xe0(%rbp), %rdi
callq 0x368b0
movq -0x20(%rbp), %rsi
leaq -0x100(%rbp), %rdi
xorl %edx, %edx
callq 0x35e30
jmp 0x45207
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x354a0
jmp 0x45223
leaq 0x24377(%rip), %rdx     # 0x695a1
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x336d0
jmp 0x4523f
movq -0x28(%rbp), %rsi
leaq -0x130(%rbp), %rdi
xorl %edx, %edx
callq 0x35e30
jmp 0x45253
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x354a0
jmp 0x4526c
leaq 0x24352(%rip), %rdx     # 0x695c5
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x336d0
jmp 0x45282
leaq -0x80(%rbp), %rdi
callq 0x38ce0
leaq -0x130(%rbp), %rdi
callq 0x38ce0
leaq -0xa0(%rbp), %rdi
callq 0x38ce0
leaq -0xc0(%rbp), %rdi
callq 0x38ce0
leaq -0x100(%rbp), %rdi
callq 0x38ce0
leaq -0xe0(%rbp), %rdi
callq 0x38ce0
movl $0x28, %edi
callq 0x34160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x140(%rbp)
leaq -0x60(%rbp), %rsi
callq 0x33910
jmp 0x452e9
movq -0x140(%rbp), %rdi
movq 0x3dcf1(%rip), %rsi     # 0x82fe8
movq 0x3dc3a(%rip), %rdx     # 0x82f38
callq 0x37fc0
jmp 0x454b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x453ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x453ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x453a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x45396
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x4538a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x38ce0
leaq -0x130(%rbp), %rdi
callq 0x38ce0
leaq -0xa0(%rbp), %rdi
callq 0x38ce0
leaq -0xc0(%rbp), %rdi
callq 0x38ce0
leaq -0x100(%rbp), %rdi
callq 0x38ce0
leaq -0xe0(%rbp), %rdi
callq 0x38ce0
jmp 0x454a7
movq -0x140(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
callq 0x34ce0
jmp 0x453fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x38ce0
jmp 0x454a7
leaq -0x40(%rbp), %rdi
callq 0x37930
movq %rax, -0x38(%rbp)
jmp 0x45433
jmp 0x4541c
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x36000
movq %rax, -0x138(%rbp)
jmp 0x451a1
cmpq $0x0, -0x38(%rbp)
jne 0x4549a
movl $0x28, %edi
callq 0x34160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x148(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x46ca0
jmp 0x45460
movq -0x148(%rbp), %rdi
movq 0x3db7a(%rip), %rsi     # 0x82fe8
movq 0x3dac3(%rip), %rdx     # 0x82f38
callq 0x37fc0
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
callq 0x34ce0
jmp 0x454a7
movq -0x38(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x108(%rbp), %rdi
callq 0x38210
nopw %cs:(%rax,%rax)