#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double atan2(double, double);
double cos(int);
int fabs(double);
double reduce_angle(double, double);
int /*<<< orphan*/ sincos(double, double *, double *);
double sqrt(double);
double tan(double);
double earth_gcend(double lon1, double lat1, double inb, double dist,
                   double *lon2, double *lat2) {
  short iter;
  double a, b, c, f, s, u, x, y, sig1, sig2, dsig, t;
  a = 6378136.6;
  b = (6378136.6 * (1.0 - (1.0 / 298.25642)));
  f = (1.0 / 298.25642);
  u = (1.0 - f) * tan(lat1);
  sincos(inb, &s, &c);
  sig1 = atan2(u, c);
  u = ((a * a) / (b * b) - 1.0) * (1.0 - s * s / (1.0 + u * u));
  x = 1.0 + u * (u * (u * (320.0 - 175.0 * u) - 768.0) + 4096.0) / 16384.0;
  y = u * (256.0 + u * (u * (74.0 - 47.0 * u) - 128.0)) / 1024.0;
  sig2 = dist / (b * x);
  for (iter = 0; iter < 20; iter++) {
    u = cos(2 * sig1 + sig2);
    sincos(sig2, &s, &c);
    dsig = y * s *
           (u + y *
                    (c * (2 * u * u - 1.0) -
                     y * u * (4.0 * s * s - 3.0) * (4.0 * u * u - 3.0) / 6.0) /
                    4.0);
    t = sig2;
    sig2 = dist / (b * x) + dsig;
    if (fabs(sig2 - t) <= 1E-12) {
      x = (1.0 - f) * tan(lat1);
      t = 1.0 / sqrt(1.0 + x * x);
      sincos(inb, &sig1, &dsig);
      a = sig1 * t;
      b = 1.0 - a * a;
      sincos(sig2, &s, &c);
      y = t * (x * s - c * dsig);
      *lat2 = atan2(t * (x * c + s * dsig), (1.0 - f) * sqrt(a * a + y * y));
      *lon2 = atan2(s * sig1, t * (c - x * s * dsig));
      t = f * b * (4.0 + f * (4.0 - 3.0 * b)) / 16.0;
      *lon2 += lon1 - (1.0 - t) * f * a *
                          (sig2 + t * s * (u + t * c * (2.0 * u * u - 1.0)));
      *lon2 = reduce_angle(*lon2 + 3.0 * 3.141592653589793238462643,
                           (2.0 * 3.141592653589793238462643)) -
              3.141592653589793238462643;
      return (reduce_angle(atan2(a, -y), (2.0 * 3.141592653589793238462643)));
    }
  }
  *lon2 = lon1;
  *lat2 = lat1;
  return (-1);
}


