void MAG_TMfwd4(double Eps, double Epssq, double K0R4, double K0R4oa,
                double Acoeff[], double Lam0, double K0, double falseE,
                double falseN, int XYonly, double Lambda, double Phi, double *X,
                double *Y, double *pscale, double *CoM) {
  double Lam, CLam, SLam, CPhi, SPhi;
  double P, part1, part2, denom, CChi, SChi;
  double U, V;
  double T, Tsq, denom2;
  double c2u, s2u, c4u, s4u, c6u, s6u, c8u, s8u;
  double c2v, s2v, c4v, s4v, c6v, s6v, c8v, s8v;
  double Xstar, Ystar;
  double sig1, sig2, comroo;
  Lam = Lambda - Lam0;
  CLam = cos(Lam);
  SLam = sin(Lam);
  CPhi = cos(Phi);
  SPhi = sin(Phi);
  P = exp(Eps * (0.5 * log((1 + Eps * SPhi) / (1 - Eps * SPhi))));
  part1 = (1 + SPhi) / P;
  part2 = (1 - SPhi) * P;
  denom = 1 / (part1 + part2);
  CChi = 2 * CPhi * denom;
  SChi = (part1 - part2) * denom;
  T = CChi * SLam;
  U = (0.5 * log((1 + T) / (1 - T)));
  V = atan2(SChi, CChi * CLam);
  Tsq = T * T;
  denom2 = 1 / (1 - Tsq);
  c2u = (1 + Tsq) * denom2;
  s2u = 2 * T * denom2;
  c2v = (-1 + CChi * CChi * (1 + CLam * CLam)) * denom2;
  s2v = 2 * CLam * CChi * SChi * denom2;
  c4u = 1 + 2 * s2u * s2u;
  s4u = 2 * c2u * s2u;
  c4v = 1 - 2 * s2v * s2v;
  s4v = 2 * c2v * s2v;
  c6u = c4u * c2u + s4u * s2u;
  s6u = s4u * c2u + c4u * s2u;
  c6v = c4v * c2v - s4v * s2v;
  s6v = s4v * c2v + c4v * s2v;
  c8u = 1 + 2 * s4u * s4u;
  s8u = 2 * c4u * s4u;
  c8v = 1 - 2 * s4v * s4v;
  s8v = 2 * c4v * s4v;
  Xstar = Acoeff[3] * s8u * c8v;
  Xstar = Xstar + Acoeff[2] * s6u * c6v;
  Xstar = Xstar + Acoeff[1] * s4u * c4v;
  Xstar = Xstar + Acoeff[0] * s2u * c2v;
  Xstar = Xstar + U;
  Ystar = Acoeff[3] * c8u * s8v;
  Ystar = Ystar + Acoeff[2] * c6u * s6v;
  Ystar = Ystar + Acoeff[1] * c4u * s4v;
  Ystar = Ystar + Acoeff[0] * c2u * s2v;
  Ystar = Ystar + V;
  *X = K0R4 * Xstar + falseE;
  *Y = K0R4 * Ystar + falseN;
  if (XYonly == 1) {
    *pscale = K0;
    *CoM = 0;
  } else {
    sig1 = 8 * Acoeff[3] * c8u * c8v;
    sig1 = sig1 + 6 * Acoeff[2] * c6u * c6v;
    sig1 = sig1 + 4 * Acoeff[1] * c4u * c4v;
    sig1 = sig1 + 2 * Acoeff[0] * c2u * c2v;
    sig1 = sig1 + 1;
    sig2 = 8 * Acoeff[3] * s8u * s8v;
    sig2 = sig2 + 6 * Acoeff[2] * s6u * s6v;
    sig2 = sig2 + 4 * Acoeff[1] * s4u * s4v;
    sig2 = sig2 + 2 * Acoeff[0] * s2u * s2v;
    comroo =
        sqrt((1 - Epssq * SPhi * SPhi) * denom2 * (sig1 * sig1 + sig2 * sig2));
    *pscale = K0R4oa * 2 * denom * comroo;
    *CoM = atan2(SChi * SLam, CLam) + atan2(sig2, sig1);
  }
}


