#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 exp(double);
scalar_t__ fabs(double);
double pow(double, double);
double sin(double);
double sqrt(double);
void eddy(int freezeflag, double wind, double *T, double *water_density,
          double *de, double lat, int numnod, double dz, double surfdz) {
  double ks, N2, ws, radmax, Po;
  double dpdz, rad;
  double zhalf[20];
  int k;
  double z;
  double Ri;
  for (k = 0; k < numnod; k++) {
    zhalf[k] = dz;
  }
  zhalf[0] = (surfdz + dz) * 0.5;
  if (freezeflag != 1) {
    for (k = 0; k < numnod; k++) {
      de[k] = 1.38889E-07;
    }
  } else {
    if (wind < 1.0)
      wind = 1.0;
    ks = 6.6 * pow(sin((double)fabs(lat) * 3.1415927 / 180.), 0.5) *
         pow(wind, -1.84);
    ws = 0.0012 * wind;
    Po = 1.0;
    radmax = 4.e4;
    for (k = 0; k < numnod - 1; k++) {
      dpdz = (water_density[k + 1] - water_density[k]) / zhalf[k];
      N2 = (dpdz / (1.e3 + water_density[k])) * 9.8;
      z = surfdz + ((float)k) * dz;
      if ((z * exp(ks * z) / ws) > 1.e8)
        rad = radmax;
      else {
        rad = 1. + 40. * N2 * (0.40 * z) * (0.40 * z) /
                       (ws * ws * exp(-2. * ks * z));
        if (rad > radmax)
          rad = radmax;
        if (rad < 1.0)
          rad = 1.0;
      }
      Ri = (-1.0 + sqrt(rad)) / 20.0;
      de[k] = 1.38889E-07 +
              (0.40 * ws * z / Po) * exp(-ks * z) / (1.0 + 37.0 * Ri * Ri);
    }
    de[numnod - 1] = de[numnod - 2];
  }
}


