#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 cos(double);
double pow(double, int);
double sin(double);
double sqrt(double);
int shval3(int igdgc, double flat, double flon, double elev, double erad,
           double a2, double b2, int nmax, double *gh, int iext, double *ext,
           double *x, double *y, double *z) {
  double d1;
  double clat, slat;
  int i, j, k, l, n, m;
  double p[119], q[119], r, ratio, aa, bb, cc, cd, dd, cl[14], fm,
      fn = 0, sd, sl[14], rr = 0;
  int npq;
  --ext;
  --gh;
  r = elev;
  slat = sin(flat * .01745329);
  if ((90.0 - flat) < 0.001) {
    aa = 89.999;
  } else if (flat + 90.0 < 0.001) {
    aa = -89.999;
  } else {
    aa = flat;
  }
  clat = cos(aa * .01745329);
  sl[0] = sin(flon * .01745329);
  cl[0] = cos(flon * .01745329);
  *x = 0.0;
  *y = 0.0;
  *z = 0.0;
  sd = 0.0;
  cd = 1.0;
  n = 0;
  l = 1;
  m = 1;
  npq = (nmax * (nmax + 3)) / 2;
  if (igdgc == 1) {
    aa = a2 * clat * clat;
    bb = b2 * slat * slat;
    cc = aa + bb;
    dd = sqrt(cc);
    r = sqrt(elev * (elev + dd * 2.0) + (a2 * aa + b2 * bb) / cc);
    cd = (elev + dd) / r;
    sd = (a2 - b2) / dd * slat * clat / r;
    aa = slat;
    slat = slat * cd - clat * sd;
    clat = clat * cd + aa * sd;
  }
  ratio = erad / r;
  aa = sqrt(3.0);
  p[0] = slat * 2.0;
  p[1] = clat * 2.0;
  p[2] = slat * 4.5 * slat - 1.5;
  p[3] = aa * 3.0 * clat * slat;
  q[0] = -clat;
  q[1] = slat;
  q[2] = clat * -3.0 * slat;
  q[3] = aa * (slat * slat - clat * clat);
  for (k = 1; k <= npq; ++k) {
    if (n < m) {
      m = 0;
      ++n;
      rr = pow(ratio, n + 2);
      fn = n;
    }
    fm = m;
    if (k >= 5) {
      if (m == n) {
        aa = sqrt(1.0 - (0.5 / fm));
        j = k - n - 1;
        p[k - 1] = (1.0 / fm + 1.0) * aa * clat * p[j - 1];
        q[k - 1] = aa * (clat * q[j - 1] + slat / fm * p[j - 1]);
        sl[m - 1] = sl[m - 2] * cl[0] + cl[m - 2] * sl[0];
        cl[m - 1] = cl[m - 2] * cl[0] - sl[m - 2] * sl[0];
      } else {
        aa = sqrt(fn * fn - fm * fm);
        d1 = fn - 1.0;
        bb = sqrt(d1 * d1 - fm * fm) / aa;
        cc = (fn * 2.0 - 1.0) / aa;
        i = k - n;
        j = k - 2 * n + 1;
        p[k - 1] = (fn + 1.0) *
                   (cc * slat / fn * p[i - 1] - bb / (fn - 1.0) * p[j - 1]);
        q[k - 1] =
            cc * (slat * q[i - 1] - clat / fn * p[i - 1]) - bb * q[j - 1];
      }
    }
    aa = rr * gh[l];
    if (m == 0) {
      *x += aa * q[k - 1];
      *z -= aa * p[k - 1];
      ++l;
    } else {
      bb = rr * gh[l + 1];
      cc = aa * cl[m - 1] + bb * sl[m - 1];
      *x += cc * q[k - 1];
      *z -= cc * p[k - 1];
      if (clat > 0.0) {
        *y += (aa * sl[m - 1] - bb * cl[m - 1]) * fm * p[k - 1] /
              ((fn + 1.0) * clat);
      } else {
        *y += (aa * sl[m - 1] - bb * cl[m - 1]) * q[k - 1] * slat;
      }
      l += 2;
    }
    ++m;
  }
  if (iext != 0) {
    aa = ext[2] * cl[0] + ext[3] * sl[0];
    *x = *x - ext[1] * clat + aa * slat;
    *y = *y + ext[2] * sl[0] - ext[3] * cl[0];
    *z = *z + ext[1] * slat + aa * clat;
  }
  aa = *x;
  *x = *x * cd + *z * sd;
  *z = *z * cd - aa * sd;
  return 0;
}


