// File: /workspace/github_cpp_makefile_star2_O3/tplinderoth[P]introDist/introDist.cpp
// Function: comp2DistIndAvg(std::basic_fstream<char, std::char_traits<char>>&, std::basic_fstream<char, std::char_traits<char>>&, unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, double const*)
int comp2DistIndAvg (std::fstream &freqfile, std::fstream &genofile, unsigned int window, unsigned int step, std::string* genofname, const double* distance) {

	/*
	 * this calculates the difference in the genetic distance between individual i and population2 in a region and
	 * the genome-wide average distance between individual i and population2
	 *
	 * D = d_R(i, P2) - d_G(i, P2)
	 * subscript G denotes average over the genome
	 * subscript R denotes average across region
	 *
	 * at site s:
	 * expected distance between individual i and population 2: E[d(i, P2)] = |g_i - E[g_p2]|/2
	 *
	 * d_G(i, P2) = 1/N_G * sum_from=1_to=N_G |g_i - E[g_p2]|/2, where N_G is total number of sites analyzed
	 *
	 * d_R(i, P2) = 1/N_R * sum_from=1_to=N_R |g_i - E[g_p2]|/2, where N_R is the number of sites in the window
	 *
	 * assumes individual i is from population 1
	 *
	 */

	std::vector<sitedist> dist;
	dist.resize(window);
	std::vector<sitedist>::iterator distiter = dist.begin();
	unsigned int lastidx = window-1;
	unsigned int nsites = 0;
	unsigned int dr_nsites = 0;
	double windD = 0.0;
	unsigned int i = 0;
	unsigned int n = window-step;
	double dg = 0.0;
	unsigned int dg_nsites = 0;

	std::stringstream ss;

	std::string(fline);
	std::string(fchr);
	unsigned int fpos;
	double p1f;
	double p2f;

	std::string(gline);
	std::string(gchr);
	unsigned int gpos;
	int geno;

	getline(freqfile, fline);
	getline(genofile, gline);

	// estimate number of lines of input files to set up vector to hold distances
	ss.str(gline);
	ss >> gchr;
	unsigned int nlines = ceil(filesize(genofname->c_str())/(gchr.size()+2*sizeof(int)-1));
	std::vector<WindowInfo> windist;
	windist.reserve(nlines/step + 10);

	// calculate windows
	while (!fline.empty()) {

		// parse frequency file lines
		ss.str(std::string());
		ss.clear();
		ss.str(fline);
		ss >> fchr >> fpos >> p1f >> p2f;

		// parse genotype file lines
		ss.str(std::string());
		ss.clear();
		ss.str(gline);
		ss >> gchr >> gpos >> geno;

		// ensure that files are synched
		if (gchr.compare(fchr) != 0 || gpos != fpos) {
			std::cerr << "Positions in input files differ\n";
			return -1;
		}

		distiter->first = gpos;
		if (geno < 0) {
			// missing data
			distiter->second = -3.0;
		} else {
			// update window information
			distiter->second = expectIndPopDist(geno, p2f);
			// update genome-wide distance
			dg += distiter->second;
			++dg_nsites;
		}
		++distiter;
		++nsites;

		if (distiter == dist.end()) {

			// calculate window value
			windD = 0.0;
			dr_nsites = 0;
			for (distiter = dist.begin(); distiter != dist.end(); ++distiter) {
				if (distiter->second < -2.0) continue;
				windD += distiter->second;
				++dr_nsites;
			}
			if (dr_nsites > 0) {
				windD /= (double)dr_nsites;
			} else {
				std::cerr << "Warning: window " << gchr << " " << dist[0].first << "," << dist[lastidx].first << " has no sites with data\n";
			}
			windist.push_back(makeWinInfo(dist[0].first, dist[lastidx].first, dr_nsites, windD));

			// prepare vector for new values
			for (i = 0; i < n; ++i) {
				dist[i].first = dist[step+i].first;
				dist[i].second = dist[step+i].second;
			}

			nsites = n;
			distiter = dist.begin() + n;
		}

		getline(freqfile, fline);
		getline(genofile, gline);
	}

	// calculate last window
	if (nsites > n && nsites < window) {
		unsigned int lastwinidx = nsites-1;
		dr_nsites = 0;
		windD = 0.0;
		for (i=0; i < lastwinidx; ++i) {
			if (dist[i].second < -2.0) continue;
			windD += dist[i].second;
			++dr_nsites;
		}
		if (dr_nsites > 0) {
			windD /= (double)dr_nsites;
		} else {
			std::cerr << "Warning: window " << gchr << " " << dist[0].first << "," << dist[lastwinidx].first << " has no sites with data\n";
		}
		windist.push_back(makeWinInfo(dist[0].first, dist[lastwinidx].first, dr_nsites, windD));
	}

	// calculate and print distance statistic
	if (dg_nsites > 0) {
		dg /= (double)dg_nsites;
	} else {
		std::cerr << "There were no sites with complete data, cannot calculate distance statistic\n";
		return 0; // use better exception handling here
	}
	std::cerr << "\nCalculated genome-wide, average distance between individual and population2: " << dg << "\n";

	if (distance) {
		// use provided distance
		dg = *distance;
		std::cerr << "\nUsing distance: " << dg <<  "\n";
	}
	std::cerr << "\n";

	unsigned int midpoint = 0;
	double Dstat = 0.0;
	for (std::vector<WindowInfo>::iterator winditer = windist.begin(); winditer != windist.end(); ++winditer) {
		Dstat = winditer->d - dg;
		midpoint = (winditer->start + winditer->stop)/2;
		std::cout << gchr << "\t" << winditer->start << "\t" << winditer->stop << "\t" << midpoint << "\t" << Dstat << "\t" << winditer->nsites << "\n";
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %r9, %r14
movq %r8, %rbx
movl %ecx, -0x5c(%rbp)
movq %rsi, %r13
movq %rdi, -0xb0(%rbp)
xorpd %xmm0, %xmm0
leaq -0x80(%rbp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rdx, -0x108(%rbp)
movl %edx, %esi
callq 0x81be
movq -0x80(%rbp), %r15
leaq -0x2f8(%rbp), %rdi
callq 0x3170
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x140(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x120(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq -0xb0(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %edx
leaq -0xd0(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x33d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %edx
leaq -0x130(%rbp), %rsi
movq %r13, %rdi
callq 0x33d0
leaq -0x2e0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x32c0
leaq -0x2f8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x3280
movq (%rbx), %rdi
callq 0x8fda
movq -0xe8(%rbp), %rcx
addq $0x7, %rcx
movq $0x0, -0xa8(%rbp)
xorl %edx, %edx
divq %rcx
xorpd %xmm0, %xmm0
leaq -0xa0(%rbp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %edx, %edx
movl -0x5c(%rbp), %ebx
divl %ebx
leal 0xa(%rax), %esi
callq 0x81f8
movq %r14, -0x158(%rbp)
movq -0x108(%rbp), %rcx
leal -0x1(%rcx), %eax
subl %ebx, %ecx
movl %eax, %eax
movq %rax, -0x110(%rbp)
movl %ecx, -0x60(%rbp)
movl %ecx, %eax
shlq $0x4, %rax
movq %rax, -0x160(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
leaq -0x2e0(%rbp), %r14
leaq -0x2f8(%rbp), %rbx
cmpq $0x0, -0xc8(%rbp)
je 0x7991
leaq -0x48(%rbp), %r12
movq %r12, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x32c0
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x7567
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x2f8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x3350
movq %r14, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x32c0
movq %rbx, %rdi
leaq -0x150(%rbp), %rsi
callq 0x3280
movq %rax, %rdi
leaq -0xfc(%rbp), %rsi
callq 0x3380
movq %rax, %rdi
leaq -0x170(%rbp), %rsi
callq 0x3140
movq %rax, %rdi
leaq -0x168(%rbp), %rsi
callq 0x3140
movq %r12, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x32c0
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x75f8
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x2f8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x3350
movq %r14, %rdi
leaq -0x130(%rbp), %rsi
callq 0x32c0
movq %rbx, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x3280
movq %rax, %rdi
leaq -0xf8(%rbp), %rsi
callq 0x3380
movq %rax, %rdi
leaq -0xf4(%rbp), %rsi
callq 0x3130
movq %r13, %rbx
movq -0xe8(%rbp), %r12
movq -0x148(%rbp), %r13
cmpq %r12, %r13
movq %r12, %rdx
cmovbq %r13, %rdx
testq %rdx, %rdx
je 0x768e
movq -0x150(%rbp), %rsi
movq -0xf0(%rbp), %rdi
callq 0x3230
cmpq %r13, %r12
jne 0x796e
testl %eax, %eax
je 0x7697
jmp 0x796e
cmpq %r13, %r12
jne 0x796e
movl -0xf8(%rbp), %eax
cmpl -0xfc(%rbp), %eax
jne 0x796e
movl %eax, (%r15)
movl -0xf4(%rbp), %eax
testl %eax, %eax
js 0x7716
cvtsi2sd %eax, %xmm0
movsd -0x168(%rbp), %xmm1
movapd %xmm1, %xmm2
addsd %xmm1, %xmm2
movsd 0x2936(%rip), %xmm3     # 0xa008
subsd %xmm1, %xmm3
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
subsd %xmm3, %xmm0
andpd 0x2962(%rip), %xmm0     # 0xa050
mulsd 0x293a(%rip), %xmm0     # 0xa030
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
movq -0xa8(%rbp), %rax
incl %eax
movq %rax, -0xa8(%rbp)
jmp 0x771e
movsd 0x291a(%rip), %xmm0     # 0xa038
movq %rbx, %r13
movsd %xmm0, 0x8(%r15)
leaq 0x10(%r15), %rcx
cmpq -0x78(%rbp), %rcx
leaq -0x2e0(%rbp), %r14
leaq -0x2f8(%rbp), %rbx
je 0x774a
incl -0x30(%rbp)
movq %rcx, %r15
jmp 0x7911
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
je 0x77b6
leaq -0x10(%rax), %rdx
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorl %ecx, %ecx
movl -0x5c(%rbp), %ebx
movsd 0x18(%rdx), %xmm0
xorl %esi, %esi
movsd 0x28cc(%rip), %xmm1     # 0xa040
ucomisd %xmm0, %xmm1
setbe %dil
ja 0x778c
movsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movb %dil, %sil
addl %esi, %ecx
addq $0x10, %rdx
cmpq %r15, %rdx
jne 0x7765
testl %ecx, %ecx
je 0x77bf
movl %ecx, %edx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
movsd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
jmp 0x7869
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x10, %edx
movq 0x6825(%rip), %rdi      # 0xdff0
leaq 0x2c7f(%rip), %rsi      # 0xa451
callq 0x3250
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq 0x6804(%rip), %rdi      # 0xdff0
callq 0x3250
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x33f4(%rip), %rsi      # 0xabf7
callq 0x3250
movq -0x80(%rbp), %rax
movl (%rax), %esi
movq %r15, %rdi
callq 0x3150
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2c3a(%rip), %rsi      # 0xa462
callq 0x3250
movq -0x80(%rbp), %rax
movq -0x110(%rbp), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %esi
movq %r15, %rdi
callq 0x3150
movl $0x18, %edx
movq %rax, %rdi
leaq 0x2c0e(%rip), %rsi      # 0xa464
callq 0x3250
xorl %ecx, %ecx
movq -0x80(%rbp), %rax
movl -0x5c(%rbp), %ebx
movsd -0x30(%rbp), %xmm1
movl (%rax), %edx
movq -0x110(%rbp), %rsi
shlq $0x4, %rsi
movl (%rax,%rsi), %eax
movl %edx, -0x58(%rbp)
movl %eax, -0x54(%rbp)
movl %ecx, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
movq -0x98(%rbp), %rsi
cmpq -0x90(%rbp), %rsi
movq -0x160(%rbp), %r15
je 0x78b9
movq -0x48(%rbp), %rax
movq %rax, 0x10(%rsi)
movupd -0x58(%rbp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, -0x98(%rbp)
jmp 0x78c9
leaq -0xa0(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x89e6
cmpl $0x0, -0x60(%rbp)
je 0x78fa
movq -0x80(%rbp), %rax
movl %ebx, %ecx
xorl %edx, %edx
movl %ecx, %esi
shlq $0x4, %rsi
movl (%rax,%rsi), %edi
movl %edi, (%rax,%rdx)
movsd 0x8(%rax,%rsi), %xmm0
movsd %xmm0, 0x8(%rax,%rdx)
addq $0x10, %rdx
incl %ecx
cmpq %rdx, %r15
jne 0x78d7
movq %r15, %rax
movq -0x80(%rbp), %r15
addq %rax, %r15
movl -0x60(%rbp), %eax
movl %eax, -0x30(%rbp)
leaq -0x2f8(%rbp), %rbx
movq -0xb0(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %edx
movq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x33d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %edx
movq %r13, %rdi
leaq -0x130(%rbp), %rsi
callq 0x33d0
jmp 0x7524
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0x6675(%rip), %rdi      # 0xdff0
leaq 0x29d5(%rip), %rsi      # 0xa357
movl $0x20, %edx
callq 0x3250
jmp 0x7d15
movl -0x30(%rbp), %edx
cmpl -0x60(%rbp), %edx
setbe %al
cmpl -0x108(%rbp), %edx
setae %cl
orb %al, %cl
jne 0x7b20
decl %edx
movl %edx, %r14d
je 0x7a21
movq -0x80(%rbp), %rax
movq %r14, %rcx
shlq $0x4, %rcx
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorl %edx, %edx
xorl %ebx, %ebx
movsd 0x8(%rax,%rdx), %xmm0
xorl %esi, %esi
movsd 0x2666(%rip), %xmm1     # 0xa040
ucomisd %xmm0, %xmm1
setbe %dil
ja 0x79f2
movsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movb %dil, %sil
addl %esi, %ebx
addq $0x10, %rdx
cmpq %rdx, %rcx
jne 0x79ca
testl %ebx, %ebx
je 0x7a2a
movl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
jmp 0x7ac4
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x65bf(%rip), %rdi      # 0xdff0
leaq 0x2a19(%rip), %rsi      # 0xa451
movl $0x10, %edx
callq 0x3250
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq 0x6599(%rip), %rdi      # 0xdff0
callq 0x3250
movq %rax, %rbx
leaq 0x3191(%rip), %rsi      # 0xabf7
movl $0x1, %edx
movq %rax, %rdi
callq 0x3250
movq -0x80(%rbp), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x3150
movq %rax, %rbx
leaq 0x29d7(%rip), %rsi      # 0xa462
movl $0x1, %edx
movq %rax, %rdi
callq 0x3250
movq -0x80(%rbp), %rax
movq %r14, %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %esi
movq %rbx, %rdi
callq 0x3150
xorl %ebx, %ebx
leaq 0x29ad(%rip), %rsi      # 0xa464
movl $0x18, %edx
movq %rax, %rdi
callq 0x3250
movq -0x80(%rbp), %rax
movl (%rax), %ecx
shlq $0x4, %r14
movl (%rax,%r14), %eax
movl %ecx, -0x58(%rbp)
movl %eax, -0x54(%rbp)
movl %ebx, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x98(%rbp), %rsi
cmpq -0x90(%rbp), %rsi
je 0x7b10
movq -0x48(%rbp), %rax
movq %rax, 0x10(%rsi)
movupd -0x58(%rbp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, -0x98(%rbp)
jmp 0x7b20
leaq -0xa0(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x89e6
cmpl $0x0, -0xa8(%rbp)
movq -0x158(%rbp), %rbx
je 0x7cfa
movq 0x64b5(%rip), %rdi      # 0xdff0
leaq 0x29cd(%rip), %rsi      # 0xa50f
movl $0x4e, %edx
callq 0x3250
movl -0xa8(%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movsd -0x38(%rbp), %xmm0
divsd %xmm1, %xmm0
movq 0x6486(%rip), %rdi      # 0xdff0
movsd %xmm0, -0x38(%rbp)
callq 0x3320
leaq 0x3037(%rip), %rsi      # 0xabb2
movl $0x1, %edx
movq %rax, %rdi
callq 0x3250
testq %rbx, %rbx
je 0x7bd3
movsd (%rbx), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x6453(%rip), %rdi      # 0xdff0
leaq 0x2959(%rip), %rsi      # 0xa4fd
movl $0x11, %edx
callq 0x3250
movq 0x643b(%rip), %rdi      # 0xdff0
movsd -0x38(%rbp), %xmm0
callq 0x3320
leaq 0x2fec(%rip), %rsi      # 0xabb2
movl $0x1, %edx
movq %rax, %rdi
callq 0x3250
movq 0x6416(%rip), %rdi      # 0xdff0
leaq 0x2fd1(%rip), %rsi      # 0xabb2
movl $0x1, %edx
callq 0x3250
movq -0xa0(%rbp), %rbx
cmpq -0x98(%rbp), %rbx
je 0x7e04
leaq 0x26e3(%rip), %r15      # 0xa2e9
leaq 0x2fa5(%rip), %r12      # 0xabb2
movsd 0x10(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
movl 0x4(%rbx), %r14d
addl (%rbx), %r14d
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq 0x6395(%rip), %rdi      # 0xdfc8
callq 0x3250
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movl (%rbx), %esi
movq %r13, %rdi
callq 0x3150
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movl 0x4(%rbx), %esi
movq %r13, %rdi
callq 0x3150
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
shrl %r14d
movl %r14d, %esi
movq %r13, %rdi
callq 0x3150
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
movq %r13, %rdi
callq 0x3320
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movl 0x8(%rbx), %esi
movq %r13, %rdi
callq 0x3150
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3250
addq $0x18, %rbx
cmpq -0x98(%rbp), %rbx
jne 0x7c0d
jmp 0x7d12
movq 0x62ef(%rip), %rdi      # 0xdff0
leaq 0x2775(%rip), %rsi      # 0xa47d
movl $0x4c, %edx
callq 0x3250
xorl %r14d, %r14d
movq -0xa0(%rbp), %rbx
testq %rbx, %rbx
leaq -0xc0(%rbp), %r15
je 0x7d3a
movq -0x90(%rbp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0x3220
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x7d5c
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x7d7e
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x7da0
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0x7dbb
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x3220
movq 0x61ee(%rip), %rsi      # 0xdfb0
leaq -0x2f8(%rbp), %rdi
callq 0x3190
leaq -0x278(%rbp), %rdi
callq 0x30e0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x7def
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x3220
movl %r14d, %eax
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x7d1c
jmp 0x7e4a
jmp 0x7e4a
jmp 0x7e20
jmp 0x7e14
movq %rax, %r14
jmp 0x7f0f
jmp 0x7e4a
jmp 0x7e4a
movq %rax, %r14
leaq -0xc0(%rbp), %rbx
jmp 0x7e6f
jmp 0x7e2e
movq %rax, %r14
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x7e4d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3220
jmp 0x7e4d
jmp 0x7e4a
movq %rax, %r14
leaq -0xc0(%rbp), %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x7e6f
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x3220
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x7e91
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x7eb3
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x7ed5
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x7ef0
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x3220
movq 0x60b9(%rip), %rsi      # 0xdfb0
leaq -0x2f8(%rbp), %rdi
callq 0x3190
leaq -0x278(%rbp), %rdi
callq 0x30e0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x7f24
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x3220
movq %r14, %rdi
callq 0x3390