x86 assembly (clang, -O0):
<MAG_TMfwd4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    %esi,-0x4c(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
mov    %r8,-0x68(%rbp)
mov    %r9,-0x70(%rbp)
movsd  0x10(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0x18(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0x18(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0xdd8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xda4(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x1a0(%rbp),%xmm0
ff
movsd  0xd94(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xd67(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xd47(%rip),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
addsd  -0xb0(%rbp),%xmm1
ff
movsd  0xd17(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xcfb(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xcab(%rip),%xmm0
addsd  -0xe0(%rbp),%xmm0
ff
movsd  0xc9b(%rip),%xmm1
subsd  -0xe0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  0xc8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  -0x80(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xc31(%rip),%xmm1
subsd  -0xe8(%rbp),%xmm1
ff
movsd  0xc21(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  0xc0d(%rip),%xmm0
addsd  -0xe8(%rbp),%xmm0
ff
mulsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0xbe5(%rip),%xmm0
mulsd  -0xe0(%rbp),%xmm0
ff
mulsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbaf(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xba7(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  0xb7b(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
mulsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  0xb4e(%rip),%xmm0
mulsd  -0x100(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0xb3a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  0xb1e(%rip),%xmm0
mulsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  0xafe(%rip),%xmm0
mulsd  -0x140(%rbp),%xmm0
ff
movsd  -0x140(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xad3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  0xab7(%rip),%xmm0
mulsd  -0x138(%rbp),%xmm0
ff
mulsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
movsd  -0xf8(%rbp),%xmm2
ff
movsd  -0x110(%rbp),%xmm1
ff
mulsd  -0x100(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
movsd  -0xf8(%rbp),%xmm2
ff
movsd  -0x108(%rbp),%xmm1
ff
mulsd  -0x100(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm2
ff
movsd  -0x150(%rbp),%xmm1
ff
mulsd  -0x140(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm2
ff
movsd  -0x148(%rbp),%xmm1
ff
mulsd  -0x140(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  0x9c0(%rip),%xmm0
mulsd  -0x110(%rbp),%xmm0
ff
movsd  -0x110(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0x9ac(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  0x990(%rip),%xmm0
mulsd  -0x108(%rbp),%xmm0
ff
mulsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0x970(%rip),%xmm0
mulsd  -0x150(%rbp),%xmm0
ff
movsd  -0x150(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x945(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  0x929(%rip),%xmm0
mulsd  -0x148(%rbp),%xmm0
ff
mulsd  -0x150(%rbp),%xmm0
ff
movsd  %xmm0,-0x170(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
mulsd  -0x168(%rbp),%xmm0
ff
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x178(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x120(%rbp),%xmm0
ff
movsd  -0x158(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x178(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x110(%rbp),%xmm0
ff
movsd  -0x148(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x178(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x100(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x178(%rbp),%xmm0
ff
addsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x178(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
mulsd  -0x128(%rbp),%xmm0
ff
mulsd  -0x170(%rbp),%xmm0
ff
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x180(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x118(%rbp),%xmm0
ff
movsd  -0x160(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x180(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x108(%rbp),%xmm0
ff
movsd  -0x150(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x180(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0xf8(%rbp),%xmm0
ff
movsd  -0x140(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x180(%rbp),%xmm0
ff
addsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0x178(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  -0x180(%rbp),%xmm2
ff
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x1,-0x4c(%rbp)
jne    18f0 <MAG_TMfwd4+0x790>
movsd  -0x38(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x70(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1b9e <MAG_TMfwd4+0xa3e>
mov    -0x28(%rbp),%rax
movsd  0x734(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mulsd  -0x128(%rbp),%xmm0
ff
mulsd  -0x168(%rbp),%xmm0
ff
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x188(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x6fb(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mulsd  -0x118(%rbp),%xmm0
ff
movsd  -0x158(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x188(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x6ba(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mulsd  -0x108(%rbp),%xmm0
ff
movsd  -0x148(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x188(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x661(%rip),%xmm0
mulsd  (%rax),%xmm0
mulsd  -0xf8(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  0x63d(%rip),%xmm0
addsd  -0x188(%rbp),%xmm0
ff
movsd  %xmm0,-0x188(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  0x649(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
mulsd  -0x170(%rbp),%xmm0
ff
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x190(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x610(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mulsd  -0x120(%rbp),%xmm0
ff
movsd  -0x160(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x190(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x5cf(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mulsd  -0x110(%rbp),%xmm0
ff
movsd  -0x150(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x190(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  0x576(%rip),%xmm0
mulsd  (%rax),%xmm0
mulsd  -0x100(%rbp),%xmm0
ff
movsd  -0x140(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x522(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0xf0(%rbp),%xmm0
ff
movsd  -0x188(%rbp),%xmm1
ff
movsd  -0x188(%rbp),%xmm3
ff
movsd  -0x190(%rbp),%xmm2
ff
mulsd  -0x190(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x198(%rbp)
ff
movsd  0x4cd(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0x198(%rbp),%xmm0
ff
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  -0x190(%rbp),%xmm0
ff
movsd  -0x188(%rbp),%xmm1
ff
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movsd  -0x1a8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mov    -0x70(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAG_TMfwd4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbp
mov    %esi,%r13d
movsd  %xmm7,0xb0(%rsp)
movsd  %xmm6,0xa8(%rsp)
movsd  %xmm5,0x78(%rsp)
mov    %rdi,%rbx
movsd  %xmm3,0x90(%rsp)
movsd  %xmm2,0xa0(%rsp)
movsd  %xmm1,0x88(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xf0(%rsp),%xmm0
subsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0xf8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xf8(%rsp),%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x38(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdd7(%rip),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
call   1070 <log@plt>
mulsd  0xdc2(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1050 <exp@plt>
movsd  0x38(%rsp),%xmm2
movapd %xmm2,%xmm3
movsd  0xd9d(%rip),%xmm4
addsd  %xmm4,%xmm3
divsd  %xmm0,%xmm3
movapd %xmm4,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm4,%xmm2
divsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
subsd  %xmm1,%xmm3
movsd  %xmm2,0x80(%rsp)
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x28(%rsp)
movsd  0x40(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
addsd  %xmm4,%xmm0
movapd %xmm4,%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1070 <log@plt>
mulsd  0xd25(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x28(%rsp),%xmm0
call   1030 <atan2@plt>
movsd  %xmm0,0x98(%rsp)
movsd  0x10(%rsp),%xmm6
movapd %xmm6,%xmm3
mulsd  %xmm6,%xmm3
movsd  0xce1(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm6,%xmm6
mulsd  %xmm1,%xmm6
movsd  0x8(%rsp),%xmm7
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
movsd  0x30(%rsp),%xmm4
movapd %xmm4,%xmm9
mulsd  %xmm4,%xmm9
addsd  %xmm2,%xmm9
movapd %xmm2,%xmm5
mulsd  %xmm0,%xmm9
addsd  0xc9c(%rip),%xmm9
mulsd  %xmm1,%xmm9
movapd %xmm4,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm7,%xmm2
mulsd  0x28(%rsp),%xmm2
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm1,%xmm2
movapd %xmm6,%xmm0
movapd %xmm6,%xmm14
addsd  %xmm6,%xmm14
mulsd  %xmm6,%xmm14
addsd  %xmm5,%xmm14
movapd %xmm3,%xmm1
movsd  %xmm3,0x20(%rsp)
movapd %xmm3,%xmm7
addsd  %xmm3,%xmm7
mulsd  %xmm0,%xmm7
movapd %xmm0,%xmm4
movsd  %xmm0,0x10(%rsp)
movsd  0xc43(%rip),%xmm3
movapd %xmm2,%xmm10
mulsd  %xmm3,%xmm10
mulsd  %xmm2,%xmm10
addsd  %xmm5,%xmm10
movapd %xmm5,%xmm11
mulsd  %xmm7,%xmm0
movapd %xmm14,%xmm8
mulsd  %xmm1,%xmm8
addsd  %xmm0,%xmm8
movapd %xmm4,%xmm0
mulsd  %xmm14,%xmm0
movapd %xmm7,%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm0,%xmm5
movapd %xmm9,%xmm4
addsd  %xmm9,%xmm4
mulsd  %xmm2,%xmm4
movapd %xmm2,%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm10,%xmm6
mulsd  %xmm9,%xmm6
subsd  %xmm0,%xmm6
movapd %xmm2,%xmm0
mulsd  %xmm10,%xmm0
movapd %xmm4,%xmm15
mulsd  %xmm9,%xmm15
addsd  %xmm0,%xmm15
movapd %xmm14,%xmm0
addsd  %xmm14,%xmm0
mulsd  %xmm7,%xmm0
mulsd  %xmm4,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm11,%xmm3
movsd  0x18(%rbx),%xmm11
movapd %xmm11,%xmm1
movsd  %xmm0,0x50(%rsp)
mulsd  %xmm0,%xmm1
movsd  %xmm3,0x68(%rsp)
mulsd  %xmm3,%xmm1
movsd  0x10(%rbx),%xmm0
movapd %xmm0,%xmm3
movsd  %xmm5,0x70(%rsp)
mulsd  %xmm5,%xmm3
movapd %xmm8,%xmm5
movsd  %xmm6,0x48(%rsp)
mulsd  %xmm6,%xmm3
addsd  %xmm1,%xmm3
movsd  0x8(%rbx),%xmm12
movapd %xmm12,%xmm1
mulsd  %xmm7,%xmm1
mulsd  %xmm10,%xmm1
addsd  %xmm3,%xmm1
movsd  (%rbx),%xmm13
movapd %xmm13,%xmm8
mulsd  0x10(%rsp),%xmm8
mulsd  %xmm9,%xmm8
addsd  %xmm1,%xmm8
addsd  0x18(%rsp),%xmm8
movapd %xmm7,%xmm3
addsd  %xmm7,%xmm3
movsd  %xmm7,0x58(%rsp)
mulsd  %xmm7,%xmm3
addsd  0xafa(%rip),%xmm3
movsd  %xmm10,0x60(%rsp)
addsd  %xmm10,%xmm10
mulsd  %xmm4,%xmm10
mulsd  %xmm3,%xmm11
mulsd  %xmm10,%xmm11
mulsd  %xmm5,%xmm0
movsd  %xmm15,0x18(%rsp)
mulsd  %xmm15,%xmm0
addsd  %xmm11,%xmm0
movsd  0x20(%rsp),%xmm7
mulsd  %xmm14,%xmm12
mulsd  %xmm4,%xmm12
addsd  %xmm0,%xmm12
mulsd  %xmm7,%xmm13
mulsd  %xmm2,%xmm13
addsd  %xmm12,%xmm13
addsd  0x98(%rsp),%xmm13
movsd  0xa0(%rsp),%xmm0
mulsd  %xmm0,%xmm8
addsd  0xa8(%rsp),%xmm8
movsd  %xmm8,0x0(%rbp)
mulsd  %xmm0,%xmm13
addsd  0xb0(%rsp),%xmm13
movsd  %xmm13,(%r12)
cmp    $0x1,%r13d
jne    15b1 <MAG_TMfwd4+0x451>
movsd  0x78(%rsp),%xmm0
movsd  %xmm0,(%r15)
xorpd  %xmm0,%xmm0
jmp    1726 <MAG_TMfwd4+0x5c6>
movapd %xmm4,%xmm11
movsd  0x18(%rbx),%xmm8
mulsd  0xa5b(%rip),%xmm8
mulsd  %xmm8,%xmm3
movsd  0x68(%rsp),%xmm6
mulsd  %xmm3,%xmm6
movsd  0x10(%rbx),%xmm3
mulsd  0xa47(%rip),%xmm3
mulsd  %xmm3,%xmm5
mulsd  0x48(%rsp),%xmm5
movsd  0x8(%rbx),%xmm0
mulsd  0xa38(%rip),%xmm0
addsd  %xmm6,%xmm5
mulsd  %xmm0,%xmm14
mulsd  0x60(%rsp),%xmm14
addsd  %xmm5,%xmm14
movsd  (%rbx),%xmm6
addsd  %xmm6,%xmm6
mulsd  %xmm6,%xmm7
mulsd  %xmm9,%xmm7
addsd  %xmm14,%xmm7
movsd  0x50(%rsp),%xmm4
mulsd  %xmm8,%xmm4
mulsd  %xmm4,%xmm10
movsd  0x70(%rsp),%xmm4
mulsd  %xmm3,%xmm4
mulsd  0x18(%rsp),%xmm4
addsd  %xmm10,%xmm4
movsd  0x58(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm11,%xmm1
addsd  %xmm4,%xmm1
movsd  0x10(%rsp),%xmm3
mulsd  %xmm6,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  0x88(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x974(%rip),%xmm2
addsd  %xmm2,%xmm7
subsd  %xmm0,%xmm2
mulsd  0x8(%rsp),%xmm2
movsd  %xmm3,0x10(%rsp)
movapd %xmm3,%xmm1
mulsd  %xmm3,%xmm1
movsd  %xmm7,0x20(%rsp)
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     16ce <MAG_TMfwd4+0x56e>
sqrtsd %xmm0,%xmm0
jmp    16d3 <MAG_TMfwd4+0x573>
call   1080 <sqrt@plt>
movsd  0x90(%rsp),%xmm1
addsd  %xmm1,%xmm1
mulsd  0x80(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
movsd  0x40(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1030 <atan2@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @MAG_TMfwd4(double %0, double %1, double %2, double %3, double* %4, double %5, double %6, double %7, double %8, i32 %9, double %10, double %11, double* %12, double* %13, double* %14, double* %15) {
%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 i32
%27 = alloca double
%28 = alloca double
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca double*
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
%45 = alloca double
%46 = alloca double
%47 = alloca double
%48 = alloca double
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
%54 = alloca double
%55 = alloca double
%56 = alloca double
%57 = alloca double
%58 = alloca double
%59 = alloca double
%60 = alloca double
%61 = alloca double
%62 = alloca double
%63 = alloca double
%64 = alloca double
%65 = alloca double
%66 = alloca double
%67 = alloca double
%68 = alloca double
%69 = alloca double
store double %0, double* %17
store double %1, double* %18
store double %2, double* %19
store double %3, double* %20
store double* %4, double** %21
store double %5, double* %22
store double %6, double* %23
store double %7, double* %24
store double %8, double* %25
store i32 %9, i32* %26
store double %10, double* %27
store double %11, double* %28
store double* %12, double** %29
store double* %13, double** %30
store double* %14, double** %31
store double* %15, double** %32
%70 = load double, double* %27
%71 = load double, double* %22
%72 = fsub double %70, %71
store double %72, double* %33
%73 = load double, double* %33
%74 = call double @cos(double %73)
store double %74, double* %34
%75 = load double, double* %33
%76 = call double @sin(double %75)
store double %76, double* %35
%77 = load double, double* %28
%78 = call double @cos(double %77)
store double %78, double* %36
%79 = load double, double* %28
%80 = call double @sin(double %79)
store double %80, double* %37
%81 = load double, double* %17
%82 = load double, double* %17
%83 = load double, double* %37
%84 = call double @llvm.fmuladd.f64(double %82, double %83, double 1.000000e+00)
%85 = load double, double* %17
%86 = load double, double* %37
%87 = fneg double %85
%88 = call double @llvm.fmuladd.f64(double %87, double %86, double 1.000000e+00)
%89 = fdiv double %84, %88
%90 = call double @log(double %89)
%91 = fmul double 5.000000e-01, %90
%92 = fmul double %81, %91
%93 = call double @exp(double %92)
store double %93, double* %38
%94 = load double, double* %37
%95 = fadd double 1.000000e+00, %94
%96 = load double, double* %38
%97 = fdiv double %95, %96
store double %97, double* %39
%98 = load double, double* %37
%99 = fsub double 1.000000e+00, %98
%100 = load double, double* %38
%101 = fmul double %99, %100
store double %101, double* %40
%102 = load double, double* %39
%103 = load double, double* %40
%104 = fadd double %102, %103
%105 = fdiv double 1.000000e+00, %104
store double %105, double* %41
%106 = load double, double* %36
%107 = fmul double 2.000000e+00, %106
%108 = load double, double* %41
%109 = fmul double %107, %108
store double %109, double* %42
%110 = load double, double* %39
%111 = load double, double* %40
%112 = fsub double %110, %111
%113 = load double, double* %41
%114 = fmul double %112, %113
store double %114, double* %43
%115 = load double, double* %42
%116 = load double, double* %35
%117 = fmul double %115, %116
store double %117, double* %46
%118 = load double, double* %46
%119 = fadd double 1.000000e+00, %118
%120 = load double, double* %46
%121 = fsub double 1.000000e+00, %120
%122 = fdiv double %119, %121
%123 = call double @log(double %122)
%124 = fmul double 5.000000e-01, %123
store double %124, double* %44
%125 = load double, double* %43
%126 = load double, double* %42
%127 = load double, double* %34
%128 = fmul double %126, %127
%129 = call double @atan2(double %125, double %128)
store double %129, double* %45
%130 = load double, double* %46
%131 = load double, double* %46
%132 = fmul double %130, %131
store double %132, double* %47
%133 = load double, double* %47
%134 = fsub double 1.000000e+00, %133
%135 = fdiv double 1.000000e+00, %134
store double %135, double* %48
%136 = load double, double* %47
%137 = fadd double 1.000000e+00, %136
%138 = load double, double* %48
%139 = fmul double %137, %138
store double %139, double* %49
%140 = load double, double* %46
%141 = fmul double 2.000000e+00, %140
%142 = load double, double* %48
%143 = fmul double %141, %142
store double %143, double* %50
%144 = load double, double* %42
%145 = load double, double* %42
%146 = fmul double %144, %145
%147 = load double, double* %34
%148 = load double, double* %34
%149 = call double @llvm.fmuladd.f64(double %147, double %148, double 1.000000e+00)
%150 = call double @llvm.fmuladd.f64(double %146, double %149, double -1.000000e+00)
%151 = load double, double* %48
%152 = fmul double %150, %151
store double %152, double* %57
%153 = load double, double* %34
%154 = fmul double 2.000000e+00, %153
%155 = load double, double* %42
%156 = fmul double %154, %155
%157 = load double, double* %43
%158 = fmul double %156, %157
%159 = load double, double* %48
%160 = fmul double %158, %159
store double %160, double* %58
%161 = load double, double* %50
%162 = fmul double 2.000000e+00, %161
%163 = load double, double* %50
%164 = call double @llvm.fmuladd.f64(double %162, double %163, double 1.000000e+00)
store double %164, double* %51
%165 = load double, double* %49
%166 = fmul double 2.000000e+00, %165
%167 = load double, double* %50
%168 = fmul double %166, %167
store double %168, double* %52
%169 = load double, double* %58
%170 = fmul double 2.000000e+00, %169
%171 = load double, double* %58
%172 = fneg double %170
%173 = call double @llvm.fmuladd.f64(double %172, double %171, double 1.000000e+00)
store double %173, double* %59
%174 = load double, double* %57
%175 = fmul double 2.000000e+00, %174
%176 = load double, double* %58
%177 = fmul double %175, %176
store double %177, double* %60
%178 = load double, double* %51
%179 = load double, double* %49
%180 = load double, double* %52
%181 = load double, double* %50
%182 = fmul double %180, %181
%183 = call double @llvm.fmuladd.f64(double %178, double %179, double %182)
store double %183, double* %53
%184 = load double, double* %52
%185 = load double, double* %49
%186 = load double, double* %51
%187 = load double, double* %50
%188 = fmul double %186, %187
%189 = call double @llvm.fmuladd.f64(double %184, double %185, double %188)
store double %189, double* %54
%190 = load double, double* %59
%191 = load double, double* %57
%192 = load double, double* %60
%193 = load double, double* %58
%194 = fmul double %192, %193
%195 = fneg double %194
%196 = call double @llvm.fmuladd.f64(double %190, double %191, double %195)
store double %196, double* %61
%197 = load double, double* %60
%198 = load double, double* %57
%199 = load double, double* %59
%200 = load double, double* %58
%201 = fmul double %199, %200
%202 = call double @llvm.fmuladd.f64(double %197, double %198, double %201)
store double %202, double* %62
%203 = load double, double* %52
%204 = fmul double 2.000000e+00, %203
%205 = load double, double* %52
%206 = call double @llvm.fmuladd.f64(double %204, double %205, double 1.000000e+00)
store double %206, double* %55
%207 = load double, double* %51
%208 = fmul double 2.000000e+00, %207
%209 = load double, double* %52
%210 = fmul double %208, %209
store double %210, double* %56
%211 = load double, double* %60
%212 = fmul double 2.000000e+00, %211
%213 = load double, double* %60
%214 = fneg double %212
%215 = call double @llvm.fmuladd.f64(double %214, double %213, double 1.000000e+00)
store double %215, double* %63
%216 = load double, double* %59
%217 = fmul double 2.000000e+00, %216
%218 = load double, double* %60
%219 = fmul double %217, %218
store double %219, double* %64
%220 = load double*, double** %21
%221 = getelementptr inbounds double, double* %220, i64 3
%222 = load double, double* %221
%223 = load double, double* %56
%224 = fmul double %222, %223
%225 = load double, double* %63
%226 = fmul double %224, %225
store double %226, double* %65
%227 = load double, double* %65
%228 = load double*, double** %21
%229 = getelementptr inbounds double, double* %228, i64 2
%230 = load double, double* %229
%231 = load double, double* %54
%232 = fmul double %230, %231
%233 = load double, double* %61
%234 = call double @llvm.fmuladd.f64(double %232, double %233, double %227)
store double %234, double* %65
%235 = load double, double* %65
%236 = load double*, double** %21
%237 = getelementptr inbounds double, double* %236, i64 1
%238 = load double, double* %237
%239 = load double, double* %52
%240 = fmul double %238, %239
%241 = load double, double* %59
%242 = call double @llvm.fmuladd.f64(double %240, double %241, double %235)
store double %242, double* %65
%243 = load double, double* %65
%244 = load double*, double** %21
%245 = getelementptr inbounds double, double* %244, i64 0
%246 = load double, double* %245
%247 = load double, double* %50
%248 = fmul double %246, %247
%249 = load double, double* %57
%250 = call double @llvm.fmuladd.f64(double %248, double %249, double %243)
store double %250, double* %65
%251 = load double, double* %65
%252 = load double, double* %44
%253 = fadd double %251, %252
store double %253, double* %65
%254 = load double*, double** %21
%255 = getelementptr inbounds double, double* %254, i64 3
%256 = load double, double* %255
%257 = load double, double* %55
%258 = fmul double %256, %257
%259 = load double, double* %64
%260 = fmul double %258, %259
store double %260, double* %66
%261 = load double, double* %66
%262 = load double*, double** %21
%263 = getelementptr inbounds double, double* %262, i64 2
%264 = load double, double* %263
%265 = load double, double* %53
%266 = fmul double %264, %265
%267 = load double, double* %62
%268 = call double @llvm.fmuladd.f64(double %266, double %267, double %261)
store double %268, double* %66
%269 = load double, double* %66
%270 = load double*, double** %21
%271 = getelementptr inbounds double, double* %270, i64 1
%272 = load double, double* %271
%273 = load double, double* %51
%274 = fmul double %272, %273
%275 = load double, double* %60
%276 = call double @llvm.fmuladd.f64(double %274, double %275, double %269)
store double %276, double* %66
%277 = load double, double* %66
%278 = load double*, double** %21
%279 = getelementptr inbounds double, double* %278, i64 0
%280 = load double, double* %279
%281 = load double, double* %49
%282 = fmul double %280, %281
%283 = load double, double* %58
%284 = call double @llvm.fmuladd.f64(double %282, double %283, double %277)
store double %284, double* %66
%285 = load double, double* %66
%286 = load double, double* %45
%287 = fadd double %285, %286
store double %287, double* %66
%288 = load double, double* %19
%289 = load double, double* %65
%290 = load double, double* %24
%291 = call double @llvm.fmuladd.f64(double %288, double %289, double %290)
%292 = load double*, double** %29
store double %291, double* %292
%293 = load double, double* %19
%294 = load double, double* %66
%295 = load double, double* %25
%296 = call double @llvm.fmuladd.f64(double %293, double %294, double %295)
%297 = load double*, double** %30
store double %296, double* %297
%298 = load i32, i32* %26
%299 = icmp eq i32 %298, 1
br i1 %299, label %300, label %304
300: ; preds = %16
%301 = load double, double* %23
%302 = load double*, double** %31
store double %301, double* %302
%303 = load double*, double** %32
store double 0.000000e+00, double* %303
br label %410
304: ; preds = %16
%305 = load double*, double** %21
%306 = getelementptr inbounds double, double* %305, i64 3
%307 = load double, double* %306
%308 = fmul double 8.000000e+00, %307
%309 = load double, double* %55
%310 = fmul double %308, %309
%311 = load double, double* %63
%312 = fmul double %310, %311
store double %312, double* %67
%313 = load double, double* %67
%314 = load double*, double** %21
%315 = getelementptr inbounds double, double* %314, i64 2
%316 = load double, double* %315
%317 = fmul double 6.000000e+00, %316
%318 = load double, double* %53
%319 = fmul double %317, %318
%320 = load double, double* %61
%321 = call double @llvm.fmuladd.f64(double %319, double %320, double %313)
store double %321, double* %67
%322 = load double, double* %67
%323 = load double*, double** %21
%324 = getelementptr inbounds double, double* %323, i64 1
%325 = load double, double* %324
%326 = fmul double 4.000000e+00, %325
%327 = load double, double* %51
%328 = fmul double %326, %327
%329 = load double, double* %59
%330 = call double @llvm.fmuladd.f64(double %328, double %329, double %322)
store double %330, double* %67
%331 = load double, double* %67
%332 = load double*, double** %21
%333 = getelementptr inbounds double, double* %332, i64 0
%334 = load double, double* %333
%335 = fmul double 2.000000e+00, %334
%336 = load double, double* %49
%337 = fmul double %335, %336
%338 = load double, double* %57
%339 = call double @llvm.fmuladd.f64(double %337, double %338, double %331)
store double %339, double* %67
%340 = load double, double* %67
%341 = fadd double %340, 1.000000e+00
store double %341, double* %67
%342 = load double*, double** %21
%343 = getelementptr inbounds double, double* %342, i64 3
%344 = load double, double* %343
%345 = fmul double 8.000000e+00, %344
%346 = load double, double* %56
%347 = fmul double %345, %346
%348 = load double, double* %64
%349 = fmul double %347, %348
store double %349, double* %68
%350 = load double, double* %68
%351 = load double*, double** %21
%352 = getelementptr inbounds double, double* %351, i64 2
%353 = load double, double* %352
%354 = fmul double 6.000000e+00, %353
%355 = load double, double* %54
%356 = fmul double %354, %355
%357 = load double, double* %62
%358 = call double @llvm.fmuladd.f64(double %356, double %357, double %350)
store double %358, double* %68
%359 = load double, double* %68
%360 = load double*, double** %21
%361 = getelementptr inbounds double, double* %360, i64 1
%362 = load double, double* %361
%363 = fmul double 4.000000e+00, %362
%364 = load double, double* %52
%365 = fmul double %363, %364
%366 = load double, double* %60
%367 = call double @llvm.fmuladd.f64(double %365, double %366, double %359)
store double %367, double* %68
%368 = load double, double* %68
%369 = load double*, double** %21
%370 = getelementptr inbounds double, double* %369, i64 0
%371 = load double, double* %370
%372 = fmul double 2.000000e+00, %371
%373 = load double, double* %50
%374 = fmul double %372, %373
%375 = load double, double* %58
%376 = call double @llvm.fmuladd.f64(double %374, double %375, double %368)
store double %376, double* %68
%377 = load double, double* %18
%378 = load double, double* %37
%379 = fmul double %377, %378
%380 = load double, double* %37
%381 = fneg double %379
%382 = call double @llvm.fmuladd.f64(double %381, double %380, double 1.000000e+00)
%383 = load double, double* %48
%384 = fmul double %382, %383
%385 = load double, double* %67
%386 = load double, double* %67
%387 = load double, double* %68
%388 = load double, double* %68
%389 = fmul double %387, %388
%390 = call double @llvm.fmuladd.f64(double %385, double %386, double %389)
%391 = fmul double %384, %390
%392 = call double @sqrt(double %391)
store double %392, double* %69
%393 = load double, double* %20
%394 = fmul double %393, 2.000000e+00
%395 = load double, double* %41
%396 = fmul double %394, %395
%397 = load double, double* %69
%398 = fmul double %396, %397
%399 = load double*, double** %31
store double %398, double* %399
%400 = load double, double* %43
%401 = load double, double* %35
%402 = fmul double %400, %401
%403 = load double, double* %34
%404 = call double @atan2(double %402, double %403)
%405 = load double, double* %68
%406 = load double, double* %67
%407 = call double @atan2(double %405, double %406)
%408 = fadd double %404, %407
%409 = load double*, double** %32
store double %408, double* %409
br label %410
410: ; preds = %304, %300
ret void
}

LLVM IR (-O2):
define void @MAG_TMfwd4(double %0, double %1, double %2, double %3, double* nocapture %4, double %5, double %6, double %7, double %8, i32 %9, double %10, double %11, double* nocapture writeonly %12, double* nocapture writeonly %13, double* nocapture writeonly %14, double* nocapture writeonly %15) {
%17 = fsub double %10, %5
%18 = tail call double @cos(double %17)
%19 = tail call double @sin(double %17)
%20 = tail call double @cos(double %11)
%21 = tail call double @sin(double %11)
%22 = tail call double @llvm.fmuladd.f64(double %0, double %21, double 1.000000e+00)
%23 = fneg double %0
%24 = tail call double @llvm.fmuladd.f64(double %23, double %21, double 1.000000e+00)
%25 = fdiv double %22, %24
%26 = tail call double @log(double %25)
%27 = fmul double %26, 5.000000e-01
%28 = fmul double %27, %0
%29 = tail call double @exp(double %28)
%30 = fadd double %21, 1.000000e+00
%31 = fdiv double %30, %29
%32 = fsub double 1.000000e+00, %21
%33 = fmul double %32, %29
%34 = fadd double %31, %33
%35 = fdiv double 1.000000e+00, %34
%36 = fmul double %20, 2.000000e+00
%37 = fmul double %36, %35
%38 = fsub double %31, %33
%39 = fmul double %38, %35
%40 = fmul double %19, %37
%41 = fadd double %40, 1.000000e+00
%42 = fsub double 1.000000e+00, %40
%43 = fdiv double %41, %42
%44 = tail call double @log(double %43)
%45 = fmul double %44, 5.000000e-01
%46 = fmul double %18, %37
%47 = tail call double @atan2(double %39, double %46)
%48 = fmul double %40, %40
%49 = fsub double 1.000000e+00, %48
%50 = fdiv double 1.000000e+00, %49
%51 = fadd double %48, 1.000000e+00
%52 = fmul double %51, %50
%53 = fmul double %40, 2.000000e+00
%54 = fmul double %53, %50
%55 = fmul double %37, %37
%56 = tail call double @llvm.fmuladd.f64(double %18, double %18, double 1.000000e+00)
%57 = tail call double @llvm.fmuladd.f64(double %55, double %56, double -1.000000e+00)
%58 = fmul double %57, %50
%59 = fmul double %18, 2.000000e+00
%60 = fmul double %59, %37
%61 = fmul double %39, %60
%62 = fmul double %61, %50
%63 = fmul double %54, 2.000000e+00
%64 = tail call double @llvm.fmuladd.f64(double %63, double %54, double 1.000000e+00)
%65 = fmul double %52, 2.000000e+00
%66 = fmul double %54, %65
%67 = fmul double %62, -2.000000e+00
%68 = tail call double @llvm.fmuladd.f64(double %67, double %62, double 1.000000e+00)
%69 = fmul double %58, 2.000000e+00
%70 = fmul double %62, %69
%71 = fmul double %54, %66
%72 = tail call double @llvm.fmuladd.f64(double %64, double %52, double %71)
%73 = fmul double %54, %64
%74 = tail call double @llvm.fmuladd.f64(double %66, double %52, double %73)
%75 = fneg double %70
%76 = fmul double %62, %75
%77 = tail call double @llvm.fmuladd.f64(double %68, double %58, double %76)
%78 = fmul double %62, %68
%79 = tail call double @llvm.fmuladd.f64(double %70, double %58, double %78)
%80 = fmul double %66, 2.000000e+00
%81 = tail call double @llvm.fmuladd.f64(double %80, double %66, double 1.000000e+00)
%82 = fmul double %64, 2.000000e+00
%83 = fmul double %66, %82
%84 = fmul double %70, -2.000000e+00
%85 = tail call double @llvm.fmuladd.f64(double %84, double %70, double 1.000000e+00)
%86 = fmul double %68, 2.000000e+00
%87 = fmul double %70, %86
%88 = getelementptr inbounds double, double* %4, i64 3
%89 = load double, double* %88
%90 = fmul double %89, %83
%91 = fmul double %85, %90
%92 = getelementptr inbounds double, double* %4, i64 2
%93 = load double, double* %92
%94 = fmul double %93, %74
%95 = tail call double @llvm.fmuladd.f64(double %94, double %77, double %91)
%96 = getelementptr inbounds double, double* %4, i64 1
%97 = load double, double* %96
%98 = fmul double %97, %66
%99 = tail call double @llvm.fmuladd.f64(double %98, double %68, double %95)
%100 = load double, double* %4
%101 = fmul double %100, %54
%102 = tail call double @llvm.fmuladd.f64(double %101, double %58, double %99)
%103 = fadd double %45, %102
%104 = fmul double %89, %81
%105 = fmul double %87, %104
%106 = fmul double %93, %72
%107 = tail call double @llvm.fmuladd.f64(double %106, double %79, double %105)
%108 = fmul double %97, %64
%109 = tail call double @llvm.fmuladd.f64(double %108, double %70, double %107)
%110 = fmul double %100, %52
%111 = tail call double @llvm.fmuladd.f64(double %110, double %62, double %109)
%112 = fadd double %47, %111
%113 = tail call double @llvm.fmuladd.f64(double %2, double %103, double %7)
store double %113, double* %12
%114 = tail call double @llvm.fmuladd.f64(double %2, double %112, double %8)
store double %114, double* %13
%115 = icmp eq i32 %9, 1
br i1 %115, label %116, label %117
116: ; preds = %16
store double %6, double* %14
br label %158
117: ; preds = %16
%118 = load double, double* %88
%119 = fmul double %118, 8.000000e+00
%120 = fmul double %81, %119
%121 = fmul double %85, %120
%122 = load double, double* %92
%123 = fmul double %122, 6.000000e+00
%124 = fmul double %72, %123
%125 = tail call double @llvm.fmuladd.f64(double %124, double %77, double %121)
%126 = load double, double* %96
%127 = fmul double %126, 4.000000e+00
%128 = fmul double %64, %127
%129 = tail call double @llvm.fmuladd.f64(double %128, double %68, double %125)
%130 = load double, double* %4
%131 = fmul double %130, 2.000000e+00
%132 = fmul double %52, %131
%133 = tail call double @llvm.fmuladd.f64(double %132, double %58, double %129)
%134 = fadd double %133, 1.000000e+00
%135 = fmul double %83, %119
%136 = fmul double %87, %135
%137 = fmul double %74, %123
%138 = tail call double @llvm.fmuladd.f64(double %137, double %79, double %136)
%139 = fmul double %66, %127
%140 = tail call double @llvm.fmuladd.f64(double %139, double %70, double %138)
%141 = fmul double %54, %131
%142 = tail call double @llvm.fmuladd.f64(double %141, double %62, double %140)
%143 = fneg double %21
%144 = fmul double %143, %1
%145 = tail call double @llvm.fmuladd.f64(double %144, double %21, double 1.000000e+00)
%146 = fmul double %145, %50
%147 = fmul double %142, %142
%148 = tail call double @llvm.fmuladd.f64(double %134, double %134, double %147)
%149 = fmul double %146, %148
%150 = tail call double @sqrt(double %149)
%151 = fmul double %3, 2.000000e+00
%152 = fmul double %151, %35
%153 = fmul double %152, %150
store double %153, double* %14
%154 = fmul double %19, %39
%155 = tail call double @atan2(double %154, double %18)
%156 = tail call double @atan2(double %142, double %134)
%157 = fadd double %155, %156
br label %158
158: ; preds = %117, %116
%159 = phi double [ %157, %117 ], [ 0.000000e+00, %116 ]
store double %159, double* %15
ret void
}