// File: TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::calculateChargeExchangePopulationEquation(double, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, double, double, double)
void RateEquations::calculateChargeExchangePopulationEquation(
	const double Nn,
	const std::vector<double>& Nzk,
	const std::vector<double>& Vzk,
	const double Te,
	const double Ne,
	const double plasma_ionisation_potential
	){
	
	std::vector<double>     cx_rec_to_below(Z+1, 0.0); //Rate (m^-3 s^-1)
	std::vector<double>   cx_rec_from_above(Z+1, 0.0);
	std::vector<double>   cx_rec_p_to_below(Z+1, 0.0); //Momentum (kg m/s s^-1 = N)
	std::vector<double> cx_rec_p_from_above(Z+1, 0.0);

	std::shared_ptr<RateCoefficient> cx_recombination_coefficient = rate_coefficients["cx_rec"];
	for(int k=0; k < Z; ++k){//N.b. iterating over all data indicies of the rate coefficient, hence the <
		double cx_recombination_coefficient_evaluated = cx_recombination_coefficient->call0D(k, Te, Ne);
		
		// Note that cx_recombination coefficients are indexed from 1 to Z
		int k_rec = k + 1; //The target charge state for recombination -- makes it a bit easier to understand

		double cx_recombination_rate_factor = cx_recombination_coefficient_evaluated * Nn;

		// Want both the target and source densities to be above the Nthres density threshold
		if((Nzk[k_rec] > Nthres) and (Nzk[k_rec-1] > Nthres)){
			cx_rec_to_below[k_rec]     = -cx_recombination_rate_factor * Nzk[k_rec];
			cx_rec_from_above[k_rec-1] = +cx_recombination_rate_factor * Nzk[k_rec];

			cx_rec_p_to_below[k_rec]     = -cx_recombination_rate_factor * mz * amu_to_kg * Vzk[k_rec];
			cx_rec_p_from_above[k_rec-1] = +cx_recombination_rate_factor * mz * amu_to_kg * Vzk[k_rec];
		}
		// Otherwise, the rates stay as default = 0
	}


	for(int k=0; k <= Z; ++k){
		std::vector<double> rates_for_stage          = {dNzk[k], cx_rec_to_below[k], cx_rec_from_above[k]}; //Add cx to the sum
		std::pair<double, double> neumaier_pair_dNzk = neumaierSum(rates_for_stage,dNzk_correction[k]); //Extend on previous compensation
		dNzk[k]                                      = neumaier_pair_dNzk.first;
		dNzk_correction[k]                           = neumaier_pair_dNzk.second; //Overwrite compensation with updated value

		std::vector<double> momentum_for_stage           = {F_zk[k], cx_rec_p_to_below[k], cx_rec_p_from_above[k]}; //Add cx to the sum
		std::pair<double, double> neumaier_pair_momentum = neumaierSum(momentum_for_stage,F_zk_correction[k]);
		F_zk[k]                                          = neumaier_pair_momentum.first; 
		F_zk_correction[k]                               = neumaier_pair_momentum.second; //Overwrite compensation with updated value
	}
	//For Neumaier summation of the change in Nn from the different rates 
	std::vector<double> dNn_from_stage(Z, 0.0); //Only need Z indices, but adding an extra to the end means that the calculation
	// can be performed in a single loop
	// Ionisation potential (in eV per transition) is not a rate coefficient, but is treated as one since the interpolation methods and
	// data shape are identical. This is used to calculate the effect of iz and rec on the electron energy (in Pcool).
	std::shared_ptr<RateCoefficient> ionisation_potential = rate_coefficients["ionisation_potential"];
	for(int k=0; k < Z; ++k){
		double ionisation_potential_evaluated            = ionisation_potential->call0D(k, Te, Ne);
		// Charge exchange simultaneously neutralises an impurity ion and ionises a dominant-species neutral. Modify Pcool to reflect this.
		Pcool                                            += eV_to_J * (ionisation_potential_evaluated-plasma_ionisation_potential) * cx_rec_from_above[k];

		dNn_from_stage[k] = -cx_rec_from_above[k]; //N.b. cx_rec_from_above[Z] = 0.0 always, included so we can use a single loop
	}
	
	std::pair<double, double> neumaier_pair_dNn = neumaierSum(dNn_from_stage);
	dNn = neumaier_pair_dNn.first + neumaier_pair_dNn.second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movsd %xmm1, -0x28(%rbp)
movsd %xmm2, -0x30(%rbp)
movsd %xmm3, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x280(%rbp)
movl 0x34(%rax), %eax
incl %eax
cltq
movq %rax, -0x278(%rbp)
movq $0x0, -0x58(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x58a0
movq -0x278(%rbp), %rsi
movq -0x270(%rbp), %rcx
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x26390
jmp 0x33af9
leaq -0x59(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rax
movl 0x34(%rax), %eax
incl %eax
cltq
movq %rax, -0x290(%rbp)
movq $0x0, -0x90(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x58a0
movq -0x290(%rbp), %rsi
movq -0x288(%rbp), %rcx
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x26390
jmp 0x33b58
leaq -0x91(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rax
movl 0x34(%rax), %eax
incl %eax
cltq
movq %rax, -0x2a0(%rbp)
movq $0x0, -0xb8(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x58a0
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rcx
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x26390
jmp 0x33bba
leaq -0xb9(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rax
movl 0x34(%rax), %eax
incl %eax
cltq
movq %rax, -0x2b0(%rbp)
movq $0x0, -0xe0(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x58a0
movq -0x2b0(%rbp), %rsi
movq -0x2a8(%rbp), %rcx
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x26390
jmp 0x33c1c
leaq -0xe1(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x45f0
movq -0x2b8(%rbp), %rdx
leaq 0x3cd2(%rip), %rsi      # 0x37929
leaq -0x118(%rbp), %rdi
callq 0x44d0
jmp 0x33c65
movq -0x2c0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x13990
movq %rax, -0x2c8(%rbp)
jmp 0x33c81
movq -0x2c8(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x13960
leaq -0x118(%rbp), %rdi
callq 0x4220
leaq -0x119(%rbp), %rdi
callq 0x4410
movl $0x0, -0x120(%rbp)
movq -0x280(%rbp), %rcx
movl -0x120(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x34010
leaq -0xf8(%rbp), %rdi
callq 0x5970
movq %rax, %rdi
movl -0x120(%rbp), %esi
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0x1aa40
movsd %xmm0, -0x2d0(%rbp)
jmp 0x33cfa
movsd -0x2d0(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
movsd -0x128(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x12c(%rbp), %rsi
callq 0x26b60
movq %rax, %rcx
movq -0x280(%rbp), %rax
movsd (%rcx), %xmm0
ucomisd 0x40(%rax), %xmm0
jbe 0x33ffa
movq -0x18(%rbp), %rdi
movl -0x12c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x26b60
movq %rax, %rcx
movq -0x280(%rbp), %rax
movsd (%rcx), %xmm0
ucomisd 0x40(%rax), %xmm0
jbe 0x33ffa
movsd -0x138(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x310(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x12c(%rbp), %rsi
callq 0x26b60
movsd -0x310(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x308(%rbp)
movslq -0x12c(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x5950
movsd -0x308(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0x138(%rbp), %xmm0
movsd %xmm0, -0x300(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x12c(%rbp), %rsi
callq 0x26b60
movsd -0x300(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x2f8(%rbp)
movl -0x12c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x5950
movsd -0x2f8(%rbp), %xmm0
movq %rax, %rcx
movq -0x280(%rbp), %rax
movsd %xmm0, (%rcx)
movsd -0x138(%rbp), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd 0x38(%rax), %xmm0
movsd 0x540e(%rip), %xmm1     # 0x39288
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2f0(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x12c(%rbp), %rsi
callq 0x26b60
movsd -0x2f0(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x2e8(%rbp)
movslq -0x12c(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x5950
movsd -0x2e8(%rbp), %xmm0
movq %rax, %rcx
movq -0x280(%rbp), %rax
movsd %xmm0, (%rcx)
movsd -0x138(%rbp), %xmm0
mulsd 0x38(%rax), %xmm0
movsd 0x53a0(%rip), %xmm1     # 0x39288
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2e0(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x12c(%rbp), %rsi
callq 0x26b60
movsd -0x2e0(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x2d8(%rbp)
movl -0x12c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0x5950
movsd -0x2d8(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x33ffa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x5930
jmp 0x34745
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x5930
jmp 0x3473c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x5930
jmp 0x34730
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe1(%rbp), %rdi
callq 0x5930
jmp 0x34724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x33fd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x4220
leaq -0x119(%rbp), %rdi
callq 0x4410
jmp 0x34718
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x3470c
jmp 0x33ffc
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x33cb6
movl $0x0, -0x13c(%rbp)
movq -0x280(%rbp), %rcx
movl -0x13c(%rbp), %eax
cmpl 0x34(%rcx), %eax
jg 0x343cf
movq -0x280(%rbp), %rdi
addq $0x70, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd (%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
movslq -0x13c(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x5950
movsd (%rax), %xmm0
movsd %xmm0, -0x178(%rbp)
movslq -0x13c(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x5950
movsd (%rax), %xmm0
movsd %xmm0, -0x170(%rbp)
leaq -0x180(%rbp), %rax
movq %rax, -0x168(%rbp)
movq $0x3, -0x160(%rbp)
leaq -0x181(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x58a0
movq -0x318(%rbp), %rcx
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
leaq -0x158(%rbp), %rdi
callq 0x26a40
jmp 0x340dd
leaq -0x181(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rdi
addq $0xa0, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd (%rax), %xmm0
leaq -0x158(%rbp), %rdi
callq 0x35490
movsd %xmm1, -0x328(%rbp)
movsd %xmm0, -0x320(%rbp)
jmp 0x34125
movq -0x280(%rbp), %rdi
movsd -0x328(%rbp), %xmm0
movsd -0x320(%rbp), %xmm1
movsd %xmm1, -0x198(%rbp)
movsd %xmm0, -0x190(%rbp)
movsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x340(%rbp)
addq $0x70, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd -0x340(%rbp), %xmm0
movq -0x280(%rbp), %rdi
movsd %xmm0, (%rax)
movsd -0x190(%rbp), %xmm0
movsd %xmm0, -0x338(%rbp)
addq $0xa0, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd -0x338(%rbp), %xmm0
movq -0x280(%rbp), %rdi
movsd %xmm0, (%rax)
addq $0x88, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd (%rax), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movslq -0x13c(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x5950
movsd (%rax), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movslq -0x13c(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x5950
movsd (%rax), %xmm0
movsd %xmm0, -0x1c8(%rbp)
leaq -0x1d8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq $0x3, -0x1b8(%rbp)
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x58a0
movq -0x330(%rbp), %rcx
movq -0x1c0(%rbp), %rsi
movq -0x1b8(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x26a40
jmp 0x34261
leaq -0x1d9(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rdi
addq $0xb8, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd (%rax), %xmm0
leaq -0x1b0(%rbp), %rdi
callq 0x35490
movsd %xmm1, -0x350(%rbp)
movsd %xmm0, -0x348(%rbp)
jmp 0x342a9
movq -0x280(%rbp), %rdi
movsd -0x350(%rbp), %xmm0
movsd -0x348(%rbp), %xmm1
movsd %xmm1, -0x1f0(%rbp)
movsd %xmm0, -0x1e8(%rbp)
movsd -0x1f0(%rbp), %xmm0
movsd %xmm0, -0x360(%rbp)
addq $0x88, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd -0x360(%rbp), %xmm0
movq -0x280(%rbp), %rdi
movsd %xmm0, (%rax)
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, -0x358(%rbp)
addq $0xb8, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x5950
movsd -0x358(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x1b0(%rbp), %rdi
callq 0x59b0
leaq -0x158(%rbp), %rdi
callq 0x59b0
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x3401a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x181(%rbp), %rdi
callq 0x5930
jmp 0x3470c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x343be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1d9(%rbp), %rdi
callq 0x5930
jmp 0x343be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x59b0
leaq -0x158(%rbp), %rdi
callq 0x59b0
jmp 0x3470c
movq -0x280(%rbp), %rax
movslq 0x34(%rax), %rax
movq %rax, -0x370(%rbp)
movq $0x0, -0x210(%rbp)
leaq -0x211(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x58a0
movq -0x370(%rbp), %rsi
movq -0x368(%rbp), %rcx
leaq -0x208(%rbp), %rdi
leaq -0x210(%rbp), %rdx
callq 0x26390
jmp 0x34422
leaq -0x211(%rbp), %rdi
callq 0x5930
movq -0x280(%rbp), %rax
movq %rax, -0x380(%rbp)
leaq -0x249(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x45f0
movq -0x378(%rbp), %rdx
leaq 0x3507(%rip), %rsi      # 0x37964
leaq -0x248(%rbp), %rdi
callq 0x44d0
jmp 0x3446b
movq -0x380(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x13990
movq %rax, -0x388(%rbp)
jmp 0x34487
movq -0x388(%rbp), %rsi
leaq -0x228(%rbp), %rdi
callq 0x13960
leaq -0x248(%rbp), %rdi
callq 0x4220
leaq -0x249(%rbp), %rdi
callq 0x4410
movl $0x0, -0x250(%rbp)
movq -0x280(%rbp), %rcx
movl -0x250(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x34646
leaq -0x228(%rbp), %rdi
callq 0x5970
movq %rax, %rdi
movl -0x250(%rbp), %esi
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0x1aa40
movsd %xmm0, -0x390(%rbp)
jmp 0x34500
movsd -0x390(%rbp), %xmm0
movsd %xmm0, -0x258(%rbp)
movsd -0x258(%rbp), %xmm1
subsd -0x38(%rbp), %xmm1
movsd 0x4d53(%rip), %xmm0     # 0x39278
mulsd %xmm1, %xmm0
movsd %xmm0, -0x3a0(%rbp)
movslq -0x250(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x5950
movsd -0x3a0(%rbp), %xmm0
movq %rax, %rcx
movq -0x280(%rbp), %rax
movsd (%rcx), %xmm2
movsd 0x60(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rax)
movslq -0x250(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x5950
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x398(%rbp)
movslq -0x250(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x5950
movsd -0x398(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x250(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x250(%rbp)
jmp 0x344bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x211(%rbp), %rdi
callq 0x5930
jmp 0x3470c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x34618
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x4220
leaq -0x249(%rbp), %rdi
callq 0x4410
jmp 0x34700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x5990
jmp 0x34700
leaq -0x208(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x35490
movsd %xmm1, -0x3b0(%rbp)
movsd %xmm0, -0x3a8(%rbp)
jmp 0x34667
movq -0x280(%rbp), %rax
movsd -0x3b0(%rbp), %xmm0
movsd -0x3a8(%rbp), %xmm1
movsd %xmm1, -0x268(%rbp)
movsd %xmm0, -0x260(%rbp)
movsd -0x268(%rbp), %xmm0
addsd -0x260(%rbp), %xmm0
movsd %xmm0, 0xe0(%rax)
leaq -0x228(%rbp), %rdi
callq 0x5990
leaq -0x208(%rbp), %rdi
callq 0x59b0
leaq -0xf8(%rbp), %rdi
callq 0x5990
leaq -0xd8(%rbp), %rdi
callq 0x59b0
leaq -0xb0(%rbp), %rdi
callq 0x59b0
leaq -0x88(%rbp), %rdi
callq 0x59b0
leaq -0x50(%rbp), %rdi
callq 0x59b0
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
leaq -0x208(%rbp), %rdi
callq 0x59b0
leaq -0xf8(%rbp), %rdi
callq 0x5990
leaq -0xd8(%rbp), %rdi
callq 0x59b0
leaq -0xb0(%rbp), %rdi
callq 0x59b0
leaq -0x88(%rbp), %rdi
callq 0x59b0
leaq -0x50(%rbp), %rdi
callq 0x59b0
movq -0x68(%rbp), %rdi
callq 0x45e0
nop