#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_ext_(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.;
  *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 + 1;
    bb = pow(b, (double)i2);
    k = l * l;
    k1 = l * l1 / 2 + 1;
    dx[k] = dp[k1] * bb;
    dy[k] = (double)0.;
    dz[k] = l * p[k1] * 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 = l * 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_ext_>:
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    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 0xdb6(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd9a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    127d <magfdz_ext_+0x12d>
movsd  0xd88(%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     177c <magfdz_ext_+0x62c>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
xor    %eax,%eax
sub    -0x58(%rbp),%eax
add    $0x1,%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)
cvtsi2sdl -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%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     1769 <magfdz_ext_+0x619>
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)
cvtsi2sdl -0x58(%rbp),%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    13fd <magfdz_ext_+0x2ad>
jmp    176e <magfdz_ext_+0x61e>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    128d <magfdz_ext_+0x13d>
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_ext_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,%r15
mov    %r8,%r14
mov    %rcx,0x68(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,0x10(%rsp)
mov    0x160(%rsp),%rax
mov    0x138(%rsp),%rbx
mov    0x130(%rsp),%r13
mov    0x128(%rsp),%rbp
movsd  0xe62(%rip),%xmm0
divsd  (%r8),%xmm0
movsd  %xmm0,0x50(%rsp)
movq   $0x0,0x0(%rbp)
movq   $0x0,0x0(%r13)
movq   $0x0,(%rbx)
movq   $0x0,(%rax)
movsd  (%rdx),%xmm0
call   1040 <sin@plt>
mov    (%r15),%eax
mov    %rax,0x8(%rsp)
test   %eax,%eax
jle    15ea <magfdz_ext_+0x49a>
movapd 0xe28(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xe14(%rip),%xmm1
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,0xa0(%rsp)
addq   $0x1,0x8(%rsp)
mov    0x10(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x48(%rsp)
mov    0x18(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x40(%rsp)
mov    $0x1,%r15d
mov    $0x3,%r8d
mov    $0x4,%edx
mov    $0x2,%esi
mov    $0x2,%edi
mov    $0x2,%ecx
mov    $0x3,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,0x28(%rsp)
mov    %rdi,0x30(%rsp)
mov    %r8,0x38(%rsp)
mov    %rax,0x58(%rsp)
mov    %edx,(%rsp)
mov    %rsi,0x60(%rsp)
and    $0xfffffffe,%esi
shl    $0x2,%rsi
mov    0x48(%rsp),%rax
add    %rsi,%rax
mov    %rax,0x80(%rsp)
add    0x40(%rsp),%rsi
mov    %rsi,0x88(%rsp)
lea    0x1(%r15),%rax
mov    %rax,0x20(%rsp)
mov    $0x1,%r12d
mov    $0x1,%eax
sub    %r15d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x50(%rsp),%xmm0
call   1060 <pow@plt>
mov    %r15d,%eax
imul   %eax,%eax
mov    0x20(%rsp),%rcx
imul   %r15d,%ecx
shr    %ecx
mov    0x18(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
mov    0x108(%rsp),%rdi
movsd  %xmm1,-0x8(%rdi,%rax,8)
mov    0x110(%rsp),%rdx
movq   $0x0,-0x8(%rdx,%rax,8)
xorps  %xmm2,%xmm2
cvtsi2sd %r15d,%xmm2
mov    0x10(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
movsd  %xmm2,0x70(%rsp)
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mov    0x118(%rsp),%rsi
movsd  %xmm1,-0x8(%rsi,%rax,8)
movsd  (%rdx,%rcx,8),%xmm1
mulsd  (%r14),%xmm1
movsd  %xmm0,0x78(%rsp)
mulsd  %xmm0,%xmm1
mov    0x120(%rsp),%rdx
movsd  %xmm1,-0x8(%rdx,%rax,8)
mov    0x100(%rsp),%rcx
movsd  -0x8(%rcx,%rax,8),%xmm0
mulsd  -0x8(%rdi,%rax,8),%xmm0
addsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x0(%rbp)
movsd  -0x8(%rcx,%rax,8),%xmm0
mulsd  -0x8(%rsi,%rax,8),%xmm0
addsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
movsd  -0x8(%rcx,%rax,8),%xmm0
mulsd  -0x8(%rdx,%rax,8),%xmm0
mov    0x160(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    %r12d,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movapd %xmm0,0xb0(%rsp)
mov    0x68(%rsp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movsd  %xmm1,0x90(%rsp)
mov    %rbp,%rbx
mov    %r14,%r12
mov    %r13,%r14
mov    0x38(%rsp),%rax
lea    (%rax,%r15,1),%r13d
mov    0x28(%rsp),%rax
lea    (%rax,%r15,1),%ebp
call   1040 <sin@plt>
movsd  %xmm0,0x98(%rsp)
movsd  0x90(%rsp),%xmm0
call   1050 <cos@plt>
mov    0x88(%rsp),%rax
movsd  (%rax,%r15,4),%xmm1
movsd  0x78(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movslq %ebp,%rax
mov    0x108(%rsp),%rdx
movsd  %xmm2,-0x8(%rdx,%rax,8)
movsd  0x98(%rsp),%xmm4
mulsd  %xmm4,%xmm1
movslq %r13d,%rcx
mov    %r14,%r13
mov    %r12,%r14
mov    %rbx,%rbp
mov    0x138(%rsp),%rbx
movsd  %xmm1,-0x8(%rdx,%rcx,8)
mov    0x100(%rsp),%rdi
mulsd  -0x8(%rdi,%rax,8),%xmm2
addsd  0x0(%rbp),%xmm2
mulsd  -0x8(%rdi,%rcx,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%rbp)
mov    0x80(%rsp),%rdx
movapd 0xb0(%rsp),%xmm2
mulsd  (%rdx,%r15,4),%xmm2
mulsd  %xmm3,%xmm2
divsd  0xa0(%rsp),%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
mov    0x110(%rsp),%rsi
movsd  %xmm1,-0x8(%rsi,%rax,8)
xorpd  0xb4d(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,-0x8(%rsi,%rcx,8)
mulsd  -0x8(%rdi,%rax,8),%xmm1
addsd  0x0(%r13),%xmm1
mulsd  -0x8(%rdi,%rcx,8),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x0(%r13)
movsd  (%rdx,%r15,4),%xmm1
mulsd  0x70(%rsp),%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mov    0x118(%rsp),%rsi
movsd  %xmm2,-0x8(%rsi,%rax,8)
mulsd  %xmm4,%xmm1
movsd  %xmm1,-0x8(%rsi,%rcx,8)
mulsd  -0x8(%rdi,%rax,8),%xmm2
addsd  (%rbx),%xmm2
mulsd  -0x8(%rdi,%rcx,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
movsd  (%r12),%xmm1
mulsd  (%rdx,%r15,4),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm0
mov    0x120(%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    0x160(%rsp),%rax
addsd  (%rax),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax)
add    $0x2,%r15
mov    0x4(%rsp),%r12d
add    $0x1,%r12d
cmp    %r15,0x30(%rsp)
jne    13b0 <magfdz_ext_+0x260>
mov    0x58(%rsp),%rax
mov    0x28(%rsp),%r9
add    %rax,%r9
mov    0x38(%rsp),%rcx
add    %rax,%rcx
add    $0x2,%rax
mov    (%rsp),%edx
mov    0x60(%rsp),%rsi
add    %edx,%esi
add    $0x2,%edx
mov    0x30(%rsp),%rdi
add    $0x2,%rdi
mov    0x20(%rsp),%r15
cmp    0x8(%rsp),%r15
mov    %rcx,%r8
mov    %r9,%rcx
jne    1260 <magfdz_ext_+0x110>
mov    0x140(%rsp),%r15
movsd  0x0(%rbp),%xmm0
movsd  0x0(%r13),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1619 <magfdz_ext_+0x4c9>
sqrtsd %xmm0,%xmm0
jmp    1622 <magfdz_ext_+0x4d2>
call   1070 <sqrt@plt>
xorpd  %xmm2,%xmm2
mov    0x158(%rsp),%r14
mov    0x150(%rsp),%r12
mov    0x148(%rsp),%rbx
movsd  %xmm0,(%r15)
mov    0x138(%rsp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     1663 <magfdz_ext_+0x513>
sqrtsd %xmm0,%xmm0
jmp    1668 <magfdz_ext_+0x518>
call   1070 <sqrt@plt>
movsd  %xmm0,(%rbx)
movq   $0x0,(%r12)
movsd  0x0(%r13),%xmm0
movsd  0x0(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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