// File: /workspace/github_cpp_makefile_star2_O1/mertyildiran[P]Plexus/plexus/plexus.cpp
// Function: Network::load(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>)
void Network::load(
    std::vector<double> input_arr,
    std::vector<double> output_arr
)
{
    if (this->sensory_neurons.size() != input_arr.size()) {
        std::cout << "Size of the input array: " << input_arr.size() << '\n';
        std::cout << "Number of the sensory neurons: "
            << this->sensory_neurons.size() << '\n';
        std::cout << "Size of the input array and number of the sensory "
            "neurons are not matching! Please try again" << '\n';
    } else {
        int step = 0;
        for (auto& neuron: this->sensory_neurons) {
            neuron->potential = input_arr[step];
            step++;
        }
    }
    if (output_arr.empty()) {
        this->freezer = true;
        for (auto& neuron: this->nonsensory_neurons) {
            neuron->desired_potential = std::nan("None");
        }
        this->freezer = false;
    } else {
        if (this->motor_neurons.size() != output_arr.size()) {
            std::cout << "Size of the output/target array: "
                << output_arr.size() << '\n';
            std::cout << "Number of the motor neurons: "
                << this->motor_neurons.size() << '\n';
            std::cout << "Size of the output/target array and number "
                "of the motor neurons are not matching! "
                "Please try again" << '\n';
        } else {
            int step = 0;
            for (auto& neuron: this->motor_neurons) {
                neuron->desired_potential = output_arr[step];
                step++;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %fs:0x28, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
movq %rcx, %rsi
subq %rax, %rsi
movq (%r12), %rdx
movq 0x8(%r12), %rdi
subq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x7d60
cmpq %rcx, %rax
je 0x7e0e
xorl %esi, %esi
movslq %esi, %rsi
movsd (%rdx,%rsi,8), %xmm0
movq (%rax), %rdi
movsd %xmm0, 0xa0(%rdi)
incl %esi
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x7d3d
jmp 0x7e0e
movq 0x8239(%rip), %r15      # 0xffa0
leaq 0x4567(%rip), %rsi      # 0xc2d5
movl $0x19, %edx
movq %r15, %rdi
callq 0x62d0
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
movq %r15, %rdi
callq 0x6170
movb $0xa, %bpl
leaq 0x2(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x62d0
leaq 0x4540(%rip), %rsi      # 0xc2ef
movl $0x1f, %edx
movq %r15, %rdi
callq 0x62d0
movq 0x18(%rbx), %rsi
subq 0x10(%rbx), %rsi
sarq $0x3, %rsi
movq %r15, %rdi
callq 0x6170
leaq 0x3(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x62d0
leaq 0x4523(%rip), %rsi      # 0xc30f
movl $0x5c, %edx
movq %r15, %rdi
callq 0x62d0
leaq 0x4(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x62d0
movq (%r14), %rax
movq 0x8(%r14), %rsi
cmpq %rsi, %rax
je 0x7e5a
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
movq %rdx, %rdi
subq %rcx, %rdi
subq %rax, %rsi
cmpq %rsi, %rdi
jne 0x7e99
cmpq %rdx, %rcx
je 0x7f45
xorl %esi, %esi
movslq %esi, %rsi
movsd (%rax,%rsi,8), %xmm0
movq (%rcx), %rdi
movsd %xmm0, (%rdi)
incl %esi
addq $0x8, %rcx
cmpq %rdx, %rcx
jne 0x7e3b
jmp 0x7f45
movb $0x1, 0x128(%rbx)
movq 0x50(%rbx), %r15
movq 0x58(%rbx), %r12
cmpq %r12, %r15
je 0x7e8d
leaq 0x41f7(%rip), %r14      # 0xc06c
movq %r14, %rdi
callq 0x6050
movq (%r15), %rax
movsd %xmm0, (%rax)
addq $0x8, %r15
cmpq %r12, %r15
jne 0x7e75
movb $0x0, 0x128(%rbx)
jmp 0x7f45
movq 0x8100(%rip), %r15      # 0xffa0
leaq 0x44c5(%rip), %rsi      # 0xc36c
movl $0x21, %edx
movq %r15, %rdi
callq 0x62d0
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x3, %rsi
movq %r15, %rdi
callq 0x6170
movb $0xa, %bpl
leaq 0x5(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x62d0
leaq 0x44a8(%rip), %rsi      # 0xc38e
movl $0x1d, %edx
movq %r15, %rdi
callq 0x62d0
movq 0x38(%rbx), %rsi
subq 0x30(%rbx), %rsi
sarq $0x3, %rsi
movq %r15, %rdi
callq 0x6170
leaq 0x6(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x62d0
leaq 0x4489(%rip), %rsi      # 0xc3ac
movl $0x62, %edx
movq %r15, %rdi
callq 0x62d0
leaq 0x7(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x62d0
movq %fs:0x28, %rax
cmpq 0x8(%rsp), %rax
jne 0x7f62
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x62a0