// File: 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
movq %rsp, %rbp
subq $0x90, %rsp
callq 0x6e150
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x86b0
jmp 0x70f69
movq 0x39018(%rip), %rdi     # 0xa9f88
leaq 0x83ae(%rip), %rsi      # 0x79325
callq 0x84a0
jmp 0x70f7e
movq 0x3904b(%rip), %rdi     # 0xa9fd0
leaq -0x4(%rbp), %rsi
callq 0x82d0
jmp 0x70f90
cmpl $0x0, -0x4(%rbp)
jge 0x70fbe
movq 0x38feb(%rip), %rdi     # 0xa9f88
leaq 0x83a1(%rip), %rsi      # 0x79345
callq 0x84a0
jmp 0x70fab
jmp 0x70f67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7116f
jmp 0x70fc0
jmp 0x70fc2
jmp 0x70fc4
movq 0x38fbd(%rip), %rdi     # 0xa9f88
leaq 0x839c(%rip), %rsi      # 0x7936e
callq 0x84a0
jmp 0x70fd9
movq 0x38ff0(%rip), %rdi     # 0xa9fd0
leaq -0x8(%rbp), %rsi
callq 0x82d0
jmp 0x70feb
cmpl $0x0, -0x8(%rbp)
jge 0x71008
movq 0x38f90(%rip), %rdi     # 0xa9f88
leaq 0x839e(%rip), %rsi      # 0x7939d
callq 0x84a0
jmp 0x71006
jmp 0x70fc2
jmp 0x7100a
jmp 0x7100c
jmp 0x7100e
movq 0x38f73(%rip), %rdi     # 0xa9f88
leaq 0x83b0(%rip), %rsi      # 0x793cc
callq 0x84a0
jmp 0x71023
movq 0x38fa6(%rip), %rdi     # 0xa9fd0
leaq -0x28(%rbp), %rsi
callq 0x8630
jmp 0x71035
leaq -0x28(%rbp), %rdi
callq 0x8340
cmpq $0x0, %rax
jne 0x7105b
movq 0x38f3d(%rip), %rdi     # 0xa9f88
leaq 0x838f(%rip), %rsi      # 0x793e1
callq 0x84a0
jmp 0x71059
jmp 0x7100c
leaq -0x28(%rbp), %rdi
callq 0x81d0
movq %rax, %rdi
callq 0x70df0
jmp 0x7106e
jmp 0x71070
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
jmp 0x71087
movq 0x38efa(%rip), %rdi     # 0xa9f88
leaq 0x8376(%rip), %rsi      # 0x7940b
callq 0x84a0
jmp 0x7109c
leaq 0x5bff(%rip), %rdi      # 0x76ca2
xorl %eax, %eax
leaq -0x38(%rbp), %rsi
callq 0x8590
movl %eax, -0x74(%rbp)
jmp 0x710b3
movl -0x74(%rbp), %eax
cmpl $0x1, %eax
je 0x710bd
jmp 0x71085
jmp 0x710bf
jmp 0x710c1
jmp 0x710c3
movq 0x38ebe(%rip), %rdi     # 0xa9f88
leaq 0x8365(%rip), %rsi      # 0x79436
callq 0x84a0
jmp 0x710d8
leaq 0x5e7f(%rip), %rdi      # 0x76f5e
xorl %eax, %eax
leaq -0x40(%rbp), %rsi
callq 0x8590
movl %eax, -0x78(%rbp)
jmp 0x710ef
movl -0x78(%rbp), %eax
cmpl $0x1, %eax
je 0x710f9
jmp 0x710c1
jmp 0x710fb
movl -0x4(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x81f0
jmp 0x71116
movl -0x7c(%rbp), %esi
movl -0x80(%rbp), %edi
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl -0x34(%rbp), %r9d
movl -0x38(%rbp), %edx
movsd -0x40(%rbp), %xmm0
movq %rsp, %rax
movl %edx, (%rax)
leaq -0x70(%rbp), %rdx
callq 0x71190
jmp 0x7113f
leaq -0x70(%rbp), %rdi
callq 0x82e0
leaq -0x28(%rbp), %rdi
callq 0x82e0
addq $0x90, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x82e0
leaq -0x28(%rbp), %rdi
callq 0x82e0
movq -0x48(%rbp), %rdi
callq 0x8860
nopw %cs:(%rax,%rax)