#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 dcs_photonuclear_f2a_BM(double, double, double const, double const,
                               double);
double dcs_photonuclear_shadowing_BM(double, double, double const, double);
double dcs_photonuclear_d2_BM(double Z, double A, double ml, double K, double q,
                              double Q2) {
  const double cf = 4 * 3.14159265358979323846 * 7.2973525693E-03 *
                    7.2973525693E-03 * 1.973269804E-16 * 1.973269804E-16;
  const double M = 0.5 * (0.938272 + 0.939565);
  const double E = K + ml;
  const double y = q / E;
  const double x = 0.5 * Q2 / (M * q);
  const double shadowing = dcs_photonuclear_shadowing_BM(Z, A, x, q);
  const double F2A = dcs_photonuclear_f2a_BM(Z, A, shadowing, x, Q2);
  const double R = 0.25;
  const double dds =
      (1 - y +
       0.5 * (1 - 2 * ml * ml / Q2) * (y * y + Q2 / (E * E)) / (1 + R)) /
          (Q2 * Q2) -
      0.25 / (E * E * Q2);
  return cf * F2A * dds / q;
}


x86 assembly (clang, -O0):
<dcs_photonuclear_d2_BM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe8f(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1030 <dcs_photonuclear_shadowing_BM@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1040 <dcs_photonuclear_f2a_BM@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  0xe1b(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe26(%rip),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  0xe21(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xe02(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0xdee(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm5
mulsd  -0x48(%rbp),%xmm5
divsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdb1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  -0x48(%rbp),%xmm2
mulsd  -0x30(%rbp),%xmm2
movsd  0xd7c(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xd5f(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcs_photonuclear_d2_BM>:
sub    $0x68,%rsp
movapd %xmm5,0x20(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
addsd  %xmm2,%xmm3
movapd %xmm3,0x50(%rsp)
movapd %xmm4,%xmm2
divsd  %xmm3,%xmm2
movapd %xmm2,0x40(%rsp)
mulsd  0xea5(%rip),%xmm5
movsd  0xea5(%rip),%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm4,%xmm3
movsd  %xmm4,0x18(%rsp)
divsd  %xmm2,%xmm5
movapd %xmm5,0x30(%rsp)
movapd %xmm5,%xmm2
call   1030 <dcs_photonuclear_shadowing_BM@plt>
movaps %xmm0,%xmm2
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movaps 0x30(%rsp),%xmm3
movaps 0x20(%rsp),%xmm4
call   1040 <dcs_photonuclear_f2a_BM@plt>
movsd  0xe67(%rip),%xmm1
movapd %xmm1,%xmm2
movapd 0x40(%rsp),%xmm4
subsd  %xmm4,%xmm2
movsd  0x10(%rsp),%xmm5
movapd %xmm5,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm5,%xmm3
movapd 0x20(%rsp),%xmm6
divsd  %xmm6,%xmm3
subsd  %xmm3,%xmm1
mulsd  0xe21(%rip),%xmm1
movapd 0x50(%rsp),%xmm5
mulsd  %xmm5,%xmm5
movapd %xmm6,%xmm3
divsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm1,%xmm4
divsd  0xe13(%rip),%xmm4
addsd  %xmm2,%xmm4
movapd %xmm6,%xmm2
movapd %xmm6,%xmm1
unpcklpd %xmm6,%xmm1
unpcklpd %xmm5,%xmm2
shufpd $0x2,0xe0e(%rip),%xmm4
mulpd  %xmm1,%xmm2
divpd  %xmm2,%xmm4
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
subsd  %xmm1,%xmm4
mulsd  0xde2(%rip),%xmm0
mulsd  %xmm4,%xmm0
divsd  0x18(%rsp),%xmm0
add    $0x68,%rsp
ret

LLVM IR (-O0):
define double @dcs_photonuclear_d2_BM(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = 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
store double %5, double* %12
store double 0x38C15141CD9A8F5A, double* %13
store double 0x3FEE0B9ECF638002, double* %14
%22 = load double, double* %10
%23 = load double, double* %9
%24 = fadd double %22, %23
store double %24, double* %15
%25 = load double, double* %11
%26 = load double, double* %15
%27 = fdiv double %25, %26
store double %27, double* %16
%28 = load double, double* %12
%29 = fmul double 5.000000e-01, %28
%30 = load double, double* %11
%31 = fmul double 0x3FEE0B9ECF638002, %30
%32 = fdiv double %29, %31
store double %32, double* %17
%33 = load double, double* %7
%34 = load double, double* %8
%35 = load double, double* %17
%36 = load double, double* %11
%37 = call double @dcs_photonuclear_shadowing_BM(double %33, double %34, double %35, double %36)
store double %37, double* %18
%38 = load double, double* %7
%39 = load double, double* %8
%40 = load double, double* %18
%41 = load double, double* %17
%42 = load double, double* %12
%43 = call double @dcs_photonuclear_f2a_BM(double %38, double %39, double %40, double %41, double %42)
store double %43, double* %19
store double 2.500000e-01, double* %20
%44 = load double, double* %16
%45 = fsub double 1.000000e+00, %44
%46 = load double, double* %9
%47 = fmul double 2.000000e+00, %46
%48 = load double, double* %9
%49 = fmul double %47, %48
%50 = load double, double* %12
%51 = fdiv double %49, %50
%52 = fsub double 1.000000e+00, %51
%53 = fmul double 5.000000e-01, %52
%54 = load double, double* %16
%55 = load double, double* %16
%56 = load double, double* %12
%57 = load double, double* %15
%58 = load double, double* %15
%59 = fmul double %57, %58
%60 = fdiv double %56, %59
%61 = call double @llvm.fmuladd.f64(double %54, double %55, double %60)
%62 = fmul double %53, %61
%63 = fdiv double %62, 1.250000e+00
%64 = fadd double %45, %63
%65 = load double, double* %12
%66 = load double, double* %12
%67 = fmul double %65, %66
%68 = fdiv double %64, %67
%69 = load double, double* %15
%70 = load double, double* %15
%71 = fmul double %69, %70
%72 = load double, double* %12
%73 = fmul double %71, %72
%74 = fdiv double 2.500000e-01, %73
%75 = fsub double %68, %74
store double %75, double* %21
%76 = load double, double* %19
%77 = fmul double 0x38C15141CD9A8F5A, %76
%78 = load double, double* %21
%79 = fmul double %77, %78
%80 = load double, double* %11
%81 = fdiv double %79, %80
ret double %81
}

LLVM IR (-O2):
define double @dcs_photonuclear_d2_BM(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fadd double %2, %3
%8 = fdiv double %4, %7
%9 = fmul double %5, 5.000000e-01
%10 = fmul double %4, 0x3FEE0B9ECF638002
%11 = fdiv double %9, %10
%12 = tail call double @dcs_photonuclear_shadowing_BM(double %0, double %1, double %11, double %4)
%13 = tail call double @dcs_photonuclear_f2a_BM(double %0, double %1, double %12, double %11, double %5)
%14 = fsub double 1.000000e+00, %8
%15 = fmul double %2, 2.000000e+00
%16 = fmul double %15, %2
%17 = fdiv double %16, %5
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %18, 5.000000e-01
%20 = fmul double %7, %7
%21 = fdiv double %5, %20
%22 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %21)
%23 = fmul double %22, %19
%24 = fdiv double %23, 1.250000e+00
%25 = fadd double %14, %24
%26 = insertelement <2 x double> poison, double %5, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = insertelement <2 x double> %26, double %20, i64 1
%29 = fmul <2 x double> %27, %28
%30 = insertelement <2 x double> <double poison, double 2.500000e-01>, double %25, i64 0
%31 = fdiv <2 x double> %30, %29
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%33 = fsub <2 x double> %31, %32
%34 = extractelement <2 x double> %33, i64 0
%35 = fmul double %13, 0x38C15141CD9A8F5A
%36 = fmul double %34, %35
%37 = fdiv double %36, %4
ret double %37
}