// File: mertyildiran[P]Plexus/plexus/plexus.cpp
// Function: Network::get_neurons_by_type(NeuronType)
void Network::get_neurons_by_type(NeuronType neuron_type)
{
    std::vector<Neuron*> available_neurons;
    for (auto const& neuron: this->neurons) {
        switch (neuron_type) {
            case NON_SENSORY_NEURON:
                if (neuron->type != SENSORY_NEURON) {
                    this->nonsensory_neurons.push_back(neuron);
                }
                break;
            case NON_MOTOR_NEURON:
                if (neuron->type != MOTOR_NEURON) {
                    this->nonmotor_neurons.push_back(neuron);
                }
                break;
            case INTER_NEURON:
                if (neuron->type == INTER_NEURON) {
                    this->interneurons.push_back(neuron);
                }
                break;
            default:
                throw std::invalid_argument(
                    "Network::pick_neurons_by_type(int input_dim, "
                    "NeuronType neuron_type) function only accepts "
                    "NON_SENSORY_NEURON, NON_MOTOR_NEURON or "
                    "INTER_NEURON as the neuron type!"
                );
                break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %fs:0x28, %rax
movq %rax, -0x8(%rbp)
movq %rdi, -0x38(%rbp)
movl %esi, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x195f0
movq -0x68(%rbp), %rax
addq $0x148, %rax            # imm = 0x148
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x19160
movq %rax, -0x28(%rbp)
movq -0x48(%rbp), %rdi
callq 0x191b0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x19210
testb $0x1, %al
jne 0x178fe
jmp 0x17a3a
leaq -0x28(%rbp), %rdi
callq 0x19250
movq %rax, -0x50(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x6c(%rbp)
testl %eax, %eax
je 0x1799b
jmp 0x1791b
movl -0x6c(%rbp), %eax
subl $0x3, %eax
je 0x1796e
jmp 0x17925
movl -0x6c(%rbp), %eax
subl $0x4, %eax
jne 0x179c2
jmp 0x17933
movq -0x50(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, 0xa8(%rax)
je 0x17969
movq -0x68(%rbp), %rdi
addq $0x50, %rdi
movq -0x50(%rbp), %rsi
callq 0x19c30
jmp 0x17956
jmp 0x17969
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x17a5e
jmp 0x17a2a
movq -0x50(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, 0xa8(%rax)
je 0x17996
movq -0x68(%rbp), %rdi
addq $0x160, %rdi            # imm = 0x160
movq -0x50(%rbp), %rsi
callq 0x19c30
jmp 0x17994
jmp 0x17996
jmp 0x17a2a
movq -0x50(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0xa8(%rax)
jne 0x179c0
movq -0x68(%rbp), %rdi
addq $0x68, %rdi
movq -0x50(%rbp), %rsi
callq 0x19c30
jmp 0x179be
jmp 0x179c0
jmp 0x17a2a
movl $0x10, %edi
callq 0x16130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq 0xf82b(%rip), %rsi      # 0x27208
callq 0x16530
jmp 0x179e4
movq %fs:0x28, %rax
movq -0x8(%rbp), %rcx
cmpq %rcx, %rax
jne 0x17a8a
movq -0x78(%rbp), %rdi
movq 0x195db(%rip), %rsi     # 0x30fe0
movq 0x195b4(%rip), %rdx     # 0x30fc0
callq 0x16490
jmp 0x17a8a
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x161d0
jmp 0x17a5e
jmp 0x17a2c
leaq -0x28(%rbp), %rdi
callq 0x19350
jmp 0x178e8
leaq -0x20(%rbp), %rdi
callq 0x19100
movq %fs:0x28, %rax
movq -0x8(%rbp), %rcx
cmpq %rcx, %rax
jne 0x17a8a
addq $0x80, %rsp
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x19100
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
movq %fs:0x28, %rax
movq -0x8(%rbp), %rcx
cmpq %rcx, %rax
jne 0x17a8a
movq -0x80(%rbp), %rdi
callq 0x164e0
callq 0x16340
nop