// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x1520(%rdi), %rsi
movq 0x1528(%rdi), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x32180
leaq 0x68733(%rip), %rsi     # 0x100133
movq %r14, %rdi
callq 0x233b0
leaq 0x180(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0x32180
leaq 0x170(%rsp), %rdi
callq 0xbf2c2
movl %eax, %ebp
movq 0x170(%rsp), %rdi
cmpq %r14, %rdi
je 0x97a60
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
je 0x98001
leaq 0x1b0(%rsp), %r13
leaq 0x88(%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 %rbx, 0xa8(%rsp)
je 0x98038
leaq 0xe0(%rsp), %r15
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 0x97f3d
leaq 0xf0(%rsp), %rdi
leaq 0x6861a(%rip), %rsi     # 0x100138
callq 0x22250
testl %eax, %eax
jne 0x97ad1
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x1520(%rbx), %rsi
movq 0x1528(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x32180
movq %r13, %rdi
leaq 0x67dbf(%rip), %rsi     # 0xff918
callq 0x233b0
leaq 0x150(%rsp), %r14
movq %r14, %rdi
leaq 0x60427(%rip), %rsi     # 0xf7f97
movq %r13, %rdx
callq 0x319d8
movq %r14, %rdi
leaq 0x67c67(%rip), %rsi     # 0xff7e9
callq 0x233b0
movq %r15, 0xd0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97bb3
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0x97bba
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0xd8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1800(%rbx), %rsi
movq 0x1808(%rbx), %rdx
leaq 0xd0(%rsp), %rdi
callq 0x222b0
leaq 0x58(%rsp), %rsi
movq %rsi, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x38(%rsp), %rbx
je 0x97c1d
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x97c23
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
leaq 0x697f6(%rip), %rsi     # 0x10143d
callq 0x233b0
movq %rbx, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97c6f
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x97c75
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x222b0
leaq 0x78(%rsp), %rsi
movq %rsi, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97cc9
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x97ccf
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 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x97cfe
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x97d1a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0x97d37
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %r15, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x97d5f
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x229c0
xorl %r13d, %r13d
movq %r12, 0x130(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x32180
movq %rbp, %rdi
callq 0xc038e
testl %eax, %eax
sete %r14b
cmpl $0xa, %r13d
setb %r15b
movq 0x130(%rsp), %rdi
cmpq %r12, %rdi
je 0x97db2
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x229c0
andb %r15b, %r14b
je 0x97dbc
incl %r13d
jmp 0x97d62
cmpl $0xb, %r13d
movq %rbx, %r15
movq 0xa8(%rsp), %rbx
leaq 0x1b0(%rsp), %r13
jb 0x97e9d
leaq 0x48(%rsp), %r14
movq %r14, %rdi
leaq 0x67a09(%rip), %rsi     # 0xff7f1
leaq 0x8(%rsp), %rdx
callq 0x319d8
movq %r14, %rdi
leaq 0x67a46(%rip), %rsi     # 0xff842
callq 0x233b0
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97e29
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x97e2f
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 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0xde138(%rip), %rdi     # 0x175f90
callq 0x22ab0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x97e79
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x97e95
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x94dea
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %rdi
callq 0x32180
movq %rbx, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x92400
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x97efc
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x97f18
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x97ad1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x97ad1
leaq 0x1b0(%rsp), %rdi
callq 0x221b0
leaq 0x59e2e(%rip), %rsi     # 0xf1d7f
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x319d8
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0x32180
leaq 0x110(%rsp), %rdi
callq 0xc038e
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x97fb3
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x97fcf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x97ff4
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x1b0(%rsp), %rdi
callq 0x22200
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x98026
movq 0x98(%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 0x5ec14(%rip), %rsi     # 0xf6c53
leaq 0x68(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x319d8
leaq 0x594aa(%rip), %rsi     # 0xf1502
leaq 0x68(%rsp), %rdi
callq 0x233b0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x98083
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x98090
movq %rdx, 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 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x980c3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x1a0(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x190(%rsp), %rdi
callq 0x32180
leaq 0x190(%rsp), %rsi
movq 0xa8(%rsp), %rdi
callq 0x78b66
movq %rax, %rbx
movq 0x190(%rsp), %rdi
cmpq %r15, %rdi
je 0x98123
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x98123
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x98315
jmp 0x98322
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x98322
movq 0x78(%rsp), %rsi
jmp 0x9831a
jmp 0x982c0
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x98306
movq 0x120(%rsp), %rsi
jmp 0x982fe
jmp 0x98251
jmp 0x982c0
jmp 0x982c0
jmp 0x981b7
movq %rax, %rbx
movq 0x170(%rsp), %rdi
cmpq %r14, %rdi
je 0x98354
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x98354
jmp 0x981b7
movq %rax, %rbx
jmp 0x98354
jmp 0x982e7
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x981e8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x981e8
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x982ea
movq 0x58(%rsp), %rsi
jmp 0x982dd
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x982ea
movq 0xc0(%rsp), %rsi
jmp 0x982dd
movq %rbx, %rcx
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rcx, %rdi
je 0x98261
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x98261
jmp 0x982c0
jmp 0x98251
movq %rax, %rbx
jmp 0x98306
movq %rax, %rbx
jmp 0x9827d
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x9827d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0x9829f
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x9829f
movq %rax, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x98306
movq 0x160(%rsp), %rsi
jmp 0x982fe
jmp 0x982e7
movq %rax, %rbx
jmp 0x98322
movq %rax, %rbx
movq 0x130(%rsp), %rdi
cmpq %r12, %rdi
je 0x982ea
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x982ea
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x98306
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x98322
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x98347
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x1b0(%rsp), %rdi
callq 0x22200
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x98379
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop