int exactJ(const double x, const double y, double *H, double *nu, double *u,
           double *v) {
  const double L = 300.0e3;
  const double H0 = 500.0;
  const double nu0 = 30.0 * 1.0e6 * 31556926.0;
  const double rho_ice = 910.0;
  const double rho_sw = 1028.0;
  const double g = 9.81;
  const double C = rho_ice * g * (1.0 - rho_ice / rho_sw) * H0 / (2.0 * nu0);
  const double my_gamma[3][3] = {
      {1.0854, 0.108, 0.0027}, {0.402, 0.04, 0.001}, {0.0402, 0.004, 0.0001}};
  const double A = L / (4.0 * 3.14159265358979);
  double uu = 0.0, vv = 0.0, denom, trig, kx, ly, B;
  int k, l;
  *H = H0 * (1.0 + 0.4 * cos(3.14159265358979 * x / L)) *
       (1.0 + 0.1 * cos(3.14159265358979 * y / L));
  *nu = (nu0 * H0) / *H;
  for (k = -2; k <= 2; k++) {
    for (l = -2; l <= 2; l++) {
      if ((k != 0) || (l != 0)) {
        denom = (double)(k * k + l * l);
        kx = (double)(k)*3.14159265358979 * x / L;
        ly = (double)(l)*3.14159265358979 * y / L;
        trig = cos(kx) * sin(ly) + sin(kx) * cos(ly);
        B = (A / denom) * (C * my_gamma[abs(k)][abs(l)]) * trig;
        uu += B * (double)(k);
        vv += B * (double)(l);
      }
    }
  }
  *u = uu;
  *v = vv;
  return 0;
}


