// File: /workspace/github_cpp_makefile_star2_O1/mertyildiran[P]Plexus/plexus/plexus.cpp
// Function: Neuron::partially_subscribe()
void Neuron::partially_subscribe()
{
    if (this->subscriptions.size() == 0) {
        unsigned seed = std::chrono::system_clock::now()
            .time_since_epoch().count();
        std::default_random_engine generator (seed);
        std::normal_distribution<double> distribution(
            this->network->connectivity,
            this->network->connectivity_sqrt
        );
        unsigned int sample_length = distribution(generator);
        if (sample_length > this->network->nonmotor_neurons.size())
            sample_length = this->network->nonmotor_neurons.size();
        if (sample_length <= 0)
            sample_length = 0;
        std::vector<Neuron*> elected = random_sample(
            this->network->nonmotor_neurons,
            sample_length
        );
        for (auto const& target_neuron: elected) {
            if (target_neuron != this) {
                this->subscriptions.insert(
                    std::pair<Neuron*, double>(
                        target_neuron,
                        Random::get(-1.0, 1.0)
                    )
                );
                target_neuron->publications.insert(
                    std::pair<Neuron*, double>(this, 0.0)
                );
            }
        }
        this->network->increase_initiated_neurons();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %fs:0x28, %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x48(%rdi)
jne 0x68f6
movq %rdi, %rbx
leaq 0x28(%rsp), %r12
callq 0x6030
movl %eax, %ecx
movabsq $0x200000005, %rdx      # imm = 0x200000005
movq %rcx, %rax
mulq %rdx
movq %rdx, %rax
shlq $0x1f, %rax
subq %rax, %rdx
leaq (%rcx,%rdx), %rax
cmpq $0x1, %rax
adcq %rcx, %rdx
leaq 0x48(%rsp), %rsi
movq %rdx, (%rsi)
movq 0x28(%rbx), %rax
cvtsi2sdl 0x4(%rax), %xmm0
cvtsi2sdl 0x8(%rax), %xmm1
leaq 0x50(%rsp), %rdi
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
movq %rdi, %rdx
callq 0x955c
cvttsd2si %xmm0, %rax
movl %eax, %ecx
movq 0x28(%rbx), %rdx
leaq 0x160(%rdx), %rsi
movq 0x168(%rdx), %r14
subq 0x160(%rdx), %r14
sarq $0x3, %r14
cmpq %rcx, %r14
cmovael %eax, %r14d
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x8080
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x7f67
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x6858
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x6280
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %rbp
cmpq %rbp, %r13
je 0x68d5
leaq 0x30(%rbx), %r14
leaq 0x40(%rsp), %r12
leaq 0x8(%rsp), %r15
cmpq %rbx, (%r13)
je 0x68cc
callq 0x890e
movq %rax, %rdi
callq 0x8a5b
addsd %xmm0, %xmm0
addsd 0x576c(%rip), %xmm0     # 0xc000
movq (%r13), %rax
movq %rax, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x9aac
movq (%r13), %rdi
addq $0x68, %rdi
movq %rbx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %r15, %rsi
callq 0x9aac
addq $0x8, %r13
cmpq %rbp, %r13
jne 0x6875
movq 0x28(%rbx), %rax
incl 0x98(%rax)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x68f6
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x6280
movq %fs:0x28, %rax
cmpq 0x70(%rsp), %rax
jne 0x6952
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
jmp 0x6929
jmp 0x6921
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x693a
movq (%r12), %rsi
subq %rdi, %rsi
callq 0x6280
movq %fs:0x28, %rax
cmpq 0x70(%rsp), %rax
jne 0x6952
movq %rbx, %rdi
callq 0x6440
callq 0x62a0
nop