// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Hat.cpp
// Function: Hat::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 <= 1); // order valid for 0, 1

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

	double lm = Hat::lm(a);
	double l0 = Hat::l0(a);
	double lp = Hat::lp(a);

	std::complex<double> A(0, 0);
	A += Talphabetai(alpha, beta, 0, a, delta, order) * std::complex<double>(cos(lm * L2E), -sin(lm * L2E));
	A += Talphabetai(alpha, beta, 1, a, delta, order) * std::complex<double>(cos(l0 * L2E), -sin(l0 * L2E));
	A += Talphabetai(alpha, beta, 2, a, delta, order) * std::complex<double>(cos(lp * L2E), -sin(lp * L2E));

	double P = std::norm(A);
	ProbabilityWarning W(&P);
	return P;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
cmpl $0x3, %edi
jae 0x6f82
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x6fa1
movl %edx, %ebx
movsd %xmm2, 0x38(%rsp)
cmpl $0x2, %edx
jae 0x6fc0
movl %edi, %r14d
leaq 0x5601(%rip), %rax      # 0xc328
mulsd (%rax), %xmm1
mulsd 0x52d5(%rip), %xmm1     # 0xc008
movsd %xmm1, 0x30(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x62c5
leaq 0x5575(%rip), %rax      # 0xc2c0
movsd (%rax), %xmm1
leaq 0xa42a(%rip), %rax      # 0x11180
mulsd (%rax), %xmm1
movsd %xmm0, 0x18(%rsp)
leaq 0xa411(%rip), %rax      # 0x11178
mulsd (%rax), %xmm1
movsd %xmm1, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x6214
movsd %xmm0, 0x28(%rsp)
movl %r14d, %edi
movl %ebp, %esi
xorl %edx, %edx
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movl %ebx, %ecx
callq 0x6ba1
leaq 0x58(%rsp), %r15
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movsd 0x18(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0x2290
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x2060
xorpd 0x5244(%rip), %xmm0     # 0xc020
leaq 0x48(%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, 0x10(%rsp)
addsd %xmm2, %xmm1
movsd %xmm1, 0x18(%rsp)
pushq $0x1
popq %rdx
movl %r14d, %edi
movl %ebp, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movl %ebx, %ecx
callq 0x6ba1
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movsd 0x20(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x2290
movsd %xmm0, 0x40(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x2060
xorpd 0x51b3(%rip), %xmm0     # 0xc020
movsd 0x40(%rsp), %xmm1
movsd %xmm1, (%r12)
movlpd %xmm0, 0x8(%r12)
leaq 0x58(%rsp), %r12
leaq 0x48(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x3719
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
addsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x20(%rsp)
pushq $0x2
popq %rdx
movl %r14d, %edi
movl %ebp, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movl %ebx, %ecx
callq 0x6ba1
movsd %xmm0, (%r12)
movsd %xmm1, 0x8(%r12)
movsd 0x28(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0x2290
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x2060
xorpd 0x511b(%rip), %xmm0     # 0xc020
movsd 0x8(%rsp), %xmm1
movsd %xmm1, (%r15)
movlpd %xmm0, 0x8(%r15)
leaq 0x58(%rsp), %rdi
leaq 0x48(%rsp), %rbx
movq %rbx, %rsi
callq 0x3719
addsd 0x10(%rsp), %xmm0
addsd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
leaq 0x58(%rsp), %rbx
leaq 0x48(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xadac
movsd (%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0xaa7a
movsd 0x8(%rsp), %xmm0
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x51f6(%rip), %rdi      # 0xc17f
leaq 0x572a(%rip), %rsi      # 0xc6ba
leaq 0x57e3(%rip), %rcx      # 0xc77a
movl $0x8b, %edx
callq 0x2100
leaq 0x523c(%rip), %rdi      # 0xc1e4
leaq 0x570b(%rip), %rsi      # 0xc6ba
leaq 0x57c4(%rip), %rcx      # 0xc77a
movl $0x8c, %edx
callq 0x2100
leaq 0x55e7(%rip), %rdi      # 0xc5ae
leaq 0x56ec(%rip), %rsi      # 0xc6ba
leaq 0x57a5(%rip), %rcx      # 0xc77a
movl $0x8d, %edx
callq 0x2100
nop