// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::setJobOutputDir(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Swarm::setJobOutputDir(string path) {
	options.jobOutputDir = path;

	if (!checkIfFileExists(options.outputDir)) {
		string cmd = "mkdir " + options.outputDir;
		//cout << "running: " << cmd << endl;
		if(runCommand(cmd) != 0) {
			outputError("Error: Couldn't create base output directory with command: " + cmd + ". Quitting.");
		}
	}

	if (checkIfFileExists(options.jobOutputDir)) {
		string input;
		string answer;
		while (1) {

			//Raquel fixing MPI support issues
			if(options.clusterSoftware != "mpi" && options.clusterSoftware != "BNF2mpi"){
				cout << "Warning: Your output directory " << options.jobOutputDir << " already exists. Overwrite? (Y or N) ";
				getline(cin, input);
				stringstream myInp(input);
				myInp >> answer;
			}

			if(options.clusterSoftware == "mpi" || options.clusterSoftware == "BNF2mpi"){
				answer = "Y";
			}

			if (answer == "Y" || answer == "y") {
				string cmd = "rm -r " + options.jobOutputDir;
				if (options.verbosity >= 1) {
					cout << "Deleting old output directory, this may take a few minutes..." << endl;
				}

				if(runCommand(cmd) != 0) {
					outputError("Error: Couldn't delete existing output directory with the command: " + cmd + ". Quitting.");
				}
				break;
			}
			else if (answer == "N" || answer == "n") {
				outputError("Error: Output directory already exists. Quitting.");
			}
		}
	}
	string cmd = "mkdir " + options.jobOutputDir;
	//cout << "else running: " << cmd << endl;
	//int ret = system(cmd.c_str());
	if(runCommand(cmd) != 0) {
		outputError("Error: Couldn't create output directory with command: " + cmd + ". Quitting.");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdi, %rbx
leaq 0x1520(%rdi), %r15
movq %r15, %rdi
callq 0x22500
leaq 0x140(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x1500(%rbx), %rsi
movq %rbx, (%rsp)
movq 0x1508(%rbx), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
callq 0x32180
movq %rbx, %rdi
callq 0xbf2c2
movl %eax, %ebx
movq 0x130(%rsp), %rdi
cmpq %r14, %rdi
je 0x7d4ef
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebx, %ebx
jne 0x7d591
movq (%rsp), %rax
leaq 0x1500(%rax), %rdx
leaq 0x7aa8e(%rip), %rsi     # 0xf7f97
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
callq 0x319d8
leaq 0xa0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x32180
leaq 0x90(%rsp), %rdi
callq 0xc038e
movl %eax, %ebx
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x7d568
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebx, %ebx
jne 0x7da35
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d591
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rax
movq 0x1520(%rax), %rsi
movq 0x1528(%rax), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
callq 0x32180
movq %rbx, %rdi
callq 0xbf2c2
movl %eax, %ebx
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7d5e9
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebx, %ebx
je 0x7d8f4
movq %r15, 0x48(%rsp)
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq (%rsp), %rax
leaq 0x1730(%rax), %r15
leaq 0x74da8(%rip), %r13     # 0xf23d0
leaq 0x8148c(%rip), %rbp     # 0xfeabb
leaq 0x28(%rsp), %r14
leaq 0x74d91(%rip), %rbx     # 0xf23cc
leaq 0x190(%rsp), %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0x22250
testl %eax, %eax
je 0x7d71b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22250
testl %eax, %eax
je 0x7d71b
movl $0x1f, %edx
movq 0xf891b(%rip), %rdi     # 0x175f90
leaq 0x813f9(%rip), %rsi     # 0xfea75
callq 0x22ab0
movq (%rsp), %rax
movq 0x1520(%rax), %rsi
movq 0x1528(%rax), %rdx
movq 0xf88f6(%rip), %rdi     # 0x175f90
callq 0x22ab0
movl $0x25, %edx
movq %rax, %rdi
leaq 0x813e7(%rip), %rsi     # 0xfea95
callq 0x22ab0
movq 0xf8906(%rip), %rcx     # 0x175fc0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %edx
movq 0xf88e8(%rip), %rdi     # 0x175fc0
leaq 0x8(%rsp), %rsi
callq 0x23300
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0x18, %edx
callq 0x23020
movq %r12, %rdi
movq %r14, %rsi
callq 0x22c50
movq %r12, %rdi
movq 0xf882f(%rip), %rsi     # 0x175f38
callq 0x226f0
leaq 0x210(%rsp), %rdi
callq 0x222d0
movq %r15, %rdi
movq %r13, %rsi
callq 0x22250
testl %eax, %eax
je 0x7d739
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22250
testl %eax, %eax
jne 0x7d751
movq 0x30(%rsp), %rdx
movl $0x1, %r8d
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x22fb0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x22250
testl %eax, %eax
je 0x7d7d5
movq %r14, %rdi
leaq 0x7422b(%rip), %rsi     # 0xf1995
callq 0x22250
testl %eax, %eax
je 0x7d7d5
movq %r14, %rdi
leaq 0xb05cc(%rip), %rsi     # 0x12dd49
callq 0x22250
testl %eax, %eax
je 0x7d79d
movq %r14, %rdi
leaq 0x82cd9(%rip), %rsi     # 0x100469
callq 0x22250
testl %eax, %eax
jne 0x7d643
leaq 0x160(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x81396(%rip), %rsi     # 0xfeb46
leaq 0x813c0(%rip), %rdx     # 0xfeb77
leaq 0x150(%rsp), %rdi
callq 0x32210
leaq 0x150(%rsp), %rsi
movq (%rsp), %rdi
callq 0x78b66
leaq 0x812e1(%rip), %rsi     # 0xfeabd
leaq 0x190(%rsp), %rdi
movq 0x48(%rsp), %r15
movq %r15, %rdx
callq 0x319d8
movq (%rsp), %rax
cmpl $0x0, 0x1614(%rax)
je 0x7d844
movq 0xf878b(%rip), %rbx     # 0x175f90
leaq 0x812b8(%rip), %rsi     # 0xfeac4
movl $0x3d, %edx
movq %rbx, %rdi
callq 0x22ab0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq 0xf8759(%rip), %rdi     # 0x175f90
callq 0x22050
movq %rax, %rdi
callq 0x22660
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x190(%rsp), %rsi
movq 0x198(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0x32180
leaq 0x70(%rsp), %rdi
callq 0xc038e
movl %eax, %ebx
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x7d893
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebx, %ebx
jne 0x7d9da
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d8bc
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7d8d8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7d8f4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x7a69c(%rip), %rsi     # 0xf7f97
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x319d8
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x32180
leaq 0x50(%rsp), %rdi
callq 0xc038e
movl %eax, %ebx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x7d94e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebx, %ebx
jne 0x7d985
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d973
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x811ec(%rip), %rsi     # 0xfeb78
leaq 0x8(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x319d8
leaq 0x8402d(%rip), %rsi     # 0x1019d2
leaq 0x8(%rsp), %rdi
callq 0x233b0
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7da8a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x7da9d
leaq 0x81121(%rip), %rsi     # 0xfeb02
leaq 0x170(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x319d8
leaq 0x83fd5(%rip), %rsi     # 0x1019d2
leaq 0x170(%rsp), %rdi
callq 0x233b0
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7dac5
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x7dad8
leaq 0x80ffd(%rip), %rsi     # 0xfea39
leaq 0x8(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x319d8
leaq 0x83f7d(%rip), %rsi     # 0x1019d2
leaq 0x8(%rsp), %rdi
callq 0x233b0
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7db00
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x7db13
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
movq 0x8(%rax), %rdx
leaq 0xb0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
callq 0x78b66
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
movq 0x8(%rax), %rdx
leaq 0xd0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
callq 0x78b66
movq %rdx, 0x110(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x120(%rsp)
movq 0x8(%rax), %rdx
leaq 0x110(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
callq 0x78b66
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dbc5
movq 0x120(%rsp), %rsi
jmp 0x7dbb8
jmp 0x7dbc2
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7db7c
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x7db7c
movq %rax, %rbx
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7dcae
movq 0x180(%rsp), %rsi
jmp 0x7dc16
jmp 0x7dc44
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dbc5
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x7dbc5
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7dc47
movq 0x18(%rsp), %rsi
jmp 0x7dc3a
jmp 0x7dcab
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dc47
movq 0xa0(%rsp), %rsi
jmp 0x7dc3a
jmp 0x7dc44
jmp 0x7dc44
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dcae
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x7dcae
jmp 0x7dd15
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dc47
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x7dc47
movq %rax, %rbx
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7dd50
movq 0x1a0(%rsp), %rsi
jmp 0x7dd48
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dd50
movq 0x100(%rsp), %rsi
jmp 0x7dd48
movq %rax, %rbx
movq 0x130(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dd50
movq 0x140(%rsp), %rsi
jmp 0x7dd48
movq %rax, %rbx
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7dd18
movq 0x1a0(%rsp), %rsi
jmp 0x7dd09
movq %rax, %rbx
movq 0xf8265(%rip), %rsi     # 0x175f38
leaq 0x190(%rsp), %rdi
callq 0x226f0
leaq 0x210(%rsp), %rdi
callq 0x222d0
jmp 0x7dd18
jmp 0x7dd15
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dd18
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x7dd18
jmp 0x7dd15
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7dd34
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7dd50
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240