// File: /workspace/github_cpp_makefile_star2_O2/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 0xc3fc
movq %r14, -0x38(%rbp)
movq %r14, %rdi
callq 0xbf0c
leaq 0x70(%rbx), %r12
incl %eax
movslq %eax, %r14
leaq -0x98(%rbp), %r15
andq $0x0, (%r15)
leaq -0x29(%rbp), %r13
movq %r13, %rdi
callq 0x531c
movq %r12, -0x58(%rbp)
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x17a40
leaq -0x29(%rbp), %rdi
callq 0x5a64
movq -0x38(%rbp), %rdi
callq 0xbf0c
leaq 0x88(%rbx), %r12
incl %eax
movslq %eax, %r14
leaq -0x98(%rbp), %r13
andq $0x0, (%r13)
leaq -0x29(%rbp), %r15
movq %r15, %rdi
callq 0x531c
movq %r12, -0x50(%rbp)
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x17a40
leaq -0x29(%rbp), %rdi
callq 0x5a64
movq -0x38(%rbp), %r12
movq %r12, %rdi
callq 0xbf0c
leaq 0xa0(%rbx), %r15
incl %eax
movslq %eax, %r14
leaq -0x98(%rbp), %rax
andq $0x0, (%rax)
leaq -0x29(%rbp), %r13
movq %r13, %rdi
callq 0x531c
movq %r15, -0x48(%rbp)
movq %r15, %rdi
movq %r14, %rsi
leaq -0x98(%rbp), %rdx
movq %r13, %rcx
callq 0x17a40
leaq -0x29(%rbp), %rdi
callq 0x5a64
movq %r12, %rdi
callq 0xbf0c
leaq 0xb8(%rbx), %r13
incl %eax
movslq %eax, %r15
leaq -0x98(%rbp), %rax
andq $0x0, (%rax)
leaq -0x29(%rbp), %r14
movq %r14, %rdi
callq 0x531c
movq %r13, -0x40(%rbp)
movq %r13, %rdi
movq %r15, %rsi
leaq -0x98(%rbp), %rdx
movq %r14, %rcx
callq 0x17a40
leaq -0x29(%rbp), %rdi
callq 0x5a64
leaq -0x98(%rbp), %rdi
movq %r12, %rsi
callq 0xbf22
leaq -0x98(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20812
movq %r14, %rdi
callq 0x5556
movq %r12, %rdi
callq 0xb89c
movb %al, 0x30(%rbx)
movq %r12, %rdi
callq 0xbf0c
movl %eax, 0x34(%rbx)
movq %r12, %rdi
callq 0xbf16
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 0x5c3e(%rip), %xmm0     # 0x24058
movq %rbx, %rdi
callq 0x1e4b6
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e47f
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a64
jmp 0x1e48b
movq %rax, %r14
jmp 0x1e48b
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a64
jmp 0x1e494
movq %rax, %r14
jmp 0x1e494
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a64
jmp 0x1e49d
movq %rax, %r14
jmp 0x1e49d
movq %rax, %r14
leaq -0x29(%rbp), %rdi
callq 0x5a64
jmp 0x1e4a6
movq %rax, %r14
jmp 0x1e4a6
movq %rax, %r14
movq -0x40(%rbp), %rdi
callq 0x53a6
movq -0x48(%rbp), %rdi
callq 0x53a6
movq -0x50(%rbp), %rdi
callq 0x53a6
movq -0x58(%rbp), %rdi
callq 0x53a6
movq %rbx, %rdi
callq 0x5556
movq %r14, %rdi
callq 0x45a0