// File: PeterDenton[P]Nu-Pert/src/Figures.cpp
// Function: Figures::Reno50_Matter()
void Reno50_Matter()
{
	std::ofstream data[2];
	data[0].open("data/Reno50_Matter_NO.txt");
	data[1].open("data/Reno50_Matter_IO.txt");

	int alpha = 0;		// electron type
	int beta = 0;		// electron type
	double delta = 0;	// irrelevant
	double Emin = 1.8e-3;	// 1 MeV in GeV
	double Emax = 1.2e-2;	// 10 MeV in GeV
	double L = 52.5;	// 52.5 km

	double LE;
	double Yrho = 2.6 * 0.5;
	double a;
	double P_vac, P_mat, P0_vac, P0_mat, PLWX_vac, PLWX_mat;

	for (int i = 0; i < 2; i++)
	{
		set_ordering(i == 0);
		for (double E = Emin; E < Emax; E += (Emax - Emin) / 2000)
		{
			LE = L / E;
			a = Yrho * E * Y_to_a;

			P_vac = Exact::Palphabeta(alpha, beta, 0, -LE, delta);	// -LE for anti-nus
			P_mat = Exact::Palphabeta(alpha, beta, -a, -LE, delta);	// -a, -LE for anti-nus

			P0_vac = GF::Palphabeta(alpha, beta, 0, -LE, delta, 0);	// -LE for anti-nus
			P0_mat = GF::Palphabeta(alpha, beta, -a, -LE, delta, 0);	// -a, -LE for anti-nus

			PLWX_vac = LWX::Pee(0, LE);	// formulas are already for anti-nus
			PLWX_mat = LWX::Pee(a, LE);	// formulas are already for anti-nus

			data[i] << E << " ";
			data[i] << P_mat - P_vac << " ";
			data[i] << P0_mat - P0_vac << " ";
			data[i] << PLWX_mat - PLWX_vac << " ";
			data[i] << std::endl;
		} // E
		data[i].close();
	} // i, ordering
}

