// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Hat.cpp
// Function: Hat::Pemu(double, double, double)
double Pemu(double a, double LE, double delta)
{
	double L4E = km_per_GeV_to_per_eV2 * LE / 4; // in eV^-2 now

	double Dlpm = lp(a) - lm(a);
	double Dlp0 = lp(a) - l0(a);
	double Dlm0 = lm(a) - l0(a);

	double Deltapm = Dlpm * L4E;
	double Deltap0 = Dlp0 * L4E;
	double Deltam0 = Dlm0 * L4E;

	double A = s23sq * pow(sin(2 * t13), 2) + 4 * eps * Jr * cos(delta) * (Dlpm - (Dmsqee - a)) / Dlp0;
	double B = 8 * eps * Jr * pow(Dmsqee, 3) / (Dlpm * Dlp0 * Dlm0);
	double C = sin(Deltapm) * sin(Deltam0) * cos(delta - Deltap0);

	double P = A * pow(Dmsqee * sin(Deltapm) / Dlpm, 2) + B * C;
	ProbabilityWarning W(&P);
	return P;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xe0, %rsp
movsd %xmm2, 0x48(%rsp)
movsd %xmm0, (%rsp)
leaq 0x5d79(%rip), %rax      # 0xc328
mulsd (%rax), %xmm1
mulsd 0x5d7d(%rip), %xmm1     # 0xc338
movsd %xmm1, 0x28(%rsp)
callq 0x6214
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
callq 0x62c5
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd (%rsp), %xmm0
callq 0x6214
movaps %xmm0, 0x10(%rsp)
leaq 0x5cc4(%rip), %r15      # 0xc2c0
leaq 0xab7d(%rip), %r14      # 0x11180
leaq 0xab6e(%rip), %rbx      # 0x11178
movsd (%r14), %xmm0
movaps %xmm0, 0x50(%rsp)
movsd (%rbx), %xmm0
movaps %xmm0, 0x30(%rsp)
movsd (%rsp), %xmm0
callq 0x62c5
movsd (%r15), %xmm1
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movapd 0x50(%rsp), %xmm2
movhpd (%r14), %xmm2           # xmm2 = xmm2[0],mem[0]
mulpd %xmm1, %xmm2
movapd 0x30(%rsp), %xmm1
movhpd (%rbx), %xmm1           # xmm1 = xmm1[0],mem[0]
mulpd %xmm2, %xmm1
movapd %xmm1, %xmm2
movapd 0x10(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
subpd %xmm2, %xmm1
movapd %xmm1, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
movapd %xmm0, %xmm2
mulsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x50(%rsp)
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0x78(%rsp)
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
movapd %xmm1, 0x80(%rsp)
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x5bf9(%rip), %r15      # 0xc2a0
leaq 0x5c6a(%rip), %rax      # 0xc318
movsd (%rax), %xmm0
addsd %xmm0, %xmm0
callq 0x2060
movsd (%r14), %xmm1
mulsd 0x5e48(%rip), %xmm1     # 0xc510
mulsd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x5c47(%rip), %rax      # 0xc320
movsd (%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
mulsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rsp)
movsd 0x48(%rsp), %xmm0
callq 0x2290
mulsd 0x68(%rsp), %xmm0
movsd (%rbx), %xmm2
movapd %xmm2, %xmm1
subsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm3
subsd %xmm1, %xmm3
mulsd %xmm0, %xmm3
divsd 0x10(%rsp), %xmm3
movsd 0x30(%rsp), %xmm0
mulsd (%r15), %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd (%r14), %xmm0
mulsd 0x5dd7(%rip), %xmm0     # 0xc518
mulsd 0x70(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x5bf4(%rip), %xmm1     # 0xc348
movapd %xmm2, %xmm0
callq 0x2270
movapd %xmm0, %xmm1
mulsd (%rsp), %xmm1
movapd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
mulsd 0x80(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd 0x50(%rsp), %xmm0
callq 0x2060
movsd %xmm0, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x2060
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x48(%rsp), %xmm0
subsd 0x78(%rsp), %xmm0
callq 0x2290
mulsd 0x10(%rsp), %xmm0
mulsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd (%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x50(%rsp), %xmm0
callq 0x2060
mulsd 0x10(%rsp), %xmm0
divsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm0
mulsd 0x30(%rsp), %xmm0
addsd (%rsp), %xmm0
leaq 0x90(%rsp), %rbx
movsd %xmm0, (%rbx)
leaq 0x98(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xadac
movsd (%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
callq 0xaa7a
movsd 0x8(%rsp), %xmm0
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %r15
retq