// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/neuron.C
// Function: NeuronGroup::CollectPreSynAct(double&, double&, int&)
void NeuronGroup::CollectPreSynAct(double & p_r, double & avg_i_r, int & max_i_r){
    double p_n = 0.0, avg_i_n = 0.0;
    int max_i_n = 0;
    for(size_t i = 0; i < _neurons.size(); ++i){
        assert(_neurons[i]);
        _neurons[i]->CollectPreSynAct(p_n, avg_i_n, max_i_n);
        p_r += p_n,  avg_i_r += avg_i_n, max_i_r = max(max_i_r, max_i_n);
    }
    p_r = _neurons.empty() ? 0 : p_r/((double)_neurons.size());
    avg_i_r = _neurons.empty() ? 0 : avg_i_r/((double)_neurons.size());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0x28, %rdi
callq 0x12d80
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0xfd09
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movq -0x40(%rbp), %rsi
callq 0x12c70
cmpq $0x0, (%rax)
je 0xfc7d
jmp 0xfc9c
leaq 0x250bc(%rip), %rdi     # 0x34d40
leaq 0x24a16(%rip), %rsi     # 0x346a1
movl $0x3dd, %edx            # imm = 0x3DD
leaq 0x25114(%rip), %rcx     # 0x34dab
callq 0x4210
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movq -0x40(%rbp), %rsi
callq 0x12c70
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x34(%rbp), %rcx
callq 0xcef0
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd -0x30(%rbp), %xmm0
movq -0x18(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x20(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x8c70
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xfc3f
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
callq 0x13750
testb $0x1, %al
jne 0xfd1c
jmp 0xfd26
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xfd75
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
addq $0x28, %rdi
callq 0x12d80
movsd -0x60(%rbp), %xmm0
movq %rax, %xmm1
movaps 0x248df(%rip), %xmm2    # 0x34630
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x248e3(%rip), %xmm2    # 0x34640
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x48(%rbp), %rdi
movsd -0x58(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, (%rax)
addq $0x28, %rdi
callq 0x13750
testb $0x1, %al
jne 0xfd95
jmp 0xfd9f
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xfdee
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
addq $0x28, %rdi
callq 0x12d80
movsd -0x70(%rbp), %xmm0
movq %rax, %xmm1
movaps 0x24866(%rip), %xmm2    # 0x34630
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2486a(%rip), %xmm2    # 0x34640
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)