// File: /workspace/github_cpp_makefile_star2_O1/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 0x2ece6
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 0x16d5e(%rip), %r14     # 0x48f90
leaq 0x5d56(%rip), %r15      # 0x37f8f
movq 0x16d90(%rip), %r12     # 0x48fd0
leaq 0x5d68(%rip), %r13      # 0x37faf
movl $0x1f, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x7400
movq %r12, %rdi
movq %rbx, %rsi
callq 0x71f0
cmpl $0x0, 0x18(%rsp)
jns 0x3227b
movl $0x28, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x7400
jmp 0x32247
movq 0x16d0e(%rip), %rbx     # 0x48f90
leaq 0x5d4f(%rip), %r14      # 0x37fd8
movq 0x16d40(%rip), %r15     # 0x48fd0
leaq 0x14(%rsp), %r12
leaq 0x5d6b(%rip), %r13      # 0x38007
movl $0x2e, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7400
movq %r15, %rdi
movq %r12, %rsi
callq 0x71f0
cmpl $0x0, 0x14(%rsp)
jns 0x322d0
movl $0x2e, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7400
jmp 0x3229c
movq 0x16cb9(%rip), %rbx     # 0x48f90
leaq 0x5d58(%rip), %r14      # 0x38036
movq 0x16ceb(%rip), %r15     # 0x48fd0
leaq 0x20(%rsp), %r12
leaq 0x5d5a(%rip), %r13      # 0x3804b
movl $0x14, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7400
movq %r15, %rdi
movq %r12, %rsi
callq 0x7480
cmpq $0x0, 0x28(%rsp)
jne 0x32326
movl $0x29, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7400
jmp 0x322f1
movq %rbp, %r13
movq 0x20(%rsp), %rdi
callq 0x31fff
movq 0x16c56(%rip), %rbx     # 0x48f90
leaq 0x5d34(%rip), %r14      # 0x38075
leaq 0x3762(%rip), %r15      # 0x35aaa
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 0x3234d
movq 0x16c1a(%rip), %rbx     # 0x48f90
leaq 0x5d23(%rip), %r14      # 0x380a0
leaq 0x3935(%rip), %r15      # 0x35cb9
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 0x32389
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 0xa916
movl 0x1c(%rsp), %eax
movsd 0x40(%rsp), %xmm0
movl %eax, (%rsp)
leaq 0x48(%rsp), %rdx
movl %ebx, %edi
movl %ebp, %esi
callq 0x32479
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x32405
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x3241c
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 0x3244e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x3244e
jmp 0x3244b
jmp 0x3244b
movq %rax, %rbx
movq %r13, %rbp
jmp 0x3245a
jmp 0x32457
jmp 0x32457
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x32471
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movq %rbx, %rdi
callq 0x76a0