int nkep_drift3(double mu, double *r0, double *v0, double dt) {
  double r0mag, v0mag2;
  double r0v0;
  double rcalc, dtcalc, terr;
  double u;
  double beta;
  double P;
  double dU;
  int n;
  double q;
  double U0w2, U1w2;
  double U, U0, U1, U2, U3;
  double f, g, F, G;
  double r1[3], v1[3];
  int d;
  int no_iter;
  double du1, du2, du3, dqdu, d2qdu2, drdu, d2rdu2, fn, fnp, fnpp, fnppp;
  r0mag = sqrt(r0[0] * r0[0] + r0[1] * r0[1] + r0[2] * r0[2]);
  v0mag2 = v0[0] * v0[0] + v0[1] * v0[1] + v0[2] * v0[2];
  r0v0 = r0[0] * v0[0] + r0[1] * v0[1] + r0[2] * v0[2];
  beta = 2 * mu / r0mag - v0mag2;
  if (beta > 0) {
    P = 2 * ((double)3.14159265358979323846264338327950288419716939937510) *
        mu / sqrt(beta * beta * beta);
    n = floor((dt + P / 2.0 - 2 * r0v0 / beta) / P);
    dU = 2 * n *
         ((double)3.14159265358979323846264338327950288419716939937510) /
         sqrt(beta * beta * beta * beta * beta);
  } else {
    dU = 0.0;
  }
  u = 0;
  no_iter = 0;
  do {
    q = beta * u * u / (1 + beta * u * u);
    if (q > 0.5 || no_iter > 12)
      return -1;
    dqdu = 2 * beta * u / (1 + beta * u * u) / (1 + beta * u * u);
    d2qdu2 = 2 * beta / (1 + beta * u * u) -
             8 * beta * beta * u * u / (1 + beta * u * u) / (1 + beta * u * u) /
                 (1 + beta * u * u);
    U0w2 = 1 - 2 * q;
    U1w2 = 2 * (1 - q) * u;
    U = 16.0 / 15 * U1w2 * U1w2 * U1w2 * U1w2 * U1w2 * G_func2(q) + dU;
    U0 = 2 * U0w2 * U0w2 - 1;
    U1 = 2 * U0w2 * U1w2;
    U2 = 2 * U1w2 * U1w2;
    U3 = beta * U + U1 * U2 / 3.0;
    rcalc = r0mag * U0 + r0v0 * U1 + mu * U2;
    drdu = 4 * (1 - q) * (r0v0 * U0 + (mu - beta * r0mag) * U1);
    d2rdu2 = -4 * dqdu * (r0v0 * U0 + (mu - beta * r0mag) * U1) +
             (4 * (1 - q) * 4 * (1 - q)) *
                 (-beta * r0v0 * U1 + (mu - beta * r0mag) * U0);
    dtcalc = r0mag * U1 + r0v0 * U2 + mu * U3;
    fn = dtcalc - dt;
    fnp = 4 * (1 - q) * rcalc;
    fnpp = 4 * (drdu * (1 - q) - rcalc * dqdu);
    fnppp = -8 * drdu * dqdu - 4 * rcalc * d2qdu2 + 4 * (1 - q) * d2rdu2;
    du1 = -fn / fnp;
    du2 = -fn / (fnp + du1 * fnpp / 2);
    du3 = -fn / (fnp + du2 * fnpp / 2 + du2 * du2 * fnppp / 6);
    u += du3;
    no_iter++;
    terr = fabs((dt - dtcalc) / dt);
  } while (terr > 1e-15);
  f = 1 - (mu / r0mag) * U2;
  g = r0mag * U1 + r0v0 * U2;
  F = -mu * U1 / (rcalc * r0mag);
  G = 1 - (mu / rcalc) * U2;
  for (d = 0; d < 3; d++) {
    r1[d] = f * r0[d] + g * v0[d];
    v1[d] = F * r0[d] + G * v0[d];
  }
  for (d = 0; d < 3; d++) {
    r0[d] = r1[d];
    v0[d] = v1[d];
  }
  return 0;
}


