#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);
double fabs(double);
double c_single_scat(double dither, int layru, int nlyr, double *phase,
                     double *omega, double *tau, double umu, double umu0,
                     double utau, double fbeam) {
  register int lyr;
  double ans, exp0, exp1;
  ans = 0.;
  exp0 = exp(-utau / umu0);
  if (fabs(umu + umu0) <= dither) {
    for (lyr = 1; lyr <= layru - 1; lyr++) {
      ans += omega[lyr - 1] * phase[lyr - 1] * (tau[lyr] - tau[lyr - 1]);
    }
    ans = fbeam / (4. * 3.14159265358979323846 * umu0) * exp0 *
          (ans + omega[layru - 1] * phase[layru - 1] * (utau - tau[layru - 1]));
    return ans;
  }
  if (umu > 0.) {
    for (lyr = layru; lyr <= nlyr; lyr++) {
      exp1 = exp(-((tau[lyr] - utau) / umu + tau[lyr] / umu0));
      ans += omega[lyr - 1] * phase[lyr - 1] * (exp0 - exp1);
      exp0 = exp1;
    }
  } else {
    for (lyr = layru; lyr >= 1; lyr--) {
      exp1 = exp(-((tau[lyr - 1] - utau) / umu + tau[lyr - 1] / umu0));
      ans += omega[lyr - 1] * phase[lyr - 1] * (exp0 - exp1);
      exp0 = exp1;
    }
  }
  ans *= fbeam / (4. * 3.14159265358979323846 * (1. + umu / umu0));
  return ans;
}


