// File: /workspace/github_cpp_makefile_star2_O1/tplinderoth[P]introDist/Dxyz.cpp
// Function: vcf2Dxyz(std::basic_ifstream<char, std::char_traits<char>>&, std::basic_ifstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, int, int, double, int)
int vcf2Dxyz (std::ifstream &poptab, std::ifstream &vcf, std::ofstream &outf, int winsize, int step, double minmaf, int infmt) {
		// set up population table map
		std::map <std::string, int> popmap;
		if (setPopTable(poptab, popmap) <= 0) {
			return -1;
		}

		// set up instream
		std::streambuf *inbuf = NULL;
		boost::iostreams::filtering_streambuf<boost::iostreams::input> zipbuf;
		zipbuf.push(boost::iostreams::gzip_decompressor());
		if (infmt == 0) {
			inbuf = vcf.rdbuf();
		}
		else if (infmt == 1) {
			zipbuf.push(vcf);
			inbuf = &zipbuf;
		} else if (infmt == 2) {
			inbuf = std::cin.rdbuf();
		}
		std::istream instream(inbuf);

		// set up outstream
		std::streambuf *outbuf = NULL;
		if (outf.is_open()) {
			outbuf = outf.rdbuf();
		} else {
			outbuf = std::cout.rdbuf();
		}
		std::ostream outstream(outbuf);

		// print header to output
		printHeader(outstream);

		// process VCF file
		std::string vcfline;

		// skip headers and set up vector to hold tokens
		while (getline(instream, vcfline)) {
			if (vcfline[0] != '#' || vcfline[1] != '#')
				break;
		}

		// find individual's positions in allele vector
		std::vector<int> source_idx; // this is the source pop index positions
		std::vector<int> sink_idx; // this is the sink pop index positions
		std::vector<int> outgroup_idx; // this is the outgroup index positions

		std::stringstream ss(vcfline);
		std::string tok;
		int idxpos [2];
		int c = -9;
		int c2 = 0;
		int pop;
		while (ss >> tok) {
			if (c >= 0) {
				if (popmap.find(tok) != popmap.end()) {
					pop = popmap.find(tok)->second;
					idxpos[0] = c2;
					idxpos[1] = c2+1;

					if (pop == 0) {
						source_idx.insert(source_idx.end(), idxpos, idxpos+2);
					} else if (pop == 1) {
						sink_idx.insert(sink_idx.end(), idxpos, idxpos+2);
					} else if (pop == 2) {
						outgroup_idx.insert(outgroup_idx.end(), idxpos, idxpos+2);
					} else {
						std::cerr << "Invalid population code: " << pop << "\n";
						return -1;
					}

				}
				c2 += 2;
			}
			++c;
		}
		unsigned int nind = c;
		int nfields = c+9;
		std::cerr << "Number of individuals in VCF: " << nind << "\n";

		// set up data structures to hold site information

		// matrix to hold Dxy values
		Matrix<double> dxy(winsize, 5); // 0:source-sink dxy, 1:source-out dxy, 2:position, 3:number sequences with data, 4: maf

		// vector to hold alleles
		std::vector<int> alleles;
		alleles.resize(nind*2);

		// loop through VCF sites
		int i = 0, j = 0;
		std::string seqid;
		std::string prevseq;
		int nsitedata; // tracks number of sites in a window with data
		double nseqdata_win; // tracks average number of sequences per site in a window with data
		double dxy_components [2]; // 0=Source-Sink Dxy, 1=Source-Outgroup Dxy
		double dxyz;
		double winstart = 0; // holds start position of last printed window
		while (getline(instream, vcfline)) {
		// assume vcf fields are [0]=CHROM, [1]=POS, [2]=ID, [3]=REF, [4]=ALT, [5]=QUAL, [6]=FILTER, [7]=INFO, [8]=FORMAT

			// parse site information
			ss.clear();
			ss.str(vcfline);
			ss >> seqid; // extract CHROM
			ss >> dxy(j,2); // extract POS
			i=2;
			while (ss >> tok) {
				if (i > 8) {
					// extract genotypes
					if(parseGenotype(tok, alleles) == alleles.end()) {
						return -1;
					}
				} else if (i == 8) {
					// ensure genotypes are present
					if (tok[0] != 'G' || tok[1] != 'T') {
						std::cerr << "No GT subfield for " << seqid << " " << dxy(j,2) << "\n";
						return -1;
					}
				}
				++i;
			}

			if (i < nfields) {
				std::cerr << "Input VCF appears truncated\n";
				return -1;
			}

			// calculate average number of pairwise differences for site
			dxyComponents(alleles, source_idx, sink_idx, outgroup_idx, dxy, j);
			++j;

			if (j == winsize || (!prevseq.empty() && prevseq != seqid)) {
				winstart=dxy(0,2);

				// calculate Dxyz window
				dxyz = calcDxyzWindow(dxy, dxy.nrow()-1, &nseqdata_win, &nsitedata, minmaf, dxy_components);

				// print window
				printWindow(outstream, dxyz, seqid, dxy(0,2), dxy(winsize-1,2), nseqdata_win, nsitedata, dxy_components);

				// slide dxy window
				j = slideWindow(dxy, winsize, step, j);
			}

			prevseq = seqid;
		}

		// process last window if necessary
		if (dxy(0,2) != winstart) {
			dxyz = calcDxyzWindow(dxy, j-1, &nseqdata_win, &nsitedata, minmaf, dxy_components);
			printWindow(outstream, dxyz, seqid, dxy(0,2), dxy(j-1,2), nseqdata_win, nsitedata, dxy_components);
		}

		return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
movl %r9d, %ebp
movsd %xmm0, 0xc8(%rsp)
movl %r8d, 0x3c(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x180(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x178(%rsp), %rsi
callq 0x7e42
testl %eax, %eax
jle 0x6e4f
leaq 0x1a8(%rsp), %r12
movq %r12, %rdi
callq 0x8df4
leaq 0xf2a9(%rip), %rax      # 0x16020
movq %rax, 0x1a8(%rsp)
leaq 0xf31a(%rip), %rax      # 0x160a0
movq %rax, 0x1e8(%rsp)
leaq 0x208(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
movl $0xf, %esi
callq 0x8894
movq 0x1f0(%rsp), %rdi
leaq 0x208(%rsp), %rsi
movq $-0x1, %rdx
movq $-0x1, %rcx
callq 0xad92
leaq 0x298(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6de9
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x6310
leaq 0x248(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e0a
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x6310
leaq 0x228(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e2b
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x6310
leaq 0x210(%rsp), %rdi
callq 0x8cba
cmpl $0x2, %ebp
je 0x6e81
cmpl $0x1, %ebp
je 0x6e59
testl %ebp, %ebp
jne 0x6e99
addq $0x10, %r14
movq %r14, %r12
jmp 0x6e9c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x7619
leaq 0x208(%rsp), %rsi
movq %r14, (%rsi)
movq 0x1f0(%rsp), %rdi
movq $-0x1, %rdx
movq $-0x1, %rcx
callq 0xd482
jmp 0x6e9c
movq 0x10148(%rip), %rax     # 0x16fd0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq 0xe8(%rax,%rcx), %r12
jmp 0x6e9c
xorl %r12d, %r12d
leaq 0x390(%rsp), %rdi
movq %r12, %rsi
callq 0x65f0
leaq 0x70(%rbx), %rdi
callq 0x60c0
testb %al, %al
je 0x6ebf
addq $0x8, %rbx
jmp 0x6ed5
movq 0x100da(%rip), %rax     # 0x16fa0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq 0xe8(%rax,%rcx), %rbx
leaq 0x390(%rsp), %r14
leaq 0x4a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x6140
leaq 0x4a8(%rsp), %rdi
callq 0x7fc8
leaq 0xf0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xe0(%rsp), %rbx
movq 0x390(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x62e0
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x65e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6f61
movq 0xe0(%rsp), %rax
cmpb $0x23, (%rax)
jne 0x6f61
cmpb $0x23, 0x1(%rax)
je 0x6f19
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
xorl %r12d, %r12d
movq %r12, 0xb0(%rsp)
movq %r12, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movq %r12, 0x70(%rsp)
movapd %xmm0, 0x60(%rsp)
leaq 0x208(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movl $0x18, %edx
callq 0x6500
leaq 0x150(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
movl $0xffffffee, %ebx       # imm = 0xFFFFFFEE
leaq 0x140(%rsp), %r14
leaq 0x178(%rsp), %r13
leaq 0x208(%rsp), %rdi
movq %r14, %rsi
callq 0x63f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x70c1
testl %ebp, %ebp
js 0x70b7
movq %r13, %rdi
movq %r14, %rsi
callq 0xe010
leaq 0x180(%rsp), %rcx
cmpq %rcx, %rax
je 0x70b3
movq %r13, %rdi
movq %r14, %rsi
callq 0xe010
movl 0x40(%rax), %r15d
movl %r12d, 0x8(%rsp)
leal 0x1(%r12), %eax
movl %eax, 0xc(%rsp)
cmpl $0x2, %r15d
je 0x709a
cmpl $0x1, %r15d
je 0x7079
testl %r15d, %r15d
jne 0x763a
movq 0xa8(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0xe09a
jmp 0x70b3
movq 0x88(%rsp), %rsi
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0xe09a
jmp 0x70b3
movq 0x68(%rsp), %rsi
leaq 0x60(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0xe09a
addl $0x2, %r12d
incl %ebp
addl $0x2, %ebx
jmp 0x6fe0
movq 0xff20(%rip), %rdi      # 0x16fe8
leaq 0x833a(%rip), %rsi      # 0xf409
movl $0x1e, %edx
callq 0x6390
movl %ebp, %esi
movq 0xff06(%rip), %rdi      # 0x16fe8
callq 0x6210
leaq 0x7f9d(%rip), %rsi      # 0xf08b
movl $0x1, %edx
movq %rax, %rdi
callq 0x6390
movslq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl $0x5, %edx
callq 0x89cc
leaq 0x390(%rsp), %r12
movq %r12, %r14
xorpd %xmm0, %xmm0
leaq 0x100(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl %ebx, %esi
callq 0x8ad8
addl $0x9, %ebp
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %r15d, %r15d
movq %r15, -0x8(%rax)
movb %r15b, (%rax)
leaq 0x130(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r15, -0x8(%rax)
movb %r15b, (%rax)
movq 0x18(%rsp), %rax
decl %eax
movl %eax, 0x38(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0xc0(%rsp)
leaq 0xe0(%rsp), %r12
leaq 0x140(%rsp), %rbx
leaq 0x100(%rsp), %r13
movq 0x390(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x62e0
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x65e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x767f
movq 0x208(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x208(%rsp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x6550
leaq 0x220(%rsp), %rdi
movq %r12, %rsi
callq 0x64a0
leaq 0x208(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x63f0
leaq 0x20(%rsp), %rdi
movl %r15d, %esi
movl $0x2, %edx
callq 0x8b0a
leaq 0x208(%rsp), %rdi
movq %rax, %rsi
callq 0x6200
movl $0x2, %r12d
leaq 0x208(%rsp), %rdi
movq %rbx, %rsi
callq 0x63f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x729e
cmpl $0x9, %r12d
jb 0x7278
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8005
movq 0x10107(%rip), %rax     # 0x17370
cmpq 0x108(%rsp), %rax
jne 0x7299
jmp 0x741e
cmpl $0x8, %r12d
jne 0x7299
movq 0x140(%rsp), %rax
cmpb $0x47, (%rax)
jne 0x7428
cmpb $0x54, 0x1(%rax)
jne 0x7428
incl %r12d
jmp 0x7233
cmpl %ebp, %r12d
jl 0x7766
movq %r13, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x20(%rsp), %r8
movl %r15d, %r9d
callq 0x8147
incl %r15d
cmpl 0x18(%rsp), %r15d
je 0x7308
movq 0x128(%rsp), %rdx
testq %rdx, %rdx
je 0x73f7
cmpq 0x48(%rsp), %rdx
jne 0x7308
movq 0x40(%rsp), %rsi
movq 0x120(%rsp), %rdi
callq 0x6320
testl %eax, %eax
je 0x73f7
leaq 0x20(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x8b0a
movsd (%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movl 0x20(%rsp), %esi
decl %esi
movq %r13, %rdi
leaq 0xd8(%rsp), %r12
movq %r12, %rdx
leaq 0x4(%rsp), %rcx
movsd 0xc8(%rsp), %xmm0
leaq 0x160(%rsp), %r14
movq %r14, %r8
callq 0x8434
movsd %xmm0, 0xd0(%rsp)
movq %r13, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x8b0a
cvttsd2si (%rax), %rax
movl %eax, 0x14(%rsp)
movq %r13, %rdi
movl 0x38(%rsp), %esi
movl $0x2, %edx
callq 0x8b0a
cvttsd2si (%rax), %rax
movl %eax, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x4a8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %r12, %r9
pushq %r14
leaq 0x38(%rsp), %rax
pushq %rax
callq 0x858c
addq $0x10, %rsp
movq %r13, %rdi
movq 0x18(%rsp), %rsi
movl 0x3c(%rsp), %edx
movl %r15d, %ecx
callq 0x86f8
movl %eax, %r15d
leaq 0x100(%rsp), %r13
leaq 0x120(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x61a0
leaq 0xe0(%rsp), %r12
leaq 0x390(%rsp), %r14
jmp 0x7192
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x74a8
movq 0xfbb9(%rip), %rdi      # 0x16fe8
leaq 0x7ff2(%rip), %rsi      # 0xf428
movl $0x13, %edx
callq 0x6390
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0xfb97(%rip), %rdi      # 0x16fe8
callq 0x6390
movq %rax, %rbx
leaq 0x7fc6(%rip), %rsi      # 0xf426
movl $0x1, %r14d
movl $0x1, %edx
movq %rax, %rdi
callq 0x6390
leaq 0x20(%rsp), %rdi
movl %r15d, %esi
movl $0x2, %edx
callq 0x8b0a
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x6510
movq %rax, %rdi
leaq 0x7bf0(%rip), %rsi      # 0xf08b
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r14, %rdx
callq 0x6390
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x74cd
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x6310
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x74e9
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6310
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x7506
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
leaq 0x20(%rsp), %rdi
callq 0x8b64
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x7535
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x6310
movq 0xfa24(%rip), %rsi      # 0x16f60
leaq 0x208(%rsp), %rdi
callq 0x6260
leaq 0x288(%rsp), %rdi
callq 0x6100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x756d
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x758a
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x75a7
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x75cc
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x6310
leaq 0x4b0(%rsp), %rdi
callq 0x6100
movq 0xf9d8(%rip), %rax      # 0x16fb8
movq (%rax), %rcx
movq 0x8(%rax), %rax
leaq 0x3a0(%rsp), %rdi
movq %rcx, -0x10(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x390(%rsp,%rcx)
movq $0x0, -0x8(%rdi)
callq 0x6100
leaq 0x1a8(%rsp), %rdi
callq 0x8bae
leaq 0x178(%rsp), %rdi
callq 0x8cec
movl %ebx, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf9a7(%rip), %rdi      # 0x16fe8
leaq 0x7da7(%rip), %rsi      # 0xf3ef
movl $0x19, %edx
callq 0x6390
movq 0xf98f(%rip), %rdi      # 0x16fe8
movl %r15d, %esi
callq 0x6580
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x7a1e(%rip), %rsi      # 0xf08b
movl $0x1, %edx
movq %rax, %rdi
callq 0x6390
jmp 0x7510
leaq 0x20(%rsp), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x2, %edx
callq 0x8b0a
movsd (%rax), %xmm0
ucomisd 0xc0(%rsp), %xmm0
jne 0x76a7
jnp 0x74a8
decl %r15d
leaq 0x20(%rsp), %r13
leaq 0xd8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl %r15d, %esi
movsd 0xc8(%rsp), %xmm0
leaq 0x160(%rsp), %rbp
movq %rbp, %r8
callq 0x8434
leaq 0xd0(%rsp), %r12
movsd %xmm0, (%r12)
xorl %ebx, %ebx
movq %r13, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x8b0a
cvttsd2si (%rax), %rax
leaq 0x14(%rsp), %r14
movl %eax, (%r14)
movq %r13, %rdi
movl %r15d, %esi
movl $0x2, %edx
callq 0x8b0a
cvttsd2si (%rax), %rax
leaq 0x10(%rsp), %r8
movl %eax, (%r8)
leaq 0x4(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x4a8(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movq %r12, %rsi
movq %r14, %rcx
leaq 0xd8(%rsp), %r9
pushq %rbp
leaq 0x38(%rsp), %rax
pushq %rax
callq 0x858c
addq $0x10, %rsp
jmp 0x74a8
movl $0x1c, %r14d
leaq 0x7cc9(%rip), %rsi      # 0xf43c
movq 0xf86e(%rip), %rdi      # 0x16fe8
jmp 0x749b
jmp 0x77ef
jmp 0x77c0
jmp 0x77ea
jmp 0x77ef
movq %rax, %rbx
jmp 0x7833
jmp 0x77ea
movq %rax, %rbx
jmp 0x78a0
movq %rax, %rbx
jmp 0x7916
movq %rax, %rbx
jmp 0x7923
jmp 0x77c0
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x896c
jmp 0x7956
movq %rax, %rbx
jmp 0x7956
jmp 0x77ca
movq %rax, %rbx
jmp 0x7963
jmp 0x77ef
jmp 0x77ea
jmp 0x77ea
jmp 0x77ea
jmp 0x77ea
jmp 0x77ea
jmp 0x77ef
jmp 0x77ea
movq %rax, %rbx
jmp 0x78f1
movq %rax, %rbx
jmp 0x785a
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x7817
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x6310
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7833
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6310
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x7850
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
leaq 0x20(%rsp), %rdi
callq 0x8b64
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x787f
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x6310
movq 0xf6da(%rip), %rsi      # 0x16f60
leaq 0x208(%rsp), %rdi
callq 0x6260
leaq 0x288(%rsp), %rdi
callq 0x6100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x78b7
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x78d4
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x78f1
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x7916
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x6310
leaq 0x4b0(%rsp), %rdi
callq 0x6100
movq 0xf68e(%rip), %rax      # 0x16fb8
movq (%rax), %rcx
movq 0x8(%rax), %rax
leaq 0x3a0(%rsp), %rdi
movq %rcx, -0x10(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x390(%rsp,%rcx)
movq $0x0, -0x8(%rdi)
callq 0x6100
leaq 0x1a8(%rsp), %rdi
callq 0x8bae
leaq 0x178(%rsp), %rdi
callq 0x8cec
movq %rbx, %rdi
callq 0x6590