// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/GF.cpp
// Function: GF::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 L4E = km_per_GeV_to_per_eV2 * LE / 4; // in eV^-2 now

	double Dl21 = Check::Dl21(a, order);
	double Dl31 = Check::Dl31(a, order);
	double Dl32 = Check::Dl32(a, order);

	double Delta21 = Dl21 * L4E;
	double Delta31 = Dl31 * L4E;
	double Delta32 = Dl32 * L4E;

	double deltaalphabeta = alpha == beta ? 1 : 0;

	double C21 = GF::C21(alpha, beta, a, delta, order);
	double C31 = GF::C31(alpha, beta, a, delta, order);
	double C32 = GF::C32(alpha, beta, a, delta, order);
	double D = GF::D(alpha, beta, a, delta, order);

	double P = deltaalphabeta + 4 * C21 * pow(sin(Delta21), 2) + 4 * C31 * pow(sin(Delta31), 2) + 4 * C32 * pow(sin(Delta32), 2)
			+ 8 * D * sin(Delta21) * sin(Delta31) * sin(Delta32);
	ProbabilityWarning W(&P);
	return P;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movsd %xmm2, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
cmpl $0x3, %edi
jae 0x6141
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x6160
movl %edx, %ebx
cmpl $0x2, %edx
jae 0x617f
movl %edi, %r14d
leaq 0x6422(%rip), %rax      # 0xc328
mulsd (%rax), %xmm1
mulsd 0x6426(%rip), %xmm1     # 0xc338
movsd %xmm1, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
movl %ebx, %edi
callq 0x29d7
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
movl %ebx, %edi
callq 0x2a4f
movsd %xmm0, 0x28(%rsp)
movsd 0x8(%rsp), %xmm0
movl %ebx, %edi
callq 0x2ac7
movsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0x20(%rsp)
movsd 0x28(%rsp), %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0x28(%rsp)
mulsd %xmm1, %xmm0
cmpl %ebp, %r14d
movsd %xmm0, 0x48(%rsp)
je 0x5f86
xorpd %xmm0, %xmm0
jmp 0x5f8e
movsd 0x608a(%rip), %xmm0     # 0xc018
movsd %xmm0, 0x40(%rsp)
movl %r14d, %edi
movl %ebp, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl %ebx, %edx
callq 0x593a
movsd %xmm0, 0x30(%rsp)
movl %r14d, %edi
movl %ebp, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl %ebx, %edx
callq 0x5a45
movsd %xmm0, 0x38(%rsp)
movl %r14d, %edi
movl %ebp, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl %ebx, %edx
callq 0x5b72
movsd %xmm0, 0x18(%rsp)
movl %r14d, %edi
movl %ebp, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl %ebx, %edx
callq 0x5c9c
movsd %xmm0, 0x8(%rsp)
movsd 0x30(%rsp), %xmm0
mulsd 0x64f6(%rip), %xmm0     # 0xc510
movsd %xmm0, 0x30(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x2060
mulsd %xmm0, %xmm0
mulsd 0x30(%rsp), %xmm0
addsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x38(%rsp), %xmm0
mulsd 0x64c1(%rip), %xmm0     # 0xc510
movsd %xmm0, 0x38(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x2060
mulsd %xmm0, %xmm0
mulsd 0x38(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
mulsd 0x648c(%rip), %xmm0     # 0xc510
movsd %xmm0, 0x18(%rsp)
movsd 0x48(%rsp), %xmm0
callq 0x2060
mulsd %xmm0, %xmm0
mulsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x645f(%rip), %xmm0     # 0xc518
movsd %xmm0, 0x8(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x2060
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x2060
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x48(%rsp), %xmm0
callq 0x2060
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
leaq 0x50(%rsp), %rbx
movsd %xmm0, (%rbx)
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xadac
movsd (%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
callq 0xaa7a
movsd 0x8(%rsp), %xmm0
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x6037(%rip), %rdi      # 0xc17f
leaq 0x63d1(%rip), %rsi      # 0xc520
leaq 0x6527(%rip), %rcx      # 0xc67d
movl $0x80, %edx
callq 0x2100
leaq 0x607d(%rip), %rdi      # 0xc1e4
leaq 0x63b2(%rip), %rsi      # 0xc520
leaq 0x6508(%rip), %rcx      # 0xc67d
movl $0x81, %edx
callq 0x2100
leaq 0x6428(%rip), %rdi      # 0xc5ae
leaq 0x6393(%rip), %rsi      # 0xc520
leaq 0x64e9(%rip), %rcx      # 0xc67d
movl $0x82, %edx
callq 0x2100
nop