x86 assembly (clang, -O0):
<c_single_scat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movsd  %xmm3,-0x48(%rbp)
movsd  %xmm4,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x40(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
movaps 0xe79(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1290 <c_single_scat+0x180>
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1215 <c_single_scat+0x105>
mov    -0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11a1 <c_single_scat+0x91>
movsd  -0x50(%rbp),%xmm0
movsd  0xdee(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm3
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1463 <c_single_scat+0x353>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    135f <c_single_scat+0x24f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     135a <c_single_scat+0x24a>
mov    -0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  -0x68(%rbp),%xmm2
subsd  -0x70(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12a8 <c_single_scat+0x198>
jmp    1424 <c_single_scat+0x314>
mov    -0x14(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x1,-0x54(%rbp)
jl     141f <c_single_scat+0x30f>
mov    -0x30(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  -0x68(%rbp),%xmm2
subsd  -0x70(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1365 <c_single_scat+0x255>
jmp    1424 <c_single_scat+0x314>
movsd  -0x50(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  0xbdd(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xbc9(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_single_scat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movapd %xmm4,0x50(%rsp)
movapd %xmm2,0x10(%rsp)
movaps %xmm1,0x30(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r14
mov    %esi,%r13d
mov    %edi,%ebx
movsd  %xmm0,(%rsp)
movapd 0xeb6(%rip),%xmm0
movapd %xmm3,0x20(%rsp)
xorpd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
call   1030 <exp@plt>
movapd 0x30(%rsp),%xmm1
movapd %xmm0,%xmm9
movapd %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
andpd  0xe96(%rip),%xmm0
movsd  (%rsp),%xmm2
ucomisd %xmm0,%xmm2
jae    1259 <c_single_scat+0x149>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    128f <c_single_scat+0x17f>
cmp    %r13d,%ebx
movapd 0x20(%rsp),%xmm3
jg     1338 <c_single_scat+0x228>
movslq %ebx,%rax
movapd 0x10(%rsp),%xmm0
unpcklpd 0x30(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
lea    (%r15,%rax,8),%r15
lea    (%r12,%rax,8),%r12
add    $0xfffffffffffffff8,%r12
lea    (%r14,%rax,8),%rbp
add    $0xfffffffffffffff8,%rbp
sub    %ebx,%r13d
add    $0x1,%r13d
xorpd  %xmm2,%xmm2
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  %xmm9,0x8(%rsp)
movsd  %xmm2,(%rsp)
movsd  (%r15,%rbx,8),%xmm1
movapd %xmm1,%xmm0
subsd  %xmm3,%xmm0
unpcklpd %xmm0,%xmm1
divpd  0x40(%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
xorpd  0xde8(%rip),%xmm0
call   1030 <exp@plt>
movapd 0x20(%rsp),%xmm3
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm9
movsd  (%r12,%rbx,8),%xmm1
mulsd  0x0(%rbp,%rbx,8),%xmm1
movsd  0x8(%rsp),%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm4,%xmm2
add    $0x1,%rbx
cmp    %ebx,%r13d
jne    11e0 <c_single_scat+0xd0>
jmp    1338 <c_single_scat+0x228>
xorpd  %xmm7,%xmm7
cmp    $0x2,%ebx
movapd 0x20(%rsp),%xmm8
jl     1401 <c_single_scat+0x2f1>
mov    %ebx,%eax
movsd  (%r15),%xmm1
add    $0xffffffffffffffff,%rax
cmp    $0x2,%ebx
jne    1367 <c_single_scat+0x257>
xorpd  %xmm7,%xmm7
mov    $0x1,%ecx
jmp    13dd <c_single_scat+0x2cd>
test   %ebx,%ebx
movapd 0x20(%rsp),%xmm3
jle    1338 <c_single_scat+0x228>
mov    %ebx,%ebp
movapd 0x10(%rsp),%xmm0
unpcklpd 0x30(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
add    $0x1,%rbp
xorpd  %xmm2,%xmm2
nopl   0x0(%rax)
movsd  %xmm9,0x8(%rsp)
movsd  %xmm2,(%rsp)
lea    -0x2(%rbp),%ebx
movsd  (%r15,%rbx,8),%xmm1
movapd %xmm1,%xmm0
subsd  %xmm3,%xmm0
unpcklpd %xmm0,%xmm1
divpd  0x40(%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
xorpd  0xd05(%rip),%xmm0
call   1030 <exp@plt>
movapd 0x20(%rsp),%xmm3
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm9
movsd  (%r12,%rbx,8),%xmm1
mulsd  (%r14,%rbx,8),%xmm1
movsd  0x8(%rsp),%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm4,%xmm2
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     12c0 <c_single_scat+0x1b0>
movapd 0x30(%rsp),%xmm1
divsd  0x10(%rsp),%xmm1
addsd  0xcdc(%rip),%xmm1
mulsd  0xccc(%rip),%xmm1
movapd 0x50(%rsp),%xmm0
divsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
jmp    1445 <c_single_scat+0x335>
mov    %rax,%rdx
and    $0xfffffffffffffffe,%rdx
neg    %rdx
xorpd  %xmm7,%xmm7
mov    $0x1,%ecx
movapd %xmm1,%xmm2
xchg   %ax,%ax
movsd  -0x8(%r12,%rcx,8),%xmm3
movsd  (%r12,%rcx,8),%xmm4
mulsd  -0x8(%r14,%rcx,8),%xmm3
movsd  (%r15,%rcx,8),%xmm5
movsd  0x8(%r15,%rcx,8),%xmm1
movapd %xmm5,%xmm6
subsd  %xmm2,%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm7,%xmm6
mulsd  (%r14,%rcx,8),%xmm4
movapd %xmm1,%xmm7
subsd  %xmm5,%xmm7
mulsd  %xmm4,%xmm7
addsd  %xmm6,%xmm7
lea    (%rdx,%rcx,1),%rsi
add    $0x2,%rsi
add    $0x2,%rcx
movapd %xmm1,%xmm2
cmp    $0x1,%rsi
jne    1380 <c_single_scat+0x270>
test   $0x1,%al
je     1401 <c_single_scat+0x2f1>
movsd  -0x8(%r12,%rcx,8),%xmm2
mulsd  -0x8(%r14,%rcx,8),%xmm2
movsd  (%r15,%rcx,8),%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm7
movapd 0x10(%rsp),%xmm1
mulsd  0xc11(%rip),%xmm1
movapd 0x50(%rsp),%xmm0
divsd  %xmm1,%xmm0
movslq %ebx,%rax
movsd  -0x8(%r12,%rax,8),%xmm1
mulsd  -0x8(%r14,%rax,8),%xmm1
subsd  -0x8(%r15,%rax,8),%xmm8
mulsd  %xmm9,%xmm0
mulsd  %xmm1,%xmm8
addsd  %xmm7,%xmm8
mulsd  %xmm8,%xmm0
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @c_single_scat(double %0, i32 %1, i32 %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double %6, double %7, double %8, double %9) {
%11 = fneg double %8
%12 = fdiv double %11, %7
%13 = tail call double @exp(double %12)
%14 = fadd double %6, %7
%15 = tail call double @llvm.fabs.f64(double %14)
%16 = fcmp ugt double %15, %0
br i1 %16, label %89, label %17
17: ; preds = %10
%18 = icmp sgt i32 %1, 1
br i1 %18, label %19, label %72
19: ; preds = %17
%20 = zext i32 %1 to i64
%21 = load double, double* %5
%22 = add nsw i64 %20, -1
%23 = and i64 %22, 1
%24 = icmp eq i32 %1, 2
br i1 %24, label %55, label %25
25: ; preds = %19
%26 = and i64 %22, -2
br label %27
27: ; preds = %27, %25
%28 = phi double [ %21, %25 ], [ %49, %27 ]
%29 = phi i64 [ 1, %25 ], [ %52, %27 ]
%30 = phi double [ 0.000000e+00, %25 ], [ %51, %27 ]
%31 = phi i64 [ 0, %25 ], [ %53, %27 ]
%32 = add nsw i64 %29, -1
%33 = getelementptr inbounds double, double* %4, i64 %32
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %3, i64 %32
%36 = load double, double* %35
%37 = fmul double %34, %36
%38 = getelementptr inbounds double, double* %5, i64 %29
%39 = load double, double* %38
%40 = fsub double %39, %28
%41 = tail call double @llvm.fmuladd.f64(double %37, double %40, double %30)
%42 = add nuw nsw i64 %29, 1
%43 = getelementptr inbounds double, double* %4, i64 %29
%44 = load double, double* %43
%45 = getelementptr inbounds double, double* %3, i64 %29
%46 = load double, double* %45
%47 = fmul double %44, %46
%48 = getelementptr inbounds double, double* %5, i64 %42
%49 = load double, double* %48
%50 = fsub double %49, %39
%51 = tail call double @llvm.fmuladd.f64(double %47, double %50, double %41)
%52 = add nuw nsw i64 %29, 2
%53 = add i64 %31, 2
%54 = icmp eq i64 %53, %26
br i1 %54, label %55, label %27
55: ; preds = %27, %19
%56 = phi double [ undef, %19 ], [ %51, %27 ]
%57 = phi double [ %21, %19 ], [ %49, %27 ]
%58 = phi i64 [ 1, %19 ], [ %52, %27 ]
%59 = phi double [ 0.000000e+00, %19 ], [ %51, %27 ]
%60 = icmp eq i64 %23, 0
br i1 %60, label %72, label %61
61: ; preds = %55
%62 = add nsw i64 %58, -1
%63 = getelementptr inbounds double, double* %4, i64 %62
%64 = load double, double* %63
%65 = getelementptr inbounds double, double* %3, i64 %62
%66 = load double, double* %65
%67 = fmul double %64, %66
%68 = getelementptr inbounds double, double* %5, i64 %58
%69 = load double, double* %68
%70 = fsub double %69, %57
%71 = tail call double @llvm.fmuladd.f64(double %67, double %70, double %59)
br label %72
72: ; preds = %61, %55, %17
%73 = phi double [ 0.000000e+00, %17 ], [ %56, %55 ], [ %71, %61 ]
%74 = add nsw i32 %1, -1
%75 = fmul double %7, 0x402921FB54442D18
%76 = fdiv double %9, %75
%77 = fmul double %76, %13
%78 = sext i32 %74 to i64
%79 = getelementptr inbounds double, double* %4, i64 %78
%80 = load double, double* %79
%81 = getelementptr inbounds double, double* %3, i64 %78
%82 = load double, double* %81
%83 = fmul double %80, %82
%84 = getelementptr inbounds double, double* %5, i64 %78
%85 = load double, double* %84
%86 = fsub double %8, %85
%87 = tail call double @llvm.fmuladd.f64(double %83, double %86, double %73)
%88 = fmul double %77, %87
br label %162
89: ; preds = %10
%90 = fcmp ogt double %6, 0.000000e+00
br i1 %90, label %97, label %91
91: ; preds = %89
%92 = icmp sgt i32 %1, 0
br i1 %92, label %93, label %155
93: ; preds = %91
%94 = zext i32 %1 to i64
%95 = insertelement <2 x double> poison, double %7, i64 0
%96 = insertelement <2 x double> %95, double %6, i64 1
br label %130
97: ; preds = %89
%98 = icmp sgt i32 %1, %2
br i1 %98, label %155, label %99
99: ; preds = %97
%100 = sext i32 %1 to i64
%101 = add i32 %2, 1
%102 = insertelement <2 x double> poison, double %7, i64 0
%103 = insertelement <2 x double> %102, double %6, i64 1
br label %104
104: ; preds = %99, %104
%105 = phi i64 [ %100, %99 ], [ %127, %104 ]
%106 = phi double [ %13, %99 ], [ %118, %104 ]
%107 = phi double [ 0.000000e+00, %99 ], [ %126, %104 ]
%108 = getelementptr inbounds double, double* %5, i64 %105
%109 = load double, double* %108
%110 = fsub double %109, %8
%111 = insertelement <2 x double> poison, double %109, i64 0
%112 = insertelement <2 x double> %111, double %110, i64 1
%113 = fdiv <2 x double> %112, %103
%114 = shufflevector <2 x double> %113, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%115 = fadd <2 x double> %113, %114
%116 = extractelement <2 x double> %115, i64 0
%117 = fneg double %116
%118 = tail call double @exp(double %117)
%119 = add nsw i64 %105, -1
%120 = getelementptr inbounds double, double* %4, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %3, i64 %119
%123 = load double, double* %122
%124 = fmul double %121, %123
%125 = fsub double %106, %118
%126 = tail call double @llvm.fmuladd.f64(double %124, double %125, double %107)
%127 = add nsw i64 %105, 1
%128 = trunc i64 %127 to i32
%129 = icmp eq i32 %101, %128
br i1 %129, label %155, label %104
130: ; preds = %93, %130
%131 = phi i64 [ %94, %93 ], [ %134, %130 ]
%132 = phi double [ %13, %93 ], [ %146, %130 ]
%133 = phi double [ 0.000000e+00, %93 ], [ %153, %130 ]
%134 = add nsw i64 %131, -1
%135 = and i64 %134, 4294967295
%136 = getelementptr inbounds double, double* %5, i64 %135
%137 = load double, double* %136
%138 = fsub double %137, %8
%139 = insertelement <2 x double> poison, double %137, i64 0
%140 = insertelement <2 x double> %139, double %138, i64 1
%141 = fdiv <2 x double> %140, %96
%142 = shufflevector <2 x double> %141, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%143 = fadd <2 x double> %141, %142
%144 = extractelement <2 x double> %143, i64 0
%145 = fneg double %144
%146 = tail call double @exp(double %145)
%147 = getelementptr inbounds double, double* %4, i64 %135
%148 = load double, double* %147
%149 = getelementptr inbounds double, double* %3, i64 %135
%150 = load double, double* %149
%151 = fmul double %148, %150
%152 = fsub double %132, %146
%153 = tail call double @llvm.fmuladd.f64(double %151, double %152, double %133)
%154 = icmp ugt i64 %131, 1
br i1 %154, label %130, label %155
155: ; preds = %130, %104, %91, %97
%156 = phi double [ 0.000000e+00, %97 ], [ 0.000000e+00, %91 ], [ %126, %104 ], [ %153, %130 ]
%157 = fdiv double %6, %7
%158 = fadd double %157, 1.000000e+00
%159 = fmul double %158, 0x402921FB54442D18
%160 = fdiv double %9, %159
%161 = fmul double %160, %156
br label %162
162: ; preds = %155, %72
%163 = phi double [ %88, %72 ], [ %161, %155 ]
ret double %163
}