void uv2dv(double *fu, double *fv, double *sd, double *sv, double *pol2,
           double *pol3, int klev, int nlat, int nt) {
  int lev, jmm, jfc, lat, nfc, nsp2;
  double dir, dii, vor, voi;
  double *ufr, *ufi, *vfr, *vfi;
  double *ful, *fvl, *sdl, *svl;
  double *po2, *po3;
  nsp2 = (nt + 1) * (nt + 2);
  nfc = (nt + 1) * 2;
  for (lev = 0; lev < klev; lev++) {
    po2 = pol2;
    po3 = pol3;
    ful = fu + lev * nfc * nlat;
    fvl = fv + lev * nfc * nlat;
    sdl = sd + lev * nsp2;
    svl = sv + lev * nsp2;
    for (jmm = 0; jmm <= nt; jmm++) {
      for (jfc = jmm; jfc <= nt; jfc++) {
        ufr = ful;
        ufi = ful + nlat;
        vfr = fvl;
        vfi = fvl + nlat;
        dir = 0.0;
        dii = 0.0;
        vor = 0.0;
        voi = 0.0;
        for (lat = 0; lat < nlat; lat++) {
          dir += vfr[lat] * po2[lat] - ufi[lat] * po3[lat];
          dii += vfi[lat] * po2[lat] + ufr[lat] * po3[lat];
          vor -= ufr[lat] * po2[lat] + vfi[lat] * po3[lat];
          voi -= ufi[lat] * po2[lat] - vfr[lat] * po3[lat];
        }
        *sdl++ = dir;
        *sdl++ = dii;
        *svl++ = vor;
        *svl++ = voi;
        po2 += nlat;
        po3 += nlat;
      }
      ful += 2 * nlat;
      fvl += 2 * nlat;
    }
  }
}


