// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::checkExternalMessages()
void Swarm::checkExternalMessages() {
	string messagePath = options.jobOutputDir + ".req";
	if (checkIfFileExists(messagePath)) {
		ifstream messageFile(messagePath);

		std::string line;

		if (messageFile.is_open()) {
			while (getline(messageFile, line)) {
				if (line == "output results") {
					string outputDir = options.jobOutputDir + "Results";
					string command = "mkdir " + outputDir + " && cp " + configPath_ + " " + outputDir;

					int errorCounter = 0;
					while (!runCommand(command) && errorCounter < 10) {
						//sleep(1);
						++errorCounter;
					}

					if (errorCounter > 10) {
						cout << "Error: Couldn't create directory: " + outputDir + " to contain final fitting results. Outputting results to screen.";
						outputRunSummary();
					}

					outputRunSummary(outputDir);
				}
			}
		}
		else {
			string errMsg = "Error: Couldn't open data file " + messagePath + " for parsing.";
			outputError(errMsg);
		}
		messageFile.close();
		string delCmd = "rm " + messagePath;
		runCommand(delCmd);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
movq %rdi, %r15
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x1520(%rdi), %rsi
movq 0x1528(%rdi), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x3213c
leaq 0x690c0(%rip), %rsi     # 0x10011a
movq %r14, %rdi
callq 0x233b0
leaq 0x180(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0x3213c
leaq 0x170(%rsp), %rdi
callq 0xbe9a8
movl %eax, %ebp
movq 0x170(%rsp), %rdi
cmpq %r14, %rdi
je 0x970b4
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
je 0x9759a
leaq 0x1b0(%rsp), %r13
leaq 0x48(%rsp), %rsi
movq %r13, %rdi
movl $0x8, %edx
callq 0x23070
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x228(%rsp), %rdi
callq 0x221e0
testb %al, %al
movq %r15, 0x88(%rsp)
je 0x975c8
leaq 0xa0(%rsp), %rbx
leaq 0x140(%rsp), %r12
leaq 0x130(%rsp), %rbp
movq 0x1b0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %edx
movq %r13, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x23300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x974d9
leaq 0xf0(%rsp), %rdi
leaq 0x68fb0(%rip), %rsi     # 0x10011f
callq 0x22250
testl %eax, %eax
jne 0x97122
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x1520(%r15), %rsi
movq 0x1528(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x3213c
movq %r13, %rdi
leaq 0x68755(%rip), %rsi     # 0xff8ff
callq 0x233b0
movq %r13, %rdx
leaq 0xc0(%rsp), %r14
leaq 0x150(%rsp), %r13
movq %r13, %rdi
leaq 0x60d7b(%rip), %rsi     # 0xf7f47
callq 0x31944
movq %r13, %rdi
leaq 0x6867e(%rip), %rsi     # 0xff859
callq 0x233b0
leaq 0x78(%rsp), %rsi
movq %rsi, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97208
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x9720e
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1800(%r15), %rsi
movq 0x1808(%r15), %rdx
leaq 0x68(%rsp), %rdi
callq 0x222b0
movq %rbx, 0x90(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9726a
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0x97270
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x98(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x90(%rsp), %rdi
leaq 0x6a18a(%rip), %rsi     # 0x101424
callq 0x233b0
movq %r14, 0xb0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x972cb
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x972d2
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0xb8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x222b0
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9732c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x97332
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x97367
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x90(%rsp), %rdi
cmpq %rbx, %rdi
je 0x97384
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x973a0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x973c5
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x229c0
xorl %r13d, %r13d
movq %r12, 0x130(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x3213c
movq %rbp, %rdi
callq 0xbfa1f
testl %eax, %eax
sete %r14b
cmpl $0xa, %r13d
setb %r15b
movq 0x130(%rsp), %rdi
cmpq %r12, %rdi
je 0x97418
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x229c0
andb %r15b, %r14b
incl %r13d
testb %r14b, %r14b
jne 0x973c8
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
callq 0x3213c
movq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x91ae2
leaq 0xa0(%rsp), %rbx
leaq 0x1b0(%rsp), %r13
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x97498
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x974b4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x97122
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x97122
leaq 0x1b0(%rsp), %rdi
callq 0x221b0
leaq 0x5a872(%rip), %rsi     # 0xf1d5f
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x31944
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0x3213c
leaq 0x110(%rsp), %rdi
callq 0xbfa1f
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x9754c
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x97568
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x9758d
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x1b0(%rsp), %rdi
callq 0x22200
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x975b6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5f634(%rip), %rsi     # 0xf6c03
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x31944
leaq 0x59efd(%rip), %rsi     # 0xf14e2
leaq 0x28(%rsp), %rdi
callq 0x233b0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
jne 0x97613
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %r14, %rsi
jmp 0x97620
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9765d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x1a0(%rsp), %r15
movq %r15, -0x10(%r15)
addq %rsi, %rdx
leaq 0x190(%rsp), %rdi
callq 0x3213c
leaq 0x190(%rsp), %rsi
movq 0x88(%rsp), %rdi
callq 0x784c2
movq %rax, %rbx
movq 0x190(%rsp), %rdi
cmpq %r15, %rdi
je 0x976b3
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x976b3
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x97875
jmp 0x97882
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97882
movq 0x38(%rsp), %rsi
jmp 0x9787a
jmp 0x97820
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x97866
movq 0x120(%rsp), %rsi
jmp 0x9785e
jmp 0x9781b
jmp 0x97820
jmp 0x97820
jmp 0x97747
movq %rax, %rbx
movq 0x170(%rsp), %rdi
cmpq %r14, %rdi
je 0x978b4
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x978b4
jmp 0x97747
movq %rax, %rbx
jmp 0x978b4
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x9784a
movq 0xe0(%rsp), %rsi
jmp 0x97842
jmp 0x97825
leaq 0x78(%rsp), %r14
movq %rax, %rbx
jmp 0x977de
movq %r14, %rcx
movq %rbx, %r15
leaq 0x78(%rsp), %r14
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %rcx, %rdi
je 0x977c1
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x977c1
jmp 0x97820
movq %rbx, %r15
leaq 0x78(%rsp), %r14
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x977de
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x977fc
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x977fc
jmp 0x9781b
movq %rax, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x97866
movq 0x160(%rsp), %rsi
jmp 0x9785e
movq %rax, %rbx
jmp 0x97866
movq %rax, %rbx
jmp 0x97882
movq %rax, %rbx
jmp 0x9784a
movq %rax, %rbx
movq 0x130(%rsp), %rdi
cmpq %r12, %rdi
je 0x9784a
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x97866
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x97882
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x978a7
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x1b0(%rsp), %rdi
callq 0x22200
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x978d0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240