// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]eph_converter/src/Broadcast.cpp
// Function: BroadcastEphUtils::m_brd2xyz(char const*, char const*, int, double, double*, double*, double*, double*, int*)
int BroadcastEphUtils::m_brd2xyz(const char* mode, const char* cprn, int wk,
		double sow, double* xsat, double* clk, double* dtmin, double* tgd,
		int* iode) {
	int i, isys, lfind,f_prn;
	double GMEARTH, EARTH_ROTATE;
	double dt, dtc, pos[3], svpos[3], geovel[3], detavel[3];
	double a, xn, xm, ex, e, v0, vs, vc, phi, ccc, sss, du, dr, di, r, u, xi,
			xx, yy, intv;
	double xnode, xpdot, ypdot, asc, xinc, xp, yp, asctrm, v;
	double edot, cosf2, cose2, nudot, rdot, udot, idot, r_bds;
	double xsat0[3];
	double A0, AK, n0, delta_na;
	list<GPSEPH>::iterator gpsItr;
	GPSEPH* eph;
	intv = 2.0;
	switch (cprn[0]) {
	case 'G':
		GMEARTH = 3.986005E14;
		EARTH_ROTATE = 7.2921151467E-5;
		break;
	case 'E':
		GMEARTH = 3.986004418E14;
		EARTH_ROTATE = 7.2921151467E-5;
		break;
	case 'C':
		GMEARTH = 3.986004418E14;
		EARTH_ROTATE = 7.2921150E-5;
		break;
	case 'J':
		GMEARTH = 3.986005E14;
		EARTH_ROTATE = 7.2921150E-5;
		break;
	default:
		GMEARTH = GME;
		EARTH_ROTATE = E_ROTATE;
		break;
	}
	lfind = 0;
	*clk = 0;
	*dtmin = 4.0;
	isys = index_string(SYS, cprn[0]);
	double tmax = 0.0, ttag;
	for (gpsItr = this->gnssEph[isys].begin();
			gpsItr != this->gnssEph[isys].end(); ++gpsItr) {
		if (strstr((*gpsItr).cprn, cprn)) {
			dt = (wk - (*gpsItr).week) * 168.0 + (sow - (*gpsItr).toe) / 3600.0;
			if (*iode >= 0) {
				if(cprn[0] == 'C'){
					if ((*gpsItr).aode == *iode || (*gpsItr).iodc == *iode
							|| (*gpsItr).aodc == *iode) {
						*dtmin = fabs(dt);
						eph = &(*gpsItr);
						lfind = 1;
						break;
					}
				}else{
					if ((*gpsItr).aode == *iode ) {
						*dtmin = fabs(dt);
						eph = &(*gpsItr);
						lfind = 1;
						break;
					}
				}
			} else if (*iode == -1) {
				if (fabs(dt) <= *dtmin) {
					*dtmin = fabs(dt);
					eph = &(*gpsItr);
					lfind = 1;
				}
			} else if (*iode == -2) {
				ttag = (*gpsItr).mjd * 86400.0 + (*gpsItr).sod;
				// For the real-time process : always the newest
				if (ttag > tmax && fabs(dt) <= intv) {
					tmax = ttag;
					*dtmin = fabs(dt);
					lfind = 1;
					eph = &(*gpsItr);
				}
			}
		}
	}
	if (lfind == 0)
		return 0;
	*iode = eph->aode;
	dt = (wk - eph->week) * 604800.0 + sow - eph->toe;
	dtc = (wk * 7 + 44244 - eph->mjd) * 86400.0 + sow - eph->sod;

	*clk = eph->a0 + (eph->a1 + eph->a2 * dtc) * dtc;
	*tgd = eph->tgd;
	if(cprn[0] == 'C'){
		double f1 = BDS_B1;
		double f2 = BDS_B3;
		double a1 = f1 * f1 / (f1 * f1 - f2 * f2);
		double tgd =  eph->tgd; /**B1/B3  B2/B3*/
		*clk = *clk - a1 * tgd ;
	}
	if (strstr(mode, "ynn") != NULL)
		return 1;
	if (cprn[0] == 'C' && eph->signal_idx > 6) {
		f_prn = atoi(cprn + 1);
		if ((f_prn >= 38 && f_prn <= 40) || (f_prn >= 59 && f_prn <= 63)) {
			A0 = A_ref_igso + eph->delta_A;
		} else {
			A0 = A_ref_MEO + eph->delta_A;
		}
		a = AK = A0 + eph->A_DOT * dt;
		n0 = sqrt(GMEARTH / A0 / A0 / A0);
		delta_na = eph->dn + 0.5 * eph->delta_n_dot * dt;
		xn = n0 + delta_na;
		xm = eph->m0 + xn * dt;
	} else {
		a = eph->roota * eph->roota;
		xn = sqrt(GMEARTH / a / a / a);
		xn = xn + eph->dn;
		xm = eph->m0 + xn * dt;
	}
	ex = xm;
	e = eph->e;
	for (i = 0; i < 12; i++)
		ex = xm + e * sin(ex);
	v0 = 1.0 - e * cos(ex);
	vs = sqrt(1.0 - e * e) * sin(ex) / v0;
	vc = (cos(ex) - e) / v0;
	v = fabs(asin(vs));
	// decide vs
	if (vc >= 0) {
		if (vs < 0)
			v = 2.0 * PI - v;
	} else {
		if (vs <= 0)
			v = PI + v;
		else
			v = PI - v;
	}

	phi = v + eph->omega;
	ccc = cos(2.0 * phi);
	sss = sin(2.0 * phi);
	du = eph->cuc * ccc + eph->cus * sss;
	dr = eph->crc * ccc + eph->crs * sss;
	di = eph->cic * ccc + eph->cis * sss;
	r = a * (1.0 - e * cos(ex)) + dr;
	u = phi + du;

	xi = eph->i0 + eph->idot * dt + di;
	xx = r * cos(u);
	yy = r * sin(u);

	if (strstr(cprn, "C01") != NULL || strstr(cprn, "C02") != NULL
			|| strstr(cprn, "C03") != NULL || strstr(cprn, "C04") != NULL
			|| strstr(cprn, "C05") != NULL || strstr(cprn, "C59") != NULL) {
		xnode = eph->omega0 + eph->omegadot * dt;
	} else {
		xnode = eph->omega0 + (eph->omegadot - EARTH_ROTATE) * dt;
	}

	//IF THE TIME SYSTEM IS DIFFERENT,IT IS BETTER TO COMPUTE THE ORBIT IN THEIR OWN SYSTEM,
	//BECAUSE TOE WILL BE DIFFERENT IF YOU TRANSFORM IT TO OTHER SYSTEM

	xnode = xnode - EARTH_ROTATE * eph->toe;
	xsat[0] = xx * cos(xnode) - yy * cos(xi) * sin(xnode);
	xsat[1] = xx * sin(xnode) + yy * cos(xi) * cos(xnode);
	xsat[2] = yy * sin(xi);

	for (i = 0; i < 3; i++)
		svpos[i] = xsat[i];

	if (strstr(cprn, "C01") != NULL || strstr(cprn, "C02") != NULL
			|| strstr(cprn, "C03") != NULL || strstr(cprn, "C04") != NULL
			|| strstr(cprn, "C05") != NULL || strstr(cprn, "C59") != NULL) {
		// rx(-5.0*rad) for GEO
		pos[0] = xsat[0];
		pos[1] = cos(-5.0 * DEG2RAD) * xsat[1] + sin(-5.0 * DEG2RAD) * xsat[2];
		pos[2] = sin(5.0 * DEG2RAD) * xsat[1] + cos(-5.0 * DEG2RAD) * xsat[2];

		// rz(wearth*dt)
		xsat[0] = pos[0] * cos(EARTH_ROTATE * dt)
				+ pos[1] * sin(EARTH_ROTATE * dt);
		xsat[1] = -1.0 * pos[0] * sin(EARTH_ROTATE * dt)
				+ pos[1] * cos(EARTH_ROTATE * dt);
		xsat[2] = pos[2];
	}
	if (strstr(mode, "yyn") != NULL)
		return 1;
	asc = xnode;
	xinc = xi;
	xp = xx;
	yp = yy;

	edot = xn / (1 - e * cos(ex));
	cosf2 = cos(v / 2) * cos(v / 2);
	cose2 = cos(ex / 2) * cos(ex / 2);
	nudot = sqrt((1 + e) / (1 - e)) * cosf2 * edot / cose2;

	rdot = a * e * edot * sin(ex)
			+ 2 * (eph->crs * ccc - eph->crc * sss) * nudot;

	udot = (1 + 2.0 * eph->cus * ccc - 2.0 * eph->cuc * sss) * nudot;

	idot = eph->idot + 2.0 * (eph->cic * ccc - eph->cis * sss) * nudot;

	if (strstr(cprn, "C01") != NULL || strstr(cprn, "C02") != NULL
			|| strstr(cprn, "C03") != NULL || strstr(cprn, "C04") != NULL
			|| strstr(cprn, "C05") != NULL || strstr(cprn, "C59") != NULL ) {
		asctrm = eph->omegadot;
	} else {
		asctrm = eph->omegadot - EARTH_ROTATE;
	}

	xpdot = rdot * cos(u) - r * sin(u) * udot;
	ypdot = rdot * sin(u) + r * cos(u) * udot;

	xsat[3] = xpdot * cos(asc) - ypdot * cos(xinc) * sin(asc)
			+ yp * sin(asc) * sin(xinc) * idot - xp * sin(asc) * asctrm
			- yp * cos(xinc) * cos(asc) * asctrm;
	xsat[4] = xpdot * sin(asc) + ypdot * cos(xinc) * cos(asc)
			- yp * cos(asc) * sin(xinc) * idot + xp * cos(asc) * asctrm
			- yp * cos(xinc) * sin(asc) * asctrm;
	xsat[5] = ypdot * sin(xinc) + yp * cos(xinc) * idot;

	if (strstr(cprn, "C01") != NULL || strstr(cprn, "C02") != NULL
			|| strstr(cprn, "C03") != NULL || strstr(cprn, "C04") != NULL
			|| strstr(cprn, "C05") != NULL || strstr(cprn, "C59") != NULL) {
		// rx(-5.0*rad) for GEO
		geovel[0] = xsat[3];
		geovel[1] = cos(-5.0 * DEG2RAD) * xsat[4]
				+ sin(-5.0 * DEG2RAD) * xsat[5];
		geovel[2] = sin(5.0 * DEG2RAD) * xsat[4]
				+ cos(-5.0 * DEG2RAD) * xsat[5];

		// rz(wearth*dt)
		detavel[0] = geovel[0] * cos(EARTH_ROTATE * dt)
				+ geovel[1] * sin(EARTH_ROTATE * dt);
		detavel[1] = -1.0 * geovel[0] * sin(EARTH_ROTATE * dt)
				+ geovel[1] * cos(EARTH_ROTATE * dt);
		detavel[2] = geovel[2];

		// dot(R(w*t))*R(i)*XPOS
		geovel[0] = svpos[0];
		geovel[1] = cos(-5.0 * DEG2RAD) * svpos[1]
				+ sin(-5.0 * DEG2RAD) * svpos[2];
		geovel[2] = sin(5.0 * DEG2RAD) * svpos[1]
				+ cos(-5.0 * DEG2RAD) * svpos[2];

		// rz(wearth*dt)
		xsat[3] = EARTH_ROTATE
				* (-1.0 * geovel[0] * sin(EARTH_ROTATE * dt)
						+ geovel[1] * cos(EARTH_ROTATE * dt));
		xsat[4] = EARTH_ROTATE
				* (-1.0 * geovel[0] * cos(EARTH_ROTATE * dt)
						- geovel[1] * sin(EARTH_ROTATE * dt));
		xsat[5] = 0.0;

		// summary
		xsat[3] += detavel[0];
		xsat[4] += detavel[1];
		xsat[5] += detavel[2];
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movsd %xmm0, -0x90(%rbp)
movq %rcx, -0x38(%rbp)
movq %rdx, %r14
movq %rdi, %r12
movb (%rdx), %al
addb $-0x43, %al
cmpb $0x7, %al
movq %r8, -0x108(%rbp)
movq %rsi, -0x48(%rbp)
ja 0x7269
movzbl %al, %eax
shll $0x3, %eax
leaq 0x6c6a(%rip), %rcx      # 0xdeb0
movsd (%rax,%rcx), %xmm0
movsd %xmm0, -0x98(%rbp)
leaq 0x6c96(%rip), %rcx      # 0xdef0
movsd (%rax,%rcx), %xmm0
movsd %xmm0, -0xb0(%rbp)
jmp 0x7289
movsd 0x6a97(%rip), %xmm0     # 0xdd08
movsd %xmm0, -0xb0(%rbp)
movsd 0x6a8f(%rip), %xmm0     # 0xdd10
movsd %xmm0, -0x98(%rbp)
movq 0x20(%rbp), %rbx
movq %r9, -0xd0(%rbp)
movq $0x0, (%r9)
movabsq $0x4010000000000000, %rax # imm = 0x4010000000000000
movq 0x10(%rbp), %rcx
movq %rax, (%rcx)
movsbl (%r14), %esi
leaq 0x6bc9(%rip), %rdi      # 0xde80
callq 0xb3de
cltq
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %r13
addq $0x28, %r13
movq (%r13), %r15
xorps %xmm0, %xmm0
cvtsi2sdl -0x38(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
cmpq %r13, %r15
je 0x741c
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x60(%rbp)
leaq 0x10(%r15), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x30b0
testq %rax, %rax
je 0x7403
movsd -0x50(%rbp), %xmm0
subsd 0xc8(%r15), %xmm0
movsd -0x90(%rbp), %xmm1
subsd 0x78(%r15), %xmm1
divsd 0x5ce0(%rip), %xmm1     # 0xd010
mulsd 0x69e0(%rip), %xmm0     # 0xdd18
addsd %xmm1, %xmm0
movl (%rbx), %eax
testl %eax, %eax
js 0x738a
cmpb $0x43, (%r14)
movl 0x38(%r15), %ecx
jne 0x73b1
cmpl %eax, %ecx
je 0x7420
movsd 0x110(%r15), %xmm2
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm2
jne 0x7370
jnp 0x7420
movsd 0xf8(%r15), %xmm2
ucomisd %xmm1, %xmm2
jne 0x7403
jp 0x7403
jmp 0x7420
cmpl $-0x2, %eax
je 0x73b7
cmpl $-0x1, %eax
jne 0x7403
andpd 0x5ce4(%rip), %xmm0     # 0xd080
movq 0x10(%rbp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0x7403
movsd -0x30(%rbp), %xmm1
jmp 0x73eb
cmpl %eax, %ecx
jne 0x7403
jmp 0x7420
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%r15), %xmm1
mulsd 0x5c68(%rip), %xmm1     # 0xd030
addsd 0x18(%r15), %xmm1
ucomisd -0x30(%rbp), %xmm1
jbe 0x7403
andpd 0x5ca3(%rip), %xmm0     # 0xd080
movsd 0x693b(%rip), %xmm2     # 0xdd20
ucomisd %xmm0, %xmm2
jb 0x7403
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x60(%rbp)
movq %r12, -0x40(%rbp)
movsd %xmm1, -0x30(%rbp)
movq (%r15), %r15
cmpq %r13, %r15
jne 0x72f4
cmpl $0x0, -0x60(%rbp)
sete %al
movq -0x40(%rbp), %r12
jmp 0x7432
movb $0x1, %al
jmp 0x7432
andpd 0x5c58(%rip), %xmm0     # 0xd080
movq 0x10(%rbp), %rax
movlpd %xmm0, (%rax)
xorl %eax, %eax
xorl %r15d, %r15d
testb %al, %al
jne 0x82d5
movl 0x28(%r12), %eax
movl %eax, (%rbx)
movsd -0x50(%rbp), %xmm0
subsd 0xb8(%r12), %xmm0
mulsd 0x68cd(%rip), %xmm0     # 0xdd28
movsd -0x90(%rbp), %xmm1
addsd %xmm1, %xmm0
subsd 0x68(%r12), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x38(%rbp), %rcx
leal (,%rcx,8), %eax
subl %ecx, %eax
subl 0x4(%r12), %eax
addl $0xacd4, %eax           # imm = 0xACD4
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x5b97(%rip), %xmm0     # 0xd030
movq 0x18(%rbp), %rax
addsd %xmm1, %xmm0
subsd 0x8(%r12), %xmm0
movsd 0x20(%r12), %xmm1
mulsd %xmm0, %xmm1
addsd 0x18(%r12), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%r12), %xmm1
movq -0xd0(%rbp), %rcx
movsd %xmm1, (%rcx)
movsd 0xd8(%r12), %xmm0
movsd %xmm0, (%rax)
cmpb $0x43, (%r14)
jne 0x74fe
movsd 0xd8(%r12), %xmm0
mulsd 0x683a(%rip), %xmm0     # 0xdd30
addsd (%rcx), %xmm0
movsd %xmm0, (%rcx)
leaq 0x6a2b(%rip), %rsi      # 0xdf30
movq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x30b0
movl $0x1, %r15d
testq %rax, %rax
jne 0x82d5
cmpb $0x43, (%r14)
jne 0x75b0
movsd 0xf8(%r12), %xmm0
ucomisd 0x67fc(%rip), %xmm0     # 0xdd38
jbe 0x75b0
leaq 0x1(%r14), %rdi
callq 0x3420
cmpl $0x3f, %eax
ja 0x82ea
movl %eax, %eax
movabsq $-0x7fffe4000000000, %rcx # imm = 0xF80001C000000000
btq %rax, %rcx
jae 0x82ea
movsd 0x67d2(%rip), %xmm2     # 0xdd40
movsd -0xb0(%rbp), %xmm0
addsd 0x1d8(%r12), %xmm2
movsd 0x1e0(%r12), %xmm1
mulsd -0x50(%rbp), %xmm1
movsd %xmm1, -0x78(%rbp)
divsd %xmm2, %xmm0
divsd %xmm2, %xmm0
divsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x75f9
sqrtsd %xmm0, %xmm0
jmp 0x760e
movsd 0x60(%r12), %xmm1
mulsd %xmm1, %xmm1
movsd -0xb0(%rbp), %xmm0
divsd %xmm1, %xmm0
divsd %xmm1, %xmm0
movsd %xmm1, -0x78(%rbp)
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x75e7
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0x75f0
callq 0x3230
movapd %xmm0, %xmm1
addsd 0x38(%r12), %xmm1
jmp 0x763e
movsd %xmm2, -0x90(%rbp)
callq 0x3230
movsd -0x90(%rbp), %xmm2
movsd -0x78(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x78(%rbp)
movsd 0x1e8(%r12), %xmm1
mulsd 0x6722(%rip), %xmm1     # 0xdd50
mulsd -0x50(%rbp), %xmm1
addsd 0x38(%r12), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0xf0(%rbp)
mulsd -0x50(%rbp), %xmm1
addsd 0x40(%r12), %xmm1
movsd 0x50(%r12), %xmm0
movaps %xmm0, -0x90(%rbp)
movl $0xc, %ebx
movsd %xmm1, -0x30(%rbp)
movapd %xmm1, %xmm0
callq 0x30a0
mulsd -0x90(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
decl %ebx
jne 0x766e
movsd %xmm0, -0x40(%rbp)
callq 0x34e0
movapd 0x679a(%rip), %xmm1     # 0xde30
movapd -0x90(%rbp), %xmm3
xorpd %xmm3, %xmm1
movapd %xmm1, -0x150(%rbp)
mulsd %xmm3, %xmm0
movsd 0x66a2(%rip), %xmm2     # 0xdd58
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x76e3
sqrtsd %xmm0, %xmm0
jmp 0x76e8
callq 0x3230
movsd %xmm0, -0x38(%rbp)
movq -0x108(%rbp), %rbx
movsd -0x40(%rbp), %xmm0
callq 0x30a0
mulsd -0x38(%rbp), %xmm0
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x34e0
subsd -0x90(%rbp), %xmm0
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x3460
andpd 0x5945(%rip), %xmm0     # 0xd080
movsd -0x30(%rbp), %xmm1
ucomisd 0x5900(%rip), %xmm1     # 0xd048
jae 0x775f
xorpd %xmm1, %xmm1
ucomisd -0x38(%rbp), %xmm1
jae 0x777c
movsd 0x660b(%rip), %xmm1     # 0xdd68
jmp 0x7772
xorpd %xmm1, %xmm1
ucomisd -0x38(%rbp), %xmm1
jbe 0x7784
movsd 0x65ee(%rip), %xmm1     # 0xdd60
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x7784
addsd 0x65e4(%rip), %xmm0     # 0xdd68
movsd 0x98(%r12), %xmm1
movapd %xmm0, -0x120(%rbp)
addsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x34e0
movsd %xmm0, -0x100(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x30a0
movsd 0x58(%r12), %xmm1
mulsd %xmm0, %xmm1
movsd 0x48(%r12), %xmm2
movsd -0x100(%rbp), %xmm3
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, -0x60(%rbp)
movsd 0x30(%r12), %xmm1
mulsd %xmm0, %xmm1
movsd 0x90(%r12), %xmm2
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, -0xd0(%rbp)
movsd 0x80(%r12), %xmm1
movsd %xmm0, -0x128(%rbp)
mulsd %xmm0, %xmm1
movsd 0x70(%r12), %xmm0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x34e0
mulsd -0x150(%rbp), %xmm0
addsd 0x6505(%rip), %xmm0     # 0xdd58
mulsd -0x78(%rbp), %xmm0
addsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x60(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0xa8(%r12), %xmm1
mulsd -0x50(%rbp), %xmm1
addsd 0x88(%r12), %xmm1
addsd -0x38(%rbp), %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0x34e0
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x30a0
mulsd -0x70(%rbp), %xmm0
movapd %xmm0, -0xd0(%rbp)
leaq 0x666d(%rip), %rsi      # 0xdf34
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x793c
leaq 0x665d(%rip), %rsi      # 0xdf38
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x793c
leaq 0x664d(%rip), %rsi      # 0xdf3c
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x793c
leaq 0x663d(%rip), %rsi      # 0xdf40
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x793c
leaq 0x662d(%rip), %rsi      # 0xdf44
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x793c
leaq 0x661d(%rip), %rsi      # 0xdf48
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
je 0x82f7
movsd 0xa0(%r12), %xmm0
mulsd -0x50(%rbp), %xmm0
addsd 0x78(%r12), %xmm0
movsd 0x68(%r12), %xmm1
mulsd -0x98(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x34e0
movsd %xmm0, -0xb0(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x68(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
movsd -0x68(%rbp), %xmm1
mulsd -0xd0(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0xb0(%rbp), %xmm0
mulsd -0xe0(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0xb0(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
mulsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x34e0
mulsd -0x68(%rbp), %xmm0
movsd -0xb0(%rbp), %xmm1
mulsd -0xe0(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rbx)
movsd -0x38(%rbp), %xmm0
callq 0x30a0
mulsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd %xmm0, 0x10(%rbx)
movsd (%rbx), %xmm0
movaps %xmm0, -0x140(%rbp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0xd8(%rbp)
leaq 0x64ec(%rip), %rsi      # 0xdf34
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7abd
leaq 0x64dc(%rip), %rsi      # 0xdf38
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7abd
leaq 0x64cc(%rip), %rsi      # 0xdf3c
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7abd
leaq 0x64bc(%rip), %rsi      # 0xdf40
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7abd
leaq 0x64ac(%rip), %rsi      # 0xdf44
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7abd
leaq 0x649c(%rip), %rsi      # 0xdf48
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
je 0x7bac
movsd (%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x8(%rbx), %xmm3
movsd 0x629d(%rip), %xmm0     # 0xdd70
movsd -0xf8(%rbp), %xmm2
mulsd %xmm2, %xmm0
movsd 0x6291(%rip), %xmm1     # 0xdd78
movapd %xmm3, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm0, %xmm4
movsd %xmm4, -0xb8(%rbp)
mulsd 0x627d(%rip), %xmm3     # 0xdd80
mulsd %xmm2, %xmm1
addsd %xmm1, %xmm3
movsd %xmm3, -0x130(%rbp)
movsd -0x98(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0x34e0
movsd %xmm0, -0xe8(%rbp)
movsd -0xb0(%rbp), %xmm0
callq 0x30a0
mulsd -0xb8(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
movsd -0xb0(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0xe8(%rbp)
movsd -0xb0(%rbp), %xmm0
callq 0x34e0
mulsd -0xb8(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rbx)
movsd -0x130(%rbp), %xmm0
movsd %xmm0, 0x10(%rbx)
leaq 0x6399(%rip), %rsi      # 0xdf4c
movq %r13, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x82d5
movaps 0x6265(%rip), %xmm0     # 0xde30
xorps -0xd0(%rbp), %xmm0
movaps %xmm0, -0xb0(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x34e0
movapd -0x150(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd 0x6161(%rip), %xmm0     # 0xdd58
addsd %xmm0, %xmm1
movsd -0xf0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movapd -0x120(%rbp), %xmm0
mulsd 0x6131(%rip), %xmm0     # 0xdd50
movapd %xmm0, -0x120(%rbp)
callq 0x34e0
movsd %xmm0, -0x48(%rbp)
movapd -0x120(%rbp), %xmm0
callq 0x34e0
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x6100(%rip), %xmm0     # 0xdd50
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
callq 0x34e0
movsd %xmm0, -0x68(%rbp)
movsd -0xb8(%rbp), %xmm0
callq 0x34e0
movapd %xmm0, %xmm3
mulsd -0x68(%rbp), %xmm3
movapd -0x90(%rbp), %xmm2
movapd %xmm2, %xmm0
movsd 0x60c7(%rip), %xmm1     # 0xdd58
addsd %xmm1, %xmm0
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7cad
sqrtsd %xmm0, %xmm0
jmp 0x7cc4
movsd %xmm3, -0x68(%rbp)
callq 0x3230
movsd -0x68(%rbp), %xmm3
movapd -0x90(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0xf0(%rbp), %xmm0
mulsd %xmm0, %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x78(%rbp), %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x30a0
movsd 0x90(%r12), %xmm4
movsd -0x128(%rbp), %xmm3
mulsd %xmm3, %xmm4
movsd 0x30(%r12), %xmm1
movsd -0x100(%rbp), %xmm2
mulsd %xmm2, %xmm1
subsd %xmm4, %xmm1
addsd %xmm1, %xmm1
movsd -0x48(%rbp), %xmm4
mulsd %xmm4, %xmm1
mulsd -0x78(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x48(%r12), %xmm1
movsd 0x58(%r12), %xmm0
addsd %xmm0, %xmm0
mulsd %xmm2, %xmm0
addsd 0x5ff4(%rip), %xmm0     # 0xdd58
mulsd 0x601c(%rip), %xmm1     # 0xdd88
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm4, %xmm1
movsd %xmm1, -0xb8(%rbp)
movsd 0x80(%r12), %xmm0
mulsd %xmm3, %xmm0
movsd 0x70(%r12), %xmm1
mulsd %xmm2, %xmm1
subsd %xmm0, %xmm1
addsd %xmm1, %xmm1
mulsd %xmm4, %xmm1
addsd 0xa8(%r12), %xmm1
movsd %xmm1, -0x78(%rbp)
leaq 0x6179(%rip), %rsi      # 0xdf34
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7e30
leaq 0x6169(%rip), %rsi      # 0xdf38
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7e30
leaq 0x6159(%rip), %rsi      # 0xdf3c
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7e30
leaq 0x6149(%rip), %rsi      # 0xdf40
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7e30
leaq 0x6139(%rip), %rsi      # 0xdf44
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x7e30
leaq 0x6129(%rip), %rsi      # 0xdf48
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
je 0x830e
movsd 0xa0(%r12), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x40(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x30a0
mulsd -0x70(%rbp), %xmm0
mulsd -0xb8(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x40(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0x90(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x34e0
mulsd -0x70(%rbp), %xmm0
mulsd -0xb8(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x90(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
movsd -0x70(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
mulsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x30a0
mulsd -0x70(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
mulsd -0xe0(%rbp), %xmm0
mulsd -0x48(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x34e0
movsd -0x70(%rbp), %xmm1
mulsd -0xb0(%rbp), %xmm1
mulsd %xmm0, %xmm1
mulsd -0x48(%rbp), %xmm1
addsd -0x60(%rbp), %xmm1
movsd %xmm1, 0x18(%rbx)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
mulsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x34e0
mulsd -0x70(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x30a0
movsd -0x40(%rbp), %xmm1
mulsd -0xb0(%rbp), %xmm1
mulsd %xmm0, %xmm1
mulsd -0x78(%rbp), %xmm1
addsd -0x60(%rbp), %xmm1
movsd %xmm1, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x34e0
mulsd -0xe0(%rbp), %xmm0
mulsd -0x48(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x30a0
movsd -0x40(%rbp), %xmm1
mulsd -0xb0(%rbp), %xmm1
mulsd %xmm0, %xmm1
mulsd -0x48(%rbp), %xmm1
addsd -0x60(%rbp), %xmm1
movsd %xmm1, 0x20(%rbx)
movsd -0x38(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x34e0
mulsd -0xd0(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movsd %xmm1, 0x28(%rbx)
leaq 0x5e78(%rip), %rsi      # 0xdf34
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x8131
leaq 0x5e68(%rip), %rsi      # 0xdf38
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x8131
leaq 0x5e58(%rip), %rsi      # 0xdf3c
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x8131
leaq 0x5e48(%rip), %rsi      # 0xdf40
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x8131
leaq 0x5e38(%rip), %rsi      # 0xdf44
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
jne 0x8131
leaq 0x5e28(%rip), %rsi      # 0xdf48
movq %r14, %rdi
callq 0x30b0
testq %rax, %rax
je 0x82d5
movsd 0x18(%rbx), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x20(%rbx), %xmm1
movsd -0x30(%rbp), %xmm2
movapd %xmm2, %xmm0
mulsd 0x5c1f(%rip), %xmm0     # 0xdd70
movsd 0x5c1f(%rip), %xmm3     # 0xdd78
movapd %xmm1, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm0, %xmm4
movsd %xmm4, -0x60(%rbp)
mulsd %xmm3, %xmm2
mulsd 0x5c0a(%rip), %xmm1     # 0xdd80
addsd %xmm2, %xmm1
movsd %xmm1, -0x30(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x34e0
movsd %xmm0, -0x90(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x30a0
mulsd -0x60(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x90(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0x48(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x34e0
mulsd -0x60(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd -0x38(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0xf8(%rbp), %xmm0
mulsd 0x5b69(%rip), %xmm0     # 0xdd70
movsd -0xd8(%rbp), %xmm1
mulsd 0x5b61(%rip), %xmm1     # 0xdd78
addsd %xmm0, %xmm1
movsd %xmm1, -0xd8(%rbp)
movaps 0x5c06(%rip), %xmm0     # 0xde30
xorps -0x140(%rbp), %xmm0
movaps %xmm0, -0x60(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x30a0
movsd %xmm0, -0x48(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x34e0
mulsd -0xd8(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd -0x140(%rbp), %xmm1
subsd %xmm1, %xmm0
mulsd -0x98(%rbp), %xmm0
movsd %xmm0, 0x18(%rbx)
movsd -0x50(%rbp), %xmm0
callq 0x34e0
movsd %xmm0, -0x48(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x30a0
mulsd -0xd8(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd -0x60(%rbp), %xmm1
subsd %xmm0, %xmm1
mulsd -0x98(%rbp), %xmm1
addsd -0x38(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
addsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%rbx)
movsd %xmm1, 0x20(%rbx)
xorpd %xmm0, %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x28(%rbx)
movl %r15d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x5a56(%rip), %xmm2     # 0xdd48
jmp 0x756e
movsd 0xa0(%r12), %xmm0
subsd -0x98(%rbp), %xmm0
jmp 0x7946
movsd 0xa0(%r12), %xmm0
subsd -0x98(%rbp), %xmm0
jmp 0x7e3a
nop