#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cos(double);
int /*<<< orphan*/ coulomb_frame_parameters(double, double, double, double,
                                            double *, double *);
double coulomb_nuclear_form_factor(double const, double);
int /*<<< orphan*/ coulomb_screening_parameters(double, double, double, double,
                                                double, int *, double *,
                                                double *);
double coulomb_spin_factor(double, double);
double sin(double);
double sqrt(double const);
double pumas_elastic_dcs(double Z, double A, double m, double K, double theta) {
  if ((Z < 1.) || (A < 1.) || (m <= 0.) || (K <= 0.))
    return 0.;
  int n_parameters;
  double kinetic0, amplitude[3], screening[5], fCM[2];
  coulomb_frame_parameters(Z, A, m, K, &kinetic0, fCM);
  coulomb_screening_parameters(Z, A, m, K, kinetic0, &n_parameters, amplitude,
                               screening);
  const double fspin = coulomb_spin_factor(m, K);
  const double c = cos(theta);
  const double s = sin(theta);
  const double gs = fCM[0] * s;
  const double sd = sqrt(c * c + gs * gs * (1. - fCM[1] * fCM[1]));
  const double cgs = c * c + gs * gs;
  const double mu0 = 0.5 * (gs * gs * (1. + fCM[1]) + c * (c - sd)) / cgs;
  const double num = fCM[0] * (c * fCM[1] + sd);
  const double jac = num * num / (cgs * cgs * sd);
  const int n = n_parameters - 1;
  double dcs = 0.;
  int i;
  for (i = 0; i < n; i++) {
    dcs += amplitude[i] / (screening[i] + mu0);
  }
  dcs *= coulomb_nuclear_form_factor(mu0, screening[n]);
  dcs *= dcs;
  const double p0 = sqrt(kinetic0 * (kinetic0 + 2. * m));
  const double p = sqrt(K * (K + 2. * m));
  const double factor =
      0.5 * 7.2973525693E-03 * Z * (K + m) * 1.973269804E-16 / (p0 * p);
  return factor * factor * dcs * jac * (1. - fspin * mu0);
}