// Assembly:
subq $0x548, %rsp            # imm = 0x548
leaq 0x140(%rsp), %rax
movq %rax, 0x98(%rsp)
movq %rax, %rcx
addq $0x400, %rcx            # imm = 0x400
movq %rcx, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x2260
jmp 0x131e8
movq 0xa0(%rsp), %rcx
movq 0x90(%rsp), %rax
addq $0x200, %rax            # imm = 0x200
cmpq %rcx, %rax
movq %rax, 0xa8(%rsp)
jne 0x131d1
leaq 0x1ceb(%rip), %rsi      # 0x14efd
leaq 0x140(%rsp), %rdi
movl $0x10, %edx
callq 0x2040
jmp 0x13226
leaq 0x340(%rsp), %rdi
leaq 0x1ce2(%rip), %rsi      # 0x14f17
movl $0x10, %edx
callq 0x2040
jmp 0x13241
movl $0x0, 0x130(%rsp)
movl $0x0, 0x12c(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x120(%rsp)
movsd 0x1b45(%rip), %xmm0     # 0x14db0
movsd %xmm0, 0x118(%rsp)
movsd 0x1b2c(%rip), %xmm0     # 0x14da8
movsd %xmm0, 0x110(%rsp)
movsd 0x1b13(%rip), %xmm0     # 0x14da0
movsd %xmm0, 0x108(%rsp)
movsd 0x1afa(%rip), %xmm0     # 0x14d98
movsd %xmm0, 0xf8(%rsp)
movl $0x0, 0xbc(%rsp)
cmpl $0x2, 0xbc(%rsp)
jge 0x13724
movl 0xbc(%rsp), %eax
testl %eax, %eax
sete %al
movzbl %al, %edi
callq 0x49d0
jmp 0x132d6
movsd 0x118(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0xb0(%rsp), %xmm1
movsd 0x110(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x136f1
movsd 0x108(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x100(%rsp)
movsd 0xf8(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm1
mulsd %xmm1, %xmm0
leaq 0xfa0(%rip), %rax       # 0x142e0
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0xf0(%rsp)
movl 0x130(%rsp), %edi
movl 0x12c(%rsp), %esi
movaps 0xcba(%rip), %xmm0      # 0x14020
movsd 0x100(%rsp), %xmm1
pxor %xmm0, %xmm1
movsd 0x120(%rsp), %xmm2
xorps %xmm0, %xmm0
callq 0x6c10
movsd %xmm0, 0x88(%rsp)
jmp 0x1338f
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
movl 0x130(%rsp), %edi
movl 0x12c(%rsp), %esi
movapd 0xc69(%rip), %xmm2      # 0x14020
movsd 0xf0(%rsp), %xmm0
pxor %xmm2, %xmm0
movsd 0x100(%rsp), %xmm1
pxor %xmm2, %xmm1
movsd 0x120(%rsp), %xmm2
callq 0x6c10
movsd %xmm0, 0x80(%rsp)
jmp 0x133ea
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0xe0(%rsp)
movl 0x130(%rsp), %edi
movl 0x12c(%rsp), %esi
movaps 0xc0f(%rip), %xmm0      # 0x14020
movsd 0x100(%rsp), %xmm1
pxor %xmm0, %xmm1
movsd 0x120(%rsp), %xmm2
xorps %xmm0, %xmm0
xorl %edx, %edx
callq 0x8c80
movsd %xmm0, 0x78(%rsp)
jmp 0x13439
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movl 0x130(%rsp), %edi
movl 0x12c(%rsp), %esi
movapd 0xbc2(%rip), %xmm2      # 0x14020
movsd 0xf0(%rsp), %xmm0
pxor %xmm2, %xmm0
movsd 0x100(%rsp), %xmm1
pxor %xmm2, %xmm1
movsd 0x120(%rsp), %xmm2
xorl %edx, %edx
callq 0x8c80
movsd %xmm0, 0x70(%rsp)
jmp 0x13490
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0x100(%rsp), %xmm1
xorps %xmm0, %xmm0
callq 0xc680
movsd %xmm0, 0x68(%rsp)
jmp 0x134b8
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0xf0(%rsp), %xmm0
movsd 0x100(%rsp), %xmm1
callq 0xc680
movsd %xmm0, 0x60(%rsp)
jmp 0x134e6
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0xc0(%rsp)
movslq 0xbc(%rsp), %rax
shlq $0x9, %rax
leaq 0x140(%rsp,%rax), %rdi
movsd 0xb0(%rsp), %xmm0
callq 0x22c0
movq %rax, 0x58(%rsp)
jmp 0x1351e
movq 0x58(%rsp), %rdi
leaq 0x166c(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x13531
movslq 0xbc(%rsp), %rax
shlq $0x9, %rax
leaq 0x140(%rsp,%rax), %rdi
movsd 0xe0(%rsp), %xmm0
movsd 0xe8(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0x22c0
movq %rax, 0x50(%rsp)
jmp 0x13567
movq 0x50(%rsp), %rdi
leaq 0x1623(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x1357a
movslq 0xbc(%rsp), %rax
shlq $0x9, %rax
leaq 0x140(%rsp,%rax), %rdi
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0x22c0
movq %rax, 0x48(%rsp)
jmp 0x135b0
movq 0x48(%rsp), %rdi
leaq 0x15da(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x135c3
movslq 0xbc(%rsp), %rax
shlq $0x9, %rax
leaq 0x140(%rsp,%rax), %rdi
movsd 0xc0(%rsp), %xmm0
movsd 0xc8(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0x22c0
movq %rax, 0x40(%rsp)
jmp 0x135f9
movq 0x40(%rsp), %rdi
leaq 0x1591(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x1360c
movslq 0xbc(%rsp), %rax
shlq $0x9, %rax
leaq 0x140(%rsp,%rax), %rdi
movq 0x59a1(%rip), %rsi      # 0x18fc8
callq 0x2180
jmp 0x1362e
jmp 0x13630
movsd 0x110(%rsp), %xmm0
subsd 0x118(%rsp), %xmm0
movsd 0x176e(%rip), %xmm1     # 0x14db8
divsd %xmm1, %xmm0
addsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
jmp 0x132e8
movq 0x98(%rsp), %rcx
movq %rax, %rsi
movq 0x90(%rsp), %rax
movq %rsi, 0x138(%rsp)
movl %edx, 0x134(%rsp)
cmpq %rax, %rcx
movq %rax, 0x38(%rsp)
je 0x136be
movq 0x38(%rsp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
movq %rdi, 0x30(%rsp)
callq 0x2220
movq 0x98(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x38(%rsp)
jne 0x13691
jmp 0x13798
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0x400, %rax            # imm = 0x400
movq %rax, 0x28(%rsp)
jmp 0x1376e
movslq 0xbc(%rsp), %rax
shlq $0x9, %rax
leaq 0x140(%rsp,%rax), %rdi
callq 0x2210
jmp 0x1370c
jmp 0x1370e
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x132b2
leaq 0x140(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x400, %rax            # imm = 0x400
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
movq %rdi, 0x8(%rsp)
callq 0x2220
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x1373c
addq $0x548, %rsp            # imm = 0x548
retq
movq 0x28(%rsp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
movq %rdi, (%rsp)
callq 0x2220
movq 0x20(%rsp), %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x1376e
jmp 0x13798
movq 0x138(%rsp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)