// File: tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::BedFileI::_ld(char const*, char const*, unsigned long const&, unsigned short const&, double&, double&, double&, double&)
void BedFileI::_ld(const char *snp1, const char *snp2, const size_t &N, const unsigned short &pad, double &rSq, double &Dprime, double &dcnt1, double &dcnt2){
	// Using the Gaunt et al. (2007) formulation
	// 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
	// However, then convert everything to the most common allele frequencies to make things compatible with Gaunt et al.
	// Using the notation in that paper, too, to make things more clear

	// constants
	const char allMiss = static_cast<char>(0x55); // all genotypes missing in a byte
	const char homDerv = static_cast<char>(0x00); // homozygous derived for all bit-pair positions

	// modifiable parameters
	double D     = 0.0;
	double p1    = 0.0; // frequency of the derived allele at snp1
	double q1    = 0.0; // frequency of the derived allele at snp2
	double f11   = 0.0; // frequency of the (hom. maj. allele @1, hom. maj.allel @2) haplotype; to be estimated; D = f11 - p1*q1
	double n11   = 0.0; // # of 1,1 homozygote haplotypes
	double n12   = 0.0; // # of hom. 1, heterozygous 2 haplotypes
	double n21   = 0.0; // # of het. 1, hom. 2 haplotypes
	double n22   = 0.0; // # of het. 1, het. 2 haplotypes
	double Npres = 0.0; // # 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;

	// Data missing at either locus are ignored (i.e. I am using pairwise-complete observations)
	for (size_t ind = 0; ind < N-1; ind++) { // leave the last byte out for now since it has padding bits (in general)
		if ( (snp1[ind] == allMiss) || (snp2[ind] == allMiss) ) { // a byte with all data missing; ignore (NOTE the OR)
			continue;
		}

		// go through the byte from the end
		for (size_t inByte = 0; inByte < 4; inByte++) {
			curBitPair1 = snp1[ind] & _masks[inByte];
			curBitPair2 = snp2[ind] & _masks[inByte];

			// Test missingness
			if ( (curBitPair1 == _tests.at('M')[inByte]) || (curBitPair2 == _tests.at('M')[inByte]) ) { // 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')[inByte]){
					q1  += 0.5;
					n12 += 1.0;
				}
			} else if (curBitPair1 == _tests.at('H')[inByte]){
				p1 += 0.5;
				if (curBitPair2 == homDerv) {
					q1  += 1.0;
					n21 += 1.0;
				} else if (curBitPair2 == _tests.at('H')[inByte]){
					q1  += 0.5;
					n22 += 1.0;
				}
			} else {
				if (curBitPair2 == homDerv) {
					q1 += 1.0;
				} else if (curBitPair2 == _tests.at('H')[inByte]){
					q1 += 0.5;
				}
			}
		}
	}
	// finally, deal with the padded byte
	for (size_t inByte = 0; inByte < (4 - pad); inByte++) { // not testing for sane values of pad, since this is a protected function and I can expect sane values in correct class implementation
		curBitPair1 = snp1[N-1] & _masks[inByte];
		curBitPair2 = snp2[N-1] & _masks[inByte];

		// Test missingness
		if ( (curBitPair1 == _tests.at('M')[inByte]) || (curBitPair2 == _tests.at('M')[inByte]) ) { // 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')[inByte]){
				q1  += 0.5;
				n12 += 1.0;
			}
		} else if (curBitPair1 == _tests.at('H')[inByte]){
			p1 += 0.5;
			if (curBitPair2 == homDerv) {
				q1  += 1.0;
				n21 += 1.0;
			} else if (curBitPair2 == _tests.at('H')[inByte]){
				q1  += 0.5;
				n22 += 1.0;
			}
		} else {
			if (curBitPair2 == homDerv) {
				q1 += 1.0;
			} else if (curBitPair2 == _tests.at('H')[inByte]){
				q1 += 0.5;
			}
		}
	}

	// minor allele counts
	dcnt1 = (p1 <= Npres - p1 ? 2.0*p1 : 2.0*(Npres - p1));
	dcnt2 = (q1 <= Npres - q1 ? 2.0*q1 : 2.0*(Npres - q1));

	if (Npres <= 1.0) {
		rSq    = -9.0;
		Dprime = -9.0;
		return;
	}
	if ( (dcnt1 == 0.0) || (dcnt2 == 0.0) ) { // even if the SNPs are pre-screened for polymorphism, the alternatives may correspond to missing at the other locus
		rSq    = -9.0;
		Dprime = -9.0;
		return;
	}
	if (n22 == Npres) { // if everyone is het, cannot determine LD because we don't know the phase
		rSq    = -9.0;
		Dprime = -9.0;
		return;
	}
	// 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  = (D*D)/(p1q1*p2q2);

		if (D < -10.0*EPS) {
			double Dmax = ( p1q1 <= p2q2 ? -p1q1 : -p2q2 ); // (9) of Gaunt et al.
			Dprime      = 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      = D/Dmax;
		} else {
			Dprime = 0.0;
		}

		return;
	}

	// 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    = -9.0;
					Dprime = -9.0;

					return;

				} 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    = -9.0;
				Dprime = -9.0;

				return;
			} 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  = (D*D)/(p1q1*p2q2);

	if (D < -10.0*EPS) {
		double Dmax = ( p1q1 <= p2q2 ? -p1q1 : -p2q2 ); // (9) of Gaunt et al.
		Dprime      = 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      = D/Dmax;
	} else {
		Dprime = 0.0;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq 0x20(%rbp), %rax
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 $0x55, -0x31(%rbp)
movb $0x0, -0x32(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
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 $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xcbff
movq -0x10(%rbp), %rax
movq -0x118(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x55, %eax
je 0xc83d
movq -0x18(%rbp), %rax
movq -0x118(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x55, %eax
jne 0xc842
jmp 0xcbe8
movq $0x0, -0x120(%rbp)
cmpq $0x4, -0x120(%rbp)
jae 0xcbe6
movq -0x10(%rbp), %rax
movq -0x118(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1b0(%rbp)
movq -0x120(%rbp), %rsi
leaq 0x1fb2a(%rip), %rdi     # 0x2c3a8
callq 0x1f1f0
movq %rax, %rcx
movl -0x1b0(%rbp), %eax
movsbl (%rcx), %ecx
andl %ecx, %eax
movb %al, -0x109(%rbp)
movq -0x18(%rbp), %rax
movq -0x118(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1ac(%rbp)
movq -0x120(%rbp), %rsi
leaq 0x1faee(%rip), %rdi     # 0x2c3a8
callq 0x1f1f0
movq %rax, %rcx
movl -0x1ac(%rbp), %eax
movsbl (%rcx), %ecx
andl %ecx, %eax
movb %al, -0x10a(%rbp)
movsbl -0x109(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movb $0x4d, -0x121(%rbp)
leaq 0x1fad2(%rip), %rdi     # 0x2c3c0
leaq -0x121(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x120(%rbp), %rsi
callq 0x43a0
movl -0x1a8(%rbp), %ecx
movsbl (%rax), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x1a1(%rbp)
je 0xc96b
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1b4(%rbp)
movb $0x4d, -0x122(%rbp)
leaq 0x1fa87(%rip), %rdi     # 0x2c3c0
leaq -0x122(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x120(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1b4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x1a1(%rbp)
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0xc977
jmp 0xc97c
jmp 0xcbcf
movsd 0x16b54(%rip), %xmm0    # 0x234d8
addsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsbl -0x109(%rbp), %eax
cmpl $0x0, %eax
jne 0xca53
movsd 0x16b32(%rip), %xmm0    # 0x234d8
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xc9e2
movsd 0x16b14(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x16b02(%rip), %xmm0    # 0x234d8
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xca4e
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movb $0x48, -0x123(%rbp)
leaq 0x1f9c3(%rip), %rdi     # 0x2c3c0
leaq -0x123(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x120(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1b8(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xca4c
movsd 0x16ad0(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x16a96(%rip), %xmm0    # 0x234d8
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xca4e
jmp 0xcbcd
movsbl -0x109(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movb $0x48, -0x124(%rbp)
leaq 0x1f952(%rip), %rdi     # 0x2c3c0
leaq -0x124(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x120(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1bc(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xcb4f
movsd 0x16a5b(%rip), %xmm0    # 0x23500
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xcae1
movsd 0x16a15(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x16a03(%rip), %xmm0    # 0x234d8
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xcb4d
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movb $0x48, -0x125(%rbp)
leaq 0x1f8c4(%rip), %rdi     # 0x2c3c0
leaq -0x125(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x120(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1c0(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xcb4b
movsd 0x169d1(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x16997(%rip), %xmm0    # 0x234d8
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
jmp 0xcb4d
jmp 0xcbcb
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xcb6f
movsd 0x16975(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xcbc9
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1c4(%rbp)
movb $0x48, -0x126(%rbp)
leaq 0x1f836(%rip), %rdi     # 0x2c3c0
leaq -0x126(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x120(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1c4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xcbc7
movsd 0x16943(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xcbc9
jmp 0xcbcb
jmp 0xcbcd
jmp 0xcbcf
movq -0x120(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x120(%rbp)
jmp 0xc84d
jmp 0xcbe8
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0xc7fa
movq $0x0, -0x130(%rbp)
movq -0x130(%rbp), %rax
movq -0x28(%rbp), %rcx
movzwl (%rcx), %edx
movl $0x4, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0xcfbe
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1d4(%rbp)
movq -0x130(%rbp), %rsi
leaq 0x1f756(%rip), %rdi     # 0x2c3a8
callq 0x1f1f0
movq %rax, %rcx
movl -0x1d4(%rbp), %eax
movsbl (%rcx), %ecx
andl %ecx, %eax
movb %al, -0x109(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1d0(%rbp)
movq -0x130(%rbp), %rsi
leaq 0x1f716(%rip), %rdi     # 0x2c3a8
callq 0x1f1f0
movq %rax, %rcx
movl -0x1d0(%rbp), %eax
movsbl (%rcx), %ecx
andl %ecx, %eax
movb %al, -0x10a(%rbp)
movsbl -0x109(%rbp), %eax
movl %eax, -0x1cc(%rbp)
movb $0x4d, -0x131(%rbp)
leaq 0x1f6fa(%rip), %rdi     # 0x2c3c0
leaq -0x131(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x130(%rbp), %rsi
callq 0x43a0
movl -0x1cc(%rbp), %ecx
movsbl (%rax), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x1c5(%rbp)
je 0xcd43
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1d8(%rbp)
movb $0x4d, -0x132(%rbp)
leaq 0x1f6af(%rip), %rdi     # 0x2c3c0
leaq -0x132(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x130(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1d8(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x1c5(%rbp)
movb -0x1c5(%rbp), %al
testb $0x1, %al
jne 0xcd4f
jmp 0xcd54
jmp 0xcfa7
movsd 0x1677c(%rip), %xmm0    # 0x234d8
addsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsbl -0x109(%rbp), %eax
cmpl $0x0, %eax
jne 0xce2b
movsd 0x1675a(%rip), %xmm0    # 0x234d8
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xcdba
movsd 0x1673c(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1672a(%rip), %xmm0    # 0x234d8
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xce26
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1dc(%rbp)
movb $0x48, -0x133(%rbp)
leaq 0x1f5eb(%rip), %rdi     # 0x2c3c0
leaq -0x133(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x130(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1dc(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xce24
movsd 0x166f8(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x166be(%rip), %xmm0    # 0x234d8
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xce26
jmp 0xcfa5
movsbl -0x109(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movb $0x48, -0x134(%rbp)
leaq 0x1f57a(%rip), %rdi     # 0x2c3c0
leaq -0x134(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x130(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1e0(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xcf27
movsd 0x16683(%rip), %xmm0    # 0x23500
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xceb9
movsd 0x1663d(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1662b(%rip), %xmm0    # 0x234d8
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xcf25
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movb $0x48, -0x135(%rbp)
leaq 0x1f4ec(%rip), %rdi     # 0x2c3c0
leaq -0x135(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x130(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1e4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xcf23
movsd 0x165f9(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x165bf(%rip), %xmm0    # 0x234d8
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
jmp 0xcf25
jmp 0xcfa3
movsbl -0x10a(%rbp), %eax
cmpl $0x0, %eax
jne 0xcf47
movsd 0x1659d(%rip), %xmm0    # 0x234d8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xcfa1
movsbl -0x10a(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movb $0x48, -0x136(%rbp)
leaq 0x1f45e(%rip), %rdi     # 0x2c3c0
leaq -0x136(%rbp), %rsi
callq 0x1f210
movq %rax, %rdi
movq -0x130(%rbp), %rsi
callq 0x43a0
movq %rax, %rcx
movl -0x1e8(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xcf9f
movsd 0x1656b(%rip), %xmm0    # 0x23500
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xcfa1
jmp 0xcfa3
jmp 0xcfa5
jmp 0xcfa7
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
jmp 0xcc0a
movsd -0x48(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
subsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xcfea
movsd 0x164f5(%rip), %xmm0    # 0x234d0
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
jmp 0xd008
movsd -0x80(%rbp), %xmm1
subsd -0x48(%rbp), %xmm1
movsd 0x164d4(%rip), %xmm0    # 0x234d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1f0(%rbp)
movsd -0x1f0(%rbp), %xmm0
movq 0x18(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x50(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xd044
movsd 0x1649b(%rip), %xmm0    # 0x234d0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
jmp 0xd062
movsd -0x80(%rbp), %xmm1
subsd -0x50(%rbp), %xmm1
movsd 0x1647a(%rip), %xmm0    # 0x234d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1f8(%rbp)
movsd -0x1f8(%rbp), %xmm0
movq 0x20(%rbp), %rax
movsd %xmm0, (%rax)
movsd 0x1645e(%rip), %xmm0    # 0x234d8
ucomisd -0x80(%rbp), %xmm0
jb 0xd0a6
movq -0x30(%rbp), %rax
movsd 0x16483(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq 0x10(%rbp), %rax
movsd 0x16473(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xe010
movq 0x18(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd0bb
jp 0xd0bb
jmp 0xd0ce
movq 0x20(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd0f3
jp 0xd0f3
movq -0x30(%rbp), %rax
movsd 0x16436(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq 0x10(%rbp), %rax
movsd 0x16426(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xe010
movsd -0x78(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
jne 0xd126
jp 0xd126
movq -0x30(%rbp), %rax
movsd 0x16403(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq 0x10(%rbp), %rax
movsd 0x163f3(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xe010
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 0xd358
jp 0xd358
movsd -0x60(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
movsd 0x1637b(%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 0x16327(%rip), %xmm0    # 0x234d8
subsd -0x48(%rbp), %xmm0
movsd 0x1631a(%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
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movsd 0x1632b(%rip), %xmm0    # 0x23528
ucomisd -0x40(%rbp), %xmm0
jbe 0xd298
movsd -0x88(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xd247
movsd -0x88(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x200(%rbp)
jmp 0xd26e
movsd -0x90(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x200(%rbp)
movsd -0x200(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x140(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0xd353
movsd -0x40(%rbp), %xmm0
movsd 0x1628b(%rip), %xmm1    # 0x23530
ucomisd %xmm1, %xmm0
jbe 0xd346
movsd -0x48(%rbp), %xmm0
movsd 0x1621c(%rip), %xmm1    # 0x234d8
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x16203(%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 0xd30f
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x208(%rbp)
jmp 0xd31f
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x208(%rbp)
movsd -0x208(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x148(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0xd351
movq 0x10(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xd353
jmp 0xe010
movsd -0x60(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
movsd 0x16191(%rip), %xmm2    # 0x23500
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
movsd 0x1616c(%rip), %xmm2    # 0x23500
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x98(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd 0x16127(%rip), %xmm1    # 0x234e0
subsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0xa0(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd 0x16106(%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 0x160cc(%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 0x16091(%rip), %xmm0    # 0x234d0
mulsd -0x80(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm2
movsd 0x1606c(%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 0x15ff4(%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 0x15f86(%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 0x15f57(%rip), %xmm1    # 0x234f0
divsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0xe0(%rbp), %xmm0
mulsd -0xe0(%rbp), %xmm0
movsd 0x15f3b(%rip), %xmm1    # 0x234f8
divsd %xmm1, %xmm0
movsd -0xd0(%rbp), %xmm1
movsd 0x15f1f(%rip), %xmm2    # 0x234f0
mulsd -0xc0(%rbp), %xmm2
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd 0x15ef7(%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 0x15e18(%rip), %xmm1    # 0x234e0
ucomisd %xmm1, %xmm0
jbe 0xd785
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x218(%rbp)
movsd -0x108(%rbp), %xmm0
callq 0x4280
subsd -0x100(%rbp), %xmm0
movsd 0x15dd1(%rip), %xmm1    # 0x234d0
mulsd -0xc0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4090
movaps %xmm0, %xmm1
movsd -0x218(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x210(%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 0x15d75(%rip), %xmm1    # 0x234d0
mulsd -0xc0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4090
movaps %xmm0, %xmm1
movsd -0x210(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xde54
movsd 0x15d7b(%rip), %xmm0    # 0x23508
ucomisd -0x108(%rbp), %xmm0
jbe 0xdcc4
movsd -0x100(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x250(%rbp)
movsd -0xf8(%rbp), %xmm0
callq 0x4280
movaps %xmm0, %xmm1
movsd -0x250(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x4300
movsd 0x15d05(%rip), %xmm1    # 0x234f0
divsd %xmm1, %xmm0
movsd %xmm0, -0x150(%rbp)
movsd -0xf0(%rbp), %xmm0
callq 0x4280
movaps %xmm0, %xmm1
movsd 0x15cc1(%rip), %xmm0    # 0x234d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x158(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x248(%rbp)
movsd -0x158(%rbp), %xmm0
movsd %xmm0, -0x240(%rbp)
movsd -0x150(%rbp), %xmm0
callq 0x4650
movsd -0x248(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x240(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x238(%rbp)
movsd -0x158(%rbp), %xmm0
movsd %xmm0, -0x230(%rbp)
movsd 0x15c8d(%rip), %xmm0    # 0x23520
addsd -0x150(%rbp), %xmm0
callq 0x4650
movsd -0x238(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x230(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x168(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
movsd -0x158(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movsd 0x15c2d(%rip), %xmm0    # 0x23518
addsd -0x150(%rbp), %xmm0
callq 0x4650
movsd -0x228(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x220(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0x160(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xd947
movsd -0x160(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xda77
movsd -0x168(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xd96f
movsd -0x168(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xd9ce
movsd -0x170(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xd997
movsd -0x170(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xd9bc
movq -0x30(%rbp), %rax
movsd 0x15b6d(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq 0x10(%rbp), %rax
movsd 0x15b5d(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xe010
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xda72
movsd -0x170(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xd9f6
movsd -0x170(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xda05
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xda70
movsd -0x168(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x15aa4(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x170(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x15a89(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xda53
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x258(%rbp)
jmp 0xda63
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x258(%rbp)
movsd -0x258(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xda72
jmp 0xdcbf
movsd -0x168(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xdaa3
movsd -0x168(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xdb4a
movsd -0x170(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xdacb
movsd -0x170(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xdada
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xdb45
movsd -0x160(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x159cf(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x170(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x159b4(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xdb28
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x260(%rbp)
jmp 0xdb38
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x260(%rbp)
movsd -0x260(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xdcbd
movsd -0x170(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xdb72
movsd -0x170(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xdbe2
movsd -0x168(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x15937(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x160(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x1591c(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xdbc0
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x268(%rbp)
jmp 0xdbd0
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x268(%rbp)
movsd -0x268(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xdcbb
movsd -0x168(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x158c7(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x160(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x158ac(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xdc30
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x270(%rbp)
jmp 0xdc40
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x270(%rbp)
movsd -0x270(%rbp), %xmm0
movsd %xmm0, -0x178(%rbp)
movsd -0x178(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x15859(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x170(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x1583e(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xdc9e
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
jmp 0xdcae
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
movsd -0x278(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xdcbd
jmp 0xdcbf
jmp 0xde52
movsd -0x100(%rbp), %xmm0
movsd 0x157fc(%rip), %xmm1    # 0x234d0
mulsd -0xc0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4090
movsd %xmm0, -0x180(%rbp)
movsd -0xe8(%rbp), %xmm0
addsd -0x180(%rbp), %xmm0
movsd %xmm0, -0x188(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0x180(%rbp), %xmm1
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x190(%rbp)
movsd -0x188(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xdd4d
movsd -0x188(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xddac
movsd -0x190(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xdd75
movsd -0x190(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xdd9a
movq -0x30(%rbp), %rax
movsd 0x1578f(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
movq 0x10(%rbp), %rax
movsd 0x1577f(%rip), %xmm0    # 0x23510
movsd %xmm0, (%rax)
jmp 0xe010
movsd -0x190(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xde50
movsd -0x190(%rbp), %xmm1
movsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xddd4
movsd -0x190(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xdde3
movsd -0x188(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xde4e
movsd -0x188(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
movaps 0x156c6(%rip), %xmm0    # 0x234c0
pand %xmm0, %xmm1
movsd -0x190(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movaps 0x156ab(%rip), %xmm2    # 0x234c0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xde31
movsd -0x188(%rbp), %xmm0
movsd %xmm0, -0x280(%rbp)
jmp 0xde41
movsd -0x190(%rbp), %xmm0
movsd %xmm0, -0x280(%rbp)
movsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0xde50
jmp 0xde52
jmp 0xde54
movsd -0x58(%rbp), %xmm0
subsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x1566a(%rip), %xmm0    # 0x234d8
subsd -0x48(%rbp), %xmm0
movsd 0x1565d(%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
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movsd 0x1566e(%rip), %xmm0    # 0x23528
ucomisd -0x40(%rbp), %xmm0
jbe 0xdf55
movsd -0x88(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xdf04
movsd -0x88(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x288(%rbp)
jmp 0xdf2b
movsd -0x90(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x288(%rbp)
movsd -0x288(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x198(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0xe010
movsd -0x40(%rbp), %xmm0
movsd 0x155ce(%rip), %xmm1    # 0x23530
ucomisd %xmm1, %xmm0
jbe 0xe003
movsd -0x48(%rbp), %xmm0
movsd 0x1555f(%rip), %xmm1    # 0x234d8
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x15546(%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 0xdfcc
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x290(%rbp)
jmp 0xdfdc
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x290(%rbp)
movsd -0x290(%rbp), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x1a0(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0xe00e
movq 0x10(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xe010
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nopl (%rax)