x86 assembly (clang, -O0):
<shval3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x960,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
mov    %esi,-0x3c(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8d0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x958(%rbp)
ff
mov    -0x58(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x818(%rbp)
ff
movsd  0xe47(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  0xe28(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xe13(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    120c <shval3+0xcc>
movsd  0xe21(%rip),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
jmp    1252 <shval3+0x112>
movsd  0xdf4(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xddf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1240 <shval3+0x100>
movsd  0xde5(%rip),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
jmp    124d <shval3+0x10d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
jmp    1252 <shval3+0x112>
movsd  0xdb6(%rip),%xmm0
mulsd  -0x828(%rbp),%xmm0
ff
call   1040 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xd9c(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x950(%rbp)
ff
movsd  0xd82(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x8c0(%rbp)
ff
mov    -0x60(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8d8(%rbp)
ff
movsd  0xd54(%rip),%xmm0
movsd  %xmm0,-0x840(%rbp)
ff
movl   $0x0,-0x8c(%rbp)
movl   $0x1,-0x88(%rbp)
movl   $0x1,-0x90(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
add    $0x3,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x95c(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1490 <shval3+0x350>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x830(%rbp)
ff
movsd  -0x828(%rbp),%xmm0
ff
addsd  -0x830(%rbp),%xmm0
ff
movsd  %xmm0,-0x838(%rbp)
ff
movsd  -0x838(%rbp),%xmm0
ff
call   1060 <sqrt@plt>
movsd  %xmm0,-0x848(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x848(%rbp),%xmm2
ff
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x30(%rbp),%xmm1
movsd  -0x828(%rbp),%xmm4
ff
movsd  -0x38(%rbp),%xmm3
mulsd  -0x830(%rbp),%xmm3
ff
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
divsd  -0x838(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x818(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
addsd  -0x848(%rbp),%xmm0
ff
divsd  -0x818(%rbp),%xmm0
ff
movsd  %xmm0,-0x840(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
divsd  -0x848(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
divsd  -0x818(%rbp),%xmm0
ff
movsd  %xmm0,-0x8d8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x840(%rbp),%xmm2
ff
movsd  -0x70(%rbp),%xmm1
mulsd  -0x8d8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x840(%rbp),%xmm2
ff
movsd  -0x828(%rbp),%xmm1
ff
mulsd  -0x8d8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x818(%rbp),%xmm0
ff
movsd  %xmm0,-0x820(%rbp)
ff
movsd  0xb8b(%rip),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x828(%rbp)
ff
movsd  0xb8e(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x450(%rbp)
ff
movsd  0xb79(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x448(%rbp)
ff
movsd  0xb5c(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb3e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x440(%rbp)
ff
movsd  0xb22(%rip),%xmm0
mulsd  -0x828(%rbp),%xmm0
ff
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x438(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x810(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x808(%rbp)
ff
movsd  0xac7(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x800(%rbp)
ff
movsd  -0x828(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm3
movsd  -0x70(%rbp),%xmm2
mulsd  -0x70(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x7f8(%rbp)
ff
movl   $0x1,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x95c(%rbp),%eax
jg     1d5b <shval3+0xc1b>
mov    -0x8c(%rbp),%eax
cmp    -0x90(%rbp),%eax
jge    1637 <shval3+0x4f7>
movl   $0x0,-0x90(%rbp)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
movsd  -0x820(%rbp),%xmm0
ff
mov    -0x8c(%rbp),%edi
add    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x958(%rbp)
ff
cvtsi2sdl -0x8c(%rbp),%xmm0
ff
movsd  %xmm0,-0x8d0(%rbp)
ff
cvtsi2sdl -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x8c8(%rbp)
ff
cmpl   $0x5,-0x84(%rbp)
jl     1a5a <shval3+0x91a>
mov    -0x90(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jne    180f <shval3+0x6cf>
movsd  0x9f2(%rip),%xmm1
divsd  -0x8c8(%rbp),%xmm1
ff
movsd  0x9aa(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x828(%rbp)
ff
mov    -0x84(%rbp),%eax
sub    -0x8c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x80(%rbp)
movsd  0x97f(%rip),%xmm0
divsd  -0x8c8(%rbp),%xmm0
ff
movsd  0x96f(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x828(%rbp),%xmm0
ff
mulsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x450(%rbp,%rax,8),%xmm0
ff ff
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x450(%rbp,%rax,8)
ff ff
movsd  -0x828(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm1
mov    -0x80(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x810(%rbp,%rax,8),%xmm3
ff ff
movsd  -0x78(%rbp),%xmm2
divsd  -0x8c8(%rbp),%xmm2
ff
mov    -0x80(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x450(%rbp,%rax,8),%xmm2
ff ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x810(%rbp,%rax,8)
ff ff
mov    -0x90(%rbp),%eax
sub    $0x2,%eax
cltq
movsd  -0x950(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x8c0(%rbp),%xmm2
ff
mov    -0x90(%rbp),%eax
sub    $0x2,%eax
cltq
movsd  -0x8c0(%rbp,%rax,8),%xmm1
ff ff
mulsd  -0x950(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x950(%rbp,%rax,8)
ff ff
mov    -0x90(%rbp),%eax
sub    $0x2,%eax
cltq
movsd  -0x8c0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x8c0(%rbp),%xmm2
ff
mov    -0x90(%rbp),%eax
sub    $0x2,%eax
cltq
movsd  -0x950(%rbp,%rax,8),%xmm1
ff ff
mulsd  -0x950(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x8c0(%rbp,%rax,8)
ff ff
jmp    1a55 <shval3+0x915>
movsd  -0x8d0(%rbp),%xmm0
ff
movsd  -0x8d0(%rbp),%xmm2
ff
movsd  -0x8c8(%rbp),%xmm1
ff
mulsd  -0x8c8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x828(%rbp)
ff
movsd  -0x8d0(%rbp),%xmm0
ff
movsd  0x7bd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x8c8(%rbp),%xmm1
ff
mulsd  -0x8c8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
divsd  -0x828(%rbp),%xmm0
ff
movsd  %xmm0,-0x830(%rbp)
ff
movsd  -0x8d0(%rbp),%xmm0
ff
addsd  %xmm0,%xmm0
movsd  0x782(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  -0x828(%rbp),%xmm0
ff
movsd  %xmm0,-0x838(%rbp)
ff
mov    -0x84(%rbp),%eax
sub    -0x8c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x84(%rbp),%eax
mov    -0x8c(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
movsd  0x710(%rip),%xmm0
addsd  -0x8d0(%rbp),%xmm0
ff
movsd  -0x838(%rbp),%xmm1
ff
mulsd  -0x78(%rbp),%xmm1
divsd  -0x8d0(%rbp),%xmm1
ff
mov    -0x7c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x450(%rbp,%rax,8),%xmm3
ff ff
movsd  -0x830(%rbp),%xmm2
ff
movsd  -0x8d0(%rbp),%xmm4
ff
movsd  0x6ca(%rip),%xmm5
subsd  %xmm5,%xmm4
divsd  %xmm4,%xmm2
mov    -0x80(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x450(%rbp,%rax,8),%xmm2
ff ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x450(%rbp,%rax,8)
ff ff
movsd  -0x838(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
mov    -0x7c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x810(%rbp,%rax,8),%xmm3
ff ff
movsd  -0x70(%rbp),%xmm1
divsd  -0x8d0(%rbp),%xmm1
ff
mov    -0x7c(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x450(%rbp,%rax,8),%xmm1
ff ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x830(%rbp),%xmm1
ff
mov    -0x80(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x810(%rbp,%rax,8),%xmm1
ff ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x810(%rbp,%rax,8)
ff ff
jmp    1a5a <shval3+0x91a>
movsd  -0x958(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
movslq -0x88(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
cmpl   $0x0,-0x90(%rbp)
jne    1b12 <shval3+0x9d2>
movsd  -0x828(%rbp),%xmm0
ff
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x810(%rbp,%rax,8),%xmm2
ff ff
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x828(%rbp),%xmm0
ff
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x450(%rbp,%rax,8),%xmm2
ff ff
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1d38 <shval3+0xbf8>
movsd  -0x958(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x830(%rbp)
ff
movsd  -0x828(%rbp),%xmm0
ff
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x8c0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x830(%rbp),%xmm1
ff
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x950(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x838(%rbp)
ff
movsd  -0x838(%rbp),%xmm0
ff
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x810(%rbp,%rax,8),%xmm2
ff ff
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x838(%rbp),%xmm0
ff
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x450(%rbp,%rax,8),%xmm2
ff ff
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1ca5 <shval3+0xb65>
movsd  -0x828(%rbp),%xmm0
ff
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x950(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x830(%rbp),%xmm1
ff
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x8c0(%rbp,%rax,8),%xmm1
ff ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x8c8(%rbp),%xmm0
ff
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x450(%rbp,%rax,8),%xmm0
ff ff
movsd  0x3a5(%rip),%xmm1
addsd  -0x8d0(%rbp),%xmm1
ff
mulsd  -0x70(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1d29 <shval3+0xbe9>
movsd  -0x828(%rbp),%xmm0
ff
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x950(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x830(%rbp),%xmm1
ff
mov    -0x90(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x8c0(%rbp,%rax,8),%xmm1
ff ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x810(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x78(%rbp),%xmm2
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x88(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x88(%rbp)
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    15cc <shval3+0x48c>
cmpl   $0x0,-0x4c(%rbp)
je     1e7d <shval3+0xd3d>
mov    -0x58(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x8c0(%rbp),%xmm2
ff
mov    -0x58(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x950(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x70(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x828(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  0x10(%rax),%xmm1
movsd  -0x950(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x58(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x8c0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x828(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x828(%rbp)
ff
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x840(%rbp),%xmm2
ff
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x8d8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x840(%rbp),%xmm2
ff
movsd  -0x828(%rbp),%xmm1
ff
mulsd  -0x8d8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x960,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shval3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x938,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,0xc8(%rsp)
mov    %ecx,0x8c(%rsp)
mov    %rdx,(%rsp)
mov    %esi,%ebp
movapd %xmm5,0x40(%rsp)
movapd %xmm4,0x50(%rsp)
movsd  %xmm3,0x80(%rsp)
movaps %xmm2,0x90(%rsp)
movsd  %xmm1,0x30(%rsp)
movapd %xmm0,%xmm1
movsd  %xmm0,0x20(%rsp)
mov    %edi,%r13d
movsd  0xe5d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1030 <sin@plt>
movsd  0x20(%rsp),%xmm2
movapd %xmm0,0x60(%rsp)
movsd  0xe42(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xe46(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e2 <shval3+0xa2>
movsd  0xe30(%rip),%xmm0
jmp    1200 <shval3+0xc0>
addsd  0xe1e(%rip),%xmm2
ucomisd %xmm2,%xmm0
jbe    11fa <shval3+0xba>
movsd  0xe28(%rip),%xmm0
jmp    1200 <shval3+0xc0>
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x30(%rsp),%xmm0
mulsd  0xde8(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x78(%rsp)
movsd  %xmm0,0x150(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0xe0(%rsp)
mov    0x8(%rsp),%rax
movq   $0x0,(%rax)
mov    0x970(%rsp),%rax
movq   $0x0,(%rax)
mov    0x978(%rsp),%rax
movq   $0x0,(%rax)
lea    0x3(%rbp),%r14d
imul   %ebp,%r14d
movapd 0x60(%rsp),%xmm8
unpcklpd 0x10(%rsp),%xmm8
cmp    $0x1,%r13d
jne    12c9 <shval3+0x189>
movapd 0x40(%rsp),%xmm2
unpcklpd 0x50(%rsp),%xmm2
mulpd  %xmm8,%xmm2
mulpd  %xmm8,%xmm2
movapd %xmm2,%xmm7
unpckhpd %xmm2,%xmm7
movapd %xmm7,%xmm5
addsd  %xmm2,%xmm5
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm5
movapd %xmm8,0x20(%rsp)
jb     12f9 <shval3+0x1b9>
sqrtsd %xmm5,%xmm6
jmp    133a <shval3+0x1fa>
movsd  0xd57(%rip),%xmm0
movapd %xmm0,0xd0(%rsp)
mov    0x978(%rsp),%rbx
mov    0x8(%rsp),%r13
mov    (%rsp),%rsi
movapd 0x90(%rsp),%xmm3
jmp    142d <shval3+0x2ed>
movapd %xmm5,%xmm0
movapd %xmm2,0x30(%rsp)
movapd %xmm5,0xa0(%rsp)
movapd %xmm7,0xb0(%rsp)
call   1060 <sqrt@plt>
movapd 0xb0(%rsp),%xmm7
movapd 0xa0(%rsp),%xmm5
xorpd  %xmm4,%xmm4
movapd 0x30(%rsp),%xmm2
movapd %xmm0,%xmm6
mov    0x978(%rsp),%rbx
mov    0x8(%rsp),%r13
movapd 0x90(%rsp),%xmm3
movapd %xmm6,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm3,%xmm0
mulsd  0x40(%rsp),%xmm2
movapd 0x50(%rsp),%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm4,%xmm0
jb     1388 <shval3+0x248>
sqrtsd %xmm0,%xmm0
jmp    13a2 <shval3+0x262>
movsd  %xmm6,0x30(%rsp)
call   1060 <sqrt@plt>
movsd  0x30(%rsp),%xmm6
movapd 0x90(%rsp),%xmm3
mov    (%rsp),%rsi
movapd 0x20(%rsp),%xmm8
movapd 0x50(%rsp),%xmm2
subsd  0x40(%rsp),%xmm2
divsd  %xmm6,%xmm2
movapd 0x60(%rsp),%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
movapd 0x10(%rsp),%xmm5
unpcklpd %xmm5,%xmm2
unpcklpd %xmm1,%xmm1
mulpd  %xmm2,%xmm1
addsd  %xmm6,%xmm3
shufpd $0x2,%xmm1,%xmm3
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm3,%xmm2
divpd  %xmm1,%xmm2
xorpd  0xc72(%rip),%xmm5
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
unpcklpd %xmm4,%xmm5
mulpd  %xmm1,%xmm5
movapd %xmm2,0xd0(%rsp)
movapd %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm1,%xmm8
addpd  %xmm5,%xmm8
movapd %xmm0,%xmm3
movapd %xmm8,%xmm0
addpd  %xmm8,%xmm0
movapd %xmm0,0x1c0(%rsp)
movsd  0xbe8(%rip),%xmm0
mulsd  %xmm8,%xmm0
mulsd  %xmm8,%xmm0
addsd  0xbde(%rip),%xmm0
movsd  %xmm0,0x1d0(%rsp)
movapd %xmm8,%xmm9
unpckhpd %xmm8,%xmm9
movsd  0xbcb(%rip),%xmm0
mulsd  %xmm9,%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm0,0x1d8(%rsp)
movapd 0xbe0(%rip),%xmm0
xorpd  %xmm9,%xmm0
movapd %xmm0,0x90(%rsp)
unpcklpd %xmm8,%xmm0
movapd %xmm0,0x580(%rsp)
movsd  0xb94(%rip),%xmm0
mulsd  %xmm9,%xmm0
movapd %xmm9,%xmm1
mulsd  %xmm9,%xmm1
movapd %xmm8,%xmm2
mulsd  %xmm8,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm8,%xmm1
shufpd $0x2,0xba1(%rip),%xmm0
unpcklpd %xmm2,%xmm1
mulpd  %xmm1,%xmm0
movapd %xmm0,0x590(%rsp)
cmp    $0x2,%r14d
jge    1598 <shval3+0x458>
cmpl   $0x0,0x8c(%rsp)
je     1a73 <shval3+0x933>
movsd  0xe0(%rsp),%xmm1
mov    0xc8(%rsp),%rax
movsd  0x10(%rax),%xmm2
movsd  0x78(%rsp),%xmm4
mulsd  %xmm4,%xmm2
movsd  0x8(%rax),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  0x0(%r13),%xmm2
movsd  (%rax),%xmm3
mulsd  %xmm9,%xmm3
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm8,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x0(%r13)
mulsd  0x8(%rax),%xmm4
mov    0x970(%rsp),%rcx
addsd  (%rcx),%xmm4
mulsd  0x10(%rax),%xmm1
subsd  %xmm1,%xmm4
movsd  %xmm4,(%rcx)
movsd  (%rax),%xmm1
mulsd  %xmm8,%xmm1
addsd  (%rbx),%xmm1
mulsd  %xmm9,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
jmp    1a77 <shval3+0x937>
mov    %r14d,%eax
shr    $0x1f,%eax
add    %r14d,%eax
sar    %eax
movsd  0x80(%rsp),%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x80(%rsp)
add    $0x1,%eax
mov    %rax,0x30(%rsp)
xor    %ebp,%ebp
mov    $0x1,%r12d
mov    $0x1,%r14d
xorpd  %xmm10,%xmm10
xorpd  %xmm11,%xmm11
mov    $0x1,%r15d
movapd %xmm8,0x20(%rsp)
movapd %xmm9,0x60(%rsp)
jmp    163b <shval3+0x4fb>
nop
movsd  0x578(%rsp,%r14,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x0(%r13),%xmm1
movsd  %xmm1,0x0(%r13)
mulsd  0x1b8(%rsp,%r14,8),%xmm0
movsd  (%rbx),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
mov    $0x1,%eax
add    %eax,%r15d
add    $0x1,%r12d
add    $0x1,%r14
cmp    %r14,0x30(%rsp)
je     14fa <shval3+0x3ba>
cmp    %r12d,%ebp
jge    168a <shval3+0x54a>
lea    0x1(%rbp),%r13d
add    $0x3,%ebp
movsd  0x80(%rsp),%xmm0
mov    %ebp,%edi
call   1050 <pow@plt>
movapd 0x60(%rsp),%xmm9
movapd 0x20(%rsp),%xmm8
mov    (%rsp),%rsi
movapd %xmm0,%xmm10
xorps  %xmm11,%xmm11
cvtsi2sd %r13d,%xmm11
xor    %r12d,%r12d
mov    %r13d,%ebp
mov    0x8(%rsp),%r13
mov    0x978(%rsp),%rbx
xorps  %xmm12,%xmm12
cvtsi2sd %r12d,%xmm12
cmp    $0x5,%r14
jb     1992 <shval3+0x852>
cmp    %ebp,%r12d
jne    16d0 <shval3+0x590>
movsd  0x9ae(%rip),%xmm0
divsd  %xmm12,%xmm0
addsd  0x971(%rip),%xmm0
ucomisd 0x9a1(%rip),%xmm0
jb     171f <shval3+0x5df>
sqrtsd %xmm0,%xmm0
jmp    1760 <shval3+0x620>
nopw   0x0(%rax,%rax,1)
movapd %xmm12,%xmm1
xorpd  0x993(%rip),%xmm1
mulsd  %xmm12,%xmm1
movapd %xmm11,%xmm0
mulsd  %xmm11,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0x968(%rip),%xmm0
movsd  %xmm10,0x50(%rsp)
movsd  %xmm11,0x40(%rsp)
movapd %xmm12,0x10(%rsp)
jb     1834 <shval3+0x6f4>
xorps  %xmm4,%xmm4
sqrtsd %xmm0,%xmm4
jmp    1856 <shval3+0x716>
movsd  %xmm10,0x50(%rsp)
movsd  %xmm11,0x40(%rsp)
movapd %xmm12,0x10(%rsp)
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm12
movsd  0x40(%rsp),%xmm11
movsd  0x50(%rsp),%xmm10
movapd 0x60(%rsp),%xmm9
movapd 0x20(%rsp),%xmm8
mov    (%rsp),%rsi
movsd  0x8c0(%rip),%xmm2
movapd %xmm2,%xmm1
divsd  %xmm12,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm9,%xmm1
mov    %r14d,%eax
sub    %ebp,%eax
add    $0xfffffffe,%eax
cltq
mulsd  0x1c0(%rsp,%rax,8),%xmm1
movsd  %xmm1,0x1b8(%rsp,%r14,8)
movapd %xmm8,%xmm1
divsd  %xmm12,%xmm1
mulsd  0x1c0(%rsp,%rax,8),%xmm1
movsd  0x580(%rsp,%rax,8),%xmm2
mulsd  %xmm9,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x578(%rsp,%r14,8)
movslq %ebp,%rax
movsd  0x140(%rsp,%rax,8),%xmm0
movsd  0xe0(%rsp),%xmm1
movsd  0xd0(%rsp,%rax,8),%xmm2
movsd  0x78(%rsp),%xmm4
mulsd  %xmm2,%xmm4
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x148(%rsp,%rax,8)
movsd  0x150(%rsp),%xmm3
movsd  %xmm3,0x78(%rsp)
mulsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0xd8(%rsp,%rax,8)
jmp    1992 <shval3+0x852>
movapd %xmm1,0xa0(%rsp)
call   1060 <sqrt@plt>
movapd 0xa0(%rsp),%xmm1
movsd  0x40(%rsp),%xmm11
movapd %xmm0,%xmm4
movapd %xmm11,%xmm5
addsd  0x7ed(%rip),%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0x7e9(%rip),%xmm0
jb     187f <shval3+0x73f>
sqrtsd %xmm0,%xmm0
jmp    18af <shval3+0x76f>
movsd  %xmm4,0xa0(%rsp)
movsd  %xmm5,0xb0(%rsp)
call   1060 <sqrt@plt>
movsd  0xb0(%rsp),%xmm5
movsd  0xa0(%rsp),%xmm4
movsd  0x40(%rsp),%xmm11
mov    (%rsp),%rsi
movapd 0x20(%rsp),%xmm8
movapd 0x60(%rsp),%xmm9
movsd  0x50(%rsp),%xmm10
movapd 0x10(%rsp),%xmm12
movapd %xmm11,%xmm1
addsd  %xmm11,%xmm1
addsd  0x76f(%rip),%xmm1
divsd  %xmm4,%xmm1
lea    0x0(%rbp,%rbp,1),%eax
movapd %xmm11,%xmm2
addsd  0x732(%rip),%xmm2
movapd %xmm8,%xmm3
mulsd  %xmm1,%xmm3
divsd  %xmm11,%xmm3
mov    %ebp,%ecx
not    %ecx
add    %r14d,%ecx
mov    %r14d,%edx
sub    %eax,%edx
movslq %ecx,%rax
movslq %edx,%rcx
xorpd  0x752(%rip),%xmm0
divsd  %xmm4,%xmm0
movapd %xmm0,%xmm4
divsd  %xmm5,%xmm4
mulsd  0x1c0(%rsp,%rcx,8),%xmm4
mulsd  0x1c0(%rsp,%rax,8),%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x1b8(%rsp,%r14,8)
movapd 0x90(%rsp),%xmm2
divsd  %xmm11,%xmm2
mulsd  0x1c0(%rsp,%rax,8),%xmm2
movsd  0x580(%rsp,%rax,8),%xmm3
mulsd  %xmm8,%xmm3
mulsd  0x580(%rsp,%rcx,8),%xmm0
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x578(%rsp,%r14,8)
mov    %r15d,%eax
movsd  -0x8(%rsi,%rax,8),%xmm0
mulsd  %xmm10,%xmm0
test   %r12d,%r12d
je     15f0 <shval3+0x4b0>
ucomisd 0x6ae(%rip),%xmm9
movsd  (%rsi,%rax,8),%xmm3
mulsd  %xmm10,%xmm3
movslq %r12d,%rax
movsd  0xd8(%rsp,%rax,8),%xmm4
movsd  0x148(%rsp,%rax,8),%xmm5
movapd %xmm3,%xmm1
mulsd  %xmm5,%xmm1
movapd %xmm0,%xmm6
mulsd  %xmm4,%xmm6
addsd  %xmm1,%xmm6
movsd  0x578(%rsp,%r14,8),%xmm1
movapd %xmm6,%xmm2
mulsd  %xmm1,%xmm2
addsd  0x0(%r13),%xmm2
movsd  %xmm2,0x0(%r13)
movsd  0x1b8(%rsp,%r14,8),%xmm2
movsd  (%rbx),%xmm7
mulsd  %xmm2,%xmm6
subsd  %xmm6,%xmm7
movsd  %xmm7,(%rbx)
mulsd  %xmm4,%xmm3
mulsd  %xmm5,%xmm0
subsd  %xmm3,%xmm0
jbe    1a50 <shval3+0x910>
mulsd  %xmm12,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm11,%xmm1
addsd  0x5e7(%rip),%xmm1
mulsd  %xmm9,%xmm1
divsd  %xmm1,%xmm0
jmp    1a59 <shval3+0x919>
nopl   0x0(%rax)
mulsd  %xmm1,%xmm0
mulsd  %xmm8,%xmm0
mov    0x970(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    $0x2,%eax
jmp    1625 <shval3+0x4e5>
movsd  (%rbx),%xmm0
movsd  0x0(%r13),%xmm1
movapd 0xd0(%rsp),%xmm4
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm4,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x0(%r13)
mulsd  %xmm1,%xmm2
movsd  (%rbx),%xmm0
mulsd  %xmm4,%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx)
xor    %eax,%eax
add    $0x938,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @shval3(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double* %8, i32 %9, double* %10, double* %11, double* %12, double* %13) {
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca i32
%23 = alloca double*
%24 = alloca i32
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca [119 x double]
%39 = alloca [119 x double]
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
%45 = alloca double
%46 = alloca double
%47 = alloca [14 x double]
%48 = alloca double
%49 = alloca double
%50 = alloca double
%51 = alloca [14 x double]
%52 = alloca double
%53 = alloca i32
store i32 %0, i32* %15
store double %1, double* %16
store double %2, double* %17
store double %3, double* %18
store double %4, double* %19
store double %5, double* %20
store double %6, double* %21
store i32 %7, i32* %22
store double* %8, double** %23
store i32 %9, i32* %24
store double* %10, double** %25
store double* %11, double** %26
store double* %12, double** %27
store double* %13, double** %28
store double 0.000000e+00, double* %49
store double 0.000000e+00, double* %52
%54 = load double*, double** %25
%55 = getelementptr inbounds double, double* %54, i32 -1
store double* %55, double** %25
%56 = load double*, double** %23
%57 = getelementptr inbounds double, double* %56, i32 -1
store double* %57, double** %23
%58 = load double, double* %18
store double %58, double* %40
%59 = load double, double* %16
%60 = fmul double %59, 0x3F91DF467707C94D
%61 = call double @sin(double %60)
store double %61, double* %31
%62 = load double, double* %16
%63 = fsub double 9.000000e+01, %62
%64 = fcmp olt double %63, 1.000000e-03
br i1 %64, label %65, label %66
65: ; preds = %14
store double 8.999900e+01, double* %42
br label %74
66: ; preds = %14
%67 = load double, double* %16
%68 = fadd double %67, 9.000000e+01
%69 = fcmp olt double %68, 1.000000e-03
br i1 %69, label %70, label %71
70: ; preds = %66
store double -8.999900e+01, double* %42
br label %73
71: ; preds = %66
%72 = load double, double* %16
store double %72, double* %42
br label %73
73: ; preds = %71, %70
br label %74
74: ; preds = %73, %65
%75 = load double, double* %42
%76 = fmul double %75, 0x3F91DF467707C94D
%77 = call double @cos(double %76)
store double %77, double* %30
%78 = load double, double* %17
%79 = fmul double %78, 0x3F91DF467707C94D
%80 = call double @sin(double %79)
%81 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 0
store double %80, double* %81
%82 = load double, double* %17
%83 = fmul double %82, 0x3F91DF467707C94D
%84 = call double @cos(double %83)
%85 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 0
store double %84, double* %85
%86 = load double*, double** %26
store double 0.000000e+00, double* %86
%87 = load double*, double** %27
store double 0.000000e+00, double* %87
%88 = load double*, double** %28
store double 0.000000e+00, double* %88
store double 0.000000e+00, double* %50
store double 1.000000e+00, double* %45
store i32 0, i32* %36
store i32 1, i32* %35
store i32 1, i32* %37
%89 = load i32, i32* %22
%90 = load i32, i32* %22
%91 = add nsw i32 %90, 3
%92 = mul nsw i32 %89, %91
%93 = sdiv i32 %92, 2
store i32 %93, i32* %53
%94 = load i32, i32* %15
%95 = icmp eq i32 %94, 1
br i1 %95, label %96, label %156
96: ; preds = %74
%97 = load double, double* %20
%98 = load double, double* %30
%99 = fmul double %97, %98
%100 = load double, double* %30
%101 = fmul double %99, %100
store double %101, double* %42
%102 = load double, double* %21
%103 = load double, double* %31
%104 = fmul double %102, %103
%105 = load double, double* %31
%106 = fmul double %104, %105
store double %106, double* %43
%107 = load double, double* %42
%108 = load double, double* %43
%109 = fadd double %107, %108
store double %109, double* %44
%110 = load double, double* %44
%111 = call double @sqrt(double %110)
store double %111, double* %46
%112 = load double, double* %18
%113 = load double, double* %18
%114 = load double, double* %46
%115 = call double @llvm.fmuladd.f64(double %114, double 2.000000e+00, double %113)
%116 = load double, double* %20
%117 = load double, double* %42
%118 = load double, double* %21
%119 = load double, double* %43
%120 = fmul double %118, %119
%121 = call double @llvm.fmuladd.f64(double %116, double %117, double %120)
%122 = load double, double* %44
%123 = fdiv double %121, %122
%124 = call double @llvm.fmuladd.f64(double %112, double %115, double %123)
%125 = call double @sqrt(double %124)
store double %125, double* %40
%126 = load double, double* %18
%127 = load double, double* %46
%128 = fadd double %126, %127
%129 = load double, double* %40
%130 = fdiv double %128, %129
store double %130, double* %45
%131 = load double, double* %20
%132 = load double, double* %21
%133 = fsub double %131, %132
%134 = load double, double* %46
%135 = fdiv double %133, %134
%136 = load double, double* %31
%137 = fmul double %135, %136
%138 = load double, double* %30
%139 = fmul double %137, %138
%140 = load double, double* %40
%141 = fdiv double %139, %140
store double %141, double* %50
%142 = load double, double* %31
store double %142, double* %42
%143 = load double, double* %31
%144 = load double, double* %45
%145 = load double, double* %30
%146 = load double, double* %50
%147 = fmul double %145, %146
%148 = fneg double %147
%149 = call double @llvm.fmuladd.f64(double %143, double %144, double %148)
store double %149, double* %31
%150 = load double, double* %30
%151 = load double, double* %45
%152 = load double, double* %42
%153 = load double, double* %50
%154 = fmul double %152, %153
%155 = call double @llvm.fmuladd.f64(double %150, double %151, double %154)
store double %155, double* %30
br label %156
156: ; preds = %96, %74
%157 = load double, double* %19
%158 = load double, double* %40
%159 = fdiv double %157, %158
store double %159, double* %41
%160 = call double @sqrt(double 3.000000e+00)
store double %160, double* %42
%161 = load double, double* %31
%162 = fmul double %161, 2.000000e+00
%163 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 0
store double %162, double* %163
%164 = load double, double* %30
%165 = fmul double %164, 2.000000e+00
%166 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 1
store double %165, double* %166
%167 = load double, double* %31
%168 = fmul double %167, 4.500000e+00
%169 = load double, double* %31
%170 = call double @llvm.fmuladd.f64(double %168, double %169, double -1.500000e+00)
%171 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 2
store double %170, double* %171
%172 = load double, double* %42
%173 = fmul double %172, 3.000000e+00
%174 = load double, double* %30
%175 = fmul double %173, %174
%176 = load double, double* %31
%177 = fmul double %175, %176
%178 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 3
store double %177, double* %178
%179 = load double, double* %30
%180 = fneg double %179
%181 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 0
store double %180, double* %181
%182 = load double, double* %31
%183 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 1
store double %182, double* %183
%184 = load double, double* %30
%185 = fmul double %184, -3.000000e+00
%186 = load double, double* %31
%187 = fmul double %185, %186
%188 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 2
store double %187, double* %188
%189 = load double, double* %42
%190 = load double, double* %31
%191 = load double, double* %31
%192 = load double, double* %30
%193 = load double, double* %30
%194 = fmul double %192, %193
%195 = fneg double %194
%196 = call double @llvm.fmuladd.f64(double %190, double %191, double %195)
%197 = fmul double %189, %196
%198 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 3
store double %197, double* %198
store i32 1, i32* %34
br label %199
199: ; preds = %548, %156
%200 = load i32, i32* %34
%201 = load i32, i32* %53
%202 = icmp sle i32 %200, %201
br i1 %202, label %203, label %551
203: ; preds = %199
%204 = load i32, i32* %36
%205 = load i32, i32* %37
%206 = icmp slt i32 %204, %205
br i1 %206, label %207, label %216
207: ; preds = %203
store i32 0, i32* %37
%208 = load i32, i32* %36
%209 = add nsw i32 %208, 1
store i32 %209, i32* %36
%210 = load double, double* %41
%211 = load i32, i32* %36
%212 = add nsw i32 %211, 2
%213 = call double @pow(double %210, i32 %212)
store double %213, double* %52
%214 = load i32, i32* %36
%215 = sitofp i32 %214 to double
store double %215, double* %49
br label %216
216: ; preds = %207, %203
%217 = load i32, i32* %37
%218 = sitofp i32 %217 to double
store double %218, double* %48
%219 = load i32, i32* %34
%220 = icmp sge i32 %219, 5
br i1 %220, label %221, label %408
221: ; preds = %216
%222 = load i32, i32* %37
%223 = load i32, i32* %36
%224 = icmp eq i32 %222, %223
br i1 %224, label %225, label %314
225: ; preds = %221
%226 = load double, double* %48
%227 = fdiv double 5.000000e-01, %226
%228 = fsub double 1.000000e+00, %227
%229 = call double @sqrt(double %228)
store double %229, double* %42
%230 = load i32, i32* %34
%231 = load i32, i32* %36
%232 = sub nsw i32 %230, %231
%233 = sub nsw i32 %232, 1
store i32 %233, i32* %33
%234 = load double, double* %48
%235 = fdiv double 1.000000e+00, %234
%236 = fadd double %235, 1.000000e+00
%237 = load double, double* %42
%238 = fmul double %236, %237
%239 = load double, double* %30
%240 = fmul double %238, %239
%241 = load i32, i32* %33
%242 = sub nsw i32 %241, 1
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %243
%245 = load double, double* %244
%246 = fmul double %240, %245
%247 = load i32, i32* %34
%248 = sub nsw i32 %247, 1
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %249
store double %246, double* %250
%251 = load double, double* %42
%252 = load double, double* %30
%253 = load i32, i32* %33
%254 = sub nsw i32 %253, 1
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %255
%257 = load double, double* %256
%258 = load double, double* %31
%259 = load double, double* %48
%260 = fdiv double %258, %259
%261 = load i32, i32* %33
%262 = sub nsw i32 %261, 1
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %263
%265 = load double, double* %264
%266 = fmul double %260, %265
%267 = call double @llvm.fmuladd.f64(double %252, double %257, double %266)
%268 = fmul double %251, %267
%269 = load i32, i32* %34
%270 = sub nsw i32 %269, 1
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %271
store double %268, double* %272
%273 = load i32, i32* %37
%274 = sub nsw i32 %273, 2
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 %275
%277 = load double, double* %276
%278 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 0
%279 = load double, double* %278
%280 = load i32, i32* %37
%281 = sub nsw i32 %280, 2
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 %282
%284 = load double, double* %283
%285 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 0
%286 = load double, double* %285
%287 = fmul double %284, %286
%288 = call double @llvm.fmuladd.f64(double %277, double %279, double %287)
%289 = load i32, i32* %37
%290 = sub nsw i32 %289, 1
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 %291
store double %288, double* %292
%293 = load i32, i32* %37
%294 = sub nsw i32 %293, 2
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 %295
%297 = load double, double* %296
%298 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 0
%299 = load double, double* %298
%300 = load i32, i32* %37
%301 = sub nsw i32 %300, 2
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 %302
%304 = load double, double* %303
%305 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 0
%306 = load double, double* %305
%307 = fmul double %304, %306
%308 = fneg double %307
%309 = call double @llvm.fmuladd.f64(double %297, double %299, double %308)
%310 = load i32, i32* %37
%311 = sub nsw i32 %310, 1
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 %312
store double %309, double* %313
br label %407
314: ; preds = %221
%315 = load double, double* %49
%316 = load double, double* %49
%317 = load double, double* %48
%318 = load double, double* %48
%319 = fmul double %317, %318
%320 = fneg double %319
%321 = call double @llvm.fmuladd.f64(double %315, double %316, double %320)
%322 = call double @sqrt(double %321)
store double %322, double* %42
%323 = load double, double* %49
%324 = fsub double %323, 1.000000e+00
store double %324, double* %29
%325 = load double, double* %29
%326 = load double, double* %29
%327 = load double, double* %48
%328 = load double, double* %48
%329 = fmul double %327, %328
%330 = fneg double %329
%331 = call double @llvm.fmuladd.f64(double %325, double %326, double %330)
%332 = call double @sqrt(double %331)
%333 = load double, double* %42
%334 = fdiv double %332, %333
store double %334, double* %43
%335 = load double, double* %49
%336 = call double @llvm.fmuladd.f64(double %335, double 2.000000e+00, double -1.000000e+00)
%337 = load double, double* %42
%338 = fdiv double %336, %337
store double %338, double* %44
%339 = load i32, i32* %34
%340 = load i32, i32* %36
%341 = sub nsw i32 %339, %340
store i32 %341, i32* %32
%342 = load i32, i32* %34
%343 = load i32, i32* %36
%344 = mul nsw i32 2, %343
%345 = sub nsw i32 %342, %344
%346 = add nsw i32 %345, 1
store i32 %346, i32* %33
%347 = load double, double* %49
%348 = fadd double %347, 1.000000e+00
%349 = load double, double* %44
%350 = load double, double* %31
%351 = fmul double %349, %350
%352 = load double, double* %49
%353 = fdiv double %351, %352
%354 = load i32, i32* %32
%355 = sub nsw i32 %354, 1
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %356
%358 = load double, double* %357
%359 = load double, double* %43
%360 = load double, double* %49
%361 = fsub double %360, 1.000000e+00
%362 = fdiv double %359, %361
%363 = load i32, i32* %33
%364 = sub nsw i32 %363, 1
%365 = sext i32 %364 to i64
%366 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %365
%367 = load double, double* %366
%368 = fmul double %362, %367
%369 = fneg double %368
%370 = call double @llvm.fmuladd.f64(double %353, double %358, double %369)
%371 = fmul double %348, %370
%372 = load i32, i32* %34
%373 = sub nsw i32 %372, 1
%374 = sext i32 %373 to i64
%375 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %374
store double %371, double* %375
%376 = load double, double* %44
%377 = load double, double* %31
%378 = load i32, i32* %32
%379 = sub nsw i32 %378, 1
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %380
%382 = load double, double* %381
%383 = load double, double* %30
%384 = load double, double* %49
%385 = fdiv double %383, %384
%386 = load i32, i32* %32
%387 = sub nsw i32 %386, 1
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %388
%390 = load double, double* %389
%391 = fmul double %385, %390
%392 = fneg double %391
%393 = call double @llvm.fmuladd.f64(double %377, double %382, double %392)
%394 = load double, double* %43
%395 = load i32, i32* %33
%396 = sub nsw i32 %395, 1
%397 = sext i32 %396 to i64
%398 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %397
%399 = load double, double* %398
%400 = fmul double %394, %399
%401 = fneg double %400
%402 = call double @llvm.fmuladd.f64(double %376, double %393, double %401)
%403 = load i32, i32* %34
%404 = sub nsw i32 %403, 1
%405 = sext i32 %404 to i64
%406 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %405
store double %402, double* %406
br label %407
407: ; preds = %314, %225
br label %408
408: ; preds = %407, %216
%409 = load double, double* %52
%410 = load double*, double** %23
%411 = load i32, i32* %35
%412 = sext i32 %411 to i64
%413 = getelementptr inbounds double, double* %410, i64 %412
%414 = load double, double* %413
%415 = fmul double %409, %414
store double %415, double* %42
%416 = load i32, i32* %37
%417 = icmp eq i32 %416, 0
br i1 %417, label %418, label %440
418: ; preds = %408
%419 = load double, double* %42
%420 = load i32, i32* %34
%421 = sub nsw i32 %420, 1
%422 = sext i32 %421 to i64
%423 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %422
%424 = load double, double* %423
%425 = load double*, double** %26
%426 = load double, double* %425
%427 = call double @llvm.fmuladd.f64(double %419, double %424, double %426)
store double %427, double* %425
%428 = load double, double* %42
%429 = load i32, i32* %34
%430 = sub nsw i32 %429, 1
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %431
%433 = load double, double* %432
%434 = load double*, double** %28
%435 = load double, double* %434
%436 = fneg double %428
%437 = call double @llvm.fmuladd.f64(double %436, double %433, double %435)
store double %437, double* %434
%438 = load i32, i32* %35
%439 = add nsw i32 %438, 1
store i32 %439, i32* %35
br label %545
440: ; preds = %408
%441 = load double, double* %52
%442 = load double*, double** %23
%443 = load i32, i32* %35
%444 = add nsw i32 %443, 1
%445 = sext i32 %444 to i64
%446 = getelementptr inbounds double, double* %442, i64 %445
%447 = load double, double* %446
%448 = fmul double %441, %447
store double %448, double* %43
%449 = load double, double* %42
%450 = load i32, i32* %37
%451 = sub nsw i32 %450, 1
%452 = sext i32 %451 to i64
%453 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 %452
%454 = load double, double* %453
%455 = load double, double* %43
%456 = load i32, i32* %37
%457 = sub nsw i32 %456, 1
%458 = sext i32 %457 to i64
%459 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 %458
%460 = load double, double* %459
%461 = fmul double %455, %460
%462 = call double @llvm.fmuladd.f64(double %449, double %454, double %461)
store double %462, double* %44
%463 = load double, double* %44
%464 = load i32, i32* %34
%465 = sub nsw i32 %464, 1
%466 = sext i32 %465 to i64
%467 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %466
%468 = load double, double* %467
%469 = load double*, double** %26
%470 = load double, double* %469
%471 = call double @llvm.fmuladd.f64(double %463, double %468, double %470)
store double %471, double* %469
%472 = load double, double* %44
%473 = load i32, i32* %34
%474 = sub nsw i32 %473, 1
%475 = sext i32 %474 to i64
%476 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %475
%477 = load double, double* %476
%478 = load double*, double** %28
%479 = load double, double* %478
%480 = fneg double %472
%481 = call double @llvm.fmuladd.f64(double %480, double %477, double %479)
store double %481, double* %478
%482 = load double, double* %30
%483 = fcmp ogt double %482, 0.000000e+00
br i1 %483, label %484, label %516
484: ; preds = %440
%485 = load double, double* %42
%486 = load i32, i32* %37
%487 = sub nsw i32 %486, 1
%488 = sext i32 %487 to i64
%489 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 %488
%490 = load double, double* %489
%491 = load double, double* %43
%492 = load i32, i32* %37
%493 = sub nsw i32 %492, 1
%494 = sext i32 %493 to i64
%495 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 %494
%496 = load double, double* %495
%497 = fmul double %491, %496
%498 = fneg double %497
%499 = call double @llvm.fmuladd.f64(double %485, double %490, double %498)
%500 = load double, double* %48
%501 = fmul double %499, %500
%502 = load i32, i32* %34
%503 = sub nsw i32 %502, 1
%504 = sext i32 %503 to i64
%505 = getelementptr inbounds [119 x double], [119 x double]* %38, i64 0, i64 %504
%506 = load double, double* %505
%507 = fmul double %501, %506
%508 = load double, double* %49
%509 = fadd double %508, 1.000000e+00
%510 = load double, double* %30
%511 = fmul double %509, %510
%512 = fdiv double %507, %511
%513 = load double*, double** %27
%514 = load double, double* %513
%515 = fadd double %514, %512
store double %515, double* %513
br label %542
516: ; preds = %440
%517 = load double, double* %42
%518 = load i32, i32* %37
%519 = sub nsw i32 %518, 1
%520 = sext i32 %519 to i64
%521 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 %520
%522 = load double, double* %521
%523 = load double, double* %43
%524 = load i32, i32* %37
%525 = sub nsw i32 %524, 1
%526 = sext i32 %525 to i64
%527 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 %526
%528 = load double, double* %527
%529 = fmul double %523, %528
%530 = fneg double %529
%531 = call double @llvm.fmuladd.f64(double %517, double %522, double %530)
%532 = load i32, i32* %34
%533 = sub nsw i32 %532, 1
%534 = sext i32 %533 to i64
%535 = getelementptr inbounds [119 x double], [119 x double]* %39, i64 0, i64 %534
%536 = load double, double* %535
%537 = fmul double %531, %536
%538 = load double, double* %31
%539 = load double*, double** %27
%540 = load double, double* %539
%541 = call double @llvm.fmuladd.f64(double %537, double %538, double %540)
store double %541, double* %539
br label %542
542: ; preds = %516, %484
%543 = load i32, i32* %35
%544 = add nsw i32 %543, 2
store i32 %544, i32* %35
br label %545
545: ; preds = %542, %418
%546 = load i32, i32* %37
%547 = add nsw i32 %546, 1
store i32 %547, i32* %37
br label %548
548: ; preds = %545
%549 = load i32, i32* %34
%550 = add nsw i32 %549, 1
store i32 %550, i32* %34
br label %199
551: ; preds = %199
%552 = load i32, i32* %24
%553 = icmp ne i32 %552, 0
br i1 %553, label %554, label %606
554: ; preds = %551
%555 = load double*, double** %25
%556 = getelementptr inbounds double, double* %555, i64 2
%557 = load double, double* %556
%558 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 0
%559 = load double, double* %558
%560 = load double*, double** %25
%561 = getelementptr inbounds double, double* %560, i64 3
%562 = load double, double* %561
%563 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 0
%564 = load double, double* %563
%565 = fmul double %562, %564
%566 = call double @llvm.fmuladd.f64(double %557, double %559, double %565)
store double %566, double* %42
%567 = load double*, double** %26
%568 = load double, double* %567
%569 = load double*, double** %25
%570 = getelementptr inbounds double, double* %569, i64 1
%571 = load double, double* %570
%572 = load double, double* %30
%573 = fneg double %571
%574 = call double @llvm.fmuladd.f64(double %573, double %572, double %568)
%575 = load double, double* %42
%576 = load double, double* %31
%577 = call double @llvm.fmuladd.f64(double %575, double %576, double %574)
%578 = load double*, double** %26
store double %577, double* %578
%579 = load double*, double** %27
%580 = load double, double* %579
%581 = load double*, double** %25
%582 = getelementptr inbounds double, double* %581, i64 2
%583 = load double, double* %582
%584 = getelementptr inbounds [14 x double], [14 x double]* %51, i64 0, i64 0
%585 = load double, double* %584
%586 = call double @llvm.fmuladd.f64(double %583, double %585, double %580)
%587 = load double*, double** %25
%588 = getelementptr inbounds double, double* %587, i64 3
%589 = load double, double* %588
%590 = getelementptr inbounds [14 x double], [14 x double]* %47, i64 0, i64 0
%591 = load double, double* %590
%592 = fneg double %589
%593 = call double @llvm.fmuladd.f64(double %592, double %591, double %586)
%594 = load double*, double** %27
store double %593, double* %594
%595 = load double*, double** %28
%596 = load double, double* %595
%597 = load double*, double** %25
%598 = getelementptr inbounds double, double* %597, i64 1
%599 = load double, double* %598
%600 = load double, double* %31
%601 = call double @llvm.fmuladd.f64(double %599, double %600, double %596)
%602 = load double, double* %42
%603 = load double, double* %30
%604 = call double @llvm.fmuladd.f64(double %602, double %603, double %601)
%605 = load double*, double** %28
store double %604, double* %605
br label %606
606: ; preds = %554, %551
%607 = load double*, double** %26
%608 = load double, double* %607
store double %608, double* %42
%609 = load double*, double** %26
%610 = load double, double* %609
%611 = load double, double* %45
%612 = load double*, double** %28
%613 = load double, double* %612
%614 = load double, double* %50
%615 = fmul double %613, %614
%616 = call double @llvm.fmuladd.f64(double %610, double %611, double %615)
%617 = load double*, double** %26
store double %616, double* %617
%618 = load double*, double** %28
%619 = load double, double* %618
%620 = load double, double* %45
%621 = load double, double* %42
%622 = load double, double* %50
%623 = fmul double %621, %622
%624 = fneg double %623
%625 = call double @llvm.fmuladd.f64(double %619, double %620, double %624)
%626 = load double*, double** %28
store double %625, double* %626
ret i32 0
}

LLVM IR (-O2):
define i32 @shval3(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double* nocapture %8, i32 %9, double* nocapture %10, double* nocapture %11, double* nocapture %12, double* nocapture %13) {
%15 = alloca [119 x double]
%16 = alloca [119 x double]
%17 = alloca [14 x double]
%18 = alloca [14 x double]
%19 = bitcast [119 x double]* %15 to i8*
%20 = bitcast [119 x double]* %16 to i8*
%21 = bitcast [14 x double]* %17 to i8*
%22 = bitcast [14 x double]* %18 to i8*
%23 = getelementptr inbounds double, double* %8, i64 -1
%24 = fmul double %1, 0x3F91DF467707C94D
%25 = tail call double @sin(double %24)
%26 = fsub double 9.000000e+01, %1
%27 = fcmp olt double %26, 1.000000e-03
br i1 %27, label %32, label %28
28: ; preds = %14
%29 = fadd double %1, 9.000000e+01
%30 = fcmp olt double %29, 1.000000e-03
br i1 %30, label %32, label %31
31: ; preds = %28
br label %32
32: ; preds = %28, %14, %31
%33 = phi double [ %24, %31 ], [ 0x3FF921E8CA4DFE50, %14 ], [ 0xBFF921E8CA4DFE50, %28 ]
%34 = tail call double @cos(double %33)
%35 = fmul double %2, 0x3F91DF467707C94D
%36 = tail call double @sin(double %35)
%37 = getelementptr inbounds [14 x double], [14 x double]* %18, i64 0, i64 0
store double %36, double* %37
%38 = tail call double @cos(double %35)
%39 = getelementptr inbounds [14 x double], [14 x double]* %17, i64 0, i64 0
store double %38, double* %39
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
%40 = add nsw i32 %7, 3
%41 = mul nsw i32 %40, %7
%42 = sdiv i32 %41, 2
%43 = icmp eq i32 %0, 1
%44 = insertelement <2 x double> poison, double %25, i64 0
%45 = insertelement <2 x double> %44, double %34, i64 1
br i1 %43, label %46, label %81
46: ; preds = %32
%47 = insertelement <2 x double> poison, double %6, i64 0
%48 = insertelement <2 x double> %47, double %5, i64 1
%49 = fmul <2 x double> %45, %48
%50 = fmul <2 x double> %45, %49
%51 = extractelement <2 x double> %50, i64 0
%52 = extractelement <2 x double> %50, i64 1
%53 = fadd double %51, %52
%54 = tail call double @sqrt(double %53)
%55 = tail call double @llvm.fmuladd.f64(double %54, double 2.000000e+00, double %3)
%56 = fmul double %51, %6
%57 = tail call double @llvm.fmuladd.f64(double %5, double %52, double %56)
%58 = fdiv double %57, %53
%59 = tail call double @llvm.fmuladd.f64(double %3, double %55, double %58)
%60 = tail call double @sqrt(double %59)
%61 = fsub double %5, %6
%62 = fdiv double %61, %54
%63 = fmul double %25, %62
%64 = insertelement <2 x double> poison, double %54, i64 0
%65 = insertelement <2 x double> %64, double %34, i64 1
%66 = insertelement <2 x double> poison, double %3, i64 0
%67 = insertelement <2 x double> %66, double %63, i64 1
%68 = fadd <2 x double> %65, %67
%69 = fmul <2 x double> %65, %67
%70 = shufflevector <2 x double> %68, <2 x double> %69, <2 x i32> <i32 0, i32 3>
%71 = insertelement <2 x double> poison, double %60, i64 0
%72 = shufflevector <2 x double> %71, <2 x double> poison, <2 x i32> zeroinitializer
%73 = fdiv <2 x double> %70, %72
%74 = fneg double %34
%75 = shufflevector <2 x double> %73, <2 x double> undef, <2 x i32> <i32 1, i32 1>
%76 = insertelement <2 x double> poison, double %25, i64 1
%77 = insertelement <2 x double> %76, double %74, i64 0
%78 = fmul <2 x double> %75, %77
%79 = shufflevector <2 x double> %73, <2 x double> undef, <2 x i32> zeroinitializer
%80 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %45, <2 x double> %79, <2 x double> %78)
br label %81
81: ; preds = %46, %32
%82 = phi double [ %60, %46 ], [ %3, %32 ]
%83 = phi <2 x double> [ %80, %46 ], [ %45, %32 ]
%84 = phi <2 x double> [ %73, %46 ], [ <double 1.000000e+00, double 0.000000e+00>, %32 ]
%85 = fdiv double %4, %82
%86 = fmul <2 x double> %83, <double 2.000000e+00, double 2.000000e+00>
%87 = bitcast [119 x double]* %15 to <2 x double>*
store <2 x double> %86, <2 x double>* %87
%88 = extractelement <2 x double> %83, i64 0
%89 = fmul double %88, 4.500000e+00
%90 = tail call double @llvm.fmuladd.f64(double %89, double %88, double -1.500000e+00)
%91 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 2
store double %90, double* %91
%92 = extractelement <2 x double> %83, i64 1
%93 = fmul double %92, 0x4014C8DC2E423980
%94 = fmul double %88, %93
%95 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 3
store double %94, double* %95
%96 = fneg double %92
%97 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 0
store double %96, double* %97
%98 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 1
store double %88, double* %98
%99 = fmul double %92, -3.000000e+00
%100 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 2
%101 = fmul double %92, %96
%102 = tail call double @llvm.fmuladd.f64(double %88, double %88, double %101)
%103 = insertelement <2 x double> %83, double %102, i64 1
%104 = insertelement <2 x double> <double poison, double 0x3FFBB67AE8584CAA>, double %99, i64 0
%105 = fmul <2 x double> %103, %104
%106 = bitcast double* %100 to <2 x double>*
store <2 x double> %105, <2 x double>* %106
%107 = icmp slt i32 %41, 2
br i1 %107, label %285, label %108
108: ; preds = %81
%109 = fcmp ogt double %92, 0.000000e+00
%110 = add nsw i32 %42, 1
%111 = zext i32 %110 to i64
br label %112
112: ; preds = %108, %279
%113 = phi double [ %36, %108 ], [ %221, %279 ]
%114 = phi i64 [ 1, %108 ], [ %283, %279 ]
%115 = phi double [ 0.000000e+00, %108 ], [ %130, %279 ]
%116 = phi double [ 0.000000e+00, %108 ], [ %129, %279 ]
%117 = phi i32 [ 1, %108 ], [ %282, %279 ]
%118 = phi i32 [ 0, %108 ], [ %127, %279 ]
%119 = phi i32 [ 1, %108 ], [ %281, %279 ]
%120 = icmp slt i32 %118, %117
br i1 %120, label %121, label %126
121: ; preds = %112
%122 = add nsw i32 %118, 1
%123 = add nsw i32 %118, 3
%124 = tail call double @pow(double %85, i32 %123)
%125 = sitofp i32 %122 to double
br label %126
126: ; preds = %121, %112
%127 = phi i32 [ %122, %121 ], [ %118, %112 ]
%128 = phi i32 [ 0, %121 ], [ %117, %112 ]
%129 = phi double [ %125, %121 ], [ %116, %112 ]
%130 = phi double [ %124, %121 ], [ %115, %112 ]
%131 = sitofp i32 %128 to double
%132 = icmp ugt i64 %114, 4
br i1 %132, label %133, label %220
133: ; preds = %126
%134 = icmp eq i32 %128, %127
br i1 %134, label %135, label %177
135: ; preds = %133
%136 = fdiv double 5.000000e-01, %131
%137 = fsub double 1.000000e+00, %136
%138 = tail call double @sqrt(double %137)
%139 = xor i32 %127, -1
%140 = fdiv double 1.000000e+00, %131
%141 = fadd double %140, 1.000000e+00
%142 = fmul double %141, %138
%143 = fmul double %92, %142
%144 = add nsw i64 %114, -1
%145 = trunc i64 %144 to i32
%146 = add i32 %145, %139
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %147
%149 = load double, double* %148
%150 = fmul double %149, %143
%151 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %144
store double %150, double* %151
%152 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %147
%153 = load double, double* %152
%154 = fdiv double %88, %131
%155 = load double, double* %148
%156 = fmul double %154, %155
%157 = tail call double @llvm.fmuladd.f64(double %92, double %153, double %156)
%158 = fmul double %138, %157
%159 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %144
store double %158, double* %159
%160 = add nsw i32 %127, -2
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [14 x double], [14 x double]* %18, i64 0, i64 %161
%163 = load double, double* %162
%164 = load double, double* %39
%165 = getelementptr inbounds [14 x double], [14 x double]* %17, i64 0, i64 %161
%166 = load double, double* %165
%167 = fmul double %166, %113
%168 = tail call double @llvm.fmuladd.f64(double %163, double %164, double %167)
%169 = add nsw i32 %127, -1
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [14 x double], [14 x double]* %18, i64 0, i64 %170
store double %168, double* %171
%172 = load double, double* %37
%173 = fneg double %163
%174 = fmul double %172, %173
%175 = tail call double @llvm.fmuladd.f64(double %166, double %164, double %174)
%176 = getelementptr inbounds [14 x double], [14 x double]* %17, i64 0, i64 %170
store double %175, double* %176
br label %220
177: ; preds = %133
%178 = fneg double %131
%179 = fmul double %178, %131
%180 = tail call double @llvm.fmuladd.f64(double %129, double %129, double %179)
%181 = tail call double @sqrt(double %180)
%182 = fadd double %129, -1.000000e+00
%183 = tail call double @llvm.fmuladd.f64(double %182, double %182, double %179)
%184 = tail call double @sqrt(double %183)
%185 = tail call double @llvm.fmuladd.f64(double %129, double 2.000000e+00, double -1.000000e+00)
%186 = fdiv double %185, %181
%187 = mul i32 %127, -2
%188 = trunc i64 %114 to i32
%189 = add i32 %187, %188
%190 = fadd double %129, 1.000000e+00
%191 = fmul double %88, %186
%192 = fdiv double %191, %129
%193 = xor i32 %127, -1
%194 = add i32 %188, %193
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %195
%197 = load double, double* %196
%198 = sext i32 %189 to i64
%199 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %198
%200 = load double, double* %199
%201 = fneg double %184
%202 = fdiv double %201, %181
%203 = fdiv double %202, %182
%204 = fmul double %203, %200
%205 = tail call double @llvm.fmuladd.f64(double %192, double %197, double %204)
%206 = fmul double %190, %205
%207 = add nsw i64 %114, -1
%208 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %207
store double %206, double* %208
%209 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %195
%210 = load double, double* %209
%211 = load double, double* %196
%212 = fdiv double %96, %129
%213 = fmul double %212, %211
%214 = tail call double @llvm.fmuladd.f64(double %88, double %210, double %213)
%215 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %198
%216 = load double, double* %215
%217 = fmul double %202, %216
%218 = tail call double @llvm.fmuladd.f64(double %186, double %214, double %217)
%219 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %207
store double %218, double* %219
br label %220
220: ; preds = %135, %177, %126
%221 = phi double [ %172, %135 ], [ %113, %177 ], [ %113, %126 ]
%222 = zext i32 %119 to i64
%223 = getelementptr inbounds double, double* %23, i64 %222
%224 = load double, double* %223
%225 = fmul double %130, %224
%226 = icmp eq i32 %128, 0
br i1 %226, label %227, label %238
227: ; preds = %220
%228 = add nsw i64 %114, -1
%229 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %228
%230 = load double, double* %229
%231 = load double, double* %11
%232 = tail call double @llvm.fmuladd.f64(double %225, double %230, double %231)
store double %232, double* %11
%233 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %228
%234 = load double, double* %233
%235 = load double, double* %13
%236 = fneg double %225
%237 = tail call double @llvm.fmuladd.f64(double %236, double %234, double %235)
store double %237, double* %13
br label %279
238: ; preds = %220
%239 = add nuw nsw i32 %119, 1
%240 = zext i32 %239 to i64
%241 = getelementptr inbounds double, double* %23, i64 %240
%242 = load double, double* %241
%243 = fmul double %130, %242
%244 = add nsw i32 %128, -1
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [14 x double], [14 x double]* %17, i64 0, i64 %245
%247 = load double, double* %246
%248 = getelementptr inbounds [14 x double], [14 x double]* %18, i64 0, i64 %245
%249 = load double, double* %248
%250 = fmul double %243, %249
%251 = tail call double @llvm.fmuladd.f64(double %225, double %247, double %250)
%252 = add nsw i64 %114, -1
%253 = getelementptr inbounds [119 x double], [119 x double]* %16, i64 0, i64 %252
%254 = load double, double* %253
%255 = load double, double* %11
%256 = tail call double @llvm.fmuladd.f64(double %251, double %254, double %255)
store double %256, double* %11
%257 = getelementptr inbounds [119 x double], [119 x double]* %15, i64 0, i64 %252
%258 = load double, double* %257
%259 = load double, double* %13
%260 = fneg double %251
%261 = tail call double @llvm.fmuladd.f64(double %260, double %258, double %259)
store double %261, double* %13
%262 = fneg double %243
%263 = fmul double %247, %262
%264 = tail call double @llvm.fmuladd.f64(double %225, double %249, double %263)
br i1 %109, label %265, label %273
265: ; preds = %238
%266 = fmul double %264, %131
%267 = fmul double %266, %258
%268 = fadd double %129, 1.000000e+00
%269 = fmul double %92, %268
%270 = fdiv double %267, %269
%271 = load double, double* %12
%272 = fadd double %270, %271
br label %277
273: ; preds = %238
%274 = fmul double %264, %254
%275 = load double, double* %12
%276 = tail call double @llvm.fmuladd.f64(double %274, double %88, double %275)
br label %277
277: ; preds = %273, %265
%278 = phi double [ %276, %273 ], [ %272, %265 ]
store double %278, double* %12
br label %279
279: ; preds = %277, %227
%280 = phi i32 [ 2, %277 ], [ 1, %227 ]
%281 = add nuw nsw i32 %119, %280
%282 = add nsw i32 %128, 1
%283 = add nuw nsw i64 %114, 1
%284 = icmp eq i64 %283, %111
br i1 %284, label %285, label %112
285: ; preds = %279, %81
%286 = phi double [ %36, %81 ], [ %221, %279 ]
%287 = icmp eq i32 %9, 0
br i1 %287, label %288, label %290
288: ; preds = %285
%289 = load double, double* %13
br label %313
290: ; preds = %285
%291 = getelementptr inbounds double, double* %10, i64 1
%292 = load double, double* %291
%293 = load double, double* %39
%294 = getelementptr inbounds double, double* %10, i64 2
%295 = load double, double* %294
%296 = fmul double %295, %286
%297 = tail call double @llvm.fmuladd.f64(double %292, double %293, double %296)
%298 = load double, double* %11
%299 = load double, double* %10
%300 = fneg double %299
%301 = tail call double @llvm.fmuladd.f64(double %300, double %92, double %298)
%302 = tail call double @llvm.fmuladd.f64(double %297, double %88, double %301)
store double %302, double* %11
%303 = load double, double* %12
%304 = load double, double* %291
%305 = tail call double @llvm.fmuladd.f64(double %304, double %286, double %303)
%306 = load double, double* %294
%307 = fneg double %306
%308 = tail call double @llvm.fmuladd.f64(double %307, double %293, double %305)
store double %308, double* %12
%309 = load double, double* %13
%310 = load double, double* %10
%311 = tail call double @llvm.fmuladd.f64(double %310, double %88, double %309)
%312 = tail call double @llvm.fmuladd.f64(double %297, double %92, double %311)
store double %312, double* %13
br label %313
313: ; preds = %288, %290
%314 = phi double [ %289, %288 ], [ %312, %290 ]
%315 = load double, double* %11
%316 = extractelement <2 x double> %84, i64 1
%317 = fmul double %316, %314
%318 = extractelement <2 x double> %84, i64 0
%319 = tail call double @llvm.fmuladd.f64(double %315, double %318, double %317)
store double %319, double* %11
%320 = load double, double* %13
%321 = fneg double %315
%322 = fmul double %316, %321
%323 = tail call double @llvm.fmuladd.f64(double %320, double %318, double %322)
store double %323, double* %13
ret i32 0
}