// File: /workspace/github_cpp_makefile_star2_O3/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 0x7daa
cmpq %rcx, %rax
je 0x7e58
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 0x7d87
jmp 0x7e58
movq 0x81ef(%rip), %r15      # 0xffa0
leaq 0x455d(%rip), %rsi      # 0xc315
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 0x4536(%rip), %rsi      # 0xc32f
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 0x4519(%rip), %rsi      # 0xc34f
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 0x7ea4
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
movq %rdx, %rdi
subq %rcx, %rdi
subq %rax, %rsi
cmpq %rsi, %rdi
jne 0x7ee3
cmpq %rdx, %rcx
je 0x7f8f
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 0x7e85
jmp 0x7f8f
movb $0x1, 0x128(%rbx)
movq 0x50(%rbx), %r15
movq 0x58(%rbx), %r12
cmpq %r12, %r15
je 0x7ed7
leaq 0x41ed(%rip), %r14      # 0xc0ac
movq %r14, %rdi
callq 0x6050
movq (%r15), %rax
movsd %xmm0, (%rax)
addq $0x8, %r15
cmpq %r12, %r15
jne 0x7ebf
movb $0x0, 0x128(%rbx)
jmp 0x7f8f
movq 0x80b6(%rip), %r15      # 0xffa0
leaq 0x44bb(%rip), %rsi      # 0xc3ac
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 0x449e(%rip), %rsi      # 0xc3ce
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 0x447f(%rip), %rsi      # 0xc3ec
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 0x7fac
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x62a0