x86 assembly (clang, -O0):
<earth_gcend>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe62(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1070 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    -0x68(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1030 <sincos@plt>
movsd  -0x70(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdee(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movsd  0xdca(%rip),%xmm3
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xdba(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
movsd  0xdb1(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xdad(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd8d(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  0xd75(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd5d(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd49(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
movsd  0xd14(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd10(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcf0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcd8(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcc0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movw   $0x0,-0x3a(%rbp)
movswl -0x3a(%rbp),%eax
cmp    $0x14,%eax
jge    1878 <earth_gcend+0x708>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
lea    -0x68(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1030 <sincos@plt>
movsd  -0x80(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  0xcc5(%rip),%xmm5
mulsd  -0x70(%rbp),%xmm5
movsd  -0x70(%rbp),%xmm4
mulsd  %xmm4,%xmm5
movsd  0xc87(%rip),%xmm4
addsd  %xmm4,%xmm5
movsd  -0x80(%rbp),%xmm4
mulsd  -0x70(%rbp),%xmm4
movsd  0xc81(%rip),%xmm6
mulsd  -0x68(%rbp),%xmm6
movsd  -0x68(%rbp),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xc7b(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
movsd  0xc5b(%rip),%xmm6
mulsd  -0x70(%rbp),%xmm6
movsd  -0x70(%rbp),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xc55(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
movsd  0xc3d(%rip),%xmm6
divsd  %xmm6,%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc06(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
call   1050 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xb96(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1862 <earth_gcend+0x6f2>
movsd  0xb34(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xaf3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xadf(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
lea    -0x88(%rbp),%rdi
lea    -0x98(%rbp),%rsi
call   1030 <sincos@plt>
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xa79(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
lea    -0x68(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1030 <sincos@plt>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm2
mulsd  -0x98(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm2
mulsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0x9d9(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
call   1040 <atan2@plt>
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm3
movsd  -0x78(%rbp),%xmm2
mulsd  -0x68(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm4
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
call   1040 <atan2@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x977(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x95b(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x94b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x973(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm1
movsd  0x8ca(%rip),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm3
ff
movsd  -0xa0(%rbp),%xmm2
ff
mulsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm5
movsd  -0xa0(%rbp),%xmm4
ff
mulsd  -0x58(%rbp),%xmm4
movsd  0x8f9(%rip),%xmm6
mulsd  -0x70(%rbp),%xmm6
movsd  -0x70(%rbp),%xmm7
mulsd  %xmm7,%xmm6
movsd  0x8bb(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0x8b0(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  0x894(%rip),%xmm1
call   1060 <reduce_angle@plt>
movsd  0x88f(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1040 <atan2@plt>
movsd  0x84d(%rip),%xmm1
call   1060 <reduce_angle@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    189f <earth_gcend+0x72f>
jmp    1867 <earth_gcend+0x6f7>
mov    -0x3a(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x3a(%rbp)
jmp    136a <earth_gcend+0x1fa>
movsd  -0x10(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x7d6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<earth_gcend>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm0,0x50(%rsp)
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1070 <tan@plt>
mulsd  0xe52(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0x18(%rsp),%r12
lea    0x20(%rsp),%rbx
movsd  0x28(%rsp),%xmm0
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <sincos@plt>
movsd  0x20(%rsp),%xmm1
movsd  (%rsp),%xmm0
call   1040 <atan2@plt>
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm2
movsd  0xe0f(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
mulsd  0xdff(%rip),%xmm2
movsd  0xdff(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xdfb(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xdf7(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xdf3(%rip),%xmm1
movsd  %xmm0,0x48(%rsp)
mulsd  %xmm2,%xmm1
mulsd  0xde9(%rip),%xmm1
movsd  0xde9(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  0xde5(%rip),%xmm4
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm4
addsd  0xddd(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  0xdd9(%rip),%xmm4
mulsd  %xmm2,%xmm4
mulsd  0xdd5(%rip),%xmm4
movsd  %xmm4,0x60(%rsp)
mulsd  0xdcf(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
divsd  %xmm1,%xmm2
mov    $0x14,%bp
addsd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
nopl   0x0(%rax,%rax,1)
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <cos@plt>
movsd  %xmm0,0x58(%rsp)
movsd  (%rsp),%xmm0
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <sincos@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x60(%rsp),%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x58(%rsp),%xmm6
movapd %xmm6,%xmm7
addsd  %xmm6,%xmm7
mulsd  %xmm6,%xmm7
addsd  0xd50(%rip),%xmm7
movapd %xmm5,%xmm2
mulsd  %xmm6,%xmm2
movapd %xmm1,%xmm3
movsd  0xd44(%rip),%xmm4
mulsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xd3b(%rip),%xmm8
addsd  %xmm8,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm6,%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm8,%xmm1
mulsd  %xmm3,%xmm1
divsd  0xd1d(%rip),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  %xmm7,0x78(%rsp)
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm5,%xmm2
mulsd  0xd05(%rip),%xmm2
addsd  %xmm6,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x40(%rsp)
addsd  0x10(%rsp),%xmm2
movsd  %xmm2,0x38(%rsp)
movapd %xmm2,%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    13ea <earth_gcend+0x27a>
add    $0xffff,%bp
movsd  0x38(%rsp),%xmm0
jne    12c0 <earth_gcend+0x150>
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
movsd  0xc8b(%rip),%xmm0
jmp    1632 <earth_gcend+0x4c2>
movsd  0x8(%rsp),%xmm0
call   1070 <tan@plt>
mulsd  0xc03(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xbf9(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     141f <earth_gcend+0x2af>
sqrtsd %xmm0,%xmm0
jmp    1424 <earth_gcend+0x2b4>
call   1090 <sqrt@plt>
movsd  0xbdc(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
lea    0x48(%rsp),%rdi
lea    0x40(%rsp),%rsi
movsd  0x28(%rsp),%xmm0
call   1030 <sincos@plt>
movsd  0x48(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xb97(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0x18(%rsp),%rdi
lea    0x20(%rsp),%rsi
movsd  0x38(%rsp),%xmm0
call   1030 <sincos@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm4
movsd  0x40(%rsp),%xmm1
movsd  0x30(%rsp),%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm1
subsd  %xmm1,%xmm2
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm4
addsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm2,0x60(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  0x8(%rsp),%xmm0
ucomisd 0xbdb(%rip),%xmm0
jb     14f8 <earth_gcend+0x388>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    150d <earth_gcend+0x39d>
movsd  %xmm4,0x8(%rsp)
call   1090 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movapd %xmm0,%xmm1
mulsd  0xaeb(%rip),%xmm1
movapd %xmm4,%xmm0
call   1040 <atan2@plt>
movsd  %xmm0,(%r14)
movsd  0x18(%rsp),%xmm1
movsd  0x48(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x20(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
mulsd  %xmm1,%xmm3
mulsd  0x40(%rsp),%xmm3
subsd  %xmm3,%xmm2
movsd  (%rsp),%xmm1
mulsd  %xmm2,%xmm1
call   1040 <atan2@plt>
movsd  0xb35(%rip),%xmm1
movsd  0x28(%rsp),%xmm4
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xb07(%rip),%xmm4
movsd  0xaf7(%rip),%xmm3
addsd  %xmm3,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm2,%xmm4
mulsd  0xb07(%rip),%xmm4
movsd  0xa67(%rip),%xmm2
subsd  %xmm4,%xmm2
movsd  0x18(%rsp),%xmm1
mulsd  %xmm4,%xmm1
mulsd  0x20(%rsp),%xmm4
mulsd  0x78(%rsp),%xmm4
addsd  0x58(%rsp),%xmm4
mulsd  %xmm1,%xmm4
mulsd  0xadb(%rip),%xmm2
addsd  0x38(%rsp),%xmm4
mulsd  0x10(%rsp),%xmm2
mulsd  %xmm4,%xmm2
addsd  0x50(%rsp),%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm0,(%r15)
addsd  0xabc(%rip),%xmm0
movsd  0xabc(%rip),%xmm1
call   1060 <reduce_angle@plt>
addsd  0xab7(%rip),%xmm0
movsd  %xmm0,(%r15)
movaps 0x60(%rsp),%xmm1
xorps  0xab6(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1040 <atan2@plt>
movsd  0xa8b(%rip),%xmm1
call   1060 <reduce_angle@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @earth_gcend(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca i16
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double* %4, double** %12
store double* %5, double** %13
store double 0x415854A626666666, double* %15
store double 0x41583FC3F6E901E9, double* %16
store double 0x3F6B775F5E758B82, double* %18
%27 = load double, double* %18
%28 = fsub double 1.000000e+00, %27
%29 = load double, double* %9
%30 = call double @tan(double %29)
%31 = fmul double %28, %30
store double %31, double* %20
%32 = load double, double* %10
%33 = call i32 @sincos(double %32, double* %19, double* %17)
%34 = load double, double* %20
%35 = load double, double* %17
%36 = call double @atan2(double %34, double %35)
store double %36, double* %23
%37 = load double, double* %15
%38 = load double, double* %15
%39 = fmul double %37, %38
%40 = load double, double* %16
%41 = load double, double* %16
%42 = fmul double %40, %41
%43 = fdiv double %39, %42
%44 = fsub double %43, 1.000000e+00
%45 = load double, double* %19
%46 = load double, double* %19
%47 = fmul double %45, %46
%48 = load double, double* %20
%49 = load double, double* %20
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double 1.000000e+00)
%51 = fdiv double %47, %50
%52 = fsub double 1.000000e+00, %51
%53 = fmul double %44, %52
store double %53, double* %20
%54 = load double, double* %20
%55 = load double, double* %20
%56 = load double, double* %20
%57 = load double, double* %20
%58 = call double @llvm.fmuladd.f64(double -1.750000e+02, double %57, double 3.200000e+02)
%59 = call double @llvm.fmuladd.f64(double %56, double %58, double -7.680000e+02)
%60 = call double @llvm.fmuladd.f64(double %55, double %59, double 4.096000e+03)
%61 = fmul double %54, %60
%62 = fdiv double %61, 1.638400e+04
%63 = fadd double 1.000000e+00, %62
store double %63, double* %21
%64 = load double, double* %20
%65 = load double, double* %20
%66 = load double, double* %20
%67 = load double, double* %20
%68 = call double @llvm.fmuladd.f64(double -4.700000e+01, double %67, double 7.400000e+01)
%69 = call double @llvm.fmuladd.f64(double %66, double %68, double -1.280000e+02)
%70 = call double @llvm.fmuladd.f64(double %65, double %69, double 2.560000e+02)
%71 = fmul double %64, %70
%72 = fdiv double %71, 1.024000e+03
store double %72, double* %22
%73 = load double, double* %11
%74 = load double, double* %16
%75 = load double, double* %21
%76 = fmul double %74, %75
%77 = fdiv double %73, %76
store double %77, double* %24
store i16 0, i16* %14
br label %78
78: ; preds = %246, %6
%79 = load i16, i16* %14
%80 = sext i16 %79 to i32
%81 = icmp slt i32 %80, 20
br i1 %81, label %82, label %249
82: ; preds = %78
%83 = load double, double* %23
%84 = load double, double* %24
%85 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %83, double %84)
%86 = fptosi double %85 to i32
%87 = call double @cos(i32 %86)
store double %87, double* %20
%88 = load double, double* %24
%89 = call i32 @sincos(double %88, double* %19, double* %17)
%90 = load double, double* %22
%91 = load double, double* %19
%92 = fmul double %90, %91
%93 = load double, double* %20
%94 = load double, double* %22
%95 = load double, double* %17
%96 = load double, double* %20
%97 = fmul double 2.000000e+00, %96
%98 = load double, double* %20
%99 = call double @llvm.fmuladd.f64(double %97, double %98, double -1.000000e+00)
%100 = load double, double* %22
%101 = load double, double* %20
%102 = fmul double %100, %101
%103 = load double, double* %19
%104 = fmul double 4.000000e+00, %103
%105 = load double, double* %19
%106 = call double @llvm.fmuladd.f64(double %104, double %105, double -3.000000e+00)
%107 = fmul double %102, %106
%108 = load double, double* %20
%109 = fmul double 4.000000e+00, %108
%110 = load double, double* %20
%111 = call double @llvm.fmuladd.f64(double %109, double %110, double -3.000000e+00)
%112 = fmul double %107, %111
%113 = fdiv double %112, 6.000000e+00
%114 = fneg double %113
%115 = call double @llvm.fmuladd.f64(double %95, double %99, double %114)
%116 = fmul double %94, %115
%117 = fdiv double %116, 4.000000e+00
%118 = fadd double %93, %117
%119 = fmul double %92, %118
store double %119, double* %25
%120 = load double, double* %24
store double %120, double* %26
%121 = load double, double* %11
%122 = load double, double* %16
%123 = load double, double* %21
%124 = fmul double %122, %123
%125 = fdiv double %121, %124
%126 = load double, double* %25
%127 = fadd double %125, %126
store double %127, double* %24
%128 = load double, double* %24
%129 = load double, double* %26
%130 = fsub double %128, %129
%131 = call i32 @fabs(double %130)
%132 = sitofp i32 %131 to double
%133 = fcmp ole double %132, 0x3D719799812DEA11
br i1 %133, label %134, label %245
134: ; preds = %82
%135 = load double, double* %18
%136 = fsub double 1.000000e+00, %135
%137 = load double, double* %9
%138 = call double @tan(double %137)
%139 = fmul double %136, %138
store double %139, double* %21
%140 = load double, double* %21
%141 = load double, double* %21
%142 = call double @llvm.fmuladd.f64(double %140, double %141, double 1.000000e+00)
%143 = call double @sqrt(double %142)
%144 = fdiv double 1.000000e+00, %143
store double %144, double* %26
%145 = load double, double* %10
%146 = call i32 @sincos(double %145, double* %23, double* %25)
%147 = load double, double* %23
%148 = load double, double* %26
%149 = fmul double %147, %148
store double %149, double* %15
%150 = load double, double* %15
%151 = load double, double* %15
%152 = fneg double %150
%153 = call double @llvm.fmuladd.f64(double %152, double %151, double 1.000000e+00)
store double %153, double* %16
%154 = load double, double* %24
%155 = call i32 @sincos(double %154, double* %19, double* %17)
%156 = load double, double* %26
%157 = load double, double* %21
%158 = load double, double* %19
%159 = load double, double* %17
%160 = load double, double* %25
%161 = fmul double %159, %160
%162 = fneg double %161
%163 = call double @llvm.fmuladd.f64(double %157, double %158, double %162)
%164 = fmul double %156, %163
store double %164, double* %22
%165 = load double, double* %26
%166 = load double, double* %21
%167 = load double, double* %17
%168 = load double, double* %19
%169 = load double, double* %25
%170 = fmul double %168, %169
%171 = call double @llvm.fmuladd.f64(double %166, double %167, double %170)
%172 = fmul double %165, %171
%173 = load double, double* %18
%174 = fsub double 1.000000e+00, %173
%175 = load double, double* %15
%176 = load double, double* %15
%177 = load double, double* %22
%178 = load double, double* %22
%179 = fmul double %177, %178
%180 = call double @llvm.fmuladd.f64(double %175, double %176, double %179)
%181 = call double @sqrt(double %180)
%182 = fmul double %174, %181
%183 = call double @atan2(double %172, double %182)
%184 = load double*, double** %13
store double %183, double* %184
%185 = load double, double* %19
%186 = load double, double* %23
%187 = fmul double %185, %186
%188 = load double, double* %26
%189 = load double, double* %17
%190 = load double, double* %21
%191 = load double, double* %19
%192 = fmul double %190, %191
%193 = load double, double* %25
%194 = fneg double %192
%195 = call double @llvm.fmuladd.f64(double %194, double %193, double %189)
%196 = fmul double %188, %195
%197 = call double @atan2(double %187, double %196)
%198 = load double*, double** %12
store double %197, double* %198
%199 = load double, double* %18
%200 = load double, double* %16
%201 = fmul double %199, %200
%202 = load double, double* %18
%203 = load double, double* %16
%204 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %203, double 4.000000e+00)
%205 = call double @llvm.fmuladd.f64(double %202, double %204, double 4.000000e+00)
%206 = fmul double %201, %205
%207 = fdiv double %206, 1.600000e+01
store double %207, double* %26
%208 = load double, double* %8
%209 = load double, double* %26
%210 = fsub double 1.000000e+00, %209
%211 = load double, double* %18
%212 = fmul double %210, %211
%213 = load double, double* %15
%214 = fmul double %212, %213
%215 = load double, double* %24
%216 = load double, double* %26
%217 = load double, double* %19
%218 = fmul double %216, %217
%219 = load double, double* %20
%220 = load double, double* %26
%221 = load double, double* %17
%222 = fmul double %220, %221
%223 = load double, double* %20
%224 = fmul double 2.000000e+00, %223
%225 = load double, double* %20
%226 = call double @llvm.fmuladd.f64(double %224, double %225, double -1.000000e+00)
%227 = call double @llvm.fmuladd.f64(double %222, double %226, double %219)
%228 = call double @llvm.fmuladd.f64(double %218, double %227, double %215)
%229 = fneg double %214
%230 = call double @llvm.fmuladd.f64(double %229, double %228, double %208)
%231 = load double*, double** %12
%232 = load double, double* %231
%233 = fadd double %232, %230
store double %233, double* %231
%234 = load double*, double** %12
%235 = load double, double* %234
%236 = fadd double %235, 0x4022D97C7F3321D2
%237 = call double @reduce_angle(double %236, double 0x401921FB54442D18)
%238 = fsub double %237, 0x400921FB54442D18
%239 = load double*, double** %12
store double %238, double* %239
%240 = load double, double* %15
%241 = load double, double* %22
%242 = fneg double %241
%243 = call double @atan2(double %240, double %242)
%244 = call double @reduce_angle(double %243, double 0x401921FB54442D18)
store double %244, double* %7
br label %254
245: ; preds = %82
br label %246
246: ; preds = %245
%247 = load i16, i16* %14
%248 = add i16 %247, 1
store i16 %248, i16* %14
br label %78
249: ; preds = %78
%250 = load double, double* %8
%251 = load double*, double** %12
store double %250, double* %251
%252 = load double, double* %9
%253 = load double*, double** %13
store double %252, double* %253
store double -1.000000e+00, double* %7
br label %254
254: ; preds = %249, %134
%255 = load double, double* %7
ret double %255
}

LLVM IR (-O2):
define double @earth_gcend(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
%13 = bitcast double* %9 to i8*
%14 = bitcast double* %10 to i8*
%15 = tail call double @tan(double %1)
%16 = fmul double %15, 0x3FEFE488A0A18A74
%17 = call i32 @sincos(double %2, double* %8, double* %7)
%18 = load double, double* %7
%19 = call double @atan2(double %16, double %18)
store double %19, double* %9
%20 = load double, double* %8
%21 = fmul double %20, %20
%22 = call double @llvm.fmuladd.f64(double %16, double %16, double 1.000000e+00)
%23 = fdiv double %21, %22
%24 = fsub double 1.000000e+00, %23
%25 = fmul double %24, 0x3F7B9AE4C7ABEB00
%26 = call double @llvm.fmuladd.f64(double %25, double -1.750000e+02, double 3.200000e+02)
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double -7.680000e+02)
%28 = call double @llvm.fmuladd.f64(double %25, double %27, double 4.096000e+03)
%29 = fmul double %25, %28
%30 = fmul double %29, 0x3F10000000000000
%31 = fadd double %30, 1.000000e+00
%32 = call double @llvm.fmuladd.f64(double %25, double -4.700000e+01, double 7.400000e+01)
%33 = call double @llvm.fmuladd.f64(double %25, double %32, double -1.280000e+02)
%34 = call double @llvm.fmuladd.f64(double %25, double %33, double 2.560000e+02)
%35 = fmul double %25, %34
%36 = fmul double %35, 0x3F50000000000000
%37 = fmul double %31, 0x41583FC3F6E901E9
%38 = fdiv double %3, %37
br label %42
39: ; preds = %42
%40 = add nuw nsw i16 %44, 1
%41 = icmp eq i16 %40, 20
br i1 %41, label %130, label %42
42: ; preds = %6, %39
%43 = phi double [ %38, %6 ], [ %67, %39 ]
%44 = phi i16 [ 0, %6 ], [ %40, %39 ]
%45 = call double @llvm.fmuladd.f64(double %19, double 2.000000e+00, double %43)
%46 = fptosi double %45 to i32
%47 = call double @cos(i32 %46)
%48 = call i32 @sincos(double %43, double* %8, double* %7)
%49 = load double, double* %8
%50 = fmul double %36, %49
%51 = load double, double* %7
%52 = fmul double %47, 2.000000e+00
%53 = call double @llvm.fmuladd.f64(double %52, double %47, double -1.000000e+00)
%54 = fmul double %36, %47
%55 = fmul double %49, 4.000000e+00
%56 = call double @llvm.fmuladd.f64(double %55, double %49, double -3.000000e+00)
%57 = fmul double %54, %56
%58 = fmul double %47, 4.000000e+00
%59 = call double @llvm.fmuladd.f64(double %58, double %47, double -3.000000e+00)
%60 = fmul double %59, %57
%61 = fdiv double %60, -6.000000e+00
%62 = call double @llvm.fmuladd.f64(double %51, double %53, double %61)
%63 = fmul double %36, %62
%64 = fmul double %63, 2.500000e-01
%65 = fadd double %47, %64
%66 = fmul double %50, %65
store double %66, double* %10
%67 = fadd double %38, %66
%68 = fsub double %67, %43
%69 = call i32 @fabs(double %68)
%70 = icmp slt i32 %69, 1
br i1 %70, label %71, label %39
71: ; preds = %42
%72 = call double @tan(double %1)
%73 = fmul double %72, 0x3FEFE488A0A18A74
%74 = call double @llvm.fmuladd.f64(double %73, double %73, double 1.000000e+00)
%75 = call double @sqrt(double %74)
%76 = fdiv double 1.000000e+00, %75
%77 = call i32 @sincos(double %2, double* %9, double* %10)
%78 = load double, double* %9
%79 = fmul double %76, %78
%80 = fneg double %79
%81 = call double @llvm.fmuladd.f64(double %80, double %79, double 1.000000e+00)
%82 = call i32 @sincos(double %67, double* %8, double* %7)
%83 = load double, double* %8
%84 = load double, double* %7
%85 = load double, double* %10
%86 = fneg double %84
%87 = fmul double %85, %86
%88 = call double @llvm.fmuladd.f64(double %73, double %83, double %87)
%89 = fmul double %76, %88
%90 = fmul double %83, %85
%91 = call double @llvm.fmuladd.f64(double %73, double %84, double %90)
%92 = fmul double %76, %91
%93 = fmul double %89, %89
%94 = call double @llvm.fmuladd.f64(double %79, double %79, double %93)
%95 = call double @sqrt(double %94)
%96 = fmul double %95, 0x3FEFE488A0A18A74
%97 = call double @atan2(double %92, double %96)
store double %97, double* %5
%98 = load double, double* %8
%99 = load double, double* %9
%100 = fmul double %98, %99
%101 = load double, double* %7
%102 = load double, double* %10
%103 = fneg double %73
%104 = fmul double %98, %103
%105 = call double @llvm.fmuladd.f64(double %104, double %102, double %101)
%106 = fmul double %76, %105
%107 = call double @atan2(double %100, double %106)
%108 = fmul double %81, 0x3F6B775F5E758B82
%109 = call double @llvm.fmuladd.f64(double %81, double -3.000000e+00, double 4.000000e+00)
%110 = call double @llvm.fmuladd.f64(double %109, double 0x3F6B775F5E758B82, double 4.000000e+00)
%111 = fmul double %108, %110
%112 = fmul double %111, 6.250000e-02
%113 = fsub double 1.000000e+00, %112
%114 = load double, double* %8
%115 = fmul double %112, %114
%116 = load double, double* %7
%117 = fmul double %112, %116
%118 = call double @llvm.fmuladd.f64(double %117, double %53, double %47)
%119 = call double @llvm.fmuladd.f64(double %115, double %118, double %67)
%120 = fmul double %113, 0xBF6B775F5E758B82
%121 = fmul double %79, %120
%122 = call double @llvm.fmuladd.f64(double %121, double %119, double %0)
%123 = fadd double %107, %122
store double %123, double* %4
%124 = fadd double %123, 0x4022D97C7F3321D2
%125 = call double @reduce_angle(double %124, double 0x401921FB54442D18)
%126 = fadd double %125, 0xC00921FB54442D18
store double %126, double* %4
%127 = fneg double %89
%128 = call double @atan2(double %79, double %127)
%129 = call double @reduce_angle(double %128, double 0x401921FB54442D18)
br label %131
130: ; preds = %39
store double %0, double* %4
store double %1, double* %5
br label %131
131: ; preds = %130, %71
%132 = phi double [ %129, %71 ], [ -1.000000e+00, %130 ]
ret double %132
}