// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/viterbi.cpp
// Function: fwdbck(std::vector<std::vector<bool, std::allocator<bool>>, std::allocator<std::vector<bool, std::allocator<bool>>>> const&, std::vector<double, std::allocator<double>> const&, int, parameters const&, std::vector<int, std::allocator<int>>&, std::vector<double, std::allocator<double>>&)
void fwdbck(const vector<vector<bool> > &haps, const vector<double> &map, int indv_idx, const parameters &params, vector<int> &out_path, vector<double> &out_prob)
{
	int N_hap = haps.size()-1;	// The minus 1 accounts for the current haplotype.
	int N_pos = haps[0].size();

	vector<vector<double> > f(N_pos, vector<double>(N_hap, -numeric_limits<double>::max()));	// Lots of memory used here
	vector<vector<double> > b(N_pos, vector<double>(N_hap, -numeric_limits<double>::max()));	// Lots of memory used here

	double em_match = log(1.0 - params.p_error);
	double em_mismatch = max(log(params.p_error), -9999.9);

	vector<int> f_idx_to_hap_idx(N_hap);
	int idx_i=0;
	for (int i=0; i<haps.size(); i++)
	{
		if (i == indv_idx)
			continue;
		f_idx_to_hap_idx[idx_i] = i;

		if (haps[indv_idx][0] == haps[i][0])
			f[0][idx_i] = em_match - log(N_hap);
		else
			f[0][idx_i] = em_mismatch - log(N_hap);

		idx_i++;
	}

	for (int i=1; i < N_pos; i++)
	{
		bool allele = haps[indv_idx][i];
		double rho = 4.0*params.Ne*((map[i] - map[i-1])/100.0);

		double tmp = exp(-rho / N_hap);
		double p_rec = (1.0-tmp) / N_hap;
		double p_no_rec = tmp + p_rec;

		p_rec = log(p_rec);
		p_no_rec = log(p_no_rec);

		for (int j=0; j < N_hap; j++)	// Could parallelize this loop?
		{
			vector<double> tmp(N_hap, -numeric_limits<double>::max());
			double m=-numeric_limits<double>::max();
			for (int k=0; k<N_hap; k++)
			{
				if (j == k)
					tmp[k] = p_no_rec + f[i-1][k];
				else
					tmp[k] = p_rec + f[i-1][k];
				m = max(m, tmp[k]);
			}

			double s = 0;
			for (int k=0; k<N_hap; k++)
				s += exp(tmp[k] - m);
			s = log(s);
			s += m;

			if (haps[ f_idx_to_hap_idx[j] ][i] == allele)
				f[i][j] = s + em_match;
			else
				f[i][j] = s + em_mismatch;
		}

		if ((i % 100) == 0)
		{
			LOG.printLOG(output_log::dbl2str(double(i)/N_pos*100, 3) + "%\n");
		}
	}

	{
		double m=-numeric_limits<double>::max();
		for (int k=0; k<N_hap; k++)
			m = max(m, f[N_pos-1][k]);
		double post = 0;
		for (int k=0; k<N_hap; k++)
			post += exp(f[N_pos-1][k] - m);
		post = log(post);
		post += m;
		LOG.printLOG("Fwd posterior: " + LOG.dbl2str(post, 3) + "\n");
	}

	for (int i=0; i<b[0].size(); i++)
	{
		b[N_pos-1][i] = -log(N_hap);
	}

	for (int i=N_pos-2; i > -1; i--)
	{
		bool allele = haps[indv_idx][i+1];
		double rho = 4.0*params.Ne*((map[i+1] - map[i])/100.0);

		double tmp = exp(-rho / N_hap);
		double p_rec = (1.0-tmp) / N_hap;
		double p_no_rec = tmp + p_rec;

		p_rec = log(p_rec);
		p_no_rec = log(p_no_rec);

		for (int j=0; j < N_hap; j++)	// Could parallelize this loop?
		{
			vector<double> tmp(N_hap, -numeric_limits<double>::max());
			double m=-numeric_limits<double>::max();
			for (int k=0; k<N_hap; k++)
			{
				tmp[k] = em_mismatch;
				if (haps[ f_idx_to_hap_idx[k] ][i+1] == allele)
					tmp[k] = em_match;

				if (j == k)
					tmp[k] += p_no_rec + b[i+1][k];
				else
					tmp[k] += p_rec + b[i+1][k];

				m = max(m, tmp[k]);
			}

			double s = 0;
			for (int k=0; k<N_hap; k++)
				s += exp(tmp[k] - m);
			s = log(s);
			s += m;

			b[i][j] = s;
		}

		if ((i % 100) == 0)
		{
			LOG.printLOG(output_log::dbl2str(double(i)/N_pos*100, 3) + "%\n");
		}
	}

	{
		bool allele = haps[indv_idx][0];
		double m=-numeric_limits<double>::max();
		for (int k=0; k<N_hap; k++)
		{
			if (haps[ f_idx_to_hap_idx[k] ][0] == allele)
				m = max(m, b[0][k] + em_match);
			else
				m = max(m, b[0][k] + em_mismatch);
		}
		double post = 0;
		for (int k=0; k<N_hap; k++)
		{
			if (haps[ f_idx_to_hap_idx[k] ][0] == allele)
				post += exp((b[0][k] + em_match) - m);
			else
				post += exp((b[0][k] + em_mismatch) - m);
		}
		post = log(post);
		post += m;
		LOG.printLOG("Bwd posterior: " + LOG.dbl2str(post, 3) + "\n");
	}

	out_path.resize(N_pos, 0);
	out_prob.resize(N_pos,0);
	for (int i=0; i<N_pos; i++)
	{
		vector<double> post(N_hap, -numeric_limits<double>::max());
		double m = -numeric_limits<double>::max();
		int m_idx = 0;
		for (int j=0; j<N_hap; j++)
		{
			post[j] = f[i][j] + b[i][j];
			if (post[j] > m)
			{
				m = post[j];
				m_idx = j;
			}
		}
		double sum = 0;
		for (int j=0; j<N_hap; j++)
		{
			post[j] = exp(post[j] - m);
			sum += post[j];
		}
		for (int j=0; j<N_hap; j++)
			post[j] /= sum;

		out_path[i] = f_idx_to_hap_idx[m_idx];
		out_prob[i] = post[m_idx];
	}


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %r9, 0x108(%rsp)
movq %r8, 0x100(%rsp)
movq %rcx, 0x78(%rsp)
movl %edx, %ebx
movq %rsi, 0x110(%rsp)
movq (%rdi), %rcx
movq %rdi, 0x40(%rsp)
movq 0x8(%rdi), %rax
subq %rcx, %rax
pushq $0x28
popq %r13
cqto
idivq %r13
decl %eax
movq 0x10(%rcx), %r14
movl 0x18(%rcx), %r15d
subq (%rcx), %r14
movq %rax, 0x70(%rsp)
movslq %eax, %rsi
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
leaq 0xa8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xe0(%rsp), %rcx
movq %rsi, 0x48(%rsp)
callq 0x97b0
leaq (%r15,%r14,8), %rax
movq %rax, 0x60(%rsp)
movslq %eax, %r14
leaq 0x118(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %r14, %rsi
callq 0x9806
leaq 0x20(%rsp), %rdi
callq 0xa19c
leaq 0xa8(%rsp), %rdx
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
movq %rax, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xc8(%rsp), %rcx
movq 0x48(%rsp), %rsi
callq 0x97b0
leaq 0xe0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x9806
movq %r14, 0x130(%rsp)
leaq 0x20(%rsp), %rdi
callq 0xa19c
movsd 0x26743(%rip), %xmm0    # 0x2d018
movq 0x78(%rsp), %r14
subsd 0x520(%r14), %xmm0
callq 0x53a0
movsd %xmm0, 0x50(%rsp)
movsd 0x520(%r14), %xmm0
callq 0x53a0
movsd %xmm0, 0x8(%rsp)
leaq 0xc8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movq 0x48(%rsp), %rsi
callq 0x985c
movq 0x60(%rsp), %rax
shlq $0x20, %rax
movq %rax, 0x138(%rsp)
movsd 0x266ee(%rip), %xmm0    # 0x2d020
maxsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movslq %ebx, %rax
movl %eax, %r15d
xorl %r12d, %r12d
imulq $0x28, %rax, %rax
movq %rax, 0x80(%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x40(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rax
subq %rdi, %rax
cqto
idivq %r13
cmpq %rbp, %rax
jbe 0x69e8
cmpq %rbp, %r15
je 0x69dc
movslq %r14d, %r14
movq 0xc8(%rsp), %rax
movl %ebp, (%rax,%r14,4)
addq 0x80(%rsp), %rdi
xorl %esi, %esi
callq 0x9792
movl %eax, %ebx
movq 0x40(%rsp), %rax
movq (%rax), %rdi
addq %r12, %rdi
xorl %esi, %esi
callq 0x9792
xorb %al, %bl
movq 0x70(%rsp), %rdi
callq 0x98ad
movsd 0x58(%rsp), %xmm1
testb %bl, %bl
jne 0x69c4
movsd 0x50(%rsp), %xmm1
movq 0x118(%rsp), %rax
movq (%rax), %rax
subsd %xmm0, %xmm1
movsd %xmm1, (%rax,%r14,8)
incl %r14d
incq %rbp
addq $0x28, %r12
jmp 0x6958
movq 0x70(%rsp), %rdx
cvtsi2sd %edx, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x60(%rsp), %rax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xf8(%rsp)
xorl %ecx, %ecx
testl %edx, %edx
cmovgl %edx, %ecx
movq %rcx, 0x18(%rsp)
cltq
movq %rax, 0x140(%rsp)
movl %edx, %r12d
pushq $0x1
popq %r13
leaq 0x20(%rsp), %r15
cmpq 0x140(%rsp), %r13
jge 0x6cc4
movq 0x40(%rsp), %rax
movq (%rax), %rdi
addq 0x80(%rsp), %rdi
movq %r13, %rsi
callq 0x9792
movb %al, 0x88(%rsp)
movq 0x110(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%r13,8), %xmm1
leaq -0x1(%r13), %rbx
subsd -0x8(%rax,%r13,8), %xmm1
divsd 0x265b4(%rip), %xmm1    # 0x2d030
movq 0x78(%rsp), %rax
movsd 0x4f0(%rax), %xmm0
mulsd 0x265a7(%rip), %xmm0    # 0x2d038
mulsd %xmm1, %xmm0
divsd 0x68(%rsp), %xmm0
callq 0x5810
movapd %xmm0, %xmm1
movsd 0x2656c(%rip), %xmm0    # 0x2d018
subsd %xmm1, %xmm0
divsd 0x68(%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x53a0
movsd %xmm0, 0xa0(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x53a0
imulq $0x18, %rbx, %rax
movq %rax, 0x90(%rsp)
imulq $0x18, %r13, %rbp
xorl %r14d, %r14d
movsd %xmm0, 0x98(%rsp)
cmpq 0x18(%rsp), %r14
je 0x6c54
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
movq %rax, 0xa8(%rsp)
movq %r15, %rdi
movq 0x48(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x97b0
movq 0x118(%rsp), %rax
addq 0x90(%rsp), %rax
movq 0x20(%rsp), %rcx
xorl %edx, %edx
movsd 0x264dd(%rip), %xmm3    # 0x2d028
movsd 0xa0(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
cmpq %rdx, %r12
je 0x6b89
movapd %xmm2, %xmm0
cmpq %rdx, %r14
je 0x6b6f
movapd %xmm1, %xmm0
movq (%rax), %rsi
addsd (%rsi,%rdx,8), %xmm0
movsd %xmm0, (%rcx,%rdx,8)
maxsd %xmm3, %xmm0
incq %rdx
movapd %xmm0, %xmm3
jmp 0x6b5d
movq %r15, %rbx
movq %r13, %r15
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
movsd %xmm3, 0x10(%rsp)
cmpq %r13, %r12
je 0x6bdc
movq 0x20(%rsp), %rax
movsd %xmm0, 0x8(%rsp)
movsd (%rax,%r13,8), %xmm0
subsd %xmm3, %xmm0
callq 0x5810
movsd 0x10(%rsp), %xmm3
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r13
jmp 0x6b9c
callq 0x53a0
movsd %xmm0, 0x8(%rsp)
movq 0xc8(%rsp), %rax
movslq (%rax,%r14,4), %rax
imulq $0x28, %rax, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %r15, %r13
movq %r15, %rsi
callq 0x9792
xorb 0x88(%rsp), %al
movsd 0x58(%rsp), %xmm0
jne 0x6c1f
movsd 0x50(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movq 0x118(%rsp), %rax
movq (%rax,%rbp), %rax
movsd %xmm1, (%rax,%r14,8)
movq %rbx, %r15
movq %rbx, %rdi
callq 0xa19c
incq %r14
jmp 0x6af5
movl %r13d, %eax
xorl %edx, %edx
pushq $0x64
popq %rcx
divl %ecx
testl %edx, %edx
leaq 0x1a8(%rsp), %rbx
jne 0x6cbc
cvtsi2sd %r13d, %xmm0
divsd 0xf8(%rsp), %xmm0
mulsd 0x263b0(%rip), %xmm0    # 0x2d030
movq %r15, %rdi
pushq $0x3
popq %rsi
callq 0x2c2cc
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x263f7(%rip), %rdx     # 0x2d08f
callq 0x98b6
leaq 0x3a82c(%rip), %rdi     # 0x414d0
movq %rbx, %rsi
callq 0x2beca
movq %rbx, %rdi
callq 0x5908
movq %r15, %rdi
callq 0x5908
incq %r13
jmp 0x6a2b
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq 0x138(%rsp), %rcx
addq %rax, %rcx
sarq $0x20, %rcx
imulq $0x18, %rcx, %rbx
movq 0x118(%rsp), %rax
addq %rbx, %rax
movsd 0x26334(%rip), %xmm1    # 0x2d028
xorl %ecx, %ecx
cmpq %rcx, 0x18(%rsp)
je 0x6d12
movq (%rax), %rdx
movsd (%rdx,%rcx,8), %xmm0
maxsd %xmm1, %xmm0
incq %rcx
movapd %xmm0, %xmm1
jmp 0x6cf6
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm1, 0x10(%rsp)
cmpq %r14, 0x18(%rsp)
je 0x6d68
movq 0x118(%rsp), %rax
movq (%rax,%rbx), %rax
movsd %xmm0, 0x8(%rsp)
movsd (%rax,%r14,8), %xmm0
subsd %xmm1, %xmm0
callq 0x5810
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r14
jmp 0x6d1f
callq 0x53a0
addsd 0x10(%rsp), %xmm0
leaq 0xa8(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x2c2cc
leaq 0x26308(%rip), %rsi     # 0x2d092
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x98d5
leaq 0x26368(%rip), %rdx     # 0x2d10b
leaq 0x168(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x98b6
leaq 0x3a714(%rip), %rdi     # 0x414d0
leaq 0x168(%rsp), %rsi
callq 0x2beca
leaq 0x168(%rsp), %rdi
callq 0x5908
leaq 0x20(%rsp), %rdi
callq 0x5908
leaq 0xa8(%rsp), %rdi
callq 0x5908
xorl %r14d, %r14d
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x6e31
movq 0x70(%rsp), %rdi
callq 0x98ad
xorpd 0x26236(%rip), %xmm0    # 0x2d050
movq 0xe0(%rsp), %rax
movq (%rax,%rbx), %rcx
movlpd %xmm0, (%rcx,%r14,8)
incq %r14
jmp 0x6df8
movq 0x60(%rsp), %rax
leal -0x2(%rax), %r14d
leaq 0x20(%rsp), %r13
movq 0x40(%rsp), %rax
movq (%rax), %rdi
addq 0x80(%rsp), %rdi
testl %r14d, %r14d
js 0x70e2
leal 0x1(%r14), %ebx
movq %rbx, %rsi
callq 0x9792
movl %eax, %r15d
movq 0x110(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movq %r14, 0x88(%rsp)
movl %r14d, %r14d
subsd (%rax,%r14,8), %xmm1
divsd 0x261a0(%rip), %xmm1    # 0x2d030
movq 0x78(%rsp), %rax
movsd 0x4f0(%rax), %xmm0
mulsd 0x26193(%rip), %xmm0    # 0x2d038
mulsd %xmm1, %xmm0
divsd 0x68(%rsp), %xmm0
callq 0x5810
movapd %xmm0, %xmm1
movsd 0x26158(%rip), %xmm0    # 0x2d018
subsd %xmm1, %xmm0
divsd 0x68(%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x53a0
movsd %xmm0, 0x98(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x53a0
movsd %xmm0, 0xa0(%rsp)
imulq $0x18, %r14, %rax
movq %rax, 0x90(%rsp)
imulq $0x18, %rbx, %rbp
xorl %r14d, %r14d
cmpq 0x18(%rsp), %r14
je 0x706a
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
movq %rax, 0xa8(%rsp)
movq %r13, %rdi
movq 0x48(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x97b0
xorl %r13d, %r13d
movsd 0x260dd(%rip), %xmm0    # 0x2d028
movsd %xmm0, 0x10(%rsp)
cmpq %r13, %r12
je 0x6fe9
movq 0x20(%rsp), %rax
movsd 0x58(%rsp), %xmm0
movsd %xmm0, (%rax,%r13,8)
movq 0xc8(%rsp), %rax
movslq (%rax,%r13,4), %rax
imulq $0x28, %rax, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %rbx, %rsi
callq 0x9792
cmpb %al, %r15b
jne 0x6fa1
movq 0x20(%rsp), %rax
movsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rax,%r13,8)
movq 0xe0(%rsp), %rax
movq (%rax,%rbp), %rcx
movq 0x20(%rsp), %rax
movsd 0xa0(%rsp), %xmm0
cmpq %r13, %r14
je 0x6fc9
movsd 0x98(%rsp), %xmm0
addsd (%rcx,%r13,8), %xmm0
addsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%rax,%r13,8)
maxsd 0x10(%rsp), %xmm0
incq %r13
jmp 0x6f4b
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x702c
movq 0x20(%rsp), %rax
movsd %xmm0, 0x8(%rsp)
movsd (%rax,%r13,8), %xmm0
subsd 0x10(%rsp), %xmm0
callq 0x5810
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r13
jmp 0x6ff0
callq 0x53a0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movq 0xe0(%rsp), %rax
movq 0x90(%rsp), %rcx
movq (%rax,%rcx), %rax
movsd %xmm1, (%rax,%r14,8)
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xa19c
incq %r14
jmp 0x6f09
movq 0x88(%rsp), %r14
movl %r14d, %eax
xorl %edx, %edx
pushq $0x64
popq %rcx
divl %ecx
testl %edx, %edx
leaq 0x188(%rsp), %rbx
jne 0x70da
cvtsi2sd %r14d, %xmm0
divsd 0xf8(%rsp), %xmm0
mulsd 0x25f92(%rip), %xmm0    # 0x2d030
movq %r13, %rdi
pushq $0x3
popq %rsi
callq 0x2c2cc
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x25fd9(%rip), %rdx     # 0x2d08f
callq 0x98b6
leaq 0x3a40e(%rip), %rdi     # 0x414d0
movq %rbx, %rsi
callq 0x2beca
movq %rbx, %rdi
callq 0x5908
movq %r13, %rdi
callq 0x5908
decl %r14d
jmp 0x6e3f
xorl %esi, %esi
callq 0x9792
movl %eax, %ebx
movsd 0x25f35(%rip), %xmm0    # 0x2d028
movsd %xmm0, 0x8(%rsp)
xorl %r14d, %r14d
cmpq %r14, 0x18(%rsp)
je 0x7154
movq 0xc8(%rsp), %rax
movslq (%rax,%r14,4), %rax
imulq $0x28, %rax, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
xorl %esi, %esi
callq 0x9792
xorb %bl, %al
movsd 0x58(%rsp), %xmm0
jne 0x7132
movsd 0x50(%rsp), %xmm0
movq 0xe0(%rsp), %rax
movq (%rax), %rax
addsd (%rax,%r14,8), %xmm0
maxsd 0x8(%rsp), %xmm0
incq %r14
movsd %xmm0, 0x8(%rsp)
jmp 0x70fc
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
cmpq %r14, 0x18(%rsp)
je 0x71c6
movsd %xmm0, 0x10(%rsp)
movq 0xc8(%rsp), %rax
movslq (%rax,%r14,4), %rax
imulq $0x28, %rax, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
xorl %esi, %esi
callq 0x9792
xorb %bl, %al
movsd 0x58(%rsp), %xmm0
jne 0x7197
movsd 0x50(%rsp), %xmm0
movq 0xe0(%rsp), %rax
movq (%rax), %rax
addsd (%rax,%r14,8), %xmm0
subsd 0x8(%rsp), %xmm0
callq 0x5810
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
incq %r14
jmp 0x715b
callq 0x53a0
addsd 0x8(%rsp), %xmm0
leaq 0xa8(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x2c2cc
leaq 0x25eba(%rip), %rsi     # 0x2d0a2
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x98d5
movq 0x130(%rsp), %r14
leaq 0x25f02(%rip), %rdx     # 0x2d10b
leaq 0x148(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x98b6
leaq 0x3a2ae(%rip), %rdi     # 0x414d0
leaq 0x148(%rsp), %rsi
callq 0x2beca
leaq 0x148(%rsp), %rdi
callq 0x5908
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x5908
leaq 0xa8(%rsp), %rdi
callq 0x5908
andl $0x0, (%rbx)
leaq 0x20(%rsp), %rdx
movq 0x100(%rsp), %rdi
movq %r14, %rsi
callq 0x98fa
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
movq 0x108(%rsp), %rdi
movq %r14, %rsi
callq 0x992e
xorl %r12d, %r12d
movq 0x60(%rsp), %rax
testl %eax, %eax
movl $0x0, %r13d
cmovgl %eax, %r13d
leaq 0x20(%rsp), %rbx
leaq 0x7(%rsp), %r15
cmpq %r13, %r12
je 0x73e2
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
movq %rax, 0xa8(%rsp)
movq %rbx, %rdi
movq 0x48(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movq %r15, %rcx
callq 0x97b0
imulq $0x18, %r12, %rax
movq 0x118(%rsp), %rcx
addq %rax, %rcx
addq 0xe0(%rsp), %rax
xorl %edx, %edx
movq 0x20(%rsp), %rsi
movsd 0x25d2a(%rip), %xmm1    # 0x2d028
xorl %ebp, %ebp
cmpq %rdx, 0x18(%rsp)
je 0x7330
movq (%rcx), %rdi
movsd (%rdi,%rdx,8), %xmm0
movq (%rax), %rdi
addsd (%rdi,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
cmoval %edx, %ebp
movsd %xmm0, (%rsi,%rdx,8)
maxsd %xmm1, %xmm0
incq %rdx
movapd %xmm0, %xmm1
jmp 0x7300
xorpd %xmm2, %xmm2
xorl %r14d, %r14d
movsd %xmm1, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq %r14, 0x18(%rsp)
je 0x737e
movsd (%rax,%r14,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm2, 0x8(%rsp)
callq 0x5810
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
addsd %xmm0, %xmm2
incq %r14
jmp 0x733d
xorl %ecx, %ecx
cmpq %rcx, 0x18(%rsp)
je 0x739a
movsd (%rax,%rcx,8), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0x7380
movslq %ebp, %rax
movq 0xc8(%rsp), %rcx
movl (%rcx,%rax,4), %ecx
movq 0x100(%rsp), %rdx
movq (%rdx), %rdx
movl %ecx, (%rdx,%r12,4)
movq 0x20(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movq 0x108(%rsp), %rax
movq (%rax), %rax
movsd %xmm0, (%rax,%r12,8)
movq %rbx, %rdi
callq 0xa19c
incq %r12
jmp 0x72a5
leaq 0xc8(%rsp), %rdi
callq 0xa18e
leaq 0xe0(%rsp), %rdi
callq 0x9962
leaq 0x118(%rsp), %rdi
callq 0x9962
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x74eb
jmp 0x74eb
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0x744b
jmp 0x7452
jmp 0x7461
jmp 0x74eb
jmp 0x74eb
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x5908
jmp 0x7455
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5908
jmp 0x7464
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x74d4
jmp 0x74eb
movq %rax, %rbx
jmp 0x750c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa19c
jmp 0x7519
movq %rax, %rbx
jmp 0x7519
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa19c
jmp 0x7526
movq %rax, %rbx
jmp 0x7526
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0x74c5
jmp 0x74cc
jmp 0x74eb
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x5908
jmp 0x74cf
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5908
jmp 0x74ff
jmp 0x74eb
jmp 0x74eb
jmp 0x74eb
jmp 0x74eb
jmp 0x74eb
jmp 0x74eb
jmp 0x74eb
jmp 0x74eb
movq %rax, %rbx
jmp 0x74ff
jmp 0x74f2
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa19c
leaq 0xc8(%rsp), %rdi
callq 0xa18e
leaq 0xe0(%rsp), %rdi
callq 0x9962
leaq 0x118(%rsp), %rdi
callq 0x9962
movq %rbx, %rdi
callq 0x5800