x86 assembly (clang, -O0):
<eddy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
movsd  %xmm2,-0x40(%rbp)
movsd  %xmm3,-0x48(%rbp)
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11c4 <eddy+0x74>
movsd  -0x40(%rbp),%xmm0
movslq -0x124(%rbp),%rax
movsd  %xmm0,-0x120(%rbp,%rax,8)
ff ff
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    118c <eddy+0x3c>
movsd  -0x48(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
cmpl   $0x1,-0x4(%rbp)
je     1236 <eddy+0xe6>
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1231 <eddy+0xe1>
mov    -0x28(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  0xe58(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    11f6 <eddy+0xa6>
jmp    15d7 <eddy+0x487>
movsd  0xdca(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1256 <eddy+0x106>
movsd  0xdb7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xdcb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  0xd76(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xd6d(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd44(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xd22(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd1d(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15b3 <eddy+0x463>
mov    -0x20(%rbp),%rax
mov    -0x124(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x124(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movslq -0x124(%rbp),%rax
divsd  -0x120(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  0xce8(%rip),%xmm1
addsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  0xccf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm1
cvtsi2ssl -0x124(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x148(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  0xc5a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13ff <eddy+0x2af>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    14d3 <eddy+0x383>
movsd  0xc61(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xc4c(%rip),%xmm1
mulsd  -0x130(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0xc38(%rip),%xmm1
mulsd  -0x130(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  0xc02(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  -0x158(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x150(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xb7d(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    14ae <eddy+0x35e>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xb52(%rip),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    14ce <eddy+0x37e>
movsd  0xb3f(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    14d3 <eddy+0x383>
movsd  -0x80(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xba0(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xb8c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  0xb58(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  -0x160(%rbp),%xmm1
ff
mulsd  %xmm0,%xmm1
movsd  0xb19(%rip),%xmm0
mulsd  -0x138(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
movsd  0xa8d(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xae5(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1302 <eddy+0x1b2>
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eddy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %rdx,%r15
test   %r8d,%r8d
jle    117f <eddy+0x2f>
mov    %r14d,%eax
cmp    $0x4,%r14d
jae    11a3 <eddy+0x53>
xor    %ecx,%ecx
jmp    12c0 <eddy+0x170>
movapd %xmm2,%xmm4
addsd  %xmm3,%xmm4
mulsd  0xe71(%rip),%xmm4
movsd  %xmm4,0x70(%rsp)
cmp    $0x1,%edi
je     12ee <eddy+0x19e>
jmp    16cd <eddy+0x57d>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm2,%xmm4
unpcklpd %xmm2,%xmm4
lea    -0x4(%rcx),%rbp
mov    %rbp,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x1c,%rbp
jae    11d1 <eddy+0x81>
xor    %ebp,%ebp
jmp    127b <eddy+0x12b>
and    $0xfffffffffffffff8,%rsi
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movapd %xmm4,0x70(%rsp,%rbp,8)
movapd %xmm4,0x80(%rsp,%rbp,8)
movapd %xmm4,0x90(%rsp,%rbp,8)
movapd %xmm4,0xa0(%rsp,%rbp,8)
movapd %xmm4,0xb0(%rsp,%rbp,8)
movapd %xmm4,0xc0(%rsp,%rbp,8)
movapd %xmm4,0xd0(%rsp,%rbp,8)
movapd %xmm4,0xe0(%rsp,%rbp,8)
movapd %xmm4,0xf0(%rsp,%rbp,8)
movapd %xmm4,0x100(%rsp,%rbp,8)
movapd %xmm4,0x110(%rsp,%rbp,8)
movapd %xmm4,0x120(%rsp,%rbp,8)
movapd %xmm4,0x130(%rsp,%rbp,8)
movapd %xmm4,0x140(%rsp,%rbp,8)
movapd %xmm4,0x150(%rsp,%rbp,8)
movapd %xmm4,0x160(%rsp,%rbp,8)
add    $0x20,%rbp
add    $0xfffffffffffffff8,%rsi
jne    11e0 <eddy+0x90>
test   %rdx,%rdx
je     12b4 <eddy+0x164>
lea    (%rsp,%rbp,8),%rsi
add    $0x80,%rsi
shl    $0x5,%rdx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm4,-0x10(%rsi,%rbp,1)
movapd %xmm4,(%rsi,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%rdx
jne    12a0 <eddy+0x150>
cmp    %rax,%rcx
je     12cf <eddy+0x17f>
nopl   0x0(%rax)
movsd  %xmm2,0x70(%rsp,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    12c0 <eddy+0x170>
movapd %xmm2,%xmm4
addsd  %xmm3,%xmm4
mulsd  0xd21(%rip),%xmm4
movsd  %xmm4,0x70(%rsp)
cmp    $0x1,%edi
jne    15b2 <eddy+0x462>
movapd %xmm4,0x20(%rsp)
movapd %xmm2,0x60(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  0xd00(%rip),%xmm2
maxsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xce6(%rip),%xmm0
divsd  0xce6(%rip),%xmm0
call   1040 <sin@plt>
movsd  0xcc1(%rip),%xmm1
call   1060 <pow@plt>
movapd %xmm0,0x30(%rsp)
movsd  0xcd6(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1060 <pow@plt>
lea    -0x1(%r14),%r12d
cmp    $0x2,%r14d
jl     159c <eddy+0x44c>
movapd 0x30(%rsp),%xmm1
mulsd  0xca7(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xca5(%rip),%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x48(%rsp)
movsd  0xc97(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x40(%rsp)
movsd  0xc8d(%rip),%xmm2
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x50(%rsp)
movapd 0xce5(%rip),%xmm0
movapd %xmm1,0x30(%rsp)
xorpd  %xmm1,%xmm0
movapd %xmm0,0x110(%rsp)
mov    %r12d,%r13d
add    $0xffffffffffffffff,%r13
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsd  0x18(%rsp),%xmm1
movapd 0x60(%rsp),%xmm2
movsd  (%r15,%rbp,8),%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x8(%r15,%rbp,8),%xmm0
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
xorps  %xmm3,%xmm3
cvtss2sd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
mulsd  %xmm3,%xmm0
call   1050 <exp@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
ucomisd 0xbfd(%rip),%xmm0
movsd  0xbed(%rip),%xmm0
ja     14f5 <eddy+0x3a5>
movsd  (%rsp),%xmm2
movsd  0x58(%rsp),%xmm0
subsd  %xmm0,%xmm2
divsd  0x20(%rsp),%xmm2
addsd  0xbda(%rip),%xmm0
divsd  %xmm0,%xmm2
mulsd  0xbd6(%rip),%xmm2
mulsd  0xbd6(%rip),%xmm2
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0xb9c(%rip),%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <exp@plt>
mulsd  0x48(%rsp),%xmm0
movsd  (%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  0xb31(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xb65(%rip),%xmm0
minsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
jbe    14f5 <eddy+0x3a5>
movsd  0xb13(%rip),%xmm0
ucomisd 0xb93(%rip),%xmm0
jb     1510 <eddy+0x3c0>
sqrtsd %xmm0,%xmm0
jmp    1515 <eddy+0x3c5>
cs nopw 0x0(%rax,%rax,1)
nop
call   1070 <sqrt@plt>
addsd  0xb53(%rip),%xmm0
divsd  0xb53(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x50(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  0x110(%rsp),%xmm0
call   1050 <exp@plt>
mulsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  0xb1b(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xa97(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0xb0b(%rip),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
cmp    %rbp,%r13
je     159c <eddy+0x44c>
movsd  0x78(%rsp,%rbp,8),%xmm0
movapd %xmm0,0x20(%rsp)
add    $0x1,%rbp
jmp    13f0 <eddy+0x2a0>
movslq %r14d,%rax
movsd  -0x10(%rbx,%rax,8),%xmm0
movslq %r12d,%rax
movsd  %xmm0,(%rbx,%rax,8)
jmp    16cd <eddy+0x57d>
test   %r14d,%r14d
jle    16cd <eddy+0x57d>
cmp    $0x4,%r14d
jae    15c8 <eddy+0x478>
xor    %ecx,%ecx
jmp    16a7 <eddy+0x557>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x1c,%rdi
jae    15ee <eddy+0x49e>
xor    %edi,%edi
jmp    1671 <eddy+0x521>
and    $0xfffffffffffffff8,%rsi
xor    %edi,%edi
movaps 0xaa5(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rbx,%rdi,8)
movups %xmm0,0x10(%rbx,%rdi,8)
movups %xmm0,0x20(%rbx,%rdi,8)
movups %xmm0,0x30(%rbx,%rdi,8)
movups %xmm0,0x40(%rbx,%rdi,8)
movups %xmm0,0x50(%rbx,%rdi,8)
movups %xmm0,0x60(%rbx,%rdi,8)
movups %xmm0,0x70(%rbx,%rdi,8)
movups %xmm0,0x80(%rbx,%rdi,8)
movups %xmm0,0x90(%rbx,%rdi,8)
movups %xmm0,0xa0(%rbx,%rdi,8)
movups %xmm0,0xb0(%rbx,%rdi,8)
movups %xmm0,0xc0(%rbx,%rdi,8)
movups %xmm0,0xd0(%rbx,%rdi,8)
movups %xmm0,0xe0(%rbx,%rdi,8)
movups %xmm0,0xf0(%rbx,%rdi,8)
add    $0x20,%rdi
add    $0xfffffffffffffff8,%rsi
jne    1600 <eddy+0x4b0>
test   %rdx,%rdx
je     16a2 <eddy+0x552>
lea    (%rbx,%rdi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%rdx
xor    %edi,%edi
movaps 0xa15(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rsi,%rdi,1)
movups %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rdx
jne    1690 <eddy+0x540>
cmp    %rax,%rcx
je     16cd <eddy+0x57d>
movabs $0x3e82a4309052ab91,%rdx
a4 82 3e
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    16c0 <eddy+0x570>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @eddy(i32 %0, double %1, double* %2, double* %3, double* %4, double %5, i32 %6, double %7, double %8) {
%10 = alloca i32
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca [20 x double]
%27 = alloca i32
%28 = alloca double
%29 = alloca double
store i32 %0, i32* %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 double %7, double* %17
store double %8, double* %18
store i32 0, i32* %27
br label %30
30: ; preds = %39, %9
%31 = load i32, i32* %27
%32 = load i32, i32* %16
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %42
34: ; preds = %30
%35 = load double, double* %17
%36 = load i32, i32* %27
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [20 x double], [20 x double]* %26, i64 0, i64 %37
store double %35, double* %38
br label %39
39: ; preds = %34
%40 = load i32, i32* %27
%41 = add nsw i32 %40, 1
store i32 %41, i32* %27
br label %30
42: ; preds = %30
%43 = load double, double* %18
%44 = load double, double* %17
%45 = fadd double %43, %44
%46 = fmul double %45, 5.000000e-01
%47 = getelementptr inbounds [20 x double], [20 x double]* %26, i64 0, i64 0
store double %46, double* %47
%48 = load i32, i32* %10
%49 = icmp ne i32 %48, 1
br i1 %49, label %50, label %64
50: ; preds = %42
store i32 0, i32* %27
br label %51
51: ; preds = %60, %50
%52 = load i32, i32* %27
%53 = load i32, i32* %16
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %63
55: ; preds = %51
%56 = load double*, double** %14
%57 = load i32, i32* %27
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
store double 1.388890e-07, double* %59
br label %60
60: ; preds = %55
%61 = load i32, i32* %27
%62 = add nsw i32 %61, 1
store i32 %62, i32* %27
br label %51
63: ; preds = %51
br label %203
64: ; preds = %42
%65 = load double, double* %11
%66 = fcmp olt double %65, 1.000000e+00
br i1 %66, label %67, label %68
67: ; preds = %64
store double 1.000000e+00, double* %11
br label %68
68: ; preds = %67, %64
%69 = load double, double* %15
%70 = call i64 @fabs(double %69)
%71 = sitofp i64 %70 to double
%72 = fmul double %71, 0x400921FB5A7ED197
%73 = fdiv double %72, 1.800000e+02
%74 = call double @sin(double %73)
%75 = call double @pow(double %74, double 5.000000e-01)
%76 = fmul double 6.600000e+00, %75
%77 = load double, double* %11
%78 = call double @pow(double %77, double -1.840000e+00)
%79 = fmul double %76, %78
store double %79, double* %19
%80 = load double, double* %11
%81 = fmul double 1.200000e-03, %80
store double %81, double* %21
store double 1.000000e+00, double* %23
store double 4.000000e+04, double* %22
store i32 0, i32* %27
br label %82
82: ; preds = %188, %68
%83 = load i32, i32* %27
%84 = load i32, i32* %16
%85 = sub nsw i32 %84, 1
%86 = icmp slt i32 %83, %85
br i1 %86, label %87, label %191
87: ; preds = %82
%88 = load double*, double** %13
%89 = load i32, i32* %27
%90 = add nsw i32 %89, 1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %88, i64 %91
%93 = load double, double* %92
%94 = load double*, double** %13
%95 = load i32, i32* %27
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = fsub double %93, %98
%100 = load i32, i32* %27
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [20 x double], [20 x double]* %26, i64 0, i64 %101
%103 = load double, double* %102
%104 = fdiv double %99, %103
store double %104, double* %24
%105 = load double, double* %24
%106 = load double*, double** %13
%107 = load i32, i32* %27
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
%111 = fadd double 1.000000e+03, %110
%112 = fdiv double %105, %111
%113 = fmul double %112, 9.800000e+00
store double %113, double* %20
%114 = load double, double* %18
%115 = load i32, i32* %27
%116 = sitofp i32 %115 to float
%117 = fpext float %116 to double
%118 = load double, double* %17
%119 = call double @llvm.fmuladd.f64(double %117, double %118, double %114)
store double %119, double* %28
%120 = load double, double* %28
%121 = load double, double* %19
%122 = load double, double* %28
%123 = fmul double %121, %122
%124 = call double @exp(double %123)
%125 = fmul double %120, %124
%126 = load double, double* %21
%127 = fdiv double %125, %126
%128 = fcmp ogt double %127, 1.000000e+08
br i1 %128, label %129, label %131
129: ; preds = %87
%130 = load double, double* %22
store double %130, double* %25
br label %161
131: ; preds = %87
%132 = load double, double* %20
%133 = fmul double 4.000000e+01, %132
%134 = load double, double* %28
%135 = fmul double 4.000000e-01, %134
%136 = fmul double %133, %135
%137 = load double, double* %28
%138 = fmul double 4.000000e-01, %137
%139 = fmul double %136, %138
%140 = load double, double* %21
%141 = load double, double* %21
%142 = fmul double %140, %141
%143 = load double, double* %19
%144 = fmul double -2.000000e+00, %143
%145 = load double, double* %28
%146 = fmul double %144, %145
%147 = call double @exp(double %146)
%148 = fmul double %142, %147
%149 = fdiv double %139, %148
%150 = fadd double 1.000000e+00, %149
store double %150, double* %25
%151 = load double, double* %25
%152 = load double, double* %22
%153 = fcmp ogt double %151, %152
br i1 %153, label %154, label %156
154: ; preds = %131
%155 = load double, double* %22
store double %155, double* %25
br label %156
156: ; preds = %154, %131
%157 = load double, double* %25
%158 = fcmp olt double %157, 1.000000e+00
br i1 %158, label %159, label %160
159: ; preds = %156
store double 1.000000e+00, double* %25
br label %160
160: ; preds = %159, %156
br label %161
161: ; preds = %160, %129
%162 = load double, double* %25
%163 = call double @sqrt(double %162)
%164 = fadd double -1.000000e+00, %163
%165 = fdiv double %164, 2.000000e+01
store double %165, double* %29
%166 = load double, double* %21
%167 = fmul double 4.000000e-01, %166
%168 = load double, double* %28
%169 = fmul double %167, %168
%170 = load double, double* %23
%171 = fdiv double %169, %170
%172 = load double, double* %19
%173 = fneg double %172
%174 = load double, double* %28
%175 = fmul double %173, %174
%176 = call double @exp(double %175)
%177 = fmul double %171, %176
%178 = load double, double* %29
%179 = fmul double 3.700000e+01, %178
%180 = load double, double* %29
%181 = call double @llvm.fmuladd.f64(double %179, double %180, double 1.000000e+00)
%182 = fdiv double %177, %181
%183 = fadd double 1.388890e-07, %182
%184 = load double*, double** %14
%185 = load i32, i32* %27
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
store double %183, double* %187
br label %188
188: ; preds = %161
%189 = load i32, i32* %27
%190 = add nsw i32 %189, 1
store i32 %190, i32* %27
br label %82
191: ; preds = %82
%192 = load double*, double** %14
%193 = load i32, i32* %16
%194 = sub nsw i32 %193, 2
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds double, double* %192, i64 %195
%197 = load double, double* %196
%198 = load double*, double** %14
%199 = load i32, i32* %16
%200 = sub nsw i32 %199, 1
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %198, i64 %201
store double %197, double* %202
br label %203
203: ; preds = %191, %63
ret void
}

LLVM IR (-O2):
define void @eddy(i32 %0, double %1, double* nocapture readnone %2, double* nocapture %3, double* nocapture %4, double %5, i32 %6, double %7, double %8) {
%10 = alloca [20 x double]
%11 = bitcast [20 x double]* %10 to i8*
%12 = icmp sgt i32 %6, 0
br i1 %12, label %13, label %101
13: ; preds = %9
%14 = zext i32 %6 to i64
%15 = icmp ult i32 %6, 4
br i1 %15, label %89, label %16
16: ; preds = %13
%17 = and i64 %14, 4294967292
%18 = insertelement <2 x double> poison, double %7, i64 0
%19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> zeroinitializer
%20 = insertelement <2 x double> poison, double %7, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = add nsw i64 %17, -4
%23 = lshr exact i64 %22, 2
%24 = add nuw nsw i64 %23, 1
%25 = and i64 %24, 7
%26 = icmp ult i64 %22, 28
br i1 %26, label %74, label %27
27: ; preds = %16
%28 = and i64 %24, 9223372036854775800
br label %29
29: ; preds = %29, %27
%30 = phi i64 [ 0, %27 ], [ %71, %29 ]
%31 = phi i64 [ 0, %27 ], [ %72, %29 ]
%32 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %30
%33 = bitcast double* %32 to <2 x double>*
store <2 x double> %19, <2 x double>* %33
%34 = getelementptr inbounds double, double* %32, i64 2
%35 = bitcast double* %34 to <2 x double>*
store <2 x double> %21, <2 x double>* %35
%36 = or i64 %30, 4
%37 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %36
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> %19, <2 x double>* %38
%39 = getelementptr inbounds double, double* %37, i64 2
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> %21, <2 x double>* %40
%41 = or i64 %30, 8
%42 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %41
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %19, <2 x double>* %43
%44 = getelementptr inbounds double, double* %42, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %21, <2 x double>* %45
%46 = or i64 %30, 12
%47 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %46
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> %19, <2 x double>* %48
%49 = getelementptr inbounds double, double* %47, i64 2
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> %21, <2 x double>* %50
%51 = or i64 %30, 16
%52 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %51
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> %19, <2 x double>* %53
%54 = getelementptr inbounds double, double* %52, i64 2
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> %21, <2 x double>* %55
%56 = or i64 %30, 20
%57 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %56
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %19, <2 x double>* %58
%59 = getelementptr inbounds double, double* %57, i64 2
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> %21, <2 x double>* %60
%61 = or i64 %30, 24
%62 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %61
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> %19, <2 x double>* %63
%64 = getelementptr inbounds double, double* %62, i64 2
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %21, <2 x double>* %65
%66 = or i64 %30, 28
%67 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %66
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> %19, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %21, <2 x double>* %70
%71 = add nuw i64 %30, 32
%72 = add i64 %31, 8
%73 = icmp eq i64 %72, %28
br i1 %73, label %74, label %29
74: ; preds = %29, %16
%75 = phi i64 [ 0, %16 ], [ %71, %29 ]
%76 = icmp eq i64 %25, 0
br i1 %76, label %87, label %77
77: ; preds = %74, %77
%78 = phi i64 [ %84, %77 ], [ %75, %74 ]
%79 = phi i64 [ %85, %77 ], [ 0, %74 ]
%80 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %78
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %19, <2 x double>* %81
%82 = getelementptr inbounds double, double* %80, i64 2
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> %21, <2 x double>* %83
%84 = add nuw i64 %78, 4
%85 = add i64 %79, 1
%86 = icmp eq i64 %85, %25
br i1 %86, label %87, label %77
87: ; preds = %77, %74
%88 = icmp eq i64 %17, %14
br i1 %88, label %96, label %89
89: ; preds = %13, %87
%90 = phi i64 [ 0, %13 ], [ %17, %87 ]
br label %91
91: ; preds = %89, %91
%92 = phi i64 [ %94, %91 ], [ %90, %89 ]
%93 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %92
store double %7, double* %93
%94 = add nuw nsw i64 %92, 1
%95 = icmp eq i64 %94, %14
br i1 %95, label %96, label %91
96: ; preds = %91, %87
%97 = fadd double %7, %8
%98 = fmul double %97, 5.000000e-01
%99 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 0
store double %98, double* %99
%100 = icmp eq i32 %0, 1
br i1 %100, label %186, label %106
101: ; preds = %9
%102 = fadd double %7, %8
%103 = fmul double %102, 5.000000e-01
%104 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 0
store double %103, double* %104
%105 = icmp eq i32 %0, 1
br i1 %105, label %186, label %269
106: ; preds = %96
br i1 %12, label %107, label %269
107: ; preds = %106
%108 = zext i32 %6 to i64
%109 = icmp ult i32 %6, 4
br i1 %109, label %179, label %110
110: ; preds = %107
%111 = and i64 %14, 4294967292
%112 = add nsw i64 %111, -4
%113 = lshr exact i64 %112, 2
%114 = add nuw nsw i64 %113, 1
%115 = and i64 %114, 7
%116 = icmp ult i64 %112, 28
br i1 %116, label %164, label %117
117: ; preds = %110
%118 = and i64 %114, 9223372036854775800
br label %119
119: ; preds = %119, %117
%120 = phi i64 [ 0, %117 ], [ %161, %119 ]
%121 = phi i64 [ 0, %117 ], [ %162, %119 ]
%122 = getelementptr inbounds double, double* %4, i64 %120
%123 = bitcast double* %122 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %123
%124 = getelementptr inbounds double, double* %122, i64 2
%125 = bitcast double* %124 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %125
%126 = or i64 %120, 4
%127 = getelementptr inbounds double, double* %4, i64 %126
%128 = bitcast double* %127 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %128
%129 = getelementptr inbounds double, double* %127, i64 2
%130 = bitcast double* %129 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %130
%131 = or i64 %120, 8
%132 = getelementptr inbounds double, double* %4, i64 %131
%133 = bitcast double* %132 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %133
%134 = getelementptr inbounds double, double* %132, i64 2
%135 = bitcast double* %134 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %135
%136 = or i64 %120, 12
%137 = getelementptr inbounds double, double* %4, i64 %136
%138 = bitcast double* %137 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %138
%139 = getelementptr inbounds double, double* %137, i64 2
%140 = bitcast double* %139 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %140
%141 = or i64 %120, 16
%142 = getelementptr inbounds double, double* %4, i64 %141
%143 = bitcast double* %142 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %143
%144 = getelementptr inbounds double, double* %142, i64 2
%145 = bitcast double* %144 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %145
%146 = or i64 %120, 20
%147 = getelementptr inbounds double, double* %4, i64 %146
%148 = bitcast double* %147 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %148
%149 = getelementptr inbounds double, double* %147, i64 2
%150 = bitcast double* %149 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %150
%151 = or i64 %120, 24
%152 = getelementptr inbounds double, double* %4, i64 %151
%153 = bitcast double* %152 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %153
%154 = getelementptr inbounds double, double* %152, i64 2
%155 = bitcast double* %154 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %155
%156 = or i64 %120, 28
%157 = getelementptr inbounds double, double* %4, i64 %156
%158 = bitcast double* %157 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %158
%159 = getelementptr inbounds double, double* %157, i64 2
%160 = bitcast double* %159 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %160
%161 = add nuw i64 %120, 32
%162 = add i64 %121, 8
%163 = icmp eq i64 %162, %118
br i1 %163, label %164, label %119
164: ; preds = %119, %110
%165 = phi i64 [ 0, %110 ], [ %161, %119 ]
%166 = icmp eq i64 %115, 0
br i1 %166, label %177, label %167
167: ; preds = %164, %167
%168 = phi i64 [ %174, %167 ], [ %165, %164 ]
%169 = phi i64 [ %175, %167 ], [ 0, %164 ]
%170 = getelementptr inbounds double, double* %4, i64 %168
%171 = bitcast double* %170 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %171
%172 = getelementptr inbounds double, double* %170, i64 2
%173 = bitcast double* %172 to <2 x double>*
store <2 x double> <double 1.388890e-07, double 1.388890e-07>, <2 x double>* %173
%174 = add nuw i64 %168, 4
%175 = add i64 %169, 1
%176 = icmp eq i64 %175, %115
br i1 %176, label %177, label %167
177: ; preds = %167, %164
%178 = icmp eq i64 %111, %14
br i1 %178, label %269, label %179
179: ; preds = %107, %177
%180 = phi i64 [ 0, %107 ], [ %111, %177 ]
br label %181
181: ; preds = %179, %181
%182 = phi i64 [ %184, %181 ], [ %180, %179 ]
%183 = getelementptr inbounds double, double* %4, i64 %182
store double 1.388890e-07, double* %183
%184 = add nuw nsw i64 %182, 1
%185 = icmp eq i64 %184, %108
br i1 %185, label %269, label %181
186: ; preds = %101, %96
%187 = phi double [ %103, %101 ], [ %98, %96 ]
%188 = fcmp olt double %1, 1.000000e+00
%189 = select i1 %188, double 1.000000e+00, double %1
%190 = tail call i64 @fabs(double %5)
%191 = sitofp i64 %190 to double
%192 = fmul double %191, 0x400921FB5A7ED197
%193 = fdiv double %192, 1.800000e+02
%194 = tail call double @sin(double %193)
%195 = tail call double @pow(double %194, double 5.000000e-01)
%196 = fmul double %195, 6.600000e+00
%197 = tail call double @pow(double %189, double -1.840000e+00)
%198 = fmul double %196, %197
%199 = fmul double %189, 1.200000e-03
%200 = add i32 %6, -1
%201 = icmp sgt i32 %6, 1
br i1 %201, label %202, label %262
202: ; preds = %186
%203 = fmul double %199, %199
%204 = fmul double %198, -2.000000e+00
%205 = fmul double %199, 4.000000e-01
%206 = fneg double %198
%207 = zext i32 %200 to i64
br label %208
208: ; preds = %259, %202
%209 = phi double [ %187, %202 ], [ %261, %259 ]
%210 = phi i64 [ 0, %202 ], [ %211, %259 ]
%211 = add nuw nsw i64 %210, 1
%212 = getelementptr inbounds double, double* %3, i64 %211
%213 = load double, double* %212
%214 = getelementptr inbounds double, double* %3, i64 %210
%215 = load double, double* %214
%216 = trunc i64 %210 to i32
%217 = sitofp i32 %216 to float
%218 = fpext float %217 to double
%219 = tail call double @llvm.fmuladd.f64(double %218, double %7, double %8)
%220 = fmul double %198, %219
%221 = tail call double @exp(double %220)
%222 = fmul double %219, %221
%223 = fdiv double %222, %199
%224 = fcmp ogt double %223, 1.000000e+08
br i1 %224, label %244, label %225
225: ; preds = %208
%226 = fsub double %213, %215
%227 = fdiv double %226, %209
%228 = fadd double %215, 1.000000e+03
%229 = fdiv double %227, %228
%230 = fmul double %229, 9.800000e+00
%231 = fmul double %230, 4.000000e+01
%232 = fmul double %219, 4.000000e-01
%233 = fmul double %232, %231
%234 = fmul double %232, %233
%235 = fmul double %204, %219
%236 = tail call double @exp(double %235)
%237 = fmul double %203, %236
%238 = fdiv double %234, %237
%239 = fadd double %238, 1.000000e+00
%240 = fcmp ogt double %239, 4.000000e+04
%241 = select i1 %240, double 4.000000e+04, double %239
%242 = fcmp olt double %241, 1.000000e+00
br i1 %242, label %243, label %244
243: ; preds = %225
br label %244
244: ; preds = %208, %225, %243
%245 = phi double [ 1.000000e+00, %243 ], [ %241, %225 ], [ 4.000000e+04, %208 ]
%246 = tail call double @sqrt(double %245)
%247 = fadd double %246, -1.000000e+00
%248 = fdiv double %247, 2.000000e+01
%249 = fmul double %205, %219
%250 = fmul double %219, %206
%251 = tail call double @exp(double %250)
%252 = fmul double %249, %251
%253 = fmul double %248, 3.700000e+01
%254 = tail call double @llvm.fmuladd.f64(double %253, double %248, double 1.000000e+00)
%255 = fdiv double %252, %254
%256 = fadd double %255, 1.388890e-07
%257 = getelementptr inbounds double, double* %4, i64 %210
store double %256, double* %257
%258 = icmp eq i64 %211, %207
br i1 %258, label %262, label %259
259: ; preds = %244
%260 = getelementptr inbounds [20 x double], [20 x double]* %10, i64 0, i64 %211
%261 = load double, double* %260
br label %208
262: ; preds = %244, %186
%263 = add nsw i32 %6, -2
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds double, double* %4, i64 %264
%266 = load double, double* %265
%267 = sext i32 %200 to i64
%268 = getelementptr inbounds double, double* %4, i64 %267
store double %266, double* %268
br label %269
269: ; preds = %181, %177, %101, %106, %262
ret void
}