// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
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 0xa882
xorl %esi, %esi
cmpq %rcx, %rax
je 0xa900
movslq %esi, %rsi
movsd (%rdx,%rsi,8), %xmm0
movq (%rax), %rdi
movsd %xmm0, 0xa0(%rdi)
incl %esi
addq $0x8, %rax
jmp 0xa85e
movq 0x9717(%rip), %r15      # 0x13fa0
leaq 0x4a45(%rip), %rsi      # 0xf2d5
movq %r15, %rdi
callq 0x9290
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x9190
pushq $0xa
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x9310
leaq 0x4a2e(%rip), %rsi      # 0xf2ef
movq %r15, %rdi
callq 0x9290
movq 0x18(%rbx), %rsi
subq 0x10(%rbx), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x9190
movq %rax, %rdi
movl %ebp, %esi
callq 0x9310
leaq 0x4a21(%rip), %rsi      # 0xf30f
movq %r15, %rdi
callq 0x9290
movq %rax, %rdi
movl %ebp, %esi
callq 0x9310
movq (%r14), %rax
movq 0x8(%r14), %rsi
cmpq %rsi, %rax
je 0xa940
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
movq %rdx, %rdi
subq %rcx, %rdi
subq %rax, %rsi
cmpq %rsi, %rdi
jne 0xa980
xorl %esi, %esi
cmpq %rdx, %rcx
je 0xa977
movslq %esi, %rsi
movsd (%rax,%rsi,8), %xmm0
movq (%rcx), %rdi
movsd %xmm0, (%rdi)
incl %esi
addq $0x8, %rcx
jmp 0xa924
movb $0x1, 0x128(%rbx)
movq 0x50(%rbx), %r15
movq 0x58(%rbx), %r12
leaq 0x4716(%rip), %r14      # 0xf06c
cmpq %r12, %r15
je 0xa970
movq %r14, %rdi
callq 0x9050
movq (%r15), %rax
movsd %xmm0, (%rax)
addq $0x8, %r15
jmp 0xa956
movb $0x0, 0x128(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x9619(%rip), %r15      # 0x13fa0
leaq 0x49de(%rip), %rsi      # 0xf36c
movq %r15, %rdi
callq 0x9290
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x9190
pushq $0xa
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x9310
leaq 0x49d1(%rip), %rsi      # 0xf38e
movq %r15, %rdi
callq 0x9290
movq 0x38(%rbx), %rsi
subq 0x30(%rbx), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x9190
movq %rax, %rdi
movl %ebp, %esi
callq 0x9310
leaq 0x49c2(%rip), %rsi      # 0xf3ac
movq %r15, %rdi
callq 0x9290
movq %rax, %rdi
movl %ebp, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9310