LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: matthewarcus[P]mmps/transform.cpp
// Function: Hammer::ProjectInvSimple(double, double, double&, double&) const
bool Hammer::ProjectInvSimple(double phi, double lambda, double& x, double& y) const
{
  double z = sqrt(1 + cos(phi)*cos(lambda/2));
  x = cos(phi)*sin(lambda/2)/z;
  y = sin(phi)/(2 * z);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movsd %xmm0, -0x40(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0xa2f6(%rip), %xmm1     # 0x15420
divsd %xmm1, %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x9f01(%rip), %xmm1     # 0x15048
addsd %xmm1, %xmm0
callq 0x5200
movsd %xmm0, -0x30(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movsd %xmm0, -0x38(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0xa2af(%rip), %xmm1     # 0x15420
divsd %xmm1, %xmm0
callq 0x5080
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
mulsd %xmm1, %xmm0
divsd -0x30(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x10(%rbp), %xmm0
callq 0x5080
movsd 0xa27b(%rip), %xmm1     # 0x15420
mulsd -0x30(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
// File: matthewarcus[P]mmps/transform.cpp
// Function: Bonne::ProjectInvSimple(double, double, double&, double&) const
bool Bonne::ProjectInvSimple(double phi, double lambda, double& x, double& y) const
{
  if (p == 0.0) {
    x = lambda * cos(phi);
    y = phi;
  } else {
    double rho = cotp + p - phi;
    double e = lambda * cos(phi)/rho;
    x = rho * sin(e);
    y = cotp - rho * cos(e);
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movsd 0xc0(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xb4b3
jp 0xb4b3
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x10(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0xb57c
movq -0x40(%rbp), %rax
movsd 0xc8(%rax), %xmm0
addsd 0xc0(%rax), %xmm0
subsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
mulsd %xmm1, %xmm0
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x5080
movq -0x40(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rcx
movsd %xmm0, (%rcx)
movsd 0xc8(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x5470
movsd -0x58(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Perspective::Init(TransformParams const&)
void Perspective::Init(const TransformParams& params) 
{
  Transform::Init(params);
  vx = params.x; vy = params.y; vz = params.z;
  rx = vx; ry = vy; rz = vz;
  m.Apply(rx,ry,rz);
  scalefactor = (vx + 1) * tan(params.aw/2);
  iscalefactor = 1/scalefactor;

  a = params.ox;
  b = params.oy;
  c = params.oz;
  a2 = sqr(a);
  b2 = sqr(b);
  c2 = sqr(c);
  ia2 = 1/a2;
  ib2 = 1/b2;
  ic2 = 1/c2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movq -0x10(%rbp), %rsi
callq 0x8500
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0xd0(%rcx)
movq -0x10(%rbp), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, 0xd8(%rcx)
movq -0x10(%rbp), %rax
movsd 0x58(%rax), %xmm0
movsd %xmm0, 0xe0(%rcx)
movsd 0xd0(%rcx), %xmm0
movsd %xmm0, 0xe8(%rcx)
movsd 0xd8(%rcx), %xmm0
movsd %xmm0, 0xf0(%rcx)
movsd 0xe0(%rcx), %xmm0
movsd %xmm0, 0xf8(%rcx)
movq %rcx, %rdi
addq $0x8, %rdi
movq %rcx, %rsi
addq $0xe8, %rsi
movq %rcx, %rdx
addq $0xf0, %rdx
addq $0xf8, %rcx
callq 0x7da0
movq -0x18(%rbp), %rax
movsd 0x99fd(%rip), %xmm0     # 0x15048
addsd 0xd0(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd 0x9db7(%rip), %xmm1     # 0x15420
divsd %xmm1, %xmm0
callq 0x5150
movq -0x18(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rax)
movsd 0x99b6(%rip), %xmm0     # 0x15048
divsd 0xc0(%rax), %xmm0
movsd %xmm0, 0xc8(%rax)
movq -0x10(%rbp), %rcx
movsd 0x60(%rcx), %xmm0
movsd %xmm0, 0x100(%rax)
movq -0x10(%rbp), %rcx
movsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x108(%rax)
movq -0x10(%rbp), %rcx
movsd 0x70(%rcx), %xmm0
movsd %xmm0, 0x110(%rax)
movsd 0x100(%rax), %xmm0
callq 0xddd0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x118(%rax)
movsd 0x108(%rax), %xmm0
callq 0xddd0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x120(%rax)
movsd 0x110(%rax), %xmm0
callq 0xddd0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x128(%rax)
movsd 0x9920(%rip), %xmm0     # 0x15048
divsd 0x118(%rax), %xmm0
movsd %xmm0, 0x130(%rax)
movsd 0x9908(%rip), %xmm0     # 0x15048
divsd 0x120(%rax), %xmm0
movsd %xmm0, 0x138(%rax)
movsd 0x98f0(%rip), %xmm0     # 0x15048
divsd 0x128(%rax), %xmm0
movsd %xmm0, 0x140(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: matthewarcus[P]mmps/transform.cpp
// Function: CylindricalTransform::AdjustSize(int&, int&, TransformParams&)
void CylindricalTransform::AdjustSize (int& w, int& h, 
				       TransformParams& params)
{
  if (params.scale < 1.0) {
    w = int(w * params.scale);
    params.scale = 1.0;     
  }
  // If a parallel has been given, check it's valid
  if (params.p < 0 || params.p >= piovertwo) {
    error ("Invalid parallel");
  }
  double h0 = GetMaxHeight(params);
  if (h0 > 0.0) { // Return <= 0 for don't adjust
    int newh = int(h0 * w * params.scale / pi);
    if (newh < h) { h = newh; };
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movsd 0x8eac(%rip), %xmm0     # 0x15048
ucomisd 0x28(%rax), %xmm0
jbe 0xc1cf
movq -0x10(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movq -0x20(%rbp), %rax
mulsd 0x28(%rax), %xmm0
cvttsd2si %xmm0, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movsd 0x8e7e(%rip), %xmm0     # 0x15048
movsd %xmm0, 0x28(%rax)
movq -0x20(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x80(%rax), %xmm0
ja 0xc1fa
movq -0x20(%rbp), %rax
fldl 0x80(%rax)
fldl 0x8e30(%rip)            # 0x15020
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jb 0xc206
jmp 0xc1fa
leaq 0x935e(%rip), %rdi      # 0x1555f
callq 0xfea0
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq (%rdi), %rax
callq *0x60(%rax)
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xc28a
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd 0x28(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
fldl -0x38(%rbp)
fldl 0x8db5(%rip)            # 0x15008
fdivrp %st, %st(1)
fnstcw -0x3a(%rbp)
movzwl -0x3a(%rbp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, -0x3c(%rbp)
fldcw -0x3c(%rbp)
fistpl -0x30(%rbp)
fldcw -0x3a(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xc288
movl -0x2c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0xc28a
addq $0x50, %rsp
popq %rbp
retq
// File: matthewarcus[P]mmps/transform.cpp
// Function: Sinusoidal2::CalcParams(double, double, double&, double&)
void Sinusoidal2::CalcParams(double a, double phi, double& k, double& b)
{
  // Find the t value for phi
  double t1 = 0;
  double t2 = pi/2.0;
  double epsilon = 1e-6;
  double k0 = 0.0, b0 = 0.0;
  while (fabs(t2 - t1) > epsilon) {
    double t0 = (t1 + t2)/2.0;
    k0 = sqr((cos(t0) + a) / ((a+1)*cos(phi)));
    b0 = (k0 * (a+1))/(1 + a * pi / 2.0);
    double p0 = b0 * sin(t0) + a * t0 - k0 * (a+1) * sin(phi);
    if (p0 <= 0.0) t1 = t0;
    else t2 = t0;
  }
  k = k0; b = b0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x8d13(%rip), %xmm0     # 0x15020
movsd %xmm0, -0x30(%rbp)
movsd 0x911e(%rip), %xmm0     # 0x15438
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x30(%rbp), %xmm0
subsd -0x28(%rbp), %xmm0
movaps 0x9160(%rip), %xmm1     # 0x154a0
pand %xmm1, %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0xc4db
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd 0x90a3(%rip), %xmm1     # 0x15408
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x8(%rbp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, -0x98(%rbp)
movsd 0x8cb4(%rip), %xmm1     # 0x15048
movsd %xmm1, -0x90(%rbp)
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movsd -0xa0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x98(%rbp), %xmm0
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0xddd0
movsd -0x90(%rbp), %xmm3
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm1
movsd -0x8(%rbp), %xmm0
movaps %xmm0, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
movsd %xmm1, -0x68(%rbp)
fldl -0x68(%rbp)
movsd %xmm0, -0x60(%rbp)
fldl -0x60(%rbp)
fldl 0x8bfe(%rip)            # 0x15008
fmulp %st, %st(1)
flds 0x9066(%rip)            # 0x15478
fmulp %st, %st(1)
fld1
faddp %st, %st(1)
fdivrp %st, %st(1)
fstpl -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x5080
movaps %xmm0, %xmm2
movsd -0x88(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x8bdb(%rip), %xmm1     # 0x15048
addsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5080
movsd -0x80(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x78(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x58(%rbp), %xmm0
jb 0xc4cc
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xc4d6
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0xc32f
movsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x48(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
addq $0xa0, %rsp
popq %rbp
retq
nop
// File: matthewarcus[P]mmps/transform.cpp
// Function: Sinusoidal2::GetLat(double)
double Sinusoidal2::GetLat(double y)
{
  double t = y/b;
  double phi = asin((b * (sin(t) + a * t)) / (k * (a+1)));
  m = (a+1) / (cos(t) + a);
  return phi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movsd -0x10(%rbp), %xmm0
divsd 0xd0(%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0xd0(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5080
movq -0x30(%rbp), %rax
movaps %xmm0, %xmm2
movsd -0x38(%rbp), %xmm0
movsd 0xc8(%rax), %xmm1
movsd -0x18(%rbp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0xd8(%rax), %xmm1
movsd 0x8a61(%rip), %xmm2     # 0x15048
addsd 0xc8(%rax), %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x53e0
movq -0x30(%rbp), %rax
movsd %xmm0, -0x20(%rbp)
movsd 0x8a3b(%rip), %xmm0     # 0x15048
addsd 0xc8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5470
movq -0x30(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x28(%rbp), %xmm0
addsd 0xc8(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rax)
movsd -0x20(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: matthewarcus[P]mmps/transform.cpp
// Function: Sinusoidal2::GetXY(double, double, double&, double&) const
bool Sinusoidal2::GetXY(double phi, double lambda, double& x, double& y) const
{
  bool result = false;
  Sinusoidal2Equation equation;
  equation.b = b; equation.a = a; equation.k = k; equation.sinphi = sin(phi);
  double t = 0.0;
  if (equation.FindRoot(-pi/2, pi/2, 1e-5, t)) {
    y = b * t;
    x = lambda * (cos(t) + a) / (a+1);
    result = true;
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movb $0x0, -0x29(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0xe200
movq -0x80(%rbp), %rax
movsd 0xd0(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0xc8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0xd8(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5080
movq -0x78(%rbp), %rdi
movsd %xmm0, -0x38(%rbp)
movq $0x0, -0x60(%rbp)
movsd 0x8930(%rip), %xmm0     # 0x15028
movsd 0x8920(%rip), %xmm1     # 0x15020
movsd 0x8d38(%rip), %xmm2     # 0x15440
leaq -0x60(%rbp), %rsi
callq 0xf5c0
movb %al, -0x6d(%rbp)
jmp 0xc716
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0xc722
jmp 0xc7a6
movq -0x80(%rbp), %rax
movsd 0xd0(%rax), %xmm0
mulsd -0x60(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x5470
movq -0x80(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
addsd 0xc8(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x88d3(%rip), %xmm1     # 0x15048
addsd 0xc8(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, -0x29(%rbp)
jmp 0xc7a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xe240
jmp 0xc7c9
movb -0x29(%rbp), %al
movb %al, -0x89(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xe240
movb -0x89(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x5420
nopw %cs:(%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Mollweide::CalcParams(double, double&)
void Mollweide::CalcParams(double phi, double& a)
{
  // Now we need to find a suitable t
  // Good old binary search - note we cavalierly fail to check if there's
  // a solution in the interval. Hell, we're going to terminate with something.
  double t = 0;     // phi = 0;
  double t1 = pi/2;  // phi = pi/2;
  double b = 0.5 * pi * sin(phi);
  double epsilon = 1e-6;
  while (fabs(t1 - t) > epsilon) {
    double t2 = (t + t1)/2.0;
    double p = t2 + 0.5 * sin (2 * t2) - b;
    if (p <= 0.0) t = t2; 
    else t1 = t2;
  }
  // t is our selected value
  a = pi / (4 * sqr(cos (t)/cos(phi)));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movsd %xmm0, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movabsq $0x3ff921fb54442d18, %rax # imm = 0x3FF921FB54442D18
movq %rax, -0x20(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x5080
movsd %xmm0, -0x48(%rbp)
fldl -0x48(%rbp)
fldl 0x87c1(%rip)            # 0x15020
fmulp %st, %st(1)
fstpl -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x8bc2(%rip), %xmm0     # 0x15438
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
subsd -0x18(%rbp), %xmm0
movaps 0x8c14(%rip), %xmm1     # 0x154a0
pand %xmm1, %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0xc912
movsd -0x18(%rbp), %xmm0
addsd -0x20(%rbp), %xmm0
movsd 0x8b77(%rip), %xmm1     # 0x15420
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x8b5c(%rip), %xmm0     # 0x15420
mulsd -0x38(%rbp), %xmm0
callq 0x5080
movsd -0x68(%rbp), %xmm1
movsd 0x8b2d(%rip), %xmm2     # 0x15408
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x40(%rbp), %xmm0
jb 0xc903
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xc90d
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0xc87b
movsd -0x18(%rbp), %xmm0
callq 0x5470
movsd %xmm0, -0x70(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0xddd0
movsd 0x8aec(%rip), %xmm1     # 0x15430
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
fldl -0x58(%rbp)
fldl 0x86b2(%rip)            # 0x15008
fdivp %st, %st(1)
fstpl -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, (%rax)
addq $0x70, %rsp
popq %rbp
retq
nop
// File: matthewarcus[P]mmps/transform.cpp
// Function: Mollweide::GetXY(double, double, double&, double&) const
bool Mollweide::GetXY(double phi, double lambda, double& x, double& y) const
{
  bool result = false;
  MollweideEquation equation;
  equation.sinphi = sin(phi);
  double t = 0.0;
  if (equation.FindRoot(-pi/2, pi/2, 1e-5, t)) {
    y = sin(t)/a;
    x = lambda * cos(t);
    result = true;
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movb $0x0, -0x29(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xe290
movsd -0x10(%rbp), %xmm0
callq 0x5080
movq -0x60(%rbp), %rdi
movsd %xmm0, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
movsd 0x853b(%rip), %xmm0     # 0x15028
movsd 0x852b(%rip), %xmm1     # 0x15020
movsd 0x8943(%rip), %xmm2     # 0x15440
leaq -0x48(%rbp), %rsi
callq 0xf5c0
movb %al, -0x55(%rbp)
jmp 0xcb0b
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0xcb14
jmp 0xcb77
movsd -0x48(%rbp), %xmm0
callq 0x5080
movq -0x68(%rbp), %rax
divsd 0xc8(%rax), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, -0x29(%rbp)
jmp 0xcb77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xe2d0
jmp 0xcb94
movb -0x29(%rbp), %al
movb %al, -0x71(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xe2d0
movb -0x71(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x5420
nopl (%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::AddLines(Image&, TransformParams const&) const
void Transform::AddLines (Image& image, const TransformParams& params) const
{
  CmdParams cmdparams;
  cmdparams.color = params.gridcolor;
  cmdparams.gridx = params.gridx;
  cmdparams.gridy = params.gridy;
  DrawGrid(image,params,cmdparams);
  //DrawDial(image,params,cmdparams);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xe2f0
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rax
movw 0xcc(%rax), %cx
movw %cx, -0x40(%rbp)
movb 0xce(%rax), %al
movb %al, -0x3e(%rbp)
movq -0x18(%rbp), %rax
movl 0xc4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movl 0xc8(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0xcc20
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawTemporaryHours(Image&, TransformParams const&, Transform::CmdParams const&) const
void Transform::DrawTemporaryHours(Image& image, 
				   const TransformParams& params,
				   const CmdParams &cmdparams) const
{
  TempPlotter tempplotter(image, params, *this);
  tempplotter.phi = cmdparams.dlat;
  tempplotter.lambda = cmdparams.dlon;
  for (int i = 6; i <= 18; i++) {
    tempplotter.time  = i;
    image.PlotLine(-inclination,+inclination,tempplotter,cmdparams.color,4);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0xe5f0
movq -0x20(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x6, -0x5c(%rbp)
cmpl $0x12, -0x5c(%rbp)
jg 0xd5e2
cvtsi2sdl -0x5c(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movsd 0xfd3c(%rip), %xmm1     # 0x1d2d8
movaps %xmm1, %xmm0
movaps 0x7f1a(%rip), %xmm2     # 0x154c0
pxor %xmm2, %xmm0
movq -0x20(%rbp), %rdx
leaq -0x58(%rbp), %rsi
movl $0x4, %ecx
callq 0x13e50
jmp 0xd5be
jmp 0xd5c0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xd580
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xe660
jmp 0xd5f1
leaq -0x58(%rbp), %rdi
callq 0xe660
addq $0x70, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x5420
nopw (%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawLocalHours(Image&, TransformParams const&, Transform::CmdParams const&) const
void Transform::DrawLocalHours (Image& image, 
				const TransformParams& params,
				const CmdParams &cmdparams) const
{
  LatPlotter latplotter(image, params, *this);
  int nx = 24;
  for (int i = 0; i < nx; i++) {
    double lambda = (i - nx/2) * 2 * pi / nx + cmdparams.dlon;
    latplotter.lambda = lambda;
    // Omit the last section of the lines of latitude.
    image.PlotLine(-inclination, +inclination, latplotter, cmdparams.color, 4);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0xe3e0
movl $0x18, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0xd6dd
movl -0x50(%rbp), %ecx
movl -0x4c(%rbp), %eax
movl %eax, %esi
shrl $0x1f, %esi
movl %eax, %edx
addl %esi, %edx
shrl %edx
subl %edx, %ecx
addl %ecx, %ecx
movl %ecx, -0x68(%rbp)
fildl -0x68(%rbp)
fldl 0x79a0(%rip)            # 0x15008
fmulp %st, %st(1)
movl %eax, -0x6c(%rbp)
fildl -0x6c(%rbp)
fdivrp %st, %st(1)
movq -0x20(%rbp), %rax
fldl 0x20(%rax)
faddp %st, %st(1)
fstpl -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movsd 0xfc44(%rip), %xmm1     # 0x1d2d8
movaps %xmm1, %xmm0
movaps 0x7e22(%rip), %xmm2     # 0x154c0
pxor %xmm2, %xmm0
movq -0x20(%rbp), %rdx
leaq -0x48(%rbp), %rsi
movl $0x4, %ecx
callq 0x13e50
jmp 0xd6b6
jmp 0xd6b8
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xd63b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xe440
jmp 0xd6ec
leaq -0x48(%rbp), %rdi
callq 0xe440
addq $0x70, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x5420
nopw %cs:(%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawAltitudes(Image&, TransformParams const&, Transform::CmdParams const&) const
void Transform::DrawAltitudes(Image& image, 
			 const TransformParams& params,
			 const CmdParams &cmdparams) const
{
  FooPlotter fooplotter(image,params,*this);
  fooplotter.lambda = cmdparams.dlon;
  fooplotter.phi = cmdparams.dlat;
  for (int i = 10; i <= 80; i += 10) {
    fooplotter.theta = radians(i);
    image.PlotLine(0,twopi,fooplotter,cmdparams.color,16);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0xe560
movq -0x20(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0xa, -0x5c(%rbp)
cmpl $0x50, -0x5c(%rbp)
jg 0xd7bb
cvtsi2sdl -0x5c(%rbp), %xmm0
callq 0xdd80
movsd %xmm0, -0x78(%rbp)
jmp 0xd76a
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorps %xmm0, %xmm0
movsd 0x78b1(%rip), %xmm1     # 0x15038
leaq -0x58(%rbp), %rsi
movl $0x10, %ecx
callq 0x13e50
jmp 0xd797
jmp 0xd799
movl -0x5c(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x5c(%rbp)
jmp 0xd753
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xe5d0
jmp 0xd7cd
leaq -0x58(%rbp), %rdi
callq 0xe5d0
addq $0x80, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x5420
nopw %cs:(%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawAnalemma(Image&, TransformParams const&, Transform::CmdParams const&) const
void Transform::DrawAnalemma (Image& image, 
                              const TransformParams& params,
			      const CmdParams &cmdparams) const
{
  int gridx = cmdparams.gridx;
  AnalemmaPlotter analemmaplotter(image, params, *this);
  int nx = 360/gridx;
  for (int i = 0; i < nx; i++) {
    double time = 2 * pi * (i - nx/2) / nx;
    analemmaplotter.time = time;
    image.PlotLine(0, twopi, analemmaplotter, cmdparams.color,16);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xe4e0
movl $0x168, %eax            # imm = 0x168
cltd
idivl -0x24(%rbp)
movl %eax, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0xd8b2
movl -0x58(%rbp), %ecx
movl -0x54(%rbp), %eax
movl %eax, %esi
shrl $0x1f, %esi
movl %eax, %edx
addl %esi, %edx
sarl %edx
subl %edx, %ecx
movl %ecx, -0x70(%rbp)
fildl -0x70(%rbp)
fldl 0x77e4(%rip)            # 0x15038
fmulp %st, %st(1)
movl %eax, -0x74(%rbp)
fildl -0x74(%rbp)
fdivrp %st, %st(1)
fstpl -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorps %xmm0, %xmm0
movsd 0x77ba(%rip), %xmm1     # 0x15038
leaq -0x50(%rbp), %rsi
movl $0x10, %ecx
callq 0x13e50
jmp 0xd88e
jmp 0xd890
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xd82d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xe540
jmp 0xd8c4
leaq -0x50(%rbp), %rdi
callq 0xe540
addq $0x80, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x5420
nopl (%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawTropics(Image&, TransformParams const&, Transform::CmdParams const&) const
void Transform::DrawTropics(Image& image, 
			    const TransformParams& params,
			    const CmdParams &cmdparams) const
{
  LongPlotter longplotter(image, params, *this);
  longplotter.phi = inclination;
  image.PlotLine(-pi, pi, longplotter, cmdparams.color,16);
  longplotter.phi = -inclination;
  image.PlotLine(-pi, pi, longplotter, cmdparams.color,16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xe460
movq -0x60(%rbp), %rsi
movsd 0xf9cb(%rip), %xmm0     # 0x1d2d8
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movsd 0x770e(%rip), %xmm0     # 0x15030
movsd 0x76de(%rip), %xmm1     # 0x15008
movl $0x10, %ecx
callq 0x13e50
jmp 0xd936
movaps 0x7b83(%rip), %xmm1     # 0x154c0
movsd 0xf993(%rip), %xmm0     # 0x1d2d8
pxor %xmm1, %xmm0
movlpd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movsd 0x76d2(%rip), %xmm0     # 0x15030
movsd 0x76a2(%rip), %xmm1     # 0x15008
leaq -0x48(%rbp), %rsi
movl $0x10, %ecx
callq 0x13e50
jmp 0xd976
leaq -0x48(%rbp), %rdi
callq 0xe4c0
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xe4c0
movq -0x50(%rbp), %rdi
callq 0x5420
nopw %cs:(%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawArctics(Image&, TransformParams const&, Transform::CmdParams const&) const
void Transform::DrawArctics(Image& image, 
			    const TransformParams& params,
			    const CmdParams &cmdparams) const
{
  LongPlotter longplotter(image, params, *this);
  longplotter.phi = 0.5*pi-inclination;
  image.PlotLine(-pi, pi, longplotter, cmdparams.color,16);
  longplotter.phi = inclination-0.5*pi;
  image.PlotLine(-pi, pi, longplotter, cmdparams.color,16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xe460
movq -0x60(%rbp), %rsi
fldl 0xf8ed(%rip)            # 0x1d2d8
fldl 0x762f(%rip)            # 0x15020
fsubp %st, %st(1)
fstpl -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movsd 0x762a(%rip), %xmm0     # 0x15030
movsd 0x75fa(%rip), %xmm1     # 0x15008
movl $0x10, %ecx
callq 0x13e50
jmp 0xda1a
fldl 0xf8b8(%rip)            # 0x1d2d8
fldl 0x7602(%rip)            # 0x15028
faddp %st, %st(1)
fstpl -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movsd 0x75f5(%rip), %xmm0     # 0x15030
movsd 0x75c5(%rip), %xmm1     # 0x15008
leaq -0x48(%rbp), %rsi
movl $0x10, %ecx
callq 0x13e50
jmp 0xda53
leaq -0x48(%rbp), %rdi
callq 0xe4c0
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xe4c0
movq -0x50(%rbp), %rdi
callq 0x5420
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawDateline(Image&, TransformParams const&, Transform::CmdParams const&, double) const
void Transform::DrawDateline (Image& image, 
			      const TransformParams& params,
			      const CmdParams &cmdparams,
			      double day) const
{
  LongPlotter longplotter(image, params, *this);
  // Spring equinox is date 0, and is day 80 of a normal year.
  day = day - 80;
  while (day < 0) day += 365;
  while (day >= 365) day -= 365;
  double date = 2 * pi * day / 365;
  longplotter.phi = sundec(date);
  image.PlotLine(-pi, pi, longplotter, cmdparams.color,16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xe460
movsd -0x28(%rbp), %xmm0
movsd 0x7939(%rip), %xmm1     # 0x153f8
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0xdae6
movsd 0x7926(%rip), %xmm0     # 0x15400
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xdac8
jmp 0xdae8
movsd -0x28(%rbp), %xmm0
movsd 0x790b(%rip), %xmm1     # 0x15400
ucomisd %xmm1, %xmm0
jb 0xdb13
movsd -0x28(%rbp), %xmm0
movsd 0x78f8(%rip), %xmm1     # 0x15400
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xdae8
fldl -0x28(%rbp)
fldl 0x751c(%rip)            # 0x15038
fmulp %st, %st(1)
flds 0x794c(%rip)            # 0x15470
fdivrp %st, %st(1)
fstpl -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
callq 0xfc50
movsd %xmm0, -0x70(%rbp)
jmp 0xdb3a
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movsd 0x74dc(%rip), %xmm0     # 0x15030
movsd 0x74ac(%rip), %xmm1     # 0x15008
leaq -0x50(%rbp), %rsi
movl $0x10, %ecx
callq 0x13e50
jmp 0xdb6c
leaq -0x50(%rbp), %rdi
callq 0xe4c0
addq $0x70, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xe4c0
movq -0x60(%rbp), %rdi
callq 0x5420
nopl (%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: Transform::DrawDatetime(Image&, TransformParams const&, Transform::CmdParams const&, double) const
void Transform::DrawDatetime (Image& image, 
			      const TransformParams& params,
			      const CmdParams &cmdparams,
			      double day) const
{
  LongPlotter longplotter(image, params, *this);
  // Spring equinox is day 0
  day = day - 80;
  while (day < 0) day += 365;
  while (day >= 365) day -= 365;
  double time = fmod(day, 1.0)-0.5; // Time relative to noon
  double date = 2 * pi * day / 365;
  double phi = sundec(date);
  double eot = equationoftime(date) / (24 * 60 * 60);
  double apparenttime = time + eot; // AT = MT + EOT
  double lambda = -(2 * pi * apparenttime);
  double x,y;
  MapXY(image, params, phi, lambda, x, y); 
  //fprintf(stderr,"%g %g %g %g %g %g\n", day, time,date,eot,phi,lambda);
  image.PlotPoint(x,y,1,cmdparams.color);
}

// 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 %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xe460
movsd -0x28(%rbp), %xmm0
movsd 0x780f(%rip), %xmm1     # 0x153f8
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0xdc10
movsd 0x77fc(%rip), %xmm0     # 0x15400
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xdbf2
jmp 0xdc12
movsd -0x28(%rbp), %xmm0
movsd 0x77e1(%rip), %xmm1     # 0x15400
ucomisd %xmm1, %xmm0
jb 0xdc3d
movsd -0x28(%rbp), %xmm0
movsd 0x77ce(%rip), %xmm1     # 0x15400
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xdc12
movsd -0x28(%rbp), %xmm0
movsd 0x73fe(%rip), %xmm1     # 0x15048
callq 0x5340
movsd 0x77f9(%rip), %xmm1     # 0x15450
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
fldl -0x28(%rbp)
fldl 0x73cf(%rip)            # 0x15038
fmulp %st, %st(1)
flds 0x77ff(%rip)            # 0x15470
fdivrp %st, %st(1)
fstpl -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0xfc50
movsd %xmm0, -0xb0(%rbp)
jmp 0xdc8a
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0xf950
movsd %xmm0, -0xb8(%rbp)
jmp 0xdcab
movq -0xa8(%rbp), %rdi
movsd -0xb8(%rbp), %xmm0
movsd 0x7796(%rip), %xmm1     # 0x15458
divsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
fldl -0x88(%rbp)
fldl 0x7323(%rip)            # 0x15010
fmulp %st, %st(1)
fstpl -0x90(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movsd -0x68(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
leaq -0x98(%rbp), %rcx
leaq -0xa0(%rbp), %r8
callq 0x94c0
jmp 0xdd1f
movq -0x10(%rbp), %rdi
movsd -0x98(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm1
movq -0x20(%rbp), %rdx
movl $0x1, %esi
callq 0x13da0
jmp 0xdd43
leaq -0x50(%rbp), %rdi
callq 0xe4c0
addq $0xc0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xe4c0
movq -0x70(%rbp), %rdi
callq 0x5420
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: FooPlotter::GetXY(double, double&, double&) const
bool GetXY(double t, double&x, double&y) const
  {
    // Angle up from the pole
    double x0 = cos(t)*cos(theta);
    double y0 = sin(t)*cos(theta);
    double z0 = sin(theta);
    // Now rotate about y axis
    double x1 = sin(phi)*x0 + cos(phi)*z0;
    double y1 = y0;
    double z1 = -cos(phi)*x0 + sin(phi)*z0;
    double phi0 = asin(z1);
    if (phi0 < -inclination || phi0 > inclination) {
      return false;
    } else {
      double lambda0 = atan2(y1,x1);
      return transform.MapXY(image, params, phi0, lambda0+lambda, x, y);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5470
movq -0x80(%rbp), %rax
movsd %xmm0, -0xa0(%rbp)
movsd 0x20(%rax), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0xa0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5080
movq -0x80(%rbp), %rax
movsd %xmm0, -0x98(%rbp)
movsd 0x20(%rax), %xmm0
callq 0x5470
movq -0x80(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x98(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x20(%rax), %xmm0
callq 0x5080
movq -0x80(%rbp), %rax
movsd %xmm0, -0x40(%rbp)
movsd 0x30(%rax), %xmm0
callq 0x5080
movq -0x80(%rbp), %rax
movsd %xmm0, -0x88(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd 0x30(%rax), %xmm0
callq 0x5470
movsd -0x90(%rbp), %xmm2
movq -0x80(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x30(%rax), %xmm0
callq 0x5470
movq -0x80(%rbp), %rax
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x30(%rax), %xmm0
callq 0x5080
movsd -0x78(%rbp), %xmm2
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
callq 0x53e0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm1
movsd 0xdedc(%rip), %xmm0     # 0x1d2d8
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd %xmm1, %xmm0
ja 0xf428
movsd -0x60(%rbp), %xmm0
ucomisd 0xdeb2(%rip), %xmm0     # 0x1d2d8
jbe 0xf42e
movb $0x0, -0x1(%rbp)
jmp 0xf473
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
callq 0x5050
movq -0x80(%rbp), %rax
movsd %xmm0, -0x68(%rbp)
movq 0x18(%rax), %rdi
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movsd -0x60(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
addsd 0x28(%rax), %xmm1
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x94c0
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: matthewarcus[P]mmps/transform.cpp
// Function: TempPlotter::GetXY(double, double&, double&) const
bool GetXY(double t, double&x, double&y) const
  {
    double delta = t;
    // time/angle between sunrise and noon and noon and sunset
    double tau = acos(-tan(phi)*tan(delta));
    //fprintf(stderr,"%g %g %g %g\n", t, phi, lambda, tau);
    double h = tau * (time - 12) / 6.0 + lambda;
    return transform.MapXY(image, params, delta, h, x, y);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x28(%rax), %xmm0
callq 0x5150
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x5150
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
mulsd %xmm1, %xmm0
callq 0x5280
movq -0x40(%rbp), %rax
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x20(%rax), %xmm1
movsd 0x5f21(%rip), %xmm2     # 0x15468
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0x5f09(%rip), %xmm1     # 0x15460
divsd %xmm1, %xmm0
addsd 0x30(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x18(%rax), %rdi
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movsd -0x28(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x94c0
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
// File: matthewarcus[P]mmps/equations.cpp
// Function: Equation::FindRoot(double, double, double, double&) const
bool Equation::FindRoot (double t0, double t1, double epsilon, double& t) const
{
  bool result = false;
  double p0 = (*this)(t0);
  double p1 = (*this)(t1);
  if (p0 > p1) {
    double temp;
    temp = t0; t0 = t1; t1 = temp;
    temp = p0; p0 = p1; p1 = temp;
  };
  if (p0 > 0 || p1 < 0) {
    fprintf(stderr, "No root for %f %f %f %f\n", t0, t1, p0, p1);
  } else {
    while (t1 - t0 > epsilon) {
      double t2 = (t0 + t1) / 2.0;
      double p2 = (*this)(t2);
      if (p2 <= 0.0) {
	t0 = t2;
      } else {
	t1 = t2;
      }
    }
    t = t0;
    result = true;
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
movb $0x0, -0x29(%rbp)
movsd -0x10(%rbp), %xmm0
movq (%rdi), %rax
callq *(%rax)
movq -0x60(%rbp), %rdi
movsd %xmm0, -0x38(%rbp)
movsd -0x18(%rbp), %xmm0
movq (%rdi), %rax
callq *(%rax)
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
ucomisd -0x40(%rbp), %xmm0
jbe 0xf655
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0xf66d
xorps %xmm0, %xmm0
ucomisd -0x40(%rbp), %xmm0
jbe 0xf69b
movq 0xd96c(%rip), %rax      # 0x1cfe0
movq (%rax), %rdi
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
leaq 0x615e(%rip), %rsi      # 0x157f0
movb $0x4, %al
callq 0x5370
jmp 0xf70f
jmp 0xf69d
movsd -0x18(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0xf6fe
movq -0x60(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
addsd -0x18(%rbp), %xmm0
movsd 0x5d5c(%rip), %xmm1     # 0x15420
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movq (%rdi), %rax
callq *(%rax)
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x58(%rbp), %xmm0
jb 0xf6f2
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0xf6fc
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xf69d
movsd -0x10(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: matthewarcus[P]mmps/equations.cpp
// Function: perihelionangle(double)
double perihelionangle (double m)
{
  double e = eccentricity;
  double r = m + 2*e*sin(m) + 5*sqr(e)*sin(2*m)/4 + 
             cube(e)*(-sin(m)/4 + 13*sin(3*m)/12);
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm0, -0x8(%rbp)
movsd 0x6053(%rip), %xmm0     # 0x15788
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x5cd4(%rip), %xmm0     # 0x15420
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x5080
movsd -0x50(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x48(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xddd0
movaps %xmm0, %xmm1
movsd 0x5ff1(%rip), %xmm0     # 0x15780
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x5c80(%rip), %xmm0     # 0x15420
mulsd -0x8(%rbp), %xmm0
callq 0x5080
movsd -0x40(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x38(%rbp), %xmm0
mulsd %xmm2, %xmm1
movsd 0x5c6d(%rip), %xmm2     # 0x15430
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xfe80
movsd %xmm0, -0x20(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x5080
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x5c28(%rip), %xmm1     # 0x15430
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x5f5f(%rip), %xmm0     # 0x15778
mulsd -0x8(%rbp), %xmm0
callq 0x5080
movsd -0x30(%rbp), %xmm2
movsd -0x28(%rbp), %xmm1
movaps %xmm0, %xmm4
movsd -0x20(%rbp), %xmm0
movsd 0x5f33(%rip), %xmm3     # 0x15770
mulsd %xmm4, %xmm3
movsd 0x5c1f(%rip), %xmm4     # 0x15468
divsd %xmm4, %xmm3
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: matthewarcus[P]mmps/equations.cpp
// Function: getperiheliontime()
double getperiheliontime ()
{
  double theta0 = 0;
  double theta1 = 2 * pi;
  double epsilon = 1e-8;
  while (theta1 - theta0 > epsilon) {
    double theta2 = (theta0 + theta1) / 2.0;
    double p = perihelionangle(theta2) - equinoxangle;
    if (p <= 0.0) {
      theta0 = theta2;
    } else {
      theta1 = theta2;
    }
  }
  printf ("Perihelion time: %f\n", -theta1);
  return -theta1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd 0x57b0(%rip), %xmm0     # 0x15038
movsd %xmm0, -0x10(%rbp)
movsd 0x5efb(%rip), %xmm0     # 0x15790
movsd %xmm0, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
subsd -0x8(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0xf8ff
movsd -0x8(%rbp), %xmm0
addsd -0x10(%rbp), %xmm0
movsd 0x5b63(%rip), %xmm1     # 0x15420
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0xf720
subsd 0xda30(%rip), %xmm0     # 0x1d308
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jb 0xf8f3
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xf8fd
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0xf89a
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
leaq 0x5ee7(%rip), %rdi      # 0x15809
movb $0x1, %al
callq 0x5040
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: matthewarcus[P]mmps/equations.cpp
// Function: sunaltitude(double, double, double)
double sunaltitude (double date, double phi, double time)
{
  // Compute altitude of sun at the given date and time,
  // on the zero meridian at latitude phi
  double delta = asin(sunheight(date)); // Declination of the sun

  // Rotate lat = phi, long = 0 round by time
  // Find x,y,z coords on the sphere - no need to use an ellipsoid, as the
  // tangents at a location are the same.
  double x = cos(time) * cos(phi);
  double y = sin(time) * cos(phi);
  double z = sin(phi);

  // The sun vector - the sun is at -x
  double sunx = -cos(delta);
  double suny = 0;
  double sunz = sin(delta);

  // Dot product to get angle to normal
  double alt = pi/2.0 - acos(x * sunx + y * suny + z * sunz);
  return alt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd %xmm2, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0xfc10
callq 0x53e0
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5470
movsd %xmm0, -0x78(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5080
movsd %xmm0, -0x70(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5470
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x5080
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x5470
movaps 0x579e(%rip), %xmm1     # 0x154c0
pxor %xmm1, %xmm0
movlpd %xmm0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x5080
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm1
movsd -0x40(%rbp), %xmm2
movsd -0x30(%rbp), %xmm0
movsd -0x48(%rbp), %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x5280
movsd %xmm0, -0x60(%rbp)
fldl -0x60(%rbp)
fldl 0x5299(%rip)            # 0x15020
fsubp %st, %st(1)
fstpl -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)