// File: tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::HmpFileI::sample(sampFiles::HmpFileO&, unsigned long const&)
void HmpFileI::sample(HmpFileO &out, const uint64_t &n){
	if (n == 0) {
		cerr << "WARNING: zero SNPs requested. Nothing to be done." << endl;
		return;
	}
	// start by figuring out the number of SNPs in the file
	if (out._varFile.is_open()) {
		out.close();
	}

	uint64_t N = _numLines(); // Number of SNPs

	try {
		_varFile.open(_fileName.c_str(), ios::in);
		if (!_varFile.is_open()) {
			cerr << "ERROR: failed to open HMP file " << _fileName << " for input" << endl;
			exit(2);
		}

	} catch (system_error &error) {
		cerr << "ERROR: cannot open HMP file " << _fileName << " for input: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}

	try {
		out._varFile.open(out._fileName.c_str(), ios::out | ios::trunc);
		if (!out._varFile.is_open()) {
			cerr << "ERROR: failed to open HMP file " << out._fileName << " for output" << endl;
			exit(2);
		}

	} catch (system_error &error) {
		cerr << "ERROR: cannot open HMP file " << out._fileName << " for output: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}

	// Test for potential problems
	if (N < n) {
		cerr << "ERROR: requested a sample of " << n << " SNPs that is greater than the number of SNPs (" << N << ") in the input file." << endl;
		return;
	} else if (N == n) {
		cerr << "WARNING: sample size (" << n << ") the same as the number of SNPs (" << N << ") in the input file. Simply copying the files." << endl;
		char *buf;
		const size_t bufSize = BUF_SIZE;
		try {
			buf = new char[bufSize];
		} catch (bad_alloc&) {
			cerr << "ERROR: failed to allocate buffer" << endl;
			exit(4);
		}

		// Copy .hmp
		while (_varFile) {
			_varFile.read(buf, bufSize);
			out._varFile.write(buf, _varFile.gcount());
		}
		_varFile.close();
		out._varFile.close();
		delete [] buf;
		return;
	}

	// Passed all the tests, proceed to sampling
	string curLine;
	char tag[3];
	_varFile.read(tag, 3);
	_varFile.seekg(0);
	if ( (tag[0] == 'r') && (tag[1] == 's') && (tag[2] == '#') ) {
		string header;
		getline(_varFile, header);
		out._varFile << header << endl;
	}

	uint64_t nloc = n; // local copy of n
	uint64_t S;
	RanDraw *snpSamp;  // so that I can catch RanDraw constructor exceptions
	try {
		snpSamp = new RanDraw();
	} catch (string error) {
		cerr << "ERROR: " << error << endl;
		exit(5);
	}
	while (nloc) {
		try {
			S = snpSamp->vitter(nloc, N); // sample the number of SNPs to skip
		} catch (string error) {
			cerr << "ERROR: " << error << endl;
			exit(5);
		}
		N -= S + 1;
		while (S) { // skipping S lines in the HMP file
			_varFile.ignore(numeric_limits<streamsize>::max(), '\n');
			S--;
		}
		getline(_varFile, curLine);
		out._varFile << curLine << endl;
		nloc--;

	}
	_varFile.close();
	out._varFile.close();
	delete snpSamp;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1e0e3
movq 0xdf2d(%rip), %rdi      # 0x2bff0
leaq 0x54e2(%rip), %rsi      # 0x235ac
callq 0x4310
movq %rax, %rdi
movq 0xded7(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1ec3a
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
testb $0x1, %al
jne 0x1e0f6
jmp 0x1e100
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x160(%rbp), %rdi
callq 0x1dc10
movq -0x160(%rbp), %rdi
movq %rax, -0x20(%rbp)
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x168(%rbp)
addq $0x218, %rdi            # imm = 0x218
callq 0x4140
movq -0x168(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x42f0
jmp 0x1e147
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
movb %al, -0x169(%rbp)
jmp 0x1e15f
movb -0x169(%rbp), %al
testb $0x1, %al
jne 0x1e2d3
jmp 0x1e16f
movq 0xde7a(%rip), %rdi      # 0x2bff0
leaq 0x5cd9(%rip), %rsi      # 0x23e56
callq 0x4310
movq %rax, -0x178(%rbp)
jmp 0x1e18b
movq -0x178(%rbp), %rdi
movq -0x160(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x180(%rbp)
jmp 0x1e1ae
movq -0x180(%rbp), %rdi
leaq 0x5398(%rip), %rsi      # 0x23554
callq 0x4310
movq %rax, -0x188(%rbp)
jmp 0x1e1ca
movq -0x188(%rbp), %rdi
movq 0xddd8(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1e1df
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1ec4f
movq -0x28(%rbp), %rdi
callq 0x4130
movq %rax, -0x38(%rbp)
movq 0xddd7(%rip), %rdi      # 0x2bff0
leaq 0x5c56(%rip), %rsi      # 0x23e76
callq 0x4310
movq %rax, -0x190(%rbp)
jmp 0x1e22e
movq -0x190(%rbp), %rdi
movq -0x160(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x198(%rbp)
jmp 0x1e251
movq -0x198(%rbp), %rdi
leaq 0x5786(%rip), %rsi      # 0x239e5
callq 0x4310
movq %rax, -0x1a0(%rbp)
jmp 0x1e26d
movq -0x38(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x1eeb0
jmp 0x1e284
movq -0x1a0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x42e0
movq %rax, -0x1a8(%rbp)
jmp 0x1e29d
movq -0x1a8(%rbp), %rdi
movq 0xdd1d(%rip), %rsi      # 0x2bfc8
callq 0x4350
jmp 0x1e2b2
leaq -0x58(%rbp), %rdi
callq 0x46d8
leaq 0x5538(%rip), %rdi      # 0x237fa
callq 0x42a0
jmp 0x1e2c9
movl $0x1, %edi
callq 0x4400
jmp 0x1e304
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1e2f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x1e2ff
jmp 0x1ec4f
movq -0x10(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x1c0(%rbp)
addq $0x218, %rdi            # imm = 0x218
callq 0x4140
movq %rax, -0x1b8(%rbp)
movl $0x10, %edi
movl $0x20, %esi
callq 0x1ee70
movl %eax, -0x1ac(%rbp)
jmp 0x1e340
movl -0x1ac(%rbp), %edx
movq -0x1b8(%rbp), %rsi
movq -0x1c0(%rbp), %rdi
callq 0x42f0
jmp 0x1e35b
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
movb %al, -0x1c1(%rbp)
jmp 0x1e370
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0x1e4de
jmp 0x1e380
movq 0xdc69(%rip), %rdi      # 0x2bff0
leaq 0x5ac8(%rip), %rsi      # 0x23e56
callq 0x4310
movq %rax, -0x1d0(%rbp)
jmp 0x1e39c
movq -0x1d0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x1d8(%rbp)
jmp 0x1e3bc
movq -0x1d8(%rbp), %rdi
leaq 0x5300(%rip), %rsi      # 0x236ca
callq 0x4310
movq %rax, -0x1e0(%rbp)
jmp 0x1e3d8
movq -0x1e0(%rbp), %rdi
movq 0xdbca(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1e3ed
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1ec4f
movq -0x28(%rbp), %rdi
callq 0x4130
movq %rax, -0x60(%rbp)
movq 0xdbc9(%rip), %rdi      # 0x2bff0
leaq 0x5a48(%rip), %rsi      # 0x23e76
callq 0x4310
movq %rax, -0x1e8(%rbp)
jmp 0x1e43c
movq -0x1e8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x1f0(%rbp)
jmp 0x1e45c
movq -0x1f0(%rbp), %rdi
leaq 0x526c(%rip), %rsi      # 0x236d6
callq 0x4310
movq %rax, -0x1f8(%rbp)
jmp 0x1e478
movq -0x60(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x1eeb0
jmp 0x1e48f
movq -0x1f8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x42e0
movq %rax, -0x200(%rbp)
jmp 0x1e4a8
movq -0x200(%rbp), %rdi
movq 0xdb12(%rip), %rsi      # 0x2bfc8
callq 0x4350
jmp 0x1e4bd
leaq -0x80(%rbp), %rdi
callq 0x46d8
leaq 0x532d(%rip), %rdi      # 0x237fa
callq 0x42a0
jmp 0x1e4d4
movl $0x1, %edi
callq 0x4400
jmp 0x1e50f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1e503
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x1e50a
jmp 0x1ec4f
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e57c
movq 0xdacd(%rip), %rdi      # 0x2bff0
leaq 0x50b4(%rip), %rsi      # 0x235de
callq 0x4310
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0x5398(%rip), %rsi      # 0x238e0
callq 0x4310
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0x50c9(%rip), %rsi      # 0x2362c
callq 0x4310
movq %rax, %rdi
movq 0xda3e(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1ec3a
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x1e762
movq 0xda5c(%rip), %rdi      # 0x2bff0
leaq 0x50a6(%rip), %rsi      # 0x23641
callq 0x4310
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0x5357(%rip), %rsi      # 0x23910
callq 0x4310
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0x535f(%rip), %rsi      # 0x23933
callq 0x4310
movq %rax, %rdi
movq 0xd9cd(%rip), %rsi      # 0x2bfb0
callq 0x4350
movq $0xa00000, -0x90(%rbp) # imm = 0xA00000
movl $0xa00000, %edi         # imm = 0xA00000
callq 0x4030
movq %rax, -0x208(%rbp)
jmp 0x1e606
movq -0x208(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1e695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x3, %ecx
cmpl %ecx, %eax
jne 0x1ec4f
movq -0x28(%rbp), %rdi
callq 0x4130
movq %rax, -0x98(%rbp)
movq 0xd9a7(%rip), %rdi      # 0x2bff0
leaq 0x5059(%rip), %rsi      # 0x236a9
callq 0x4310
movq %rax, -0x210(%rbp)
jmp 0x1e65e
movq -0x210(%rbp), %rdi
movq 0xd944(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1e673
movl $0x4, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x4580
jmp 0x1e690
jmp 0x1ec4f
jmp 0x1e697
movq -0x160(%rbp), %rax
movq %rax, %rdi
addq $0x8, %rdi
movq 0x8(%rax), %rax
addq -0x18(%rax), %rdi
callq 0x4440
testb $0x1, %al
jne 0x1e6b8
jmp 0x1e720
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
movq -0x88(%rbp), %rsi
movl $0xa00000, %edx         # imm = 0xA00000
callq 0x4450
movq -0x160(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x8, %rax
addq $0x10, %rax
movq %rax, -0x220(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x218(%rbp)
addq $0x8, %rdi
callq 0x46c0
movq -0x220(%rbp), %rdi
movq -0x218(%rbp), %rsi
movq %rax, %rdx
callq 0x44a0
jmp 0x1e697
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
movq -0x88(%rbp), %rax
movq %rax, -0x228(%rbp)
cmpq $0x0, %rax
je 0x1e75d
movq -0x228(%rbp), %rdi
callq 0x4480
jmp 0x1ec3a
jmp 0x1e764
leaq -0xb8(%rbp), %rdi
callq 0x44d0
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
leaq -0xbb(%rbp), %rsi
movl $0x3, %edx
callq 0x4450
jmp 0x1e78e
movq -0x160(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x230(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0xd0(%rbp), %rdi
callq 0x1ef20
jmp 0x1e7b2
movq -0x230(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
callq 0x4460
jmp 0x1e7ce
movsbl -0xbb(%rbp), %eax
cmpl $0x72, %eax
jne 0x1e898
movsbl -0xba(%rbp), %eax
cmpl $0x73, %eax
jne 0x1e898
movsbl -0xb9(%rbp), %eax
cmpl $0x23, %eax
jne 0x1e898
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x44d0
movq -0x160(%rbp), %rdi
movq -0x238(%rbp), %rsi
addq $0x8, %rdi
callq 0x4080
jmp 0x1e82a
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x42e0
movq %rax, -0x240(%rbp)
jmp 0x1e847
movq -0x240(%rbp), %rdi
movq 0xd75b(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1e85c
leaq -0xf0(%rbp), %rdi
callq 0x46d8
jmp 0x1e898
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1ec43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x46d8
jmp 0x1ec43
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
movl $0x8, %edi
callq 0x4330
movq %rax, -0x248(%rbp)
jmp 0x1e8b9
movq -0x248(%rbp), %rdi
callq 0x22380
jmp 0x1e8c7
movq -0x248(%rbp), %rax
movq %rax, -0x108(%rbp)
jmp 0x1e9bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1e905
movq -0x248(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x8, %esi
callq 0x4340
movl -0x2c(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x1ec43
movq -0x28(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x4430
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
callq 0x4150
jmp 0x1e936
movq -0x250(%rbp), %rdi
callq 0x4130
movq 0xd6a7(%rip), %rdi      # 0x2bff0
leaq 0x4dbd(%rip), %rsi      # 0x2370d
callq 0x4310
movq %rax, -0x258(%rbp)
jmp 0x1e95e
movq -0x258(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x42e0
movq %rax, -0x260(%rbp)
jmp 0x1e97a
movq -0x260(%rbp), %rdi
movq 0xd628(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1e98f
movl $0x5, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x1e9b8
jmp 0x1ec43
jmp 0x1e9bf
cmpq $0x0, -0xf8(%rbp)
je 0x1ebdc
movq -0x108(%rbp), %rdi
movq -0xf8(%rbp), %xmm0
movaps 0x4abd(%rip), %xmm2     # 0x234a0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x4ac1(%rip), %xmm1     # 0x234b0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm3, %xmm0
movsd %xmm0, -0x130(%rbp)
movq -0x20(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x138(%rbp)
leaq -0x130(%rbp), %rsi
leaq -0x138(%rbp), %rdx
callq 0x227a0
movq %rax, -0x268(%rbp)
jmp 0x1ea42
movq -0x268(%rbp), %rax
movq %rax, -0x100(%rbp)
jmp 0x1eb19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x1ec43
movq -0x28(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x4430
movq %rax, %rsi
leaq -0x158(%rbp), %rdi
callq 0x4150
jmp 0x1ea92
movq -0x270(%rbp), %rdi
callq 0x4130
movq 0xd54b(%rip), %rdi      # 0x2bff0
leaq 0x4c61(%rip), %rsi      # 0x2370d
callq 0x4310
movq %rax, -0x278(%rbp)
jmp 0x1eaba
movq -0x278(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x42e0
movq %rax, -0x280(%rbp)
jmp 0x1ead6
movq -0x280(%rbp), %rdi
movq 0xd4cc(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1eaeb
movl $0x5, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x1eb14
jmp 0x1ec43
movq -0x100(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x100(%rbp)
je 0x1eb7a
movq -0x160(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x288(%rbp)
callq 0x1f390
movq -0x288(%rbp), %rdi
movq %rax, %rsi
movl $0xa, %edx
callq 0x41f0
jmp 0x1eb66
movq -0x100(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x1eb2f
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4080
jmp 0x1eb93
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x42e0
movq %rax, -0x290(%rbp)
jmp 0x1ebb0
movq -0x290(%rbp), %rdi
movq 0xd3f2(%rip), %rsi      # 0x2bfb0
callq 0x4350
jmp 0x1ebc5
movq -0xf8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x1e9bf
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
jmp 0x1ebee
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
jmp 0x1ebfd
movq -0x108(%rbp), %rax
movq %rax, -0x298(%rbp)
cmpq $0x0, %rax
je 0x1ec2e
movq -0x298(%rbp), %rdi
callq 0x1ef60
movq -0x298(%rbp), %rdi
movl $0x8, %esi
callq 0x4340
leaq -0xb8(%rbp), %rdi
callq 0x46d8
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
leaq -0xb8(%rbp), %rdi
callq 0x46d8
movq -0x28(%rbp), %rdi
callq 0x4610
movq %rax, %rdi
callq 0x82c0