#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(double);
double fabs(double);
double pow(double, double);
double sin(double);
double sqrt(double);
int magfdz_(double *p, double *dp, double *theta, double *phi, double *r,
            int *lmax, double *g, double *dx, double *dy, double *dz,
            double *dpot, double *x, double *y, double *z, double *h, double *f,
            double *ainc, double *d, double *pot) {
  int i1, i2;
  double cost, sint, b;
  int k, l, m;
  double t, dpotd, sinth;
  int k1, l1;
  double bb, dxd, dzd, dxy;
  --dpot;
  --dz;
  --dy;
  --dx;
  --g;
  --dp;
  --p;
  b = (double)6371.2 / *r;
  *x = (double)0.;
  *y = (double)0.;
  *z = (double)0.;
  *f = (double)0.;
  *h = (double)0.;
  *pot = (double)0.;
  sinth = sin(*theta);
  if (fabs(sinth) < ((double)1e-10)) {
    sinth = (double)1e-10;
  }
  i1 = *lmax;
  for (l = 1; l <= i1; ++l) {
    l1 = l + 1;
    i2 = l + 2;
    bb = pow(b, (double)i2);
    k = l * l;
    k1 = (l * l1) / 2 + 1;
    dx[k] = dp[k1] * bb;
    dy[k] = (double)0.;
    dz[k] = -p[k1] * l1 * bb;
    dpot[k] = p[k1] * *r * bb;
    *x += g[k] * dx[k];
    *z += g[k] * dz[k];
    *pot += g[k] * dpot[k];
    i2 = l;
    for (m = 1; m <= i2; ++m) {
      t = (double)m * *phi;
      k = l * l + (m << 1) - 1;
      k1 = l * l1 / 2 + m + 1;
      sint = sin(t);
      cost = cos(t);
      dxd = dp[k1] * bb;
      dx[k] = dxd * cost;
      dx[k + 1] = dxd * sint;
      *x = *x + g[k] * dx[k] + g[k + 1] * dx[k + 1];
      dxy = m * p[k1] * bb / sinth;
      dy[k] = dxy * sint;
      dy[k + 1] = -dxy * cost;
      *y = *y + g[k] * dy[k] + g[k + 1] * dy[k + 1];
      dzd = -l1 * p[k1] * bb;
      dz[k] = dzd * cost;
      dz[k + 1] = dzd * sint;
      *z = *z + g[k] * dz[k] + g[k + 1] * dz[k + 1];
      dpotd = *r * p[k1] * bb;
      dpot[k] = dpotd * cost;
      dpot[k + 1] = dpotd * sint;
      *pot = *pot + g[k] * dpot[k] + g[k + 1] * dpot[k + 1];
    }
  }
  *h = sqrt((*x) * (*x) + (*y) * (*y));
  *f = sqrt((*h) * (*h) + (*z) * (*z));
  *ainc = 0.0;
  *d = atan2(*y, *x);
  return 0;
}


