// File: /workspace/github_cpp_makefile_star2_O3/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::RateEquations(atomicpp::ImpuritySpecies&, double, double)
RateEquations::RateEquations(ImpuritySpecies& impurity, const double density_threshold /*= 1e9*/, const double mi_in_amu /*= 1*/) : 
	dNzk(impurity.get_atomic_number()+1, 0.0),
	F_zk(impurity.get_atomic_number()+1, 0.0),
	dNzk_correction(impurity.get_atomic_number()+1, 0.0),
	F_zk_correction(impurity.get_atomic_number()+1, 0.0)
	{

	// Set parameters that are useful for multiple functions
	rate_coefficients        = impurity.get_rate_coefficients();
	use_charge_exchange      = impurity.get_has_charge_exchange();
	Z                        = impurity.get_atomic_number();
	mz                       = impurity.get_mass(); //in amu

	Nthres                   = density_threshold;
	mi                       = mi_in_amu;

	//Initialise the outputs
	Pcool                    = 0.0;
	Prad                     = 0.0;
	dNe                      = 0.0;
	F_i                      = 0.0;
	dNn                      = 0.0;
	F_n                      = 0.0;

	//Calculate the factor that doesn't change throughout evaluation
	calculateStoppingTimeConstantFactor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movsd %xmm1, -0x68(%rbp)
movsd %xmm0, -0x60(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
callq 0xc61a
movq %r14, -0x38(%rbp)
movq %r14, %rdi
callq 0xc10e
leaq 0x70(%rbx), %r12
incl %eax
movslq %eax, %r14
leaq -0x98(%rbp), %r15
movq $0x0, (%r15)
leaq -0x29(%rbp), %r13
movq %r13, %rdi
callq 0x533c
movq %r12, -0x58(%rbp)
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x1802a
leaq -0x29(%rbp), %rdi
callq 0x5a80
movq -0x38(%rbp), %rdi
callq 0xc10e
leaq 0x88(%rbx), %r12
incl %eax
movslq %eax, %r14
leaq -0x98(%rbp), %r13
movq $0x0, (%r13)
leaq -0x29(%rbp), %r15
movq %r15, %rdi
callq 0x533c
movq %r12, -0x50(%rbp)
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x1802a
leaq -0x29(%rbp), %rdi
callq 0x5a80
movq -0x38(%rbp), %r12
movq %r12, %rdi
callq 0xc10e
leaq 0xa0(%rbx), %r15
incl %eax
movslq %eax, %r14
leaq -0x98(%rbp), %rax
movq $0x0, (%rax)
leaq -0x29(%rbp), %r13
movq %r13, %rdi
callq 0x533c
movq %r15, -0x48(%rbp)
movq %r15, %rdi
movq %r14, %rsi
leaq -0x98(%rbp), %rdx
movq %r13, %rcx
callq 0x1802a
leaq -0x29(%rbp), %rdi
callq 0x5a80
movq %r12, %rdi
callq 0xc10e
leaq 0xb8(%rbx), %r13
incl %eax
movslq %eax, %r15
leaq -0x98(%rbp), %rax
movq $0x0, (%rax)
leaq -0x29(%rbp), %r14
movq %r14, %rdi
callq 0x533c
movq %r13, -0x40(%rbp)
movq %r13, %rdi
movq %r15, %rsi
leaq -0x98(%rbp), %rdx
movq %r14, %rcx
callq 0x1802a
leaq -0x29(%rbp), %rdi
callq 0x5a80
leaq -0x98(%rbp), %rdi
movq %r12, %rsi
callq 0xc124
leaq -0x98(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21128
movq %r14, %rdi
callq 0x5566
movq %r12, %rdi
callq 0xba88
movb %al, 0x30(%rbx)
movq %r12, %rdi
callq 0xc10e
movl %eax, 0x34(%rbx)
movq %r12, %rdi
callq 0xc118
movsd %xmm0, 0x38(%rbx)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, 0x40(%rbx)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, 0x48(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0xd0(%rbx)
movups %xmm0, 0xe0(%rbx)
movsd 0x63fe(%rip), %xmm0     # 0x25058
movq %rbx, %rdi
callq 0x1ecf6
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ecbf
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a80
jmp 0x1eccb
movq %rax, %r14
jmp 0x1eccb
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a80
jmp 0x1ecd4
movq %rax, %r14
jmp 0x1ecd4
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a80
jmp 0x1ecdd
movq %rax, %r14
jmp 0x1ecdd
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a80
jmp 0x1ece6
movq %rax, %r14
jmp 0x1ece6
movq %rax, %r14
movq -0x40(%rbp), %rdi
callq 0x53c6
movq -0x48(%rbp), %rdi
callq 0x53c6
movq -0x50(%rbp), %rdi
callq 0x53c6
movq -0x58(%rbp), %rdi
callq 0x53c6
movq %rbx, %rdi
callq 0x5566
movq %r14, %rdi
callq 0x45a0