// File: tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::BedFileI::_ld(char const*, char const*, sampFiles::PopIndex const&, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&)
void BedFileI::_ld(const char *snp1, const char *snp2, const PopIndex &popID, vector<double> &rSq, vector<double> &Dprime, vector<double> &dcnt1, vector<double> &dcnt2){

	// The data in .bed files are strictly biallelic by definition of the format, so that makes things easier.
	// Using derived alleles because they are mostly at low frequency so the expected number of calculations is low

	// constants
	const char homDerv = static_cast<char>(0x00); // homozygous derived for all bit-pair positions

	// modifiable parameters
	double D;
	double p1;     // frequency of the derived allele at snp1
	double q1;     // frequency of the derived allele at snp2
	double f11;    // frequency of the (hom. maj. allele @1, hom. maj.allel @2) haplotype; to be estimated; D = f11 - p1*q1
	double n11;    // # of 1,1 homozygote haplotypes
	double n12;    // # of hom. 1, heterozygous 2 haplotypes
	double n21;    // # of het. 1, hom. 2 haplotypes
	double n22;    // # of het. 1, het. 2 haplotypes
	double Npres;  // # of present genotypes (present at both loci)
	double p1q1;   // p1*q1
	double p2q2;   // p2*q2
	// f11 min and max
	double f11Min;
	double f11Max;
	// re-used intermediate variables
	double opq;       // 1-2p-2q
	double smn;       // 2n11+n12+n21
	double ppq;       // p1+q1
	// qubic equation coefficients
	double a;
	double b;
	double c;
	double d;
	// decision variables
	double bda;    // b/a
	double xN;
	double deltaSq;
	double hSq;
	double gammaN;
	double Delta3;

	char curBitPair1;
	char curBitPair2;

	for (size_t iPop = 0; iPop < popID.popNumber(); iPop++) {
		// reset everything
		p1    = 0.0;
		q1    = 0.0;
		f11   = 0.0;
		n11   = 0.0;
		n12   = 0.0;
		n21   = 0.0;
		n22   = 0.0;
		Npres = 0.0;

		for (auto popIt = popID[iPop].begin(); popIt != popID[iPop].end(); ++popIt) {
			size_t byteInd    = (*popIt)/4;
			size_t bitPairInd = (*popIt) % 4; // will automatically index from the end of the byte
			curBitPair1 = snp1[byteInd] & _masks[bitPairInd];
			curBitPair2 = snp2[byteInd] & _masks[bitPairInd];

			// Test miss
			if ( (curBitPair1 == _tests.at('M')[bitPairInd]) || (curBitPair2 == _tests.at('M')[bitPairInd]) ) { // must use .at() because _tests is const
				continue;
			}
			Npres += 1.0;
			// Go through all the pairwise possibilities; adding up gametes (one per diploid)
			if (curBitPair1 == homDerv) {
				p1 += 1.0;
				if (curBitPair2 == homDerv) {
					q1  += 1.0;
					n11 += 1.0;
				} else if (curBitPair2 == _tests.at('H')[bitPairInd]){
					q1  += 0.5;
					n12 += 1.0;
				}
			} else if (curBitPair1 == _tests.at('H')[bitPairInd]){
				p1 += 0.5;
				if (curBitPair2 == homDerv) {
					q1  += 1.0;
					n21 += 1.0;
				} else if (curBitPair2 == _tests.at('H')[bitPairInd]){
					q1  += 0.5;
					n22 += 1.0;
				}
			} else {
				if (curBitPair2 == homDerv) {
					q1 += 1.0;
				} else if (curBitPair2 == _tests.at('H')[bitPairInd]){
					q1 += 0.5;
				}
			}
		}
		dcnt1[iPop]  = (p1 <= Npres - p1 ? 2.0*p1 : 2.0*(Npres - p1));
		dcnt2[iPop]  = (q1 <= Npres - q1 ? 2.0*q1 : 2.0*(Npres - q1));

		if (Npres <= 1.0) {
			rSq[iPop]    = -9.0;
			Dprime[iPop] = -9.0;
			continue;
		}
		if ( (dcnt1[iPop] == 0.0) || (dcnt2[iPop] == 0.0) ) { // even if the SNPs are pre-screened for polymorphism, the alternatives may correspond to missing at the other locus
			rSq[iPop]    = -9.0;
			Dprime[iPop] = -9.0;
			continue;
		}
		if (n22 == Npres) { // if everyone is het, cannot determine LD because we don't know the phase
			rSq[iPop]    = -9.0;
			Dprime[iPop] = -9.0;
			continue;
		}
		// Finish calculating statistics if everything is sane
		p1   = p1/Npres;
		q1   = q1/Npres;
		// intermediate values
		p1q1 = p1*q1;

		if (n22 == 0.0) { // no het/het match-ups; means I can directly enumerate haplotypes
			f11        = (n11 + 0.5*(n12 + n21))/Npres;
			D          = f11 - p1q1;
			p2q2       = (1.0-p1)*(1.0-q1);
			rSq[iPop]  = (D*D)/(p1q1*p2q2);

			if (D < -10.0*EPS) {
				double Dmax  = ( p1q1 <= p2q2 ? -p1q1 : -p2q2 ); // (9) of Gaunt et al.
				Dprime[iPop] = D/Dmax;
			} else if (D > 10.0*EPS) {
				p1q1 = p1*(1.0 - q1);
				p2q2 = (1.0 - p1)*q1;

				double Dmax  = ( p1q1 <= p2q2 ? p1q1 : p2q2 ); // (9) of Gaunt et al.
				Dprime[iPop] = D/Dmax;
			} else {
				Dprime[iPop] = 0.0;
			}

		} else {
			// There is n22, so need to estimate f11 via ML (using Gaunt et al. cubic equation); they say f11 is between major alleles, but that is not necessary. Results will be the same for minor or any other combination
			// Calculate the bracketing values for f11:
			f11Min = n11 + 0.5*(n12 + n21); // i.e., all the het/het haplotypes are crossovers
			f11Max = f11Min + 0.5*n22;      // i.e., all het/het haplotypes are in phase
			f11Min = f11Min/Npres - 100.0*EPS; // some padding to take into account round-off errors
			f11Max = f11Max/Npres + 100.0*EPS;
			// re-used auxiliary variables
			ppq = p1 + q1;
			opq = 1.0 - 2.0*ppq;
			smn = 2.0*n11 + n12 + n21;
			// coefficients
			a   = 2.0*Npres; // will need to multiply again later to make 4N; doing this to re-use the 2N
			b   = a*opq - 2.0*smn - n22;
			c   = a*p1q1 - smn*opq - n22*(1.0 - ppq);
			d   = -smn*p1q1;
			a  *= 2.0;
			// decision variables
			bda     = b/a;
			xN      = -bda/3.0;
			deltaSq = bda*bda/9.0 - c/(3.0*a);
			hSq     = 4.0*a*a*deltaSq*deltaSq*deltaSq;
			gammaN  = xN*( xN*( a*xN + b ) + c ) + d;
			Delta3  = gammaN*gammaN - hSq;

			// now decide how many roots we have
			if (Delta3 > 100.0*EPS) { // everything is cool, only one distinct root
				f11 = xN + cbrt((sqrt(Delta3) - gammaN)/(2.0*a)) + cbrt(-(sqrt(Delta3) + gammaN)/(2.0*a));
			} else if (Delta3 < -100.0*EPS){ // Three roots; worst case scenario
				double theta  = acos(-gammaN/sqrt(hSq))/3.0;
				double ddelta = 2.0*sqrt(deltaSq);
				double alpha  = xN + ddelta*cos(theta);
				double beta   = xN + ddelta*cos(2.0*PI/3.0 + theta);
				double gamma  = xN + ddelta*cos(4.0*PI/3.0 + theta);

				if ( (alpha < f11Min) || (alpha > f11Max) ) {
					if ( (beta < f11Min) || (beta > f11Max) ) {
						if ( (gamma < f11Min) || (gamma > f11Max) ) {
							rSq[iPop]    = -9.0;
							Dprime[iPop] = -9.0;
							continue;
						} else {
							f11 = gamma;
						}
					} else if ( (gamma < f11Min) || (gamma > f11Max) ) {
						f11 = beta;
					} else {
						// two plausible roots; choose the one with smallest |D|
						f11 = (fabs(beta - p1q1) <= fabs(gamma - p1q1) ? beta : gamma);
					}
				} else {
					if ( (beta < f11Min) || (beta > f11Max) ) {
						if ( (gamma < f11Min) || (gamma > f11Max) ) {
							f11 = alpha;
						} else {
							// two plausible roots; choose the one with smallest |D|
							f11 = (fabs(alpha - p1q1) <= fabs(gamma - p1q1) ? alpha : gamma);
						}
					} else if ( (gamma < f11Min) || (gamma > f11Max) ) {
						// two plausible roots; choose the one with smallest |D|
						f11 = (fabs(beta - p1q1) <= fabs(alpha - p1q1) ? beta : alpha);
					} else {
						// three plausible roots; choose the one with smallest |D|
						double minAB = (fabs(beta - p1q1) <= fabs(alpha - p1q1) ? beta : alpha);
						f11 = (fabs(minAB - p1q1) <= fabs(gamma - p1q1) ? minAB : gamma);
					}

				}
			} else { // Delta3 == 0; two different roots
				double mu    = cbrt(gammaN/(2.0*a));
				double alpha = xN + mu;
				double gamma = xN - 2.0*mu;
				if ( (alpha < f11Min) || (alpha > f11Max) ) { // f11 cannot be greater than min(p1, q1)
					if ( (gamma < f11Min) || (gamma > f11Max) ) {
						rSq[iPop]    = -9.0;
						Dprime[iPop] = -9.0;
						continue;
					} else {
						f11 = gamma;
					}
				} else {
					if ( (gamma < f11Min) || (gamma > f11Max) ) { // impossible gamma; going with alpha
						f11 = alpha;
					} else { // both doable; conservatively choose the one minimzing |D|
						f11 = (fabs(alpha - p1q1) <= fabs(gamma - p1q1) ? alpha : gamma);
					}
				}

			}

			D         = f11 - p1q1;
			p2q2      = (1.0-p1)*(1.0-q1);
			rSq[iPop] = (D*D)/(p1q1*p2q2);

			if (D < -10.0*EPS) {
				double Dmax  = ( p1q1 <= p2q2 ? -p1q1 : -p2q2 ); // (9) of Gaunt et al.
				Dprime[iPop] = D/Dmax;
			} else if (D > 10.0*EPS) {
				p1q1 = p1*(1.0 - q1);
				p2q2 = (1.0 - p1)*q1;

				double Dmax  = ( p1q1 <= p2q2 ? p1q1 : p2q2 ); // (9) of Gaunt et al.
				Dprime[iPop] = D/Dmax;
			} else {
				Dprime[iPop] = 0.0;
			}

		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1f240
movq %rax, %rcx
movq -0x1b0(%rbp), %rax
cmpq %rcx, %rax
jae 0xf6cc
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x1f260
movq %rax, %rdi
callq 0x1f290
movq %rax, -0x120(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x1f260
movq %rax, %rdi
callq 0x1f300
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x1f2c0
testb $0x1, %al
jne 0xe11e
jmp 0xe4d7
leaq -0x120(%rbp), %rdi
callq 0x1f330
movq (%rax), %rax
shrq $0x2, %rax
movq %rax, -0x130(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x1f330
movq (%rax), %rax
andq $0x3, %rax
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rax
movq -0x130(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1c0(%rbp)
movq -0x138(%rbp), %rsi
leaq 0x1e233(%rip), %rdi     # 0x2c3a8
callq 0x1f1f0
movq %rax, %rcx
movl -0x1c0(%rbp), %eax
movsbl (%rcx), %ecx
andl %ecx, %eax
movb %al, -0x109(%rbp)
movq -0x18(%rbp), %rax
movq -0x130(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1bc(%rbp)
movq -0x138(%rbp), %rsi
leaq 0x1e1f7(%rip), %rdi     # 0x2c3a8
callq 0x1f1f0
movq %rax, %rcx
movl -0x1bc(%rbp), %eax
movsbl (%rcx), %ecx
andl %ecx, %eax
movb %al, -0x10a(%rbp)
movsbl -0x109(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movb $0x4d, -0x139(%rbp)
leaq 0x1e1db(%rip), %rdi     # 0x2c3c0
leaq -0x139(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x138(%rbp), %rsi
callq 0x43a0
movl -0x1b8(%rbp), %ecx
movsbl (%rax), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x1b1(%rbp)
je 0xe262
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1c4(%rbp)
movb $0x4d, -0x13a(%rbp)
leaq 0x1e190(%rip), %rdi     # 0x2c3c0
leaq -0x13a(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x138(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1c4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x1b1(%rbp)
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0xe26e
jmp 0xe273
jmp 0xe4c6
movsd 0x1525d(%rip), %xmm0    # 0x234d8
addsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsbl -0x109(%rbp), %eax
cmpl $0x0, %eax
jne 0xe34a
movsd 0x1523b(%rip), %xmm0    # 0x234d8
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xe2d9
movsd 0x1521d(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1520b(%rip), %xmm0    # 0x234d8
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xe345
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1c8(%rbp)
movb $0x48, -0x13b(%rbp)
leaq 0x1e0cc(%rip), %rdi     # 0x2c3c0
leaq -0x13b(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x138(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1c8(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xe343
movsd 0x151d9(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1519f(%rip), %xmm0    # 0x234d8
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xe345
jmp 0xe4c4
movsbl -0x109(%rbp), %eax
movl %eax, -0x1cc(%rbp)
movb $0x48, -0x13c(%rbp)
leaq 0x1e05b(%rip), %rdi     # 0x2c3c0
leaq -0x13c(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x138(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1cc(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xe446
movsd 0x15164(%rip), %xmm0    # 0x23500
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xe3d8
movsd 0x1511e(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1510c(%rip), %xmm0    # 0x234d8
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xe444
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1d0(%rbp)
movb $0x48, -0x13d(%rbp)
leaq 0x1dfcd(%rip), %rdi     # 0x2c3c0
leaq -0x13d(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x138(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1d0(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xe442
movsd 0x150da(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x150a0(%rip), %xmm0    # 0x234d8
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
jmp 0xe444
jmp 0xe4c2
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xe466
movsd 0x1507e(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xe4c0
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1d4(%rbp)
movb $0x48, -0x13e(%rbp)
leaq 0x1df3f(%rip), %rdi     # 0x2c3c0
leaq -0x13e(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x138(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1d4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xe4be
movsd 0x1504c(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xe4c0
jmp 0xe4c2
jmp 0xe4c4
jmp 0xe4c6
leaq -0x120(%rbp), %rdi
callq 0x1f350
jmp 0xe0e3
movsd -0x48(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
subsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xe503
movsd 0x14fdc(%rip), %xmm0    # 0x234d0
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x1e0(%rbp)
jmp 0xe521
movsd -0x80(%rbp), %xmm1
subsd -0x48(%rbp), %xmm1
movsd 0x14fbb(%rip), %xmm0    # 0x234d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1e0(%rbp)
movsd -0x1e0(%rbp), %xmm0
movsd %xmm0, -0x1e8(%rbp)
movq 0x10(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0x50(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xe579
movsd 0x14f66(%rip), %xmm0    # 0x234d0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
jmp 0xe597
movsd -0x80(%rbp), %xmm1
subsd -0x50(%rbp), %xmm1
movsd 0x14f45(%rip), %xmm0    # 0x234d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1f0(%rbp)
movsd -0x1f0(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movq 0x18(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x1f8(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd 0x14f0d(%rip), %xmm0    # 0x234d8
ucomisd -0x80(%rbp), %xmm0
jb 0xe60f
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14f26(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14f0a(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xf6b5
movq 0x10(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xe630
jp 0xe630
jmp 0xe64f
movq 0x18(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xe68c
jp 0xe68c
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14ea9(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14e8d(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xf6b5
movsd -0x78(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
jne 0xe6d7
jp 0xe6d7
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14e5e(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14e42(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xf6b5
movsd -0x48(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x50(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x48(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x78(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xe969
jp 0xe969
movsd -0x60(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
movsd 0x14dca(%rip), %xmm2    # 0x23500
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x14d76(%rip), %xmm0    # 0x234d8
subsd -0x48(%rbp), %xmm0
movsd 0x14d69(%rip), %xmm1    # 0x234d8
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x200(%rbp)
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x200(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd 0x14d5e(%rip), %xmm0    # 0x23528
ucomisd -0x40(%rbp), %xmm0
jbe 0xe881
movsd -0x88(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xe814
movsd -0x88(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x208(%rbp)
jmp 0xe83b
movsd -0x90(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x208(%rbp)
movsd -0x208(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x148(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x210(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xe964
movsd -0x40(%rbp), %xmm0
movsd 0x14ca2(%rip), %xmm1    # 0x23530
ucomisd %xmm1, %xmm0
jbe 0xe94b
movsd -0x48(%rbp), %xmm0
movsd 0x14c33(%rip), %xmm1    # 0x234d8
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x14c1a(%rip), %xmm0    # 0x234d8
subsd -0x48(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x88(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xe8f8
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x218(%rbp)
jmp 0xe908
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x218(%rbp)
movsd -0x218(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x150(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x220(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xe962
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xe964
jmp 0xf6b3
movsd -0x60(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
movsd 0x14b80(%rip), %xmm2    # 0x23500
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
movsd 0x14b5b(%rip), %xmm2    # 0x23500
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x98(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd 0x14b16(%rip), %xmm1    # 0x234e0
subsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0xa0(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd 0x14af5(%rip), %xmm1    # 0x234e0
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x48(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0xb8(%rbp), %xmm1
addsd %xmm1, %xmm1
movsd 0x14abb(%rip), %xmm0    # 0x234d8
subsd %xmm1, %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x60(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd 0x14a80(%rip), %xmm0    # 0x234d0
mulsd -0x80(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm2
movsd 0x14a5b(%rip), %xmm1    # 0x234d0
mulsd -0xb0(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd -0x78(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0xc0(%rbp), %xmm1
movsd -0x88(%rbp), %xmm2
movsd -0xb0(%rbp), %xmm0
mulsd -0xa8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
movsd 0x149e3(%rip), %xmm2    # 0x234d8
subsd -0xb8(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0xb0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd -0x88(%rbp), %xmm0
movsd %xmm0, -0xd8(%rbp)
movsd 0x14975(%rip), %xmm0    # 0x234d0
mulsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0xc8(%rbp), %xmm0
divsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0xe0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x14946(%rip), %xmm1    # 0x234f0
divsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0xe0(%rbp), %xmm0
mulsd -0xe0(%rbp), %xmm0
movsd 0x1492a(%rip), %xmm1    # 0x234f8
divsd %xmm1, %xmm0
movsd -0xd0(%rbp), %xmm1
movsd 0x1490e(%rip), %xmm2    # 0x234f0
mulsd -0xc0(%rbp), %xmm2
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd 0x148e6(%rip), %xmm0    # 0x234e8
mulsd -0xc0(%rbp), %xmm0
mulsd -0xc0(%rbp), %xmm0
mulsd -0xf0(%rbp), %xmm0
mulsd -0xf0(%rbp), %xmm0
mulsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm2
movsd -0xc0(%rbp), %xmm3
movsd -0xe8(%rbp), %xmm4
movsd -0xc8(%rbp), %xmm1
mulsd %xmm4, %xmm3
addsd %xmm1, %xmm3
movsd -0xd0(%rbp), %xmm1
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd -0xd8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x100(%rbp), %xmm0
movsd -0x100(%rbp), %xmm2
movsd -0xf8(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
movsd -0x108(%rbp), %xmm0
movsd 0x14807(%rip), %xmm1    # 0x234e0
ucomisd %xmm1, %xmm0
jbe 0xed96
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x230(%rbp)
movsd -0x108(%rbp), %xmm0
callq 0x4280
subsd -0x100(%rbp), %xmm0
movsd 0x147c0(%rip), %xmm1    # 0x234d0
mulsd -0xc0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4090
movaps %xmm0, %xmm1
movsd -0x230(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x228(%rbp)
movsd -0x108(%rbp), %xmm0
callq 0x4280
addsd -0x100(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x14764(%rip), %xmm1    # 0x234d0
mulsd -0xc0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4090
movaps %xmm0, %xmm1
movsd -0x228(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf495
movsd 0x1476a(%rip), %xmm0    # 0x23508
ucomisd -0x108(%rbp), %xmm0
jbe 0xf2ed
movsd -0x100(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x268(%rbp)
movsd -0xf8(%rbp), %xmm0
callq 0x4280
movaps %xmm0, %xmm1
movsd -0x268(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x4300
movsd 0x146f4(%rip), %xmm1    # 0x234f0
divsd %xmm1, %xmm0
movsd %xmm0, -0x158(%rbp)
movsd -0xf0(%rbp), %xmm0
callq 0x4280
movaps %xmm0, %xmm1
movsd 0x146b0(%rip), %xmm0    # 0x234d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x260(%rbp)
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x258(%rbp)
movsd -0x158(%rbp), %xmm0
callq 0x4650
movsd -0x260(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x258(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x168(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x250(%rbp)
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x248(%rbp)
movsd 0x1467c(%rip), %xmm0    # 0x23520
addsd -0x158(%rbp), %xmm0
callq 0x4650
movsd -0x250(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x248(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x240(%rbp)
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x238(%rbp)
movsd 0x1461c(%rip), %xmm0    # 0x23518
addsd -0x158(%rbp), %xmm0
callq 0x4650
movsd -0x240(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x238(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x178(%rbp)
movsd -0x168(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xef58
movsd -0x168(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf0a0
movsd -0x170(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xef80
movsd -0x170(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xeff7
movsd -0x178(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xefa8
movsd -0x178(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xefe5
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14550(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x14534(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xf6b5
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf09b
movsd -0x178(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf01f
movsd -0x178(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf02e
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf099
movsd -0x170(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x1447b(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x178(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x14460(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xf07c
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x270(%rbp)
jmp 0xf08c
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x270(%rbp)
movsd -0x270(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf09b
jmp 0xf2e8
movsd -0x170(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf0cc
movsd -0x170(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf173
movsd -0x178(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf0f4
movsd -0x178(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf103
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf16e
movsd -0x168(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x143a6(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x178(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x1438b(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xf151
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
jmp 0xf161
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
movsd -0x278(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf2e6
movsd -0x178(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf19b
movsd -0x178(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf20b
movsd -0x170(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x1430e(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x168(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x142f3(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xf1e9
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x280(%rbp)
jmp 0xf1f9
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x280(%rbp)
movsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf2e4
movsd -0x170(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x1429e(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x168(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x14283(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xf259
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x288(%rbp)
jmp 0xf269
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x288(%rbp)
movsd -0x288(%rbp), %xmm0
movsd %xmm0, -0x180(%rbp)
movsd -0x180(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x14230(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x178(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x14215(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xf2c7
movsd -0x180(%rbp), %xmm0
movsd %xmm0, -0x290(%rbp)
jmp 0xf2d7
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x290(%rbp)
movsd -0x290(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf2e6
jmp 0xf2e8
jmp 0xf493
movsd -0x100(%rbp), %xmm0
movsd 0x141d3(%rip), %xmm1    # 0x234d0
mulsd -0xc0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4090
movsd %xmm0, -0x188(%rbp)
movsd -0xe8(%rbp), %xmm0
addsd -0x188(%rbp), %xmm0
movsd %xmm0, -0x190(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0x188(%rbp), %xmm1
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x198(%rbp)
movsd -0x190(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf376
movsd -0x190(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf3ed
movsd -0x198(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf39e
movsd -0x198(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf3db
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x1415a(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd 0x1413e(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xf6b5
movsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf491
movsd -0x198(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xf415
movsd -0x198(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xf424
movsd -0x190(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf48f
movsd -0x190(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x14085(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x198(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x1406a(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xf472
movsd -0x190(%rbp), %xmm0
movsd %xmm0, -0x298(%rbp)
jmp 0xf482
movsd -0x198(%rbp), %xmm0
movsd %xmm0, -0x298(%rbp)
movsd -0x298(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xf491
jmp 0xf493
jmp 0xf495
movsd -0x58(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x14029(%rip), %xmm0    # 0x234d8
subsd -0x48(%rbp), %xmm0
movsd 0x1401c(%rip), %xmm1    # 0x234d8
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x2a0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x2a0(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd 0x14011(%rip), %xmm0    # 0x23528
ucomisd -0x40(%rbp), %xmm0
jbe 0xf5ce
movsd -0x88(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xf561
movsd -0x88(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x2a8(%rbp)
jmp 0xf588
movsd -0x90(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x2a8(%rbp)
movsd -0x2a8(%rbp), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x1a0(%rbp), %xmm0
movsd %xmm0, -0x2b0(%rbp)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x2b0(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xf6b1
movsd -0x40(%rbp), %xmm0
movsd 0x13f55(%rip), %xmm1    # 0x23530
ucomisd %xmm1, %xmm0
jbe 0xf698
movsd -0x48(%rbp), %xmm0
movsd 0x13ee6(%rip), %xmm1    # 0x234d8
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x13ecd(%rip), %xmm0    # 0x234d8
subsd -0x48(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x88(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xf645
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x2b8(%rbp)
jmp 0xf655
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x2b8(%rbp)
movsd -0x2b8(%rbp), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x1a8(%rbp), %xmm0
movsd %xmm0, -0x2c0(%rbp)
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
movsd -0x2c0(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xf6af
movq -0x30(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x1f370
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xf6b1
jmp 0xf6b3
jmp 0xf6b5
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0xe05a
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
nopw %cs:(%rax,%rax)