// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/neuron.C
// Function: Neuron::SpiKL_IP(int)
void Neuron::SpiKL_IP(int t){
	double Tau_Lower_Bound=32;
	double Tau_Upper_Bound=512;
	double R_Lower_Bound=32;
	double R_Upper_Bound=512;
	double y=_lsm_calcium/(TAU_C-1);
	double LR1=5;
	double LR2=5;
	double beta=5;  //reciprocal of miu
    if(!(_name[0] == 'r' && _name[9] == '_'))   return;	
	double X;
	if(y>0.01){
		X=_lsm_v_thresh/(exp((1/_lsm_t_m_c)*(1/y-LSM_T_REFRAC))-1);
		_lsm_R+=LR1*(2*y*_lsm_t_m_c*_lsm_v_thresh-X-_lsm_v_thresh-beta*_lsm_t_m_c*_lsm_v_thresh*y*y)/(_lsm_R*X);
		_lsm_t_m_c+=LR2*(2*LSM_T_REFRAC*y-1-beta*(LSM_T_REFRAC*y*y-y))/_lsm_t_m_c;		
	}
	else{
		_lsm_R+=LR1*0.1;
		_lsm_t_m_c-=LR2*0.1;
	}
	if(_lsm_R<R_Lower_Bound)
		_lsm_R=R_Lower_Bound;
	if(_lsm_R>R_Upper_Bound)
		_lsm_R=R_Upper_Bound;

	if(_lsm_t_m_c<Tau_Lower_Bound)
		_lsm_t_m_c=Tau_Lower_Bound;
	if(_lsm_t_m_c>Tau_Upper_Bound)
		_lsm_t_m_c=Tau_Upper_Bound;
	

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movsd 0x27c29(%rip), %xmm0    # 0x345d8
movsd %xmm0, -0x18(%rbp)
movsd 0x27c14(%rip), %xmm0    # 0x345d0
movsd %xmm0, -0x20(%rbp)
movsd 0x27c0f(%rip), %xmm0    # 0x345d8
movsd %xmm0, -0x28(%rbp)
movsd 0x27bfa(%rip), %xmm0    # 0x345d0
movsd %xmm0, -0x30(%rbp)
movsd 0x178(%rax), %xmm0
movsd 0x27bdd(%rip), %xmm1    # 0x345c8
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x27bac(%rip), %xmm0    # 0x345a8
movsd %xmm0, -0x40(%rbp)
movsd 0x27b9f(%rip), %xmm0    # 0x345a8
movsd %xmm0, -0x48(%rbp)
movsd 0x27b92(%rip), %xmm0    # 0x345a8
movsd %xmm0, -0x50(%rbp)
movq 0x10(%rax), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0xca38
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movsbl 0x9(%rax), %eax
cmpl $0x5f, %eax
je 0xca3d
jmp 0xcd00
movsd -0x38(%rbp), %xmm0
movsd 0x27b96(%rip), %xmm1    # 0x345e0
ucomisd %xmm1, %xmm0
jbe 0xcc03
movq -0x60(%rbp), %rax
movsd 0x1d0(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x27b53(%rip), %xmm0    # 0x345c0
divsd 0x1f0(%rax), %xmm0
movsd 0x27b43(%rip), %xmm1    # 0x345c0
divsd -0x38(%rbp), %xmm1
movsd 0x27596(%rip), %xmm2    # 0x34020
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x4710
movq -0x60(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
movsd 0x27b15(%rip), %xmm2    # 0x345c0
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x2755b(%rip), %xmm2    # 0x34020
mulsd -0x38(%rbp), %xmm2
mulsd 0x1f0(%rax), %xmm2
movsd 0x1d0(%rax), %xmm3
movsd -0x58(%rbp), %xmm1
movq %xmm1, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
subsd 0x1d0(%rax), %xmm2
movsd -0x50(%rbp), %xmm1
mulsd 0x1f0(%rax), %xmm1
mulsd 0x1d0(%rax), %xmm1
mulsd -0x38(%rbp), %xmm1
movsd -0x38(%rbp), %xmm3
movq %xmm1, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0x1d8(%rax), %xmm1
mulsd -0x58(%rbp), %xmm1
divsd %xmm1, %xmm0
addsd 0x1d8(%rax), %xmm0
movsd %xmm0, 0x1d8(%rax)
movsd -0x48(%rbp), %xmm0
movsd -0x38(%rbp), %xmm2
movsd 0x27a75(%rip), %xmm1    # 0x345f0
mulsd %xmm1, %xmm2
movsd 0x27a11(%rip), %xmm1    # 0x34598
addsd %xmm1, %xmm2
movsd -0x50(%rbp), %xmm1
movsd 0x27488(%rip), %xmm3    # 0x34020
mulsd -0x38(%rbp), %xmm3
movsd -0x38(%rbp), %xmm5
movsd -0x38(%rbp), %xmm4
movq %xmm4, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm4
mulsd %xmm5, %xmm3
addsd %xmm4, %xmm3
movq %xmm1, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
divsd 0x1f0(%rax), %xmm0
addsd 0x1f0(%rax), %xmm0
movsd %xmm0, 0x1f0(%rax)
jmp 0xcc68
movq -0x60(%rbp), %rax
movsd -0x40(%rbp), %xmm0
movsd 0x1d8(%rax), %xmm1
movsd 0x279cc(%rip), %xmm2    # 0x345e8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1d8(%rax)
movsd -0x48(%rbp), %xmm0
movsd 0x1f0(%rax), %xmm1
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movsd 0x27990(%rip), %xmm2    # 0x345e8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1f0(%rax)
movq -0x60(%rbp), %rax
movsd 0x1d8(%rax), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xcc90
movq -0x60(%rbp), %rax
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x1d8(%rax)
movq -0x60(%rbp), %rax
movsd 0x1d8(%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0xccb4
movq -0x60(%rbp), %rax
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x1d8(%rax)
movq -0x60(%rbp), %rax
movsd 0x1f0(%rax), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xccdc
movq -0x60(%rbp), %rax
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x1f0(%rax)
movq -0x60(%rbp), %rax
movsd 0x1f0(%rax), %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0xcd00
movq -0x60(%rbp), %rax
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x1f0(%rax)
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)