// File: DoubleString[P]RtConverter/src/Rnxbrd/BroadcastEphUtils.cpp
// Function: bamboo::BroadcastEphUtils::glsfright(double*, double*, bamboo::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 0x14e55(%rip), %xmm0    # 0xcc1d8
movsd %xmm0, -0x28(%rbp)
movsd 0x14e40(%rip), %xmm0    # 0xcc1d0
movsd %xmm0, -0x30(%rbp)
movsd 0x14d13(%rip), %xmm0    # 0xcc0b0
movsd %xmm0, -0x38(%rbp)
movsd 0x14e1e(%rip), %xmm0    # 0xcc1c8
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 0x95e0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movl $0x3, %edi
callq 0x38f40
movaps %xmm0, %xmm1
movsd 0x14da9(%rip), %xmm0    # 0xcc1c0
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x60(%rbp), %xmm0
movl $0x5, %edi
callq 0x38f40
movaps %xmm0, %xmm1
movsd 0x14d7e(%rip), %xmm0    # 0xcc1b8
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x14d59(%rip), %xmm1    # 0xcc1b0
mulsd 0x20(%rax), %xmm1
movsd 0x14d44(%rip), %xmm2    # 0xcc1a8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x14d2a(%rip), %xmm1    # 0xcc1b0
mulsd 0x18(%rax), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x14cfe(%rip), %xmm2    # 0xcc1a8
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 0x38f40
movaps %xmm0, %xmm1
movsd -0xb8(%rbp), %xmm0
movsd 0x14ca6(%rip), %xmm2    # 0xcc1a0
mulsd %xmm2, %xmm1
movsd 0x495a(%rip), %xmm2     # 0xbbe60
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 0x38f40
movaps %xmm0, %xmm1
movsd -0xb0(%rbp), %xmm0
movsd 0x14c4e(%rip), %xmm2    # 0xcc1a0
mulsd %xmm2, %xmm1
movsd 0x4902(%rip), %xmm2     # 0xbbe60
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 0x38f40
movaps %xmm0, %xmm1
movsd -0xa8(%rbp), %xmm0
movsd 0x14bf6(%rip), %xmm2    # 0xcc1a0
mulsd %xmm2, %xmm1
movsd 0x5882(%rip), %xmm2     # 0xbce38
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x3, -0x44(%rbp)
jge 0xb7662
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 0xb75cd
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)