x86 assembly (clang, -O0):
<uv2dv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x38,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x20(%rbp),%eax
add    $0x1,%eax
mov    0x20(%rbp),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    0x20(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1518 <uv2dv+0x418>
mov    -0x28(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x44(%rbp),%ecx
imul   0x18(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x44(%rbp),%ecx
imul   0x18(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x48(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x48(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    0x20(%rbp),%eax
jg     1505 <uv2dv+0x405>
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    0x20(%rbp),%eax
jg     14bb <uv2dv+0x3bb>
mov    -0x90(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x90(%rbp),%rax
movslq 0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x98(%rbp),%rax
movslq 0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    13ff <uv2dv+0x2ff>
mov    -0x80(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x78(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xb8(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x70(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xb8(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xb0(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x88(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb8(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x78(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xb0(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x80(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb8(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1279 <uv2dv+0x179>
movsd  -0x50(%rbp),%xmm0
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xa0(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xa0(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0xa8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xa8(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
mov    -0xa8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0xa8(%rbp)
movsd  %xmm0,(%rax)
mov    0x18(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
mov    0x18(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1201 <uv2dv+0x101>
mov    0x18(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x90(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    0x18(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x98(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11ef <uv2dv+0xef>
jmp    150a <uv2dv+0x40a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114e <uv2dv+0x4e>
add    $0x38,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv2dv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,-0x20(%rsp)
mov    %r8,-0x28(%rsp)
mov    %rcx,-0x30(%rsp)
mov    %rdx,-0x38(%rsp)
mov    %rsi,-0x58(%rsp)
mov    %rdi,-0x60(%rsp)
mov    0x38(%rsp),%eax
test   %eax,%eax
jle    1340 <uv2dv+0x240>
mov    0x48(%rsp),%r13d
mov    0x40(%rsp),%r10d
lea    0x1(%r13),%esi
lea    0x2(%r13),%ecx
imul   %esi,%ecx
lea    (%r10,%r10,1),%edx
movslq %r10d,%r8
movslq %edx,%rdx
movslq %ecx,%rcx
mov    %rcx,-0x40(%rsp)
mov    %eax,%eax
mov    %rax,-0x18(%rsp)
mov    %r8d,%eax
imul   %r10d,%esi
add    %esi,%esi
mov    %esi,-0x64(%rsp)
shl    $0x3,%rdx
mov    %rdx,-0x10(%rsp)
mov    -0x58(%rsp),%rcx
lea    (%rcx,%r8,8),%rcx
mov    %rcx,-0x48(%rsp)
mov    -0x60(%rsp),%rcx
lea    (%rcx,%r8,8),%rcx
mov    %rcx,-0x50(%rsp)
shl    $0x3,%r8
shl    $0x3,%rax
xor    %ecx,%ecx
mov    %rcx,-0x70(%rsp)
movapd 0xe54(%rip),%xmm8
xor    %ecx,%ecx
mov    %rcx,-0x78(%rsp)
jmp    11ea <uv2dv+0xea>
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x78(%rsp),%rdx
add    $0x1,%rdx
mov    -0x70(%rsp),%rcx
add    -0x64(%rsp),%ecx
mov    %rcx,-0x70(%rsp)
mov    %rdx,%rcx
mov    %rdx,-0x78(%rsp)
cmp    -0x18(%rsp),%rdx
je     1340 <uv2dv+0x240>
test   %r13d,%r13d
js     11c0 <uv2dv+0xc0>
mov    -0x78(%rsp),%r9
imul   -0x40(%rsp),%r9
movslq -0x70(%rsp),%rdi
mov    -0x60(%rsp),%rcx
lea    (%rcx,%rdi,8),%rcx
mov    -0x48(%rsp),%rdx
lea    (%rdx,%rdi,8),%rdx
mov    -0x50(%rsp),%rsi
lea    (%rsi,%rdi,8),%rsi
mov    -0x58(%rsp),%rbp
lea    0x0(%rbp,%rdi,8),%rbp
mov    -0x30(%rsp),%rdi
lea    (%rdi,%r9,8),%rdi
mov    -0x38(%rsp),%rbx
lea    (%rbx,%r9,8),%r15
xor    %r9d,%r9d
mov    -0x20(%rsp),%r12
mov    -0x28(%rsp),%r11
jmp    1273 <uv2dv+0x173>
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x8(%rsp),%r14
lea    0x1(%r14),%r9d
mov    -0x10(%rsp),%rbx
add    %rbx,%rcx
add    %rbx,%rdx
add    %rbx,%rsi
add    %rbx,%rbp
cmp    %r13d,%r14d
je     11c0 <uv2dv+0xc0>
mov    %r9,-0x8(%rsp)
jmp    12a7 <uv2dv+0x1a7>
nopw   0x0(%rax,%rax,1)
xorpd  %xmm2,%xmm2
movupd %xmm10,(%r15)
add    $0x10,%r15
movupd %xmm2,(%rdi)
add    $0x10,%rdi
add    %r8,%r11
add    %r8,%r12
lea    0x1(%r9),%ebx
cmp    %r13d,%r9d
mov    %ebx,%r9d
je     1250 <uv2dv+0x150>
xorpd  %xmm10,%xmm10
test   %r10d,%r10d
jle    1280 <uv2dv+0x180>
xor    %r14d,%r14d
xorpd  %xmm2,%xmm2
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%r14,1),%xmm9
movapd %xmm9,%xmm4
xorpd  %xmm8,%xmm4
movsd  (%r12,%r14,1),%xmm5
unpcklpd %xmm5,%xmm5
movsd  (%rcx,%r14,1),%xmm6
unpcklpd %xmm6,%xmm4
mulpd  %xmm5,%xmm4
movsd  0x0(%rbp,%r14,1),%xmm3
movsd  (%rdx,%r14,1),%xmm0
movapd %xmm3,%xmm7
unpcklpd %xmm0,%xmm7
movsd  (%r11,%r14,1),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm7
addpd  %xmm4,%xmm7
addpd  %xmm7,%xmm10
xorpd  %xmm8,%xmm3
unpcklpd %xmm3,%xmm0
mulpd  %xmm5,%xmm0
unpcklpd %xmm9,%xmm6
mulpd  %xmm1,%xmm6
addpd  %xmm0,%xmm6
subpd  %xmm6,%xmm2
add    $0x8,%r14
cmp    %r14,%rax
jne    12c0 <uv2dv+0x1c0>
jmp    1284 <uv2dv+0x184>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @uv2dv(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%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 double*
%33 = alloca double*
%34 = alloca double*
%35 = alloca double*
%36 = alloca double*
%37 = alloca double*
%38 = alloca double*
store double* %0, double** %10
store double* %1, double** %11
store double* %2, double** %12
store double* %3, double** %13
store double* %4, double** %14
store double* %5, double** %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%39 = load i32, i32* %18
%40 = add nsw i32 %39, 1
%41 = load i32, i32* %18
%42 = add nsw i32 %41, 2
%43 = mul nsw i32 %40, %42
store i32 %43, i32* %24
%44 = load i32, i32* %18
%45 = add nsw i32 %44, 1
%46 = mul nsw i32 %45, 2
store i32 %46, i32* %23
store i32 0, i32* %19
br label %47
47: ; preds = %248, %9
%48 = load i32, i32* %19
%49 = load i32, i32* %16
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %251
51: ; preds = %47
%52 = load double*, double** %14
store double* %52, double** %37
%53 = load double*, double** %15
store double* %53, double** %38
%54 = load double*, double** %10
%55 = load i32, i32* %19
%56 = load i32, i32* %23
%57 = mul nsw i32 %55, %56
%58 = load i32, i32* %17
%59 = mul nsw i32 %57, %58
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %54, i64 %60
store double* %61, double** %33
%62 = load double*, double** %11
%63 = load i32, i32* %19
%64 = load i32, i32* %23
%65 = mul nsw i32 %63, %64
%66 = load i32, i32* %17
%67 = mul nsw i32 %65, %66
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %62, i64 %68
store double* %69, double** %34
%70 = load double*, double** %12
%71 = load i32, i32* %19
%72 = load i32, i32* %24
%73 = mul nsw i32 %71, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %70, i64 %74
store double* %75, double** %35
%76 = load double*, double** %13
%77 = load i32, i32* %19
%78 = load i32, i32* %24
%79 = mul nsw i32 %77, %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %76, i64 %80
store double* %81, double** %36
store i32 0, i32* %20
br label %82
82: ; preds = %244, %51
%83 = load i32, i32* %20
%84 = load i32, i32* %18
%85 = icmp sle i32 %83, %84
br i1 %85, label %86, label %247
86: ; preds = %82
%87 = load i32, i32* %20
store i32 %87, i32* %21
br label %88
88: ; preds = %230, %86
%89 = load i32, i32* %21
%90 = load i32, i32* %18
%91 = icmp sle i32 %89, %90
br i1 %91, label %92, label %233
92: ; preds = %88
%93 = load double*, double** %33
store double* %93, double** %29
%94 = load double*, double** %33
%95 = load i32, i32* %17
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
store double* %97, double** %30
%98 = load double*, double** %34
store double* %98, double** %31
%99 = load double*, double** %34
%100 = load i32, i32* %17
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
store double* %102, double** %32
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %27
store double 0.000000e+00, double* %28
store i32 0, i32* %22
br label %103
103: ; preds = %206, %92
%104 = load i32, i32* %22
%105 = load i32, i32* %17
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %209
107: ; preds = %103
%108 = load double*, double** %31
%109 = load i32, i32* %22
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = load double*, double** %37
%114 = load i32, i32* %22
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %113, i64 %115
%117 = load double, double* %116
%118 = load double*, double** %30
%119 = load i32, i32* %22
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
%123 = load double*, double** %38
%124 = load i32, i32* %22
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
%127 = load double, double* %126
%128 = fmul double %122, %127
%129 = fneg double %128
%130 = call double @llvm.fmuladd.f64(double %112, double %117, double %129)
%131 = load double, double* %25
%132 = fadd double %131, %130
store double %132, double* %25
%133 = load double*, double** %32
%134 = load i32, i32* %22
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = load double*, double** %37
%139 = load i32, i32* %22
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
%142 = load double, double* %141
%143 = load double*, double** %29
%144 = load i32, i32* %22
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %143, i64 %145
%147 = load double, double* %146
%148 = load double*, double** %38
%149 = load i32, i32* %22
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds double, double* %148, i64 %150
%152 = load double, double* %151
%153 = fmul double %147, %152
%154 = call double @llvm.fmuladd.f64(double %137, double %142, double %153)
%155 = load double, double* %26
%156 = fadd double %155, %154
store double %156, double* %26
%157 = load double*, double** %29
%158 = load i32, i32* %22
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %157, i64 %159
%161 = load double, double* %160
%162 = load double*, double** %37
%163 = load i32, i32* %22
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = load double*, double** %32
%168 = load i32, i32* %22
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = load double*, double** %38
%173 = load i32, i32* %22
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds double, double* %172, i64 %174
%176 = load double, double* %175
%177 = fmul double %171, %176
%178 = call double @llvm.fmuladd.f64(double %161, double %166, double %177)
%179 = load double, double* %27
%180 = fsub double %179, %178
store double %180, double* %27
%181 = load double*, double** %30
%182 = load i32, i32* %22
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %181, i64 %183
%185 = load double, double* %184
%186 = load double*, double** %37
%187 = load i32, i32* %22
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
%190 = load double, double* %189
%191 = load double*, double** %31
%192 = load i32, i32* %22
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %191, i64 %193
%195 = load double, double* %194
%196 = load double*, double** %38
%197 = load i32, i32* %22
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %196, i64 %198
%200 = load double, double* %199
%201 = fmul double %195, %200
%202 = fneg double %201
%203 = call double @llvm.fmuladd.f64(double %185, double %190, double %202)
%204 = load double, double* %28
%205 = fsub double %204, %203
store double %205, double* %28
br label %206
206: ; preds = %107
%207 = load i32, i32* %22
%208 = add nsw i32 %207, 1
store i32 %208, i32* %22
br label %103
209: ; preds = %103
%210 = load double, double* %25
%211 = load double*, double** %35
%212 = getelementptr inbounds double, double* %211, i32 1
store double* %212, double** %35
store double %210, double* %211
%213 = load double, double* %26
%214 = load double*, double** %35
%215 = getelementptr inbounds double, double* %214, i32 1
store double* %215, double** %35
store double %213, double* %214
%216 = load double, double* %27
%217 = load double*, double** %36
%218 = getelementptr inbounds double, double* %217, i32 1
store double* %218, double** %36
store double %216, double* %217
%219 = load double, double* %28
%220 = load double*, double** %36
%221 = getelementptr inbounds double, double* %220, i32 1
store double* %221, double** %36
store double %219, double* %220
%222 = load i32, i32* %17
%223 = load double*, double** %37
%224 = sext i32 %222 to i64
%225 = getelementptr inbounds double, double* %223, i64 %224
store double* %225, double** %37
%226 = load i32, i32* %17
%227 = load double*, double** %38
%228 = sext i32 %226 to i64
%229 = getelementptr inbounds double, double* %227, i64 %228
store double* %229, double** %38
br label %230
230: ; preds = %209
%231 = load i32, i32* %21
%232 = add nsw i32 %231, 1
store i32 %232, i32* %21
br label %88
233: ; preds = %88
%234 = load i32, i32* %17
%235 = mul nsw i32 2, %234
%236 = load double*, double** %33
%237 = sext i32 %235 to i64
%238 = getelementptr inbounds double, double* %236, i64 %237
store double* %238, double** %33
%239 = load i32, i32* %17
%240 = mul nsw i32 2, %239
%241 = load double*, double** %34
%242 = sext i32 %240 to i64
%243 = getelementptr inbounds double, double* %241, i64 %242
store double* %243, double** %34
br label %244
244: ; preds = %233
%245 = load i32, i32* %20
%246 = add nsw i32 %245, 1
store i32 %246, i32* %20
br label %82
247: ; preds = %82
br label %248
248: ; preds = %247
%249 = load i32, i32* %19
%250 = add nsw i32 %249, 1
store i32 %250, i32* %19
br label %47
251: ; preds = %47
ret void
}

LLVM IR (-O2):
define void @uv2dv(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture %4, double* nocapture %5, i32 %6, i32 %7, i32 %8) {
%10 = add i32 %8, 1
%11 = icmp sgt i32 %6, 0
br i1 %11, label %12, label %108
12: ; preds = %9
%13 = add nsw i32 %8, 2
%14 = mul nsw i32 %10, %13
%15 = shl i32 %7, 1
%16 = mul i32 %15, %10
%17 = icmp slt i32 %8, 0
%18 = sext i32 %7 to i64
%19 = icmp sgt i32 %7, 0
%20 = sext i32 %15 to i64
%21 = sext i32 %14 to i64
%22 = zext i32 %6 to i64
%23 = zext i32 %7 to i64
br label %24
24: ; preds = %12, %105
%25 = phi i64 [ 0, %12 ], [ %106, %105 ]
%26 = trunc i64 %25 to i32
%27 = mul i32 %16, %26
%28 = sext i32 %27 to i64
%29 = mul nsw i64 %25, %21
br i1 %17, label %105, label %30
30: ; preds = %24
%31 = getelementptr inbounds double, double* %3, i64 %29
%32 = getelementptr inbounds double, double* %2, i64 %29
%33 = getelementptr inbounds double, double* %1, i64 %28
%34 = getelementptr inbounds double, double* %0, i64 %28
br label %35
35: ; preds = %100, %30
%36 = phi double* [ %97, %100 ], [ %5, %30 ]
%37 = phi double* [ %96, %100 ], [ %4, %30 ]
%38 = phi double* [ %94, %100 ], [ %31, %30 ]
%39 = phi double* [ %92, %100 ], [ %32, %30 ]
%40 = phi double* [ %102, %100 ], [ %33, %30 ]
%41 = phi double* [ %101, %100 ], [ %34, %30 ]
%42 = phi i32 [ %103, %100 ], [ 0, %30 ]
%43 = getelementptr inbounds double, double* %41, i64 %18
%44 = getelementptr inbounds double, double* %40, i64 %18
br label %45
45: ; preds = %35, %89
%46 = phi double* [ %36, %35 ], [ %97, %89 ]
%47 = phi double* [ %37, %35 ], [ %96, %89 ]
%48 = phi double* [ %38, %35 ], [ %94, %89 ]
%49 = phi double* [ %39, %35 ], [ %92, %89 ]
%50 = phi i32 [ %42, %35 ], [ %98, %89 ]
br i1 %19, label %51, label %89
51: ; preds = %45, %51
%52 = phi i64 [ %87, %51 ], [ 0, %45 ]
%53 = phi <2 x double> [ %78, %51 ], [ zeroinitializer, %45 ]
%54 = phi <2 x double> [ %86, %51 ], [ zeroinitializer, %45 ]
%55 = getelementptr inbounds double, double* %40, i64 %52
%56 = load double, double* %55
%57 = getelementptr inbounds double, double* %47, i64 %52
%58 = load double, double* %57
%59 = getelementptr inbounds double, double* %43, i64 %52
%60 = load double, double* %59
%61 = getelementptr inbounds double, double* %46, i64 %52
%62 = load double, double* %61
%63 = fneg double %60
%64 = getelementptr inbounds double, double* %44, i64 %52
%65 = load double, double* %64
%66 = getelementptr inbounds double, double* %41, i64 %52
%67 = load double, double* %66
%68 = insertelement <2 x double> poison, double %62, i64 0
%69 = shufflevector <2 x double> %68, <2 x double> poison, <2 x i32> zeroinitializer
%70 = insertelement <2 x double> poison, double %63, i64 0
%71 = insertelement <2 x double> %70, double %67, i64 1
%72 = fmul <2 x double> %69, %71
%73 = insertelement <2 x double> poison, double %56, i64 0
%74 = insertelement <2 x double> %73, double %65, i64 1
%75 = insertelement <2 x double> poison, double %58, i64 0
%76 = shufflevector <2 x double> %75, <2 x double> poison, <2 x i32> zeroinitializer
%77 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %76, <2 x double> %72)
%78 = fadd <2 x double> %53, %77
%79 = fneg double %56
%80 = insertelement <2 x double> poison, double %65, i64 0
%81 = insertelement <2 x double> %80, double %79, i64 1
%82 = fmul <2 x double> %69, %81
%83 = insertelement <2 x double> poison, double %67, i64 0
%84 = insertelement <2 x double> %83, double %60, i64 1
%85 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %84, <2 x double> %76, <2 x double> %82)
%86 = fsub <2 x double> %54, %85
%87 = add nuw nsw i64 %52, 1
%88 = icmp eq i64 %87, %23
br i1 %88, label %89, label %51
89: ; preds = %51, %45
%90 = phi <2 x double> [ zeroinitializer, %45 ], [ %78, %51 ]
%91 = phi <2 x double> [ zeroinitializer, %45 ], [ %86, %51 ]
%92 = getelementptr inbounds double, double* %49, i64 2
%93 = bitcast double* %49 to <2 x double>*
store <2 x double> %90, <2 x double>* %93
%94 = getelementptr inbounds double, double* %48, i64 2
%95 = bitcast double* %48 to <2 x double>*
store <2 x double> %91, <2 x double>* %95
%96 = getelementptr inbounds double, double* %47, i64 %18
%97 = getelementptr inbounds double, double* %46, i64 %18
%98 = add nuw i32 %50, 1
%99 = icmp eq i32 %50, %8
br i1 %99, label %100, label %45
100: ; preds = %89
%101 = getelementptr inbounds double, double* %41, i64 %20
%102 = getelementptr inbounds double, double* %40, i64 %20
%103 = add nuw i32 %42, 1
%104 = icmp eq i32 %42, %8
br i1 %104, label %105, label %35
105: ; preds = %100, %24
%106 = add nuw nsw i64 %25, 1
%107 = icmp eq i64 %106, %22
br i1 %107, label %108, label %24
108: ; preds = %105, %9
ret void
}