// File: /workspace/github_cpp_makefile_star2_O1/tonymugen[P]sampleSNPs/sampleLD.cpp
// Function: main
int main(int argc, char *argv[]){
	string inFileStub;  // input file name stub (without extension)
	string popFileName; // population index file name
	string nSampTxt;    // string version of the number of samples
	uint64_t n;         // number of samples
	bool pop = false;   // are we stratifying by population?

	// set usage message
	string cliHelp = "Command line flags required (in any order):\n  -s NNN (number of samples)\n  -i fileStub (input file name, without extension)\n  -p popIndexFile (optional file with the population index)";
	unordered_map <char, string> clInfo;
	parseCL(argc, argv, clInfo);
	auto clIter = clInfo.begin(); // iterator of the command line flags

	// processing CL input
	clIter = clInfo.find('s');
	if (clIter == clInfo.end()) { // if not there, complain
		cerr << "ERROR: specification of the number of samples is required" << endl;
		cerr << cliHelp << endl;
		exit(1);
	} else {
		n        = stoi(clIter->second);
		nSampTxt = clIter->second;
	}
	clIter = clInfo.find('i');
	if (clIter == clInfo.end()) { // if not there, complain
		cerr << "ERROR: specification of the input file name is required" << endl;
		cerr << cliHelp << endl;
		exit(1);
	} else {
		inFileStub = clIter->second;
	}

	clIter = clInfo.find('p');
	if (clIter != clInfo.end()) {
		pop         = true;
		popFileName = clIter->second;
	}
	if (pop) { // stratify by population
		PopIndex popIdx(popFileName);
		BedFileI inBed(inFileStub);
		inBed.sampleLD(popIdx, n);
	} else {
		BedFileI inBed(inFileStub);
		inBed.sampleLD(n);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x778, %rsp            # imm = 0x778
movq %rsi, %rbx
movl %edi, 0xc(%rsp)
leaq 0x48(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x68(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x11f9d(%rip), %rsi     # 0x1707f
leaq 0x1204d(%rip), %rdx     # 0x17136
leaq 0x10(%rsp), %rdi
callq 0x59fc
leaq 0xc8(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0xc(%rsp), %rdi
leaq 0x98(%rsp), %rdx
movq %rbx, %rsi
callq 0x4f4c
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdi
xorl %r9d, %r9d
movl $0x73, %eax
xorl %edx, %edx
divq %rdi
movq %rdx, %rcx
movl %ecx, %eax
movq (%rsi,%rax,8), %rax
testq %rax, %rax
je 0x5197
movq (%rax), %r8
cmpb $0x73, 0x8(%r8)
movq %rax, %r9
je 0x5197
movq %r8, %r10
movq (%r8), %r8
testq %r8, %r8
je 0x5194
movsbq 0x8(%r8), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r9d
cmpq %rcx, %rdx
jne 0x5197
movq %r10, %r9
cmpb $0x73, %sil
jne 0x5166
jmp 0x5197
xorl %r9d, %r9d
testq %r9, %r9
je 0x51a1
movq (%r9), %rbx
jmp 0x51a3
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x5463
movq 0x10(%rbx), %r15
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0xf0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x4390
cmpq %r15, (%r12)
je 0x54a7
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x54b3
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x54b3
addq $0x10, %rbx
testl %ecx, %ecx
jne 0x5205
movl %ebp, (%r14)
cltq
movq %rax, 0x30(%rsp)
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x4140
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdi
xorl %r9d, %r9d
movl $0x69, %eax
xorl %edx, %edx
divq %rdi
movq %rdx, %rcx
movl %ecx, %eax
movq (%rsi,%rax,8), %rax
testq %rax, %rax
je 0x5282
movq (%rax), %r8
cmpb $0x69, 0x8(%r8)
movq %rax, %r9
je 0x5282
movq %r8, %r10
movq (%r8), %r8
testq %r8, %r8
je 0x527f
movsbq 0x8(%r8), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r9d
cmpq %rcx, %rdx
jne 0x5282
movq %r10, %r9
cmpb $0x69, %sil
jne 0x5251
jmp 0x5282
xorl %r9d, %r9d
testq %r9, %r9
je 0x528c
movq (%r9), %rsi
jmp 0x528e
xorl %esi, %esi
testq %rsi, %rsi
je 0x54bf
addq $0x10, %rsi
leaq 0x38(%rsp), %rdi
callq 0x4140
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdi
xorl %r9d, %r9d
movl $0x70, %eax
xorl %edx, %edx
divq %rdi
movq %rdx, %rcx
movl %ecx, %eax
movq (%rsi,%rax,8), %rax
testq %rax, %rax
je 0x530e
movq (%rax), %r8
cmpb $0x70, 0x8(%r8)
movq %rax, %r9
je 0x530e
movq %r8, %r10
movq (%r8), %r8
testq %r8, %r8
je 0x530b
movsbq 0x8(%r8), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r9d
cmpq %rcx, %rdx
jne 0x530e
movq %r10, %r9
cmpb $0x70, %sil
jne 0x52dd
jmp 0x530e
xorl %r9d, %r9d
testq %r9, %r9
je 0x5318
movq (%r9), %rsi
jmp 0x531a
xorl %esi, %esi
testq %rsi, %rsi
je 0x5395
addq $0x10, %rsi
leaq 0x58(%rsp), %rdi
callq 0x4140
leaq 0xd0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x15d02
leaq 0xf0(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x6b2e
leaq 0x19668(%rip), %rax     # 0x1e9c0
addq $0x10, %rax
leaq 0xf0(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xd0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xc92c
leaq 0xf0(%rsp), %rdi
callq 0x6cde
leaq 0xd0(%rsp), %rdi
callq 0x55ec
jmp 0x53d4
leaq 0xf0(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x6b2e
leaq 0x19612(%rip), %rax     # 0x1e9c0
addq $0x10, %rax
leaq 0xf0(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x30(%rsp), %rsi
callq 0xaf48
leaq 0xf0(%rsp), %rdi
callq 0x6cde
leaq 0x98(%rsp), %rdi
callq 0x563a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x53fd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42b0
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x5417
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42b0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x5433
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x544f
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42b0
xorl %eax, %eax
addq $0x778, %rsp            # imm = 0x778
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x19b86(%rip), %rdi     # 0x1eff0
leaq 0x11cc6(%rip), %rsi     # 0x17137
movl $0x39, %edx
callq 0x42d0
movq 0x19b6e(%rip), %rdi     # 0x1eff0
callq 0x4110
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x19b58(%rip), %rdi     # 0x1eff0
callq 0x42d0
movq %rax, %rdi
callq 0x4110
jmp 0x5501
leaq 0x11cfb(%rip), %rdi     # 0x171a9
callq 0x4160
leaq 0x11cef(%rip), %rdi     # 0x171a9
callq 0x43b0
movq 0x19b2a(%rip), %rdi     # 0x1eff0
leaq 0x11ca4(%rip), %rsi     # 0x17171
movl $0x37, %edx
callq 0x42d0
movq 0x19b12(%rip), %rdi     # 0x1eff0
callq 0x4110
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x19afc(%rip), %rdi     # 0x1eff0
callq 0x42d0
movq %rax, %rdi
callq 0x4110
movl $0x1, %edi
callq 0x42f0
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x6cde
jmp 0x555d
jmp 0x555a
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x6cde
jmp 0x5534
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x55ec
jmp 0x555d
jmp 0x555a
jmp 0x555a
movq %rax, %rbx
jmp 0x5586
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x555d
movl %ebp, (%r14)
jmp 0x555d
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x563a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5586
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42b0
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x55a0
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42b0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x55bc
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x55d8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42b0
movq %rbx, %rdi
callq 0x44c0