x86 assembly (clang, -O0):
<pumas_elastic_dcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  0xe64(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     11d6 <pumas_elastic_dcs+0x66>
movsd  0xe51(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     11d6 <pumas_elastic_dcs+0x66>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jae    11d6 <pumas_elastic_dcs+0x66>
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     11e3 <pumas_elastic_dcs+0x73>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15a7 <pumas_elastic_dcs+0x437>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
lea    -0xa0(%rbp),%rsi
lea    -0x40(%rbp),%rdi
call   1090 <coulomb_frame_parameters@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    -0x34(%rbp),%rdi
call   1050 <coulomb_screening_parameters@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1070 <coulomb_spin_factor@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0x98(%rbp),%xmm4
ff
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm3
movsd  0xd26(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movsd  0xcc1(%rip),%xmm2
addsd  -0x98(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm3
ff
subsd  -0xc8(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xc95(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  -0xe0(%rbp),%xmm0
ff
movsd  -0xd0(%rbp),%xmm1
ff
mulsd  -0xd0(%rbp),%xmm1
ff
mulsd  -0xc8(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xec(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movl   $0x0,-0xfc(%rbp)
mov    -0xfc(%rbp),%eax
cmp    -0xec(%rbp),%eax
jge    146f <pumas_elastic_dcs+0x2ff>
movslq -0xfc(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movslq -0xfc(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm1
ff ff
addsd  -0xd8(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
addsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    1410 <pumas_elastic_dcs+0x2a0>
movsd  -0xd8(%rbp),%xmm0
ff
movslq -0xec(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm1
ff ff
call   1030 <coulomb_nuclear_form_factor@plt>
mulsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x110(%rbp)
ff
movsd  0xb0c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xae9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x108(%rbp),%xmm1
ff
mulsd  -0x110(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
mulsd  -0x118(%rbp),%xmm0
ff
mulsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0xe8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm2
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xa66(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pumas_elastic_dcs>:
sub    $0xb8,%rsp
movapd %xmm0,%xmm5
movsd  0xe7d(%rip),%xmm6
ucomisd %xmm0,%xmm6
xorpd  %xmm0,%xmm0
ja     1506 <pumas_elastic_dcs+0x396>
ucomisd %xmm1,%xmm6
ja     1506 <pumas_elastic_dcs+0x396>
xorpd  %xmm6,%xmm6
ucomisd %xmm2,%xmm6
jae    1506 <pumas_elastic_dcs+0x396>
ucomisd %xmm3,%xmm6
jae    1506 <pumas_elastic_dcs+0x396>
lea    0x48(%rsp),%rdi
lea    0x50(%rsp),%rsi
movapd %xmm5,%xmm0
movsd  %xmm2,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm5,0x30(%rsp)
movsd  %xmm4,(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1090 <coulomb_frame_parameters@plt>
movsd  0x48(%rsp),%xmm4
lea    0x3c(%rsp),%rdi
lea    0x70(%rsp),%rsi
lea    0x90(%rsp),%rdx
movsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
call   1050 <coulomb_screening_parameters@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1070 <coulomb_spin_factor@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm6
mulsd  0x50(%rsp),%xmm6
mulsd  %xmm6,%xmm6
movsd  0x58(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xd91(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm6,%xmm0
movapd %xmm2,%xmm5
mulsd  %xmm2,%xmm5
addsd  %xmm5,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     129f <pumas_elastic_dcs+0x12f>
xorpd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
xorps  %xmm4,%xmm4
sqrtsd %xmm0,%xmm4
jmp    12cf <pumas_elastic_dcs+0x15f>
xorpd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
movsd  %xmm5,0x28(%rsp)
movsd  %xmm6,0x10(%rsp)
call   1080 <sqrt@plt>
movsd  0x10(%rsp),%xmm6
movsd  0x28(%rsp),%xmm5
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm4
addsd  %xmm6,%xmm5
movsd  0x58(%rsp),%xmm3
movsd  0xd1f(%rip),%xmm0
addsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
subsd  %xmm4,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm6,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xd07(%rip),%xmm0
divsd  %xmm5,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm4,%xmm2
mulsd  0x50(%rsp),%xmm2
mulsd  %xmm5,%xmm5
mov    0x3c(%rsp),%ecx
lea    -0x1(%rcx),%eax
cmp    $0x2,%ecx
jl     13be <pumas_elastic_dcs+0x24e>
mov    %eax,%ecx
cmp    $0x1,%eax
jne    1336 <pumas_elastic_dcs+0x1c6>
xorpd  %xmm6,%xmm6
xor    %edx,%edx
jmp    138f <pumas_elastic_dcs+0x21f>
mov    %ecx,%esi
and    $0xfffffffe,%esi
xorpd  %xmm6,%xmm6
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x90(%rsp,%rdx,8),%xmm3
addsd  %xmm0,%xmm3
movsd  0x70(%rsp,%rdx,8),%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm6,%xmm1
movsd  0x78(%rsp,%rdx,8),%xmm6
movsd  0x98(%rsp,%rdx,8),%xmm3
addsd  %xmm0,%xmm3
divsd  %xmm3,%xmm6
addsd  %xmm1,%xmm6
add    $0x2,%rdx
cmp    %rdx,%rsi
jne    1350 <pumas_elastic_dcs+0x1e0>
movsd  %xmm6,(%rsp)
test   $0x1,%cl
je     13be <pumas_elastic_dcs+0x24e>
movsd  0x70(%rsp,%rdx,8),%xmm3
movsd  0x90(%rsp,%rdx,8),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm3
movsd  (%rsp),%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,(%rsp)
mulsd  %xmm2,%xmm2
movsd  %xmm2,0x8(%rsp)
mulsd  %xmm5,%xmm4
movsd  %xmm4,0x10(%rsp)
cltq
movsd  0x90(%rsp,%rax,8),%xmm1
movsd  %xmm0,0x28(%rsp)
call   1030 <coulomb_nuclear_form_factor@plt>
movapd %xmm0,%xmm7
mulsd  (%rsp),%xmm7
movsd  0x48(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
addsd  %xmm2,%xmm2
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     141e <pumas_elastic_dcs+0x2ae>
sqrtsd %xmm0,%xmm9
jmp    1442 <pumas_elastic_dcs+0x2d2>
movsd  %xmm7,(%rsp)
movsd  %xmm2,0x68(%rsp)
call   1080 <sqrt@plt>
xorpd  %xmm1,%xmm1
movsd  0x68(%rsp),%xmm2
movsd  (%rsp),%xmm7
movapd %xmm0,%xmm9
movsd  0x18(%rsp),%xmm3
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm0
divsd  %xmm0,%xmm6
mulsd  %xmm7,%xmm7
addsd  %xmm3,%xmm2
mulsd  %xmm3,%xmm2
ucomisd %xmm1,%xmm2
jb     1473 <pumas_elastic_dcs+0x303>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    14a6 <pumas_elastic_dcs+0x336>
movapd %xmm2,%xmm0
movsd  %xmm6,0x8(%rsp)
movsd  %xmm7,(%rsp)
movsd  %xmm9,0x10(%rsp)
call   1080 <sqrt@plt>
movsd  0x10(%rsp),%xmm9
movsd  (%rsp),%xmm7
movsd  0x8(%rsp),%xmm6
movsd  0x18(%rsp),%xmm3
movsd  0xb52(%rip),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x30(%rsp),%xmm4
movsd  0x40(%rsp),%xmm5
movsd  0x28(%rsp),%xmm8
mulsd  0xb41(%rip),%xmm4
addsd  %xmm3,%xmm2
mulsd  %xmm4,%xmm2
mulsd  0xb39(%rip),%xmm2
mulsd  %xmm0,%xmm9
divsd  %xmm9,%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm2,%xmm7
mulsd  %xmm7,%xmm6
mulsd  %xmm8,%xmm5
subsd  %xmm5,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm1,%xmm0
add    $0xb8,%rsp
ret

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

LLVM IR (-O2):
define double @pumas_elastic_dcs(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca [3 x double]
%9 = alloca [5 x double]
%10 = alloca [2 x double]
%11 = fcmp olt double %0, 1.000000e+00
%12 = fcmp olt double %1, 1.000000e+00
%13 = or i1 %11, %12
%14 = fcmp ole double %2, 0.000000e+00
%15 = or i1 %13, %14
%16 = fcmp ole double %3, 0.000000e+00
%17 = or i1 %15, %16
br i1 %17, label %129, label %18
18: ; preds = %5
%19 = bitcast i32* %6 to i8*
%20 = bitcast double* %7 to i8*
%21 = bitcast [3 x double]* %8 to i8*
%22 = bitcast [5 x double]* %9 to i8*
%23 = bitcast [2 x double]* %10 to i8*
%24 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%25 = call i32 @coulomb_frame_parameters(double %0, double %1, double %2, double %3, double* %7, double* %24)
%26 = load double, double* %7
%27 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%28 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 0
%29 = call i32 @coulomb_screening_parameters(double %0, double %1, double %2, double %3, double %26, i32* %6, double* %27, double* %28)
%30 = call double @coulomb_spin_factor(double %2, double %3)
%31 = call double @cos(double %4)
%32 = call double @sin(double %4)
%33 = load double, double* %24
%34 = fmul double %32, %33
%35 = fmul double %34, %34
%36 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
%37 = load double, double* %36
%38 = fneg double %37
%39 = call double @llvm.fmuladd.f64(double %38, double %37, double 1.000000e+00)
%40 = fmul double %35, %39
%41 = call double @llvm.fmuladd.f64(double %31, double %31, double %40)
%42 = call double @sqrt(double %41)
%43 = call double @llvm.fmuladd.f64(double %31, double %31, double %35)
%44 = load double, double* %36
%45 = fadd double %44, 1.000000e+00
%46 = fsub double %31, %42
%47 = fmul double %31, %46
%48 = call double @llvm.fmuladd.f64(double %35, double %45, double %47)
%49 = fmul double %48, 5.000000e-01
%50 = fdiv double %49, %43
%51 = load double, double* %24
%52 = call double @llvm.fmuladd.f64(double %31, double %44, double %42)
%53 = fmul double %51, %52
%54 = fmul double %53, %53
%55 = fmul double %43, %43
%56 = fmul double %42, %55
%57 = fdiv double %54, %56
%58 = load i32, i32* %6
%59 = add i32 %58, -1
%60 = icmp sgt i32 %58, 1
br i1 %60, label %61, label %102
61: ; preds = %18
%62 = zext i32 %59 to i64
%63 = and i64 %62, 1
%64 = icmp eq i32 %59, 1
br i1 %64, label %89, label %65
65: ; preds = %61
%66 = and i64 %62, 4294967294
br label %67
67: ; preds = %67, %65
%68 = phi i64 [ 0, %65 ], [ %86, %67 ]
%69 = phi double [ 0.000000e+00, %65 ], [ %85, %67 ]
%70 = phi i64 [ 0, %65 ], [ %87, %67 ]
%71 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %68
%72 = load double, double* %71
%73 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %68
%74 = load double, double* %73
%75 = fadd double %50, %74
%76 = fdiv double %72, %75
%77 = fadd double %69, %76
%78 = or i64 %68, 1
%79 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %78
%80 = load double, double* %79
%81 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %78
%82 = load double, double* %81
%83 = fadd double %50, %82
%84 = fdiv double %80, %83
%85 = fadd double %77, %84
%86 = add nuw nsw i64 %68, 2
%87 = add i64 %70, 2
%88 = icmp eq i64 %87, %66
br i1 %88, label %89, label %67
89: ; preds = %67, %61
%90 = phi double [ undef, %61 ], [ %85, %67 ]
%91 = phi i64 [ 0, %61 ], [ %86, %67 ]
%92 = phi double [ 0.000000e+00, %61 ], [ %85, %67 ]
%93 = icmp eq i64 %63, 0
br i1 %93, label %102, label %94
94: ; preds = %89
%95 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %91
%96 = load double, double* %95
%97 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %91
%98 = load double, double* %97
%99 = fadd double %50, %98
%100 = fdiv double %96, %99
%101 = fadd double %92, %100
br label %102
102: ; preds = %94, %89, %18
%103 = phi double [ 0.000000e+00, %18 ], [ %90, %89 ], [ %101, %94 ]
%104 = sext i32 %59 to i64
%105 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %104
%106 = load double, double* %105
%107 = call double @coulomb_nuclear_form_factor(double %50, double %106)
%108 = fmul double %103, %107
%109 = fmul double %108, %108
%110 = load double, double* %7
%111 = call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %110)
%112 = fmul double %110, %111
%113 = call double @sqrt(double %112)
%114 = call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %3)
%115 = fmul double %114, %3
%116 = call double @sqrt(double %115)
%117 = fmul double %0, 0x3F6DE3D42A1ED29D
%118 = fadd double %2, %3
%119 = fmul double %117, %118
%120 = fmul double %119, 0x3CAC7014A3063882
%121 = fmul double %113, %116
%122 = fdiv double %120, %121
%123 = fmul double %122, %122
%124 = fmul double %109, %123
%125 = fmul double %57, %124
%126 = fneg double %30
%127 = call double @llvm.fmuladd.f64(double %126, double %50, double 1.000000e+00)
%128 = fmul double %127, %125
br label %129
129: ; preds = %5, %102
%130 = phi double [ %128, %102 ], [ 0.000000e+00, %5 ]
ret double %130
}