x86 assembly (clang, -O0):
<nkep_drift3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdcb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    132e <nkep_drift3+0x1fe>
movsd  0xdad(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x190(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  0xd56(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xd46(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  -0x68(%rbp),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x70(%rbp),%xmm0
call   1050 <floor@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xd1d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x188(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1336 <nkep_drift3+0x206>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x128(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcae(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xc86(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     13a9 <nkep_drift3+0x279>
cmpl   $0xc,-0x128(%rbp)
jle    13b5 <nkep_drift3+0x285>
movl   $0xffffffff,-0x4(%rbp)
jmp    1ca7 <nkep_drift3+0xb77>
movsd  0xc43(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc3e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc1b(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  0xbe3(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbe3(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xc13(%rip),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
mulsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xba4(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
movsd  -0x68(%rbp),%xmm2
mulsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xb81(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
movsd  -0x68(%rbp),%xmm2
mulsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xb5e(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0xb36(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xb22(%rip),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
movsd  0xaf2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb31(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mov    $0x1,%al
call   1030 <G_func2@plt>
movsd  -0x198(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xa71(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0xaa5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xa41(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xa21(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  -0xb8(%rbp),%xmm1
ff
movsd  0xa2c(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x30(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0x9ac(%rip),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
movsd  0x9ac(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x10(%rbp),%xmm4
movsd  -0x68(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm5
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm4,%xmm2
mulsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  0x959(%rip),%xmm0
mulsd  -0x148(%rbp),%xmm0
ff
movsd  -0x40(%rbp),%xmm2
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x10(%rbp),%xmm4
movsd  -0x68(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm5
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm4,%xmm1
mulsd  -0xb0(%rbp),%xmm1
ff
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  0x8de(%rip),%xmm3
subsd  -0x88(%rbp),%xmm3
ff
movsd  0x8de(%rip),%xmm1
mulsd  %xmm3,%xmm1
movsd  0x8d2(%rip),%xmm3
mulsd  %xmm3,%xmm1
movsd  0x8b6(%rip),%xmm3
subsd  -0x88(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm1
movsd  -0x68(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  -0x40(%rbp),%xmm3
movsd  -0xb0(%rbp),%xmm5
ff
movsd  -0x10(%rbp),%xmm6
movsd  -0x68(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm7
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm7,%xmm4
addsd  %xmm6,%xmm4
mulsd  -0xa8(%rbp),%xmm4
ff
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x30(%rbp),%xmm1
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  0x7d9(%rip),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
movsd  0x7d9(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x158(%rbp),%xmm1
ff
movsd  0x7a8(%rip),%xmm2
subsd  -0x88(%rbp),%xmm2
ff
movsd  -0x48(%rbp),%xmm0
mulsd  -0x148(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x77c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  0x770(%rip),%xmm1
mulsd  -0x158(%rbp),%xmm1
ff
movsd  -0x148(%rbp),%xmm2
ff
movsd  0x750(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x150(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x70c(%rip),%xmm2
subsd  -0x88(%rbp),%xmm2
ff
movsd  0x70c(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  -0x160(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x168(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x170(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x168(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x170(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm2
ff
mulsd  -0x178(%rbp),%xmm2
ff
movsd  0x652(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x168(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x170(%rbp),%xmm1
ff
movsd  -0x138(%rbp),%xmm2
ff
mulsd  -0x178(%rbp),%xmm2
ff
movsd  0x5ff(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  -0x138(%rbp),%xmm2
ff
mulsd  -0x138(%rbp),%xmm2
ff
mulsd  -0x180(%rbp),%xmm2
ff
movsd  0x5ff(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x128(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x128(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movaps 0x5fc(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0x5de(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1348 <nkep_drift3+0x218>
movsd  -0x10(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x557(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm1
mulsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x48(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x4b2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movl   $0x0,-0x124(%rbp)
cmpl   $0x3,-0x124(%rbp)
jge    1c35 <nkep_drift3+0xb05>
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xd0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
movslq -0x124(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x124(%rbp),%rax
movsd  %xmm0,-0x100(%rbp,%rax,8)
ff ff
movsd  -0xd8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xe0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
movslq -0x124(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x124(%rbp),%rax
movsd  %xmm0,-0x120(%rbp,%rax,8)
ff ff
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1b84 <nkep_drift3+0xa54>
movl   $0x0,-0x124(%rbp)
cmpl   $0x3,-0x124(%rbp)
jge    1ca0 <nkep_drift3+0xb70>
movslq -0x124(%rbp),%rax
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x124(%rbp),%rax
movsd  -0x120(%rbp,%rax,8),%xmm0
ff ff
mov    -0x20(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1c3f <nkep_drift3+0xb0f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nkep_drift3>:
push   %rbp
push   %r14
push   %rbx
sub    $0xf0,%rsp
movsd  %xmm1,0x48(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
movaps %xmm0,0x20(%rsp)
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
ucomisd %xmm2,%xmm0
jb     1188 <nkep_drift3+0x58>
sqrtsd %xmm0,%xmm5
jmp    1191 <nkep_drift3+0x61>
call   1040 <sqrt@plt>
movapd %xmm0,%xmm5
movsd  (%r14),%xmm0
movsd  0x8(%r14),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  0x10(%r14),%xmm4
movapd %xmm4,%xmm2
mulsd  %xmm4,%xmm2
mulsd  0x8(%rbx),%xmm1
addsd  %xmm3,%xmm2
mulsd  (%rbx),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x10(%rbx),%xmm4
addsd  %xmm0,%xmm4
movapd %xmm4,0x50(%rsp)
movapd 0x20(%rsp),%xmm4
addsd  %xmm4,%xmm4
divsd  %xmm5,%xmm4
subsd  %xmm2,%xmm4
ucomisd 0xe98(%rip),%xmm4
movapd %xmm4,0x30(%rsp)
movsd  %xmm5,(%rsp)
jbe    12dc <nkep_drift3+0x1ac>
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
jb     122b <nkep_drift3+0xfb>
sqrtsd %xmm0,%xmm0
jmp    1236 <nkep_drift3+0x106>
call   1040 <sqrt@plt>
movapd 0x30(%rsp),%xmm4
movapd 0x50(%rsp),%xmm1
unpcklpd 0x20(%rsp),%xmm1
mulpd  0xdb6(%rip),%xmm1
movapd %xmm4,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
movsd  0xdca(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0x48(%rsp),%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
call   1050 <floor@plt>
movapd 0x30(%rsp),%xmm4
cvttsd2si %xmm0,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xda0(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm0
ucomisd 0xddc(%rip),%xmm0
jb     12bc <nkep_drift3+0x18c>
sqrtsd %xmm0,%xmm0
jmp    12c7 <nkep_drift3+0x197>
call   1040 <sqrt@plt>
movapd 0x30(%rsp),%xmm4
movsd  (%rsp),%xmm5
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm4,%xmm0
addsd  %xmm4,%xmm0
movapd %xmm0,0x90(%rsp)
movsd  0xd4b(%rip),%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x60(%rsp)
movapd 0xd05(%rip),%xmm1
xorpd  %xmm4,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm5,%xmm0
movapd 0x20(%rsp),%xmm2
subsd  %xmm0,%xmm2
movapd %xmm2,0x70(%rsp)
mulsd  0x50(%rsp),%xmm1
movapd %xmm1,0x80(%rsp)
xorpd  %xmm2,%xmm2
xor    %ebp,%ebp
movsd  0xd04(%rip),%xmm6
movsd  0xce3(%rip),%xmm11
nopl   (%rax)
movapd %xmm4,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm0,%xmm1
addsd  %xmm6,%xmm1
divsd  %xmm1,%xmm0
ucomisd %xmm11,%xmm0
mov    $0xffffffff,%eax
ja     1789 <nkep_drift3+0x659>
cmp    $0xc,%ebp
ja     1789 <nkep_drift3+0x659>
movapd 0x90(%rsp),%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm2,%xmm4
divsd  %xmm1,%xmm4
divsd  %xmm1,%xmm4
movapd %xmm4,0xd0(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  0x60(%rsp),%xmm2
mulsd  0x10(%rsp),%xmm2
mulsd  0x10(%rsp),%xmm2
divsd  %xmm1,%xmm2
divsd  %xmm1,%xmm2
unpcklpd %xmm2,%xmm3
unpcklpd %xmm1,%xmm1
divpd  %xmm1,%xmm3
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
subsd  %xmm1,%xmm3
movapd %xmm3,0xe0(%rsp)
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm6,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm2,0xc0(%rsp)
subsd  %xmm0,%xmm6
movsd  %xmm6,0x68(%rsp)
addsd  %xmm6,%xmm6
mulsd  0x10(%rsp),%xmm6
movapd %xmm6,0xa0(%rsp)
movapd %xmm6,%xmm1
mulsd  0xc2a(%rip),%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm1,0xb0(%rsp)
mov    $0x1,%al
call   1030 <G_func2@plt>
movapd 0xa0(%rsp),%xmm13
movsd  (%rsp),%xmm10
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
mulsd  0xb0(%rsp),%xmm2
addsd  0x8(%rsp),%xmm2
movapd 0xc0(%rsp),%xmm1
movapd %xmm1,%xmm0
unpcklpd %xmm13,%xmm0
addpd  %xmm0,%xmm0
mulsd  %xmm0,%xmm1
addsd  0xbca(%rip),%xmm1
movapd %xmm1,%xmm5
unpcklpd %xmm13,%xmm13
mulpd  %xmm0,%xmm13
movapd %xmm13,%xmm8
unpckhpd %xmm13,%xmm8
movapd %xmm13,%xmm1
mulsd  %xmm8,%xmm1
divsd  0xba8(%rip),%xmm1
mulsd  0x30(%rsp),%xmm2
addsd  %xmm1,%xmm2
movapd 0x50(%rsp),%xmm11
movapd %xmm11,%xmm1
mulsd  %xmm13,%xmm1
movapd %xmm10,%xmm4
mulsd  %xmm5,%xmm4
addsd  %xmm1,%xmm4
movapd 0x20(%rsp),%xmm9
movapd %xmm9,%xmm3
mulsd  %xmm8,%xmm3
addsd  %xmm4,%xmm3
movsd  0x68(%rsp),%xmm12
movapd %xmm12,%xmm6
movsd  0xb5e(%rip),%xmm14
mulsd  %xmm14,%xmm6
movapd 0x70(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm13,%xmm1
movapd %xmm11,%xmm7
mulsd  %xmm5,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm6,%xmm1
mulsd  %xmm0,%xmm5
movapd 0x80(%rsp),%xmm0
mulsd  %xmm13,%xmm0
addsd  %xmm5,%xmm0
movapd %xmm6,%xmm5
mulsd  %xmm7,%xmm5
mulsd  %xmm14,%xmm1
mulsd  %xmm12,%xmm1
mulsd  %xmm1,%xmm0
movapd 0xd0(%rsp),%xmm14
movapd %xmm14,%xmm4
movsd  0xafd(%rip),%xmm15
mulsd  %xmm15,%xmm4
mulsd  %xmm7,%xmm4
addsd  %xmm0,%xmm4
movapd %xmm11,%xmm0
movsd  0xaa2(%rip),%xmm11
mulsd  %xmm8,%xmm0
movapd %xmm10,%xmm1
mulsd  %xmm13,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm14,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm5,%xmm12
subsd  %xmm0,%xmm12
movapd %xmm3,%xmm7
mulsd  %xmm15,%xmm7
mulsd  0xe0(%rsp),%xmm7
mulsd  %xmm6,%xmm4
mulsd  %xmm9,%xmm2
addsd  %xmm1,%xmm2
mulsd  0xa9d(%rip),%xmm5
mulsd  %xmm14,%xmm5
movsd  0x48(%rsp),%xmm9
movapd %xmm9,%xmm0
subsd  %xmm2,%xmm0
subsd  %xmm9,%xmm2
mulsd  %xmm3,%xmm6
mulsd  0xa66(%rip),%xmm12
addsd  %xmm7,%xmm5
addsd  %xmm5,%xmm4
movapd %xmm2,%xmm5
divsd  %xmm6,%xmm5
mulsd  %xmm12,%xmm5
mulsd  %xmm11,%xmm5
movapd %xmm6,%xmm7
subsd  %xmm5,%xmm7
movapd %xmm2,%xmm5
xorpd  0x9e0(%rip),%xmm5
divsd  %xmm7,%xmm5
mulsd  %xmm5,%xmm12
mulsd  %xmm11,%xmm12
addsd  %xmm6,%xmm12
mulsd  %xmm5,%xmm5
mulsd  %xmm4,%xmm5
divsd  0xa2d(%rip),%xmm5
addsd  %xmm12,%xmm5
divsd  %xmm5,%xmm2
movsd  0x10(%rsp),%xmm4
subsd  %xmm2,%xmm4
movsd  %xmm4,0x10(%rsp)
movapd 0x30(%rsp),%xmm4
movsd  0x10(%rsp),%xmm2
add    $0x1,%ebp
divsd  %xmm9,%xmm0
movsd  0x9c0(%rip),%xmm6
andpd  0x990(%rip),%xmm0
ucomisd 0x9f0(%rip),%xmm0
ja     1350 <nkep_drift3+0x220>
movapd 0x96a(%rip),%xmm0
movapd 0x20(%rsp),%xmm5
xorpd  %xmm5,%xmm0
movapd %xmm5,%xmm4
movsd  (%rsp),%xmm14
divsd  %xmm14,%xmm4
mulsd  %xmm8,%xmm4
movapd %xmm6,%xmm2
subsd  %xmm4,%xmm2
mulsd  %xmm0,%xmm13
mulsd  %xmm3,%xmm14
divsd  %xmm14,%xmm13
divsd  %xmm3,%xmm5
mulsd  %xmm8,%xmm5
subsd  %xmm5,%xmm6
movsd  (%r14),%xmm5
movsd  0x8(%r14),%xmm8
movapd %xmm1,%xmm7
mulsd  %xmm5,%xmm7
movsd  (%rbx),%xmm3
movsd  0x8(%rbx),%xmm0
movapd %xmm2,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm7,%xmm4
mulsd  %xmm6,%xmm5
mulsd  %xmm13,%xmm3
addsd  %xmm5,%xmm3
movapd %xmm1,%xmm5
mulsd  %xmm8,%xmm5
movapd %xmm2,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm5,%xmm7
mulsd  %xmm6,%xmm8
mulsd  %xmm13,%xmm0
addsd  %xmm8,%xmm0
movsd  0x10(%rbx),%xmm8
movsd  0x10(%r14),%xmm5
mulsd  %xmm5,%xmm1
mulsd  %xmm8,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm5,%xmm6
mulsd  %xmm8,%xmm13
addsd  %xmm6,%xmm13
movsd  %xmm4,(%rbx)
movsd  %xmm3,(%r14)
movsd  %xmm7,0x8(%rbx)
movsd  %xmm0,0x8(%r14)
movsd  %xmm2,0x10(%rbx)
movsd  %xmm13,0x10(%r14)
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @nkep_drift3(double %0, double* nocapture %1, double* nocapture %2, double %3) {
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %8)
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %9)
%13 = tail call double @sqrt(double %12)
%14 = load double, double* %2
%15 = getelementptr inbounds double, double* %2, i64 1
%16 = load double, double* %15
%17 = fmul double %16, %16
%18 = tail call double @llvm.fmuladd.f64(double %14, double %14, double %17)
%19 = getelementptr inbounds double, double* %2, i64 2
%20 = load double, double* %19
%21 = tail call double @llvm.fmuladd.f64(double %20, double %20, double %18)
%22 = load double, double* %1
%23 = load double, double* %6
%24 = fmul double %16, %23
%25 = tail call double @llvm.fmuladd.f64(double %22, double %14, double %24)
%26 = load double, double* %10
%27 = tail call double @llvm.fmuladd.f64(double %26, double %20, double %25)
%28 = fmul double %0, 2.000000e+00
%29 = fdiv double %28, %13
%30 = fsub double %29, %21
%31 = fcmp ogt double %30, 0.000000e+00
br i1 %31, label %32, label %57
32: ; preds = %4
%33 = fmul double %30, %30
%34 = fmul double %30, %33
%35 = tail call double @sqrt(double %34)
%36 = insertelement <2 x double> poison, double %0, i64 1
%37 = insertelement <2 x double> %36, double %27, i64 0
%38 = fmul <2 x double> %37, <double 2.000000e+00, double 0x401921FB54442D18>
%39 = insertelement <2 x double> poison, double %30, i64 0
%40 = insertelement <2 x double> %39, double %35, i64 1
%41 = fdiv <2 x double> %38, %40
%42 = extractelement <2 x double> %41, i64 1
%43 = fmul double %42, 5.000000e-01
%44 = fadd double %43, %3
%45 = extractelement <2 x double> %41, i64 0
%46 = fsub double %44, %45
%47 = fdiv double %46, %42
%48 = tail call double @llvm.floor.f64(double %47)
%49 = fptosi double %48 to i32
%50 = shl nsw i32 %49, 1
%51 = sitofp i32 %50 to double
%52 = fmul double %51, 0x400921FB54442D18
%53 = fmul double %30, %34
%54 = fmul double %30, %53
%55 = tail call double @sqrt(double %54)
%56 = fdiv double %52, %55
br label %57
57: ; preds = %4, %32
%58 = phi double [ %56, %32 ], [ 0.000000e+00, %4 ]
%59 = fmul double %30, 2.000000e+00
%60 = fmul double %30, 8.000000e+00
%61 = fmul double %30, %60
%62 = fneg double %30
%63 = tail call double @llvm.fmuladd.f64(double %62, double %13, double %0)
%64 = fmul double %27, %62
%65 = insertelement <2 x double> poison, double %59, i64 0
br label %66
66: ; preds = %76, %57
%67 = phi i32 [ 0, %57 ], [ %159, %76 ]
%68 = phi double [ 0.000000e+00, %57 ], [ %158, %76 ]
%69 = fmul double %30, %68
%70 = fmul double %68, %69
%71 = tail call double @llvm.fmuladd.f64(double %69, double %68, double 1.000000e+00)
%72 = fdiv double %70, %71
%73 = fcmp ogt double %72, 5.000000e-01
%74 = icmp ugt i32 %67, 12
%75 = select i1 %73, i1 true, i1 %74
br i1 %75, label %192, label %76
76: ; preds = %66
%77 = fmul double %59, %68
%78 = fdiv double %77, %71
%79 = fdiv double %78, %71
%80 = fmul double %61, %68
%81 = fmul double %68, %80
%82 = fdiv double %81, %71
%83 = fdiv double %82, %71
%84 = insertelement <2 x double> %65, double %83, i64 1
%85 = insertelement <2 x double> poison, double %71, i64 0
%86 = shufflevector <2 x double> %85, <2 x double> poison, <2 x i32> zeroinitializer
%87 = fdiv <2 x double> %84, %86
%88 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%89 = fsub <2 x double> %87, %88
%90 = extractelement <2 x double> %89, i64 0
%91 = tail call double @llvm.fmuladd.f64(double %72, double -2.000000e+00, double 1.000000e+00)
%92 = fsub double 1.000000e+00, %72
%93 = fmul double %92, 2.000000e+00
%94 = fmul double %68, %93
%95 = fmul double %94, 0x3FF1111111111111
%96 = fmul double %94, %95
%97 = fmul double %94, %96
%98 = fmul double %94, %97
%99 = fmul double %94, %98
%100 = tail call i32 (double, ...) bitcast (i32 (...)* @G_func2 to i32 (double, ...)*)(double %72)
%101 = sitofp i32 %100 to double
%102 = tail call double @llvm.fmuladd.f64(double %99, double %101, double %58)
%103 = insertelement <2 x double> poison, double %91, i64 0
%104 = insertelement <2 x double> %103, double %94, i64 1
%105 = fmul <2 x double> %104, <double 2.000000e+00, double 2.000000e+00>
%106 = extractelement <2 x double> %105, i64 0
%107 = tail call double @llvm.fmuladd.f64(double %106, double %91, double -1.000000e+00)
%108 = insertelement <2 x double> poison, double %94, i64 0
%109 = shufflevector <2 x double> %108, <2 x double> poison, <2 x i32> zeroinitializer
%110 = fmul <2 x double> %109, %105
%111 = extractelement <2 x double> %110, i64 0
%112 = extractelement <2 x double> %110, i64 1
%113 = fmul double %111, %112
%114 = fdiv double %113, 3.000000e+00
%115 = tail call double @llvm.fmuladd.f64(double %30, double %102, double %114)
%116 = fmul double %27, %111
%117 = tail call double @llvm.fmuladd.f64(double %13, double %107, double %116)
%118 = tail call double @llvm.fmuladd.f64(double %0, double %112, double %117)
%119 = fmul double %92, 4.000000e+00
%120 = fmul double %63, %111
%121 = tail call double @llvm.fmuladd.f64(double %27, double %107, double %120)
%122 = fmul double %119, %121
%123 = fmul double %79, -4.000000e+00
%124 = fmul double %119, 4.000000e+00
%125 = fmul double %92, %124
%126 = fmul double %63, %107
%127 = tail call double @llvm.fmuladd.f64(double %64, double %111, double %126)
%128 = fmul double %125, %127
%129 = tail call double @llvm.fmuladd.f64(double %123, double %121, double %128)
%130 = fmul double %27, %112
%131 = tail call double @llvm.fmuladd.f64(double %13, double %111, double %130)
%132 = tail call double @llvm.fmuladd.f64(double %0, double %115, double %131)
%133 = fsub double %132, %3
%134 = fmul double %119, %118
%135 = fneg double %118
%136 = fmul double %79, %135
%137 = tail call double @llvm.fmuladd.f64(double %122, double %92, double %136)
%138 = fmul double %137, 4.000000e+00
%139 = fmul double %122, -8.000000e+00
%140 = fmul double %118, -4.000000e+00
%141 = fmul double %90, %140
%142 = tail call double @llvm.fmuladd.f64(double %139, double %79, double %141)
%143 = tail call double @llvm.fmuladd.f64(double %119, double %129, double %142)
%144 = fneg double %133
%145 = fdiv double %144, %134
%146 = fmul double %138, %145
%147 = fmul double %146, 5.000000e-01
%148 = fadd double %134, %147
%149 = fdiv double %144, %148
%150 = fmul double %138, %149
%151 = fmul double %150, 5.000000e-01
%152 = fadd double %134, %151
%153 = fmul double %149, %149
%154 = fmul double %143, %153
%155 = fdiv double %154, 6.000000e+00
%156 = fadd double %152, %155
%157 = fdiv double %133, %156
%158 = fsub double %68, %157
%159 = add nuw nsw i32 %67, 1
%160 = fsub double %3, %132
%161 = fdiv double %160, %3
%162 = tail call double @llvm.fabs.f64(double %161)
%163 = fcmp ogt double %162, 1.000000e-15
br i1 %163, label %66, label %164
164: ; preds = %76
%165 = extractelement <2 x double> %110, i64 0
%166 = fneg double %0
%167 = fdiv double %166, %13
%168 = tail call double @llvm.fmuladd.f64(double %167, double %112, double 1.000000e+00)
%169 = fmul double %165, %166
%170 = fmul double %13, %118
%171 = fdiv double %169, %170
%172 = fdiv double %166, %118
%173 = tail call double @llvm.fmuladd.f64(double %172, double %112, double 1.000000e+00)
%174 = load double, double* %1
%175 = load double, double* %2
%176 = fmul double %131, %175
%177 = tail call double @llvm.fmuladd.f64(double %168, double %174, double %176)
%178 = fmul double %173, %175
%179 = tail call double @llvm.fmuladd.f64(double %171, double %174, double %178)
%180 = load double, double* %6
%181 = load double, double* %15
%182 = fmul double %131, %181
%183 = tail call double @llvm.fmuladd.f64(double %168, double %180, double %182)
%184 = fmul double %173, %181
%185 = tail call double @llvm.fmuladd.f64(double %171, double %180, double %184)
%186 = load double, double* %10
%187 = load double, double* %19
%188 = fmul double %131, %187
%189 = tail call double @llvm.fmuladd.f64(double %168, double %186, double %188)
%190 = fmul double %173, %187
%191 = tail call double @llvm.fmuladd.f64(double %171, double %186, double %190)
store double %177, double* %1
store double %179, double* %2
store double %183, double* %6
store double %185, double* %15
store double %189, double* %10
store double %191, double* %19
br label %192
192: ; preds = %66, %164
%193 = phi i32 [ 0, %164 ], [ -1, %66 ]
ret i32 %193
}