x86 assembly (clang, -O0):
<magfdz_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x30(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x30(%rbp)
mov    0x28(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x28(%rbp)
mov    0x20(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x20(%rbp)
mov    0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x18(%rbp)
mov    0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
movsd  0xe01(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x48(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x58(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x50(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x70(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movaps 0xda0(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd84(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1293 <magfdz_+0x143>
movsd  0xd72(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     17af <magfdz_+0x65f>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
mov    -0x58(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x58(%rbp),%eax
imul   -0x58(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
imul   -0x80(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsi2sdl -0x80(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x70(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%eax
mov    %eax,-0x38(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     179c <magfdz_+0x64c>
cvtsi2sdl -0x5c(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x58(%rbp),%eax
imul   -0x58(%rbp),%eax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
imul   -0x80(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x48(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x38(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x5c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x48(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
sub    -0x80(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x40(%rbp),%xmm0
mov    0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x48(%rbp),%xmm0
mov    0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    0x30(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x70(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x70(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    142c <magfdz_+0x2dc>
jmp    17a1 <magfdz_+0x651>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    12a3 <magfdz_+0x153>
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm2
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x40(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mov    0x50(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x50(%rbp),%rax
movsd  (%rax),%xmm2
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x48(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mov    0x58(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x60(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <atan2@plt>
mov    0x68(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magfdz_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r9,%r15
mov    %r8,%rbp
mov    %rcx,0x78(%rsp)
mov    %rsi,0x20(%rsp)
mov    %rdi,0x18(%rsp)
mov    0x170(%rsp),%rsi
mov    0x158(%rsp),%rax
mov    0x150(%rsp),%rcx
mov    0x148(%rsp),%r14
mov    0x140(%rsp),%rbx
movsd  0xe5a(%rip),%xmm0
divsd  (%r8),%xmm0
movsd  %xmm0,0x50(%rsp)
mov    0x138(%rsp),%r13
movq   $0x0,0x0(%r13)
movq   $0x0,(%rbx)
movq   $0x0,(%r14)
movq   $0x0,(%rax)
movq   $0x0,(%rcx)
movq   $0x0,(%rsi)
movsd  (%rdx),%xmm0
call   1040 <sin@plt>
mov    (%r15),%eax
mov    %rax,0x10(%rsp)
test   %eax,%eax
jle    161f <magfdz_+0x4cf>
movapd 0xe0b(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xdf7(%rip),%xmm1
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,0xb0(%rsp)
addq   $0x1,0x10(%rsp)
mov    0x18(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x48(%rsp)
mov    0x20(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x40(%rsp)
mov    $0x1,%r12d
mov    $0x3,%r8d
mov    $0x4,%edx
mov    $0x2,%esi
mov    $0x2,%edi
mov    $0x2,%ecx
mov    $0x3,%eax
mov    %rbp,0x70(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rcx,0x28(%rsp)
mov    %rdi,0x30(%rsp)
mov    %r8,0x38(%rsp)
mov    %rax,0x58(%rsp)
mov    %edx,0xc(%rsp)
mov    %rsi,0x60(%rsp)
and    $0xfffffffe,%esi
shl    $0x2,%rsi
mov    0x48(%rsp),%rax
add    %rsi,%rax
mov    %rax,0x90(%rsp)
add    0x40(%rsp),%rsi
mov    %rsi,0x98(%rsp)
mov    %r12d,%r15d
add    $0x1,%r12
lea    0x2(%r15),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x50(%rsp),%xmm0
call   1060 <pow@plt>
mov    %r15d,%eax
cvtsi2sd %r12d,%xmm3
imul   %eax,%eax
mov    %r12,0x68(%rsp)
mov    %r12d,%ecx
imul   %r15d,%ecx
shr    %ecx
mov    0x20(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
mov    0x118(%rsp),%rdi
movsd  %xmm1,-0x8(%rdi,%rax,8)
mov    0x120(%rsp),%rdx
movq   $0x0,-0x8(%rdx,%rax,8)
mov    0x18(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
movapd 0xcea(%rip),%xmm2
xorpd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
mov    0x128(%rsp),%rsi
movsd  %xmm1,-0x8(%rsi,%rax,8)
movsd  (%rdx,%rcx,8),%xmm1
mulsd  0x0(%rbp),%xmm1
movsd  %xmm0,0x88(%rsp)
mulsd  %xmm0,%xmm1
mov    0x130(%rsp),%rdx
movsd  %xmm1,-0x8(%rdx,%rax,8)
mov    0x110(%rsp),%rcx
movsd  -0x8(%rcx,%rax,8),%xmm0
mulsd  -0x8(%rdi,%rax,8),%xmm0
addsd  0x0(%r13),%xmm0
movsd  %xmm0,0x0(%r13)
movsd  -0x8(%rcx,%rax,8),%xmm0
mulsd  -0x8(%rsi,%rax,8),%xmm0
addsd  (%r14),%xmm0
movsd  %xmm0,(%r14)
movsd  -0x8(%rcx,%rax,8),%xmm0
mulsd  -0x8(%rdx,%rax,8),%xmm0
mov    0x170(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
not    %r15d
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  %xmm0,0x80(%rsp)
mov    $0x1,%r12d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movapd %xmm0,0xc0(%rsp)
mov    0x78(%rsp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movsd  %xmm1,0xa0(%rsp)
mov    0x38(%rsp),%rax
lea    (%rax,%r15,1),%ebp
mov    %r13,%r14
mov    0x28(%rsp),%rax
lea    (%rax,%r15,1),%r13d
call   1040 <sin@plt>
movsd  %xmm0,0xa8(%rsp)
movsd  0xa0(%rsp),%xmm0
call   1050 <cos@plt>
mov    0x98(%rsp),%rax
movsd  (%rax,%r15,4),%xmm1
movsd  0x88(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movslq %r13d,%rax
mov    %r14,%r13
mov    0x148(%rsp),%r14
mov    0x118(%rsp),%rdx
movsd  %xmm2,-0x8(%rdx,%rax,8)
movsd  0xa8(%rsp),%xmm4
mulsd  %xmm4,%xmm1
movslq %ebp,%rcx
mov    0x70(%rsp),%rbp
movsd  %xmm1,-0x8(%rdx,%rcx,8)
mov    0x110(%rsp),%rdi
mulsd  -0x8(%rdi,%rax,8),%xmm2
addsd  0x0(%r13),%xmm2
mulsd  -0x8(%rdi,%rcx,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%r13)
mov    0x90(%rsp),%rdx
movapd 0xc0(%rsp),%xmm2
mulsd  (%rdx,%r15,4),%xmm2
mulsd  %xmm3,%xmm2
divsd  0xb0(%rsp),%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
mov    0x120(%rsp),%rsi
movsd  %xmm1,-0x8(%rsi,%rax,8)
xorpd  0xb14(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,-0x8(%rsi,%rcx,8)
mulsd  -0x8(%rdi,%rax,8),%xmm1
addsd  (%rbx),%xmm1
mulsd  -0x8(%rdi,%rcx,8),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx)
movsd  (%rdx,%r15,4),%xmm1
mulsd  0x80(%rsp),%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mov    0x128(%rsp),%rsi
movsd  %xmm2,-0x8(%rsi,%rax,8)
mulsd  %xmm4,%xmm1
movsd  %xmm1,-0x8(%rsi,%rcx,8)
mulsd  -0x8(%rdi,%rax,8),%xmm2
addsd  (%r14),%xmm2
mulsd  -0x8(%rdi,%rcx,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,(%r14)
movsd  0x0(%rbp),%xmm1
mulsd  (%rdx,%r15,4),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm0
mov    0x130(%rsp),%rdx
movsd  %xmm0,-0x8(%rdx,%rax,8)
mulsd  %xmm4,%xmm1
movsd  %xmm1,-0x8(%rdx,%rcx,8)
mulsd  -0x8(%rdi,%rax,8),%xmm0
mulsd  -0x8(%rdi,%rcx,8),%xmm1
mov    0x170(%rsp),%rax
addsd  (%rax),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax)
add    $0x2,%r15
add    $0x1,%r12d
cmp    %r15,0x30(%rsp)
jne    13f0 <magfdz_+0x2a0>
mov    0x58(%rsp),%rax
mov    0x28(%rsp),%r9
add    %rax,%r9
mov    0x38(%rsp),%rcx
add    %rax,%rcx
add    $0x2,%rax
mov    0xc(%rsp),%edx
mov    0x60(%rsp),%rsi
add    %edx,%esi
add    $0x2,%edx
mov    0x30(%rsp),%rdi
add    $0x2,%rdi
mov    0x68(%rsp),%r12
cmp    0x10(%rsp),%r12
mov    %rcx,%r8
mov    %r9,%rcx
jne    1280 <magfdz_+0x130>
movsd  0x0(%r13),%xmm0
movsd  (%rbx),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1645 <magfdz_+0x4f5>
sqrtsd %xmm0,%xmm0
jmp    164e <magfdz_+0x4fe>
call   1070 <sqrt@plt>
xorpd  %xmm2,%xmm2
mov    0x168(%rsp),%r14
mov    0x160(%rsp),%rbp
mov    0x150(%rsp),%rax
movsd  %xmm0,(%rax)
mov    0x148(%rsp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     168e <magfdz_+0x53e>
sqrtsd %xmm0,%xmm0
jmp    1693 <magfdz_+0x543>
call   1070 <sqrt@plt>
mov    0x158(%rsp),%rax
movsd  %xmm0,(%rax)
movq   $0x0,0x0(%rbp)
movsd  (%rbx),%xmm0
movsd  0x0(%r13),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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