// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Exact.cpp
// Function: Exact::Palphabeta(int, int, double, double, double)
double Palphabeta(int alpha, int beta, double a, double LE, double delta)
{
	assert (alpha >= 0 && alpha <= 2); // alpha valid for 0, 1, 2
	assert (beta >= 0 && beta <= 2); // beta valid for 0, 1, 2

	double L2E = km_per_GeV_to_per_eV2 * LE / 2; // in eV^-2 now

	// See eq. 4.0.1 or eq. 3.12 in arXiv:1505.01826
	std::complex<double> A(0, 0);
	A += Talphabetai(alpha, beta, 0, a, delta) * std::complex<double>(cos(M1sq(a) * L2E), -sin(M1sq(a) * L2E));
	A += Talphabetai(alpha, beta, 1, a, delta) * std::complex<double>(cos(M2sq(a) * L2E), -sin(M2sq(a) * L2E));
	A += Talphabetai(alpha, beta, 2, a, delta) * std::complex<double>(cos(M3sq(a) * L2E), -sin(M3sq(a) * L2E));

	return std::norm(A);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
cmpl $0x3, %edi
jae 0x5068
movl %esi, %ebx
cmpl $0x3, %esi
jae 0x5087
movl %edi, %ebp
leaq 0x74b1(%rip), %rax      # 0xc328
mulsd (%rax), %xmm1
mulsd 0x7185(%rip), %xmm1     # 0xc008
movsd %xmm1, 0x10(%rsp)
movl %ebx, %esi
xorl %edx, %edx
movsd %xmm0, 0x8(%rsp)
movapd %xmm2, %xmm1
movsd %xmm2, 0x20(%rsp)
callq 0x4d32
leaq 0x48(%rsp), %r14
movsd %xmm0, (%r14)
movsd %xmm1, 0x8(%r14)
movsd 0x8(%rsp), %xmm0
callq 0x424f
mulsd 0x10(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x424f
mulsd 0x10(%rsp), %xmm0
callq 0x2060
xorpd 0x7134(%rip), %xmm0     # 0xc020
leaq 0x38(%rsp), %r15
movsd 0x18(%rsp), %xmm1
movsd %xmm1, (%r15)
movlpd %xmm0, 0x8(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3719
xorpd %xmm2, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0x28(%rsp)
addsd %xmm1, %xmm2
movsd %xmm2, 0x18(%rsp)
pushq $0x1
popq %rdx
movl %ebp, %edi
movl %ebx, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
callq 0x4d32
movsd %xmm0, (%r14)
movsd %xmm1, 0x8(%r14)
movsd 0x8(%rsp), %xmm0
callq 0x4264
mulsd 0x10(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4264
mulsd 0x10(%rsp), %xmm0
callq 0x2060
xorpd 0x709e(%rip), %xmm0     # 0xc020
movsd 0x30(%rsp), %xmm1
movsd %xmm1, (%r15)
movlpd %xmm0, 0x8(%r15)
leaq 0x48(%rsp), %r15
leaq 0x38(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x3719
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
pushq $0x2
popq %rdx
movl %ebp, %edi
movl %ebx, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
callq 0x4d32
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movsd 0x8(%rsp), %xmm0
callq 0x4279
mulsd 0x10(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4279
mulsd 0x10(%rsp), %xmm0
callq 0x2060
xorpd 0x6fff(%rip), %xmm0     # 0xc020
movsd 0x20(%rsp), %xmm1
movsd %xmm1, (%r14)
movlpd %xmm0, 0x8(%r14)
leaq 0x48(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x3719
addsd 0x28(%rsp), %xmm0
movsd 0x18(%rsp), %xmm2
addsd %xmm1, %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7110(%rip), %rdi      # 0xc17f
leaq 0x731a(%rip), %rsi      # 0xc390
leaq 0x7368(%rip), %rcx      # 0xc3e5
movl $0xd2, %edx
callq 0x2100
leaq 0x7156(%rip), %rdi      # 0xc1e4
leaq 0x72fb(%rip), %rsi      # 0xc390
leaq 0x7349(%rip), %rcx      # 0xc3e5
movl $0xd3, %edx
callq 0x2100
nop