// File: /workspace/github_cpp_makefile_star2_O3/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 0x2e84f
xorl %eax, %eax
leaq 0x18(%rsp), %rbx
movl %eax, (%rbx)
movl %eax, 0x14(%rsp)
leaq 0x30(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
movq 0x1622a(%rip), %r14     # 0x47f90
leaq 0x522a(%rip), %r15      # 0x36f97
movq 0x1625c(%rip), %r12     # 0x47fd0
leaq 0x523c(%rip), %r13      # 0x36fb7
movl $0x1f, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x7400
movq %r12, %rdi
movq %rbx, %rsi
callq 0x71f0
cmpl $0x0, 0x18(%rsp)
jns 0x31daf
movl $0x28, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x7400
jmp 0x31d7b
movq 0x161da(%rip), %rbx     # 0x47f90
leaq 0x5223(%rip), %r14      # 0x36fe0
movq 0x1620c(%rip), %r15     # 0x47fd0
leaq 0x14(%rsp), %r12
leaq 0x523f(%rip), %r13      # 0x3700f
movl $0x2e, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7400
movq %r15, %rdi
movq %r12, %rsi
callq 0x71f0
cmpl $0x0, 0x14(%rsp)
jns 0x31e04
movl $0x2e, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7400
jmp 0x31dd0
movq 0x16185(%rip), %rbx     # 0x47f90
leaq 0x522c(%rip), %r14      # 0x3703e
movq 0x161b7(%rip), %r15     # 0x47fd0
leaq 0x20(%rsp), %r12
leaq 0x522e(%rip), %r13      # 0x37053
movl $0x14, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7400
movq %r15, %rdi
movq %r12, %rsi
callq 0x7480
cmpq $0x0, 0x28(%rsp)
jne 0x31e5a
movl $0x29, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7400
jmp 0x31e25
movq %rbp, %r13
movq 0x20(%rsp), %rdi
callq 0x31b35
movq 0x16122(%rip), %rbx     # 0x47f90
leaq 0x5208(%rip), %r14      # 0x3707d
leaq 0x2c4e(%rip), %r15      # 0x34aca
leaq 0x1c(%rsp), %r12
movl $0x2a, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7400
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x7410
cmpl $0x1, %eax
jne 0x31e81
movq 0x160e6(%rip), %rbx     # 0x47f90
leaq 0x51f7(%rip), %r14      # 0x370a8
leaq 0x2e21(%rip), %r15      # 0x34cd9
leaq 0x40(%rsp), %r12
movl $0x14, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7400
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x7410
cmpl $0x1, %eax
jne 0x31ebd
movl 0x18(%rsp), %ebx
movl 0x14(%rsp), %ebp
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0xa9b2
movl 0x1c(%rsp), %eax
movsd 0x40(%rsp), %xmm0
movl %eax, (%rsp)
leaq 0x48(%rsp), %rdx
movl %ebx, %edi
movl %ebp, %esi
callq 0x31fad
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x31f39
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x31f50
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x31f82
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x31f82
jmp 0x31f7f
jmp 0x31f7f
movq %rax, %rbx
movq %r13, %rbp
jmp 0x31f8e
jmp 0x31f8b
jmp 0x31f8b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x31fa5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movq %rbx, %rdi
callq 0x76a0