x86 assembly (clang, -O0):
<exactJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe85(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xea2(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
movsd  0xe58(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xe1a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe05(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe09(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xddd(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xde9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  0xdcd(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xdb8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
movsd  0xd8c(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd88(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xd5c(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0xfffffffe,-0xf4(%rbp)
ff ff ff
cmpl   $0x2,-0xf4(%rbp)
jg     14f2 <exactJ+0x3b2>
movl   $0xfffffffe,-0xf8(%rbp)
ff ff ff
cmpl   $0x2,-0xf8(%rbp)
jg     14d9 <exactJ+0x399>
cmpl   $0x0,-0xf4(%rbp)
jne    12f8 <exactJ+0x1b8>
cmpl   $0x0,-0xf8(%rbp)
je     14c0 <exactJ+0x380>
mov    -0xf4(%rbp),%eax
imul   -0xf4(%rbp),%eax
mov    -0xf8(%rbp),%ecx
imul   -0xf8(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
cvtsi2sdl -0xf4(%rbp),%xmm0
ff
movsd  0xcf0(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xcd7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
cvtsi2sdl -0xf8(%rbp),%xmm0
ff
movsd  0xcc3(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xcaa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
call   1060 <cos@plt>
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
call   1060 <cos@plt>
movsd  -0x128(%rbp),%xmm1
ff
movsd  -0x120(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  0xc3b(%rip),%xmm0
divsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0xf4(%rbp),%edi
call   1030 <abs@plt>
movslq %eax,%rcx
lea    -0xb0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
mov    -0xf8(%rbp),%edi
call   1030 <abs@plt>
movsd  -0x110(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
movslq %ecx,%rcx
movsd  0xbe9(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
cvtsi2sdl -0xf4(%rbp),%xmm2
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
cvtsi2sdl -0xf8(%rbp),%xmm2
ff
movsd  -0xc8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    14c5 <exactJ+0x385>
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    12d1 <exactJ+0x191>
jmp    14de <exactJ+0x39e>
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    12ba <exactJ+0x17a>
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exactJ>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rcx,0xb0(%rsp)
mov    %rdx,0xa8(%rsp)
mov    %rsi,%r12
mov    %rdi,%rbx
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0xb8(%rsp)
mulsd  0xea2(%rip),%xmm0
divsd  0xea2(%rip),%xmm0
call   1040 <cos@plt>
mulsd  0xe9d(%rip),%xmm0
addsd  0xe9d(%rip),%xmm0
mulsd  0xe9d(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xe6a(%rip),%xmm0
divsd  0xe6a(%rip),%xmm0
movsd  %xmm0,0x88(%rsp)
call   1040 <cos@plt>
mulsd  0xe74(%rip),%xmm0
addsd  0xe5c(%rip),%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0xe63(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r12)
movsd  0xe59(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe17(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0xe3a(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x78(%rsp)
xorpd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x70(%rsp)
mulsd  0xe1a(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%rsp)
xorpd  %xmm0,%xmm0
mov    $0xfffffffe,%r14d
movsd  0xe06(%rip),%xmm1
lea    0xe4f(%rip),%r12
jmp    1378 <exactJ+0x258>
cs nopw 0x0(%rax,%rax,1)
movaps (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x88(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x30(%rsp)
movaps (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x88(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movapd 0x30(%rsp),%xmm3
mulsd  0x50(%rsp),%xmm3
addsd  %xmm0,%xmm3
mulsd  0x60(%rsp),%xmm3
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
movapd %xmm3,%xmm1
mulsd  0x90(%rsp),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm2,%xmm3
unpcklpd %xmm1,%xmm3
movapd %xmm3,0x30(%rsp)
movaps (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x60(%rsp)
movaps (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
movapd 0x60(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x48(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd %xmm1,%xmm2
movapd 0xd45(%rip),%xmm0
movapd 0x90(%rsp),%xmm1
unpcklpd %xmm1,%xmm0
mulpd  %xmm2,%xmm0
addpd  0x30(%rsp),%xmm0
addsd  0xcae(%rip),%xmm1
add    $0x1,%r14d
cmp    $0x3,%r14d
je     15dd <exactJ+0x4bd>
movapd %xmm1,0x90(%rsp)
movapd %xmm0,0x30(%rsp)
mov    %r14d,%ebx
imul   %ebx,%ebx
mulsd  0xc6b(%rip),%xmm1
mulsd  0xb8(%rsp),%xmm1
divsd  0xc62(%rip),%xmm1
movapd %xmm1,%xmm0
movapd %xmm1,(%rsp)
mov    %r14d,%ebp
neg    %ebp
cmovs  %r14d,%ebp
lea    0x4(%rbx),%r13d
call   1040 <cos@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0x80(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x50(%rsp)
movaps (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x80(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0xc0(%rsp)
lea    0x1(%rbx),%r15d
movaps (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x78(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x60(%rsp)
movaps (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x78(%rsp),%xmm0
call   1040 <cos@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movsd  0xc0(%rsp),%xmm2
mulsd  0x40(%rsp),%xmm2
movapd 0x50(%rsp),%xmm6
mulsd  0x48(%rsp),%xmm6
addsd  %xmm2,%xmm6
movsd  0xbeb(%rip),%xmm8
movapd %xmm8,%xmm2
divsd  %xmm1,%xmm2
lea    0x0(%rbp,%rbp,2),%r13
movsd  0x10(%r12,%r13,8),%xmm5
movsd  0xbd6(%rip),%xmm3
mulsd  %xmm3,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm5,%xmm6
unpcklpd %xmm6,%xmm6
movapd 0xbce(%rip),%xmm1
movapd 0x90(%rsp),%xmm7
unpcklpd %xmm7,%xmm1
mulpd  %xmm6,%xmm1
addpd  0x30(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %r15d,%xmm2
mulsd  0x10(%rsp),%xmm0
movapd 0x60(%rsp),%xmm6
mulsd  0x20(%rsp),%xmm6
addsd  %xmm0,%xmm6
movapd %xmm8,%xmm0
divsd  %xmm2,%xmm0
movsd  0x8(%r12,%r13,8),%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm6
unpcklpd %xmm6,%xmm6
movapd %xmm6,%xmm3
movapd 0xb7d(%rip),%xmm6
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm6
mulpd  %xmm3,%xmm6
addpd  %xmm1,%xmm6
test   %r14d,%r14d
movsd  %xmm5,0x48(%rsp)
movsd  %xmm2,0x60(%rsp)
movapd %xmm6,0x20(%rsp)
je     1260 <exactJ+0x140>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
movsd  %xmm1,0x30(%rsp)
movaps (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x70(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movaps (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x70(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x50(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
movsd  0xac1(%rip),%xmm0
divsd  0x30(%rsp),%xmm0
movsd  (%r12,%r13,8),%xmm1
mulsd  0xab5(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
unpcklpd %xmm1,%xmm1
xorpd  %xmm0,%xmm0
unpcklpd 0x90(%rsp),%xmm0
mulpd  %xmm1,%xmm0
movapd 0x20(%rsp),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
jmp    1260 <exactJ+0x140>
mov    0xa8(%rsp),%rax
movhpd %xmm0,(%rax)
mov    0xb0(%rsp),%rax
movlpd %xmm0,(%rax)
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.exactJ.my_gamma = [3 x [3 x double]] [[3 x double] [double 1.085400e+00, double 1.080000e-01, double 2.700000e-03], [3 x double] [double 4.020000e-01, double 4.000000e-02, double 1.000000e-03], [3 x double] [double 4.020000e-02, double 4.000000e-03, double 1.000000e-04]]
define i32 @exactJ(double %0, double %1, double* %2, double* %3, double* %4, double* %5) {
%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 [3 x [3 x double]]
%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 i32
%30 = alloca i32
store double %0, double* %7
store double %1, double* %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store double 3.000000e+05, double* %13
store double 5.000000e+02, double* %14
store double 0x430AE834A776C800, double* %15
store double 9.100000e+02, double* %16
store double 1.028000e+03, double* %17
store double 9.810000e+00, double* %18
store double 0x3DF298659B83CDD5, double* %19
%31 = bitcast [3 x [3 x double]]* %20 to i8*
store double 0x40D7504F74248436, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
%32 = load double, double* %7
%33 = fmul double 0x400921FB54442D11, %32
%34 = fdiv double %33, 3.000000e+05
%35 = call double @cos(double %34)
%36 = call double @llvm.fmuladd.f64(double 4.000000e-01, double %35, double 1.000000e+00)
%37 = fmul double 5.000000e+02, %36
%38 = load double, double* %8
%39 = fmul double 0x400921FB54442D11, %38
%40 = fdiv double %39, 3.000000e+05
%41 = call double @cos(double %40)
%42 = call double @llvm.fmuladd.f64(double 1.000000e-01, double %41, double 1.000000e+00)
%43 = fmul double %37, %42
%44 = load double*, double** %9
store double %43, double* %44
%45 = load double*, double** %9
%46 = load double, double* %45
%47 = fdiv double 0x439A46C36B89FF50, %46
%48 = load double*, double** %10
store double %47, double* %48
store i32 -2, i32* %29
br label %49
49: ; preds = %123, %6
%50 = load i32, i32* %29
%51 = icmp sle i32 %50, 2
br i1 %51, label %52, label %126
52: ; preds = %49
store i32 -2, i32* %30
br label %53
53: ; preds = %119, %52
%54 = load i32, i32* %30
%55 = icmp sle i32 %54, 2
br i1 %55, label %56, label %122
56: ; preds = %53
%57 = load i32, i32* %29
%58 = icmp ne i32 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = load i32, i32* %30
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %118
62: ; preds = %59, %56
%63 = load i32, i32* %29
%64 = load i32, i32* %29
%65 = mul nsw i32 %63, %64
%66 = load i32, i32* %30
%67 = load i32, i32* %30
%68 = mul nsw i32 %66, %67
%69 = add nsw i32 %65, %68
%70 = sitofp i32 %69 to double
store double %70, double* %24
%71 = load i32, i32* %29
%72 = sitofp i32 %71 to double
%73 = fmul double %72, 0x400921FB54442D11
%74 = load double, double* %7
%75 = fmul double %73, %74
%76 = fdiv double %75, 3.000000e+05
store double %76, double* %26
%77 = load i32, i32* %30
%78 = sitofp i32 %77 to double
%79 = fmul double %78, 0x400921FB54442D11
%80 = load double, double* %8
%81 = fmul double %79, %80
%82 = fdiv double %81, 3.000000e+05
store double %82, double* %27
%83 = load double, double* %26
%84 = call double @cos(double %83)
%85 = load double, double* %27
%86 = call double @sin(double %85)
%87 = load double, double* %26
%88 = call double @sin(double %87)
%89 = load double, double* %27
%90 = call double @cos(double %89)
%91 = fmul double %88, %90
%92 = call double @llvm.fmuladd.f64(double %84, double %86, double %91)
store double %92, double* %25
%93 = load double, double* %24
%94 = fdiv double 0x40D7504F74248436, %93
%95 = load i32, i32* %29
%96 = call i32 @abs(i32 %95)
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %20, i64 0, i64 %97
%99 = load i32, i32* %30
%100 = call i32 @abs(i32 %99)
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [3 x double], [3 x double]* %98, i64 0, i64 %101
%103 = load double, double* %102
%104 = fmul double 0x3DF298659B83CDD5, %103
%105 = fmul double %94, %104
%106 = load double, double* %25
%107 = fmul double %105, %106
store double %107, double* %28
%108 = load double, double* %28
%109 = load i32, i32* %29
%110 = sitofp i32 %109 to double
%111 = load double, double* %22
%112 = call double @llvm.fmuladd.f64(double %108, double %110, double %111)
store double %112, double* %22
%113 = load double, double* %28
%114 = load i32, i32* %30
%115 = sitofp i32 %114 to double
%116 = load double, double* %23
%117 = call double @llvm.fmuladd.f64(double %113, double %115, double %116)
store double %117, double* %23
br label %118
118: ; preds = %62, %59
br label %119
119: ; preds = %118
%120 = load i32, i32* %30
%121 = add nsw i32 %120, 1
store i32 %121, i32* %30
br label %53
122: ; preds = %53
br label %123
123: ; preds = %122
%124 = load i32, i32* %29
%125 = add nsw i32 %124, 1
store i32 %125, i32* %29
br label %49
126: ; preds = %49
%127 = load double, double* %22
%128 = load double*, double** %11
store double %127, double* %128
%129 = load double, double* %23
%130 = load double*, double** %12
store double %129, double* %130
ret i32 0
}

LLVM IR (-O2):
@__const.exactJ.my_gamma = [3 x [3 x double]] [[3 x double] [double 1.085400e+00, double 1.080000e-01, double 2.700000e-03], [3 x double] [double 4.020000e-01, double 4.000000e-02, double 1.000000e-03], [3 x double] [double 4.020000e-02, double 4.000000e-03, double 1.000000e-04]]
define i32 @exactJ(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fmul double %0, 0x400921FB54442D11
%8 = fdiv double %7, 3.000000e+05
%9 = tail call double @cos(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 4.000000e-01, double 1.000000e+00)
%11 = fmul double %10, 5.000000e+02
%12 = fmul double %1, 0x400921FB54442D11
%13 = fdiv double %12, 3.000000e+05
%14 = tail call double @cos(double %13)
%15 = tail call double @llvm.fmuladd.f64(double %14, double 1.000000e-01, double 1.000000e+00)
%16 = fmul double %11, %15
store double %16, double* %2
%17 = fdiv double 0x439A46C36B89FF50, %16
store double %17, double* %3
%18 = fmul double %1, 0xC01921FB54442D11
%19 = fdiv double %18, 3.000000e+05
%20 = fmul double %1, 0xC00921FB54442D11
%21 = fdiv double %20, 3.000000e+05
%22 = fmul double %1, 0.000000e+00
%23 = fdiv double %22, 3.000000e+05
%24 = fmul double %1, 0x401921FB54442D11
%25 = fdiv double %24, 3.000000e+05
br label %26
26: ; preds = %6, %91
%27 = phi i32 [ -2, %6 ], [ %131, %91 ]
%28 = phi <2 x double> [ zeroinitializer, %6 ], [ %130, %91 ]
%29 = icmp eq i32 %27, 0
%30 = mul nsw i32 %27, %27
%31 = sitofp i32 %27 to double
%32 = fmul double %31, 0x400921FB54442D11
%33 = fmul double %32, %0
%34 = fdiv double %33, 3.000000e+05
%35 = tail call i32 @llvm.abs.i32(i32 %27, i1 true)
%36 = zext i32 %35 to i64
%37 = add nuw nsw i32 %30, 4
%38 = sitofp i32 %37 to double
%39 = tail call double @cos(double %34)
%40 = tail call double @sin(double %19)
%41 = tail call double @sin(double %34)
%42 = tail call double @cos(double %19)
%43 = fmul double %41, %42
%44 = tail call double @llvm.fmuladd.f64(double %39, double %40, double %43)
%45 = fdiv double 0x40D7504F74248436, %38
%46 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* @__const.exactJ.my_gamma, i64 0, i64 %36, i64 2
%47 = load double, double* %46
%48 = fmul double %47, 0x3DF298659B83CDD5
%49 = fmul double %45, %48
%50 = fmul double %44, %49
%51 = insertelement <2 x double> poison, double %50, i64 0
%52 = shufflevector <2 x double> %51, <2 x double> poison, <2 x i32> zeroinitializer
%53 = insertelement <2 x double> <double -2.000000e+00, double poison>, double %31, i64 1
%54 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> %53, <2 x double> %28)
%55 = add nuw nsw i32 %30, 1
%56 = sitofp i32 %55 to double
%57 = tail call double @cos(double %34)
%58 = tail call double @sin(double %21)
%59 = tail call double @sin(double %34)
%60 = tail call double @cos(double %21)
%61 = fmul double %59, %60
%62 = tail call double @llvm.fmuladd.f64(double %57, double %58, double %61)
%63 = fdiv double 0x40D7504F74248436, %56
%64 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* @__const.exactJ.my_gamma, i64 0, i64 %36, i64 1
%65 = load double, double* %64
%66 = fmul double %65, 0x3DF298659B83CDD5
%67 = fmul double %63, %66
%68 = fmul double %62, %67
%69 = insertelement <2 x double> poison, double %68, i64 0
%70 = shufflevector <2 x double> %69, <2 x double> poison, <2 x i32> zeroinitializer
%71 = insertelement <2 x double> <double -1.000000e+00, double poison>, double %31, i64 1
%72 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %70, <2 x double> %71, <2 x double> %54)
br i1 %29, label %91, label %73
73: ; preds = %26
%74 = sitofp i32 %30 to double
%75 = tail call double @cos(double %34)
%76 = tail call double @sin(double %23)
%77 = tail call double @sin(double %34)
%78 = tail call double @cos(double %23)
%79 = fmul double %77, %78
%80 = tail call double @llvm.fmuladd.f64(double %75, double %76, double %79)
%81 = fdiv double 0x40D7504F74248436, %74
%82 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* @__const.exactJ.my_gamma, i64 0, i64 %36, i64 0
%83 = load double, double* %82
%84 = fmul double %83, 0x3DF298659B83CDD5
%85 = fmul double %81, %84
%86 = fmul double %80, %85
%87 = insertelement <2 x double> poison, double %86, i64 0
%88 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> zeroinitializer
%89 = insertelement <2 x double> <double 0.000000e+00, double poison>, double %31, i64 1
%90 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %88, <2 x double> %89, <2 x double> %72)
br label %91
91: ; preds = %73, %26
%92 = phi <2 x double> [ %90, %73 ], [ %72, %26 ]
%93 = add nuw nsw i32 %30, 1
%94 = sitofp i32 %93 to double
%95 = tail call double @cos(double %34)
%96 = tail call double @sin(double %13)
%97 = tail call double @sin(double %34)
%98 = tail call double @cos(double %13)
%99 = fmul double %97, %98
%100 = tail call double @llvm.fmuladd.f64(double %95, double %96, double %99)
%101 = fdiv double 0x40D7504F74248436, %94
%102 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* @__const.exactJ.my_gamma, i64 0, i64 %36, i64 1
%103 = load double, double* %102
%104 = fmul double %103, 0x3DF298659B83CDD5
%105 = fmul double %101, %104
%106 = fmul double %100, %105
%107 = extractelement <2 x double> %92, i64 1
%108 = tail call double @llvm.fmuladd.f64(double %106, double %31, double %107)
%109 = extractelement <2 x double> %92, i64 0
%110 = fadd double %106, %109
%111 = add nuw nsw i32 %30, 4
%112 = sitofp i32 %111 to double
%113 = tail call double @cos(double %34)
%114 = tail call double @sin(double %25)
%115 = tail call double @sin(double %34)
%116 = tail call double @cos(double %25)
%117 = fmul double %115, %116
%118 = tail call double @llvm.fmuladd.f64(double %113, double %114, double %117)
%119 = fdiv double 0x40D7504F74248436, %112
%120 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* @__const.exactJ.my_gamma, i64 0, i64 %36, i64 2
%121 = load double, double* %120
%122 = fmul double %121, 0x3DF298659B83CDD5
%123 = fmul double %119, %122
%124 = fmul double %118, %123
%125 = insertelement <2 x double> poison, double %124, i64 0
%126 = shufflevector <2 x double> %125, <2 x double> poison, <2 x i32> zeroinitializer
%127 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %31, i64 1
%128 = insertelement <2 x double> poison, double %110, i64 0
%129 = insertelement <2 x double> %128, double %108, i64 1
%130 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %126, <2 x double> %127, <2 x double> %129)
%131 = add nsw i32 %27, 1
%132 = icmp eq i32 %131, 3
br i1 %132, label %133, label %26
133: ; preds = %91
%134 = extractelement <2 x double> %130, i64 1
store double %134, double* %4
%135 = extractelement <2 x double> %130, i64 0
store double %135, double* %5
ret i32 0
}