// File: DoubleString[P]eph_converter/src/Broadcast.cpp
// Function: BroadcastEphUtils::glsfright(double*, double*, GLSEPH&)
void BroadcastEphUtils::glsfright(double* x, double* acc, GLSEPH& eph) {
	const double c20 = -1.08262575e-3;
	const double GMEARTH = 3.986004418e5;
	const double EROT = 7.292115e-5;
	const double ER = 6.378136e3;
	int i;
	double factor1, factor2, r, vec1[3], vec2[3];
	r = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
	factor1 = -GMEARTH / pow(r, 3);
	factor2 = 1.5 * GMEARTH * c20 * ER * ER / pow(r, 5);
	vec1[0] = EROT * EROT * x[0] + 2.0 * EROT * x[4];
	vec1[1] = EROT * EROT * x[1] - 2.0 * EROT * x[3];
	vec1[2] = 0.0;
	vec2[0] = x[0] * (1.0 - 5.0 * pow((x[2] / r), 2));
	vec2[1] = x[1] * (1.0 - 5.0 * pow((x[2] / r), 2));
	vec2[2] = x[2] * (3.0 - 5.0 * pow((x[2] / r), 2));
	for (i = 0; i < 3; i++) {
		acc[i] = x[i + 3];
		acc[i + 3] = eph.acc[i] + vec1[i] + factor2 * vec2[i] + factor1 * x[i];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd 0x78fd(%rip), %xmm0     # 0x17e80
movsd %xmm0, -0x28(%rbp)
movsd 0x78e8(%rip), %xmm0     # 0x17e78
movsd %xmm0, -0x30(%rbp)
movsd 0x772b(%rip), %xmm0     # 0x17cc8
movsd %xmm0, -0x38(%rbp)
movsd 0x78c6(%rip), %xmm0     # 0x17e70
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm1
movq -0x10(%rbp), %rax
movsd (%rax), %xmm2
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
mulsd 0x8(%rax), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x3220
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movl $0x3, %edi
callq 0x13b90
movaps %xmm0, %xmm1
movsd 0x7851(%rip), %xmm0     # 0x17e68
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x60(%rbp), %xmm0
movl $0x5, %edi
callq 0x13b90
movaps %xmm0, %xmm1
movsd 0x7826(%rip), %xmm0     # 0x17e60
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x7801(%rip), %xmm1     # 0x17e58
mulsd 0x20(%rax), %xmm1
movsd 0x77ec(%rip), %xmm2     # 0x17e50
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x77d2(%rip), %xmm1     # 0x17e58
mulsd 0x18(%rax), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x77a6(%rip), %xmm2     # 0x17e50
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
divsd -0x60(%rbp), %xmm0
movl $0x2, %edi
callq 0x13b90
movaps %xmm0, %xmm1
movsd -0xb8(%rbp), %xmm0
movsd 0x774e(%rip), %xmm2     # 0x17e48
mulsd %xmm2, %xmm1
movsd 0x7632(%rip), %xmm2     # 0x17d38
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
divsd -0x60(%rbp), %xmm0
movl $0x2, %edi
callq 0x13b90
movaps %xmm0, %xmm1
movsd -0xb0(%rbp), %xmm0
movsd 0x76f6(%rip), %xmm2     # 0x17e48
mulsd %xmm2, %xmm1
movsd 0x75da(%rip), %xmm2     # 0x17d38
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
divsd -0x60(%rbp), %xmm0
movl $0x2, %edi
callq 0x13b90
movaps %xmm0, %xmm1
movsd -0xa8(%rbp), %xmm0
movsd 0x769e(%rip), %xmm2     # 0x17e48
mulsd %xmm2, %xmm1
movsd 0x75ca(%rip), %xmm2     # 0x17d80
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x3, -0x44(%rbp)
jge 0x10862
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd 0x60(%rax,%rcx,8), %xmm0
movslq -0x44(%rbp), %rax
addsd -0x80(%rbp,%rax,8), %xmm0
movsd -0x58(%rbp), %xmm1
movslq -0x44(%rbp), %rax
movsd -0xa0(%rbp,%rax,8), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x107cd
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)