// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Hyperbolas.cpp
// Function: Hyperbolas::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(Hyperbolas::l1(a) * L2E), -sin(Hyperbolas::l1(a) * L2E));
	A += Talphabetai(alpha, beta, 1, a, delta) * std::complex<double>(cos(Hyperbolas::l2(a) * L2E), -sin(Hyperbolas::l2(a) * L2E));
	A += Talphabetai(alpha, beta, 2, a, delta) * std::complex<double>(cos(Hyperbolas::l3(a) * L2E), -sin(Hyperbolas::l3(a) * L2E));

	return std::norm(A);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
cmpl $0x3, %edi
jae 0x7fd6
movl %esi, %ebx
cmpl $0x3, %esi
jae 0x7ff5
movl %edi, %ebp
leaq 0x4543(%rip), %rax      # 0xc328
mulsd (%rax), %xmm1
mulsd 0x4217(%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 0x7ca0
leaq 0x48(%rsp), %r14
movsd %xmm0, (%r14)
movsd %xmm1, 0x8(%r14)
movsd 0x8(%rsp), %xmm0
callq 0x703e
mulsd 0x10(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x703e
mulsd 0x10(%rsp), %xmm0
callq 0x2060
xorpd 0x41c6(%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 0x7ca0
movsd %xmm0, (%r14)
movsd %xmm1, 0x8(%r14)
movsd 0x8(%rsp), %xmm0
callq 0x70d6
mulsd 0x10(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x70d6
mulsd 0x10(%rsp), %xmm0
callq 0x2060
xorpd 0x4130(%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 0x7ca0
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movsd 0x8(%rsp), %xmm0
callq 0x71fc
mulsd 0x10(%rsp), %xmm0
callq 0x2290
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x71fc
mulsd 0x10(%rsp), %xmm0
callq 0x2060
xorpd 0x4091(%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 0x41a2(%rip), %rdi      # 0xc17f
leaq 0x47d4(%rip), %rsi      # 0xc7b8
leaq 0x482c(%rip), %rcx      # 0xc817
movl $0xb1, %edx
callq 0x2100
leaq 0x41e8(%rip), %rdi      # 0xc1e4
leaq 0x47b5(%rip), %rsi      # 0xc7b8
leaq 0x480d(%rip), %rcx      # 0xc817
movl $0xb2, %edx
callq 0x2100