// File: /workspace/github_cpp_makefile_star2_O2/melop[P]admixem/simulation.cpp
// Function: UIExportResults()
void UIExportResults() {
	UILoadConfig();
		
	int nGen = 0; // generation to sample:
	int nRep = 0; //which replicate to sample from?
	string sExportFolder;
	int nPop1Size, nPop2Size, nPop3Size , nMarkerNum; // how many individuals to sample
	double nRandSeed;

	while(true) { //
		
			std::cout << "\n Which generation to sample? :" ;
			std::cin >> nGen;
			
			if (nGen < 0 ) {
				std::cout << "\n Make sure the generation is correct. \n";
				continue; // 
			}
			else {
				break;
			}
			
			
			
		}

	while(true) { //
		
			std::cout << "\n Which replicate to sample? Starting from 0 :" ;
			std::cin >> nRep;
			
			if (nRep < 0 ) {
				std::cout << "\n Make sure the replicate number is correct. \n";
				continue; // 
			}
			else {
				break;
			}
			
			
			
		}

	while(true) { //
		
			std::cout << "\n Export to folder :" ;
			std::cin >> sExportFolder;
			
			if (sExportFolder.size() == 0 ) {
				std::cout << "\n Make sure the folder name is correct. \n";
				continue; // 
			}
			else {
				fnMakeDir(sExportFolder.c_str()); // make dir.
				break;
			}
			
			
			
		}

	/*
	while(true) { //
		
			std::cout << "\n How many individuals to sample for each pop (-1 to include all) in the order of pop1 pop2 pophybrid :" ;
			if(scanf("%d %d %d", &nPop1Size, &nPop2Size, &nPop3Size)!=3) {
				continue;
			}
			else {
				break;
			}
			
		}
		*/
	nPop1Size = -1;
	nPop2Size = -1;
	nPop3Size = -1;

	while(true) { //
		
			std::cout << "\n How many markers to sample? max: 10000 :" ;
			if(scanf("%d", &nMarkerNum)!=1) {
				continue;
			}
			else {
				break;
			}
			
		}

	while(true) { //
		
			std::cout << "\n Random Seed? 0-1 :" ;
			if(scanf("%lf", &nRandSeed)!=1) {
				continue;
			}
			else {
				break;
			}
			
		}


	PerformExport(nGen, nRep, sExportFolder, nPop1Size, nPop2Size, nPop3Size, nMarkerNum, nRandSeed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
callq 0x299fe
leaq 0x18(%rsp), %rbx
andl $0x0, (%rbx)
andl $0x0, 0x14(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x19906(%rip), %r14     # 0x44f90
leaq 0x48d6(%rip), %r15      # 0x2ff67
movq 0x19938(%rip), %r12     # 0x44fd0
leaq 0x48e8(%rip), %r13      # 0x2ff87
movq %r14, %rdi
movq %r15, %rsi
callq 0x73d0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7250
cmpl $0x0, 0x18(%rsp)
jns 0x2b6c9
movq %r14, %rdi
movq %r13, %rsi
callq 0x73d0
jmp 0x2b69f
movq 0x198c0(%rip), %rbx     # 0x44f90
leaq 0x48d9(%rip), %r14      # 0x2ffb0
movq 0x198f2(%rip), %r15     # 0x44fd0
leaq 0x14(%rsp), %r12
leaq 0x48f5(%rip), %r13      # 0x2ffdf
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73d0
movq %r15, %rdi
movq %r12, %rsi
callq 0x7250
cmpl $0x0, 0x14(%rsp)
jns 0x2b714
movq %rbx, %rdi
movq %r13, %rsi
callq 0x73d0
jmp 0x2b6ea
movq 0x19875(%rip), %rbx     # 0x44f90
leaq 0x48ec(%rip), %r14      # 0x3000e
movq 0x198a7(%rip), %r15     # 0x44fd0
leaq 0x28(%rsp), %r12
leaq 0x48ee(%rip), %r13      # 0x30023
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73d0
movq %r15, %rdi
movq %r12, %rsi
callq 0x74e0
cmpq $0x0, 0x30(%rsp)
jne 0x2b760
movq %rbx, %rdi
movq %r13, %rsi
callq 0x73d0
jmp 0x2b735
movq 0x28(%rsp), %rdi
callq 0x2b571
movq 0x1981f(%rip), %rbx     # 0x44f90
leaq 0x48d5(%rip), %r14      # 0x3004d
leaq 0x22fb(%rip), %r15      # 0x2da7a
leaq 0x1c(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73d0
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x7460
cmpl $0x1, %eax
jne 0x2b784
movq 0x197e8(%rip), %rbx     # 0x44f90
leaq 0x48c9(%rip), %r14      # 0x30078
leaq 0x24d3(%rip), %r15      # 0x2dc89
leaq 0x20(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73d0
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x7460
cmpl $0x1, %eax
jne 0x2b7bb
movl 0x18(%rsp), %ebx
movl 0x14(%rsp), %ebp
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x7550
movl 0x1c(%rsp), %eax
movsd 0x20(%rsp), %xmm0
movl %eax, (%rsp)
leaq 0x48(%rsp), %rdx
movl %ebx, %edi
movl %ebp, %esi
callq 0x2b85b
leaq 0x48(%rsp), %rdi
callq 0x71a0
leaq 0x28(%rsp), %rdi
callq 0x71a0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x71a0
jmp 0x2b849
jmp 0x2b846
jmp 0x2b846
jmp 0x2b846
jmp 0x2b846
jmp 0x2b846
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x71a0
movq %rbx, %rdi
callq 0x76d0