// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Mixed.cpp
// Function: Mixed::Palphabeta(int, int, double, double, double, int)
double Palphabeta(int alpha, int beta, double a, double LE, double delta, int order)
{
	assert (alpha >= 0 && alpha <= 2); // alpha valid for 0, 1, 2
	assert (beta >= 0 && beta <= 2); // beta valid for 0, 1, 2
	assert (order >= 0 && order <= 2); // order 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, order) * std::complex<double>(cos(Check::l1(a, order) * L2E), -sin(Check::l1(a, order) * L2E));
	A += Talphabetai(alpha, beta, 1, a, delta, order) * std::complex<double>(cos(Check::l2(a, order) * L2E), -sin(Check::l2(a, order) * L2E));
	A += Talphabetai(alpha, beta, 2, a, delta, order) * std::complex<double>(cos(Check::l3(a, order) * L2E), -sin(Check::l3(a, order) * L2E));

	return std::norm(A);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
cmpl $0x3, %edi
jae 0x9c80
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x9c9d
movl %edx, %ebx
cmpl $0x3, %edx
jae 0x9cbc
movl %edi, %r14d
leaq 0x28ac(%rip), %rax      # 0xc328
mulsd (%rax), %xmm1
mulsd 0x2580(%rip), %xmm1     # 0xc008
movsd %xmm1, 0x8(%rsp)
movl %ebp, %esi
xorl %edx, %edx
movsd %xmm0, (%rsp)
movapd %xmm2, %xmm1
movl %ebx, %ecx
movsd %xmm2, 0x18(%rsp)
callq 0x9935
leaq 0x40(%rsp), %r15
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movsd (%rsp), %xmm0
movl %ebx, %edi
callq 0x250c
mulsd 0x8(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
movl %ebx, %edi
callq 0x250c
mulsd 0x8(%rsp), %xmm0
callq 0x2060
xorpd 0x252c(%rip), %xmm0     # 0xc020
leaq 0x30(%rsp), %r12
movsd 0x10(%rsp), %xmm1
movsd %xmm1, (%r12)
movlpd %xmm0, 0x8(%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3719
xorpd %xmm2, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rsp)
addsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
pushq $0x1
popq %rdx
movl %r14d, %edi
movl %ebp, %esi
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl %ebx, %ecx
callq 0x9935
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movsd (%rsp), %xmm0
movl %ebx, %edi
callq 0x26bf
mulsd 0x8(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x28(%rsp)
movsd (%rsp), %xmm0
movl %ebx, %edi
callq 0x26bf
mulsd 0x8(%rsp), %xmm0
callq 0x2060
xorpd 0x2490(%rip), %xmm0     # 0xc020
movsd 0x28(%rsp), %xmm1
movsd %xmm1, (%r12)
movlpd %xmm0, 0x8(%r12)
leaq 0x40(%rsp), %r12
leaq 0x30(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x3719
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
pushq $0x2
popq %rdx
movl %r14d, %edi
movl %ebp, %esi
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl %ebx, %ecx
callq 0x9935
movsd %xmm0, (%r12)
movsd %xmm1, 0x8(%r12)
movsd (%rsp), %xmm0
movl %ebx, %edi
callq 0x286e
mulsd 0x8(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x18(%rsp)
movsd (%rsp), %xmm0
movl %ebx, %edi
callq 0x286e
mulsd 0x8(%rsp), %xmm0
callq 0x2060
xorpd 0x23e9(%rip), %xmm0     # 0xc020
movsd 0x18(%rsp), %xmm1
movsd %xmm1, (%r15)
movlpd %xmm0, 0x8(%r15)
leaq 0x40(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3719
addsd 0x20(%rsp), %xmm0
movsd 0x10(%rsp), %xmm2
addsd %xmm1, %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24f8(%rip), %rdi      # 0xc17f
leaq 0x2eb2(%rip), %rsi      # 0xcb40
leaq 0x2f05(%rip), %rcx      # 0xcb9a
pushq $0x7f
popq %rdx
callq 0x2100
leaq 0x2540(%rip), %rdi      # 0xc1e4
leaq 0x2e95(%rip), %rsi      # 0xcb40
leaq 0x2ee8(%rip), %rcx      # 0xcb9a
movl $0x80, %edx
callq 0x2100
leaq 0x236d(%rip), %rdi      # 0xc030
leaq 0x2e76(%rip), %rsi      # 0xcb40
leaq 0x2ec9(%rip), %rcx      # 0xcb9a
movl $0x81, %edx
callq 0x2100
nop