// File: 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:
subq $0x118, %rsp            # imm = 0x118
movsd %xmm0, 0x110(%rsp)
movsd %xmm1, 0x108(%rsp)
movsd %xmm2, 0x100(%rsp)
leaq 0x8b8f(%rip), %rax      # 0x122d8
movsd (%rax), %xmm0
mulsd 0x108(%rsp), %xmm0
movsd 0x8b8a(%rip), %xmm1     # 0x122e8
divsd %xmm1, %xmm0
movsd %xmm0, 0xf8(%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x92a0
movsd %xmm0, (%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x9380
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xf0(%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x92a0
movsd %xmm0, 0x8(%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x9530
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x9380
movsd %xmm0, 0x10(%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x9530
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0xf0(%rsp), %xmm0
mulsd 0xf8(%rsp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0xe8(%rsp), %xmm0
mulsd 0xf8(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xe0(%rsp), %xmm0
mulsd 0xf8(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
leaq 0x8a37(%rip), %rax      # 0x122a0
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x878d(%rip), %xmm0     # 0x12008
leaq 0xd96e(%rip), %rax      # 0x171f0
mulsd (%rax), %xmm0
callq 0x2060
movsd 0x8775(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x20(%rsp)
movsd 0x8a42(%rip), %xmm0     # 0x122e8
leaq 0xd95b(%rip), %rax      # 0x17208
mulsd (%rax), %xmm0
leaq 0xd940(%rip), %rax      # 0x171f8
mulsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x100(%rsp), %xmm0
callq 0x22d0
movsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x28(%rsp), %xmm0
mulsd %xmm3, %xmm1
movsd 0xf0(%rsp), %xmm3
leaq 0xd907(%rip), %rax      # 0x17200
movsd (%rax), %xmm4
subsd 0x110(%rsp), %xmm4
subsd %xmm4, %xmm3
mulsd %xmm3, %xmm1
divsd 0xe8(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0x8b68(%rip), %xmm0     # 0x12498
leaq 0xd8d1(%rip), %rax      # 0x17208
mulsd (%rax), %xmm0
leaq 0xd8b6(%rip), %rax      # 0x171f8
mulsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0xd8ad(%rip), %rax      # 0x17200
movsd (%rax), %xmm0
movsd 0x8991(%rip), %xmm1     # 0x122f0
callq 0x22a0
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd 0xf0(%rsp), %xmm1
mulsd 0xe8(%rsp), %xmm1
mulsd 0xe0(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0xd8(%rsp), %xmm0
callq 0x2060
movsd %xmm0, 0x38(%rsp)
movsd 0xc8(%rsp), %xmm0
callq 0x2060
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x100(%rsp), %xmm0
subsd 0xd0(%rsp), %xmm0
callq 0x22d0
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
leaq 0xd7ef(%rip), %rax      # 0x17200
movsd (%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0xd8(%rsp), %xmm0
callq 0x2060
movaps %xmm0, %xmm1
movsd 0x48(%rsp), %xmm0
mulsd %xmm1, %xmm0
divsd 0xf0(%rsp), %xmm0
movsd 0x85c1(%rip), %xmm1     # 0x12008
callq 0x22a0
movaps %xmm0, %xmm2
movsd 0x50(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
mulsd 0xb0(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x110a0
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x47e0
movsd 0x58(%rsp), %xmm0
addq $0x118, %rsp            # imm = 0x118
retq
nopw %cs:(%rax,%rax)