// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::doSwarm()
void Swarm::doSwarm() {
	if(options.verbosity >=3) cout<<"doSwarm invoked: bootsrtarps:"<< options.bootstrap<<" \n";
	for (bootstrapCounter = 0; bootstrapCounter <= options.bootstrap; ++bootstrapCounter) {
		initFit();
		// Main fit loops

		if (options.synchronicity) {
			if (options.fitType == "ga") {
				runSGA();
				if(options.verbosity>=3){
					cout << "Finished GA" << endl;
				}
			}
			else if (options.fitType == "pso") {
				//cout << "RAQUEL BEFORE PSO" << endl;
				runSPSO();
				//cout << "RAQUEL After PSO" << endl;

			}
			else if (options.fitType == "de") {
				runSDE();
			}
			else if (options.fitType == "sa") {
				runSSA();
			}
		}

		// Asynchronous fit loops
		else {
			// Genetic fit
			if (options.fitType == "ga") {
				runAGA();
			}
			// PSO fit
			else if (options.fitType == "pso") {
				runAPSO();
			}
			else if (options.fitType == "de") {
				runADE();
			}
			else if (options.fitType == "sa") {
				runASA();
			}
		}
		if(options.verbosity>=4){

			cout << "RAQUEL: starting finishFit function" << endl;

		}
		finishFit();
		if(options.verbosity>=4){

			cout << "RAQUEL: done finishFit function" << endl;
		}

	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, 0x1614(%rdi)
jb 0x7ddac
movq 0xf821a(%rip), %r14     # 0x175f90
leaq 0x80e32(%rip), %rsi     # 0xfebaf
movl $0x1d, %edx
movq %r14, %rdi
callq 0x22ab0
movl 0x1638(%rbx), %esi
movq %r14, %rdi
callq 0x22650
leaq 0xa437a(%rip), %rsi     # 0x122119
movl $0x2, %edx
movq %rax, %rdi
callq 0x22ab0
movl $0x0, 0x13ec(%rbx)
leaq 0x14e0(%rbx), %r14
leaq 0x741e5(%rip), %r15     # 0xf1fa9
movq 0xf81c5(%rip), %r12     # 0x175f90
leaq 0x81130(%rip), %rbp     # 0xfef02
leaq 0x80e24(%rip), %r13     # 0xfebfd
movq %rbx, %rdi
callq 0x7a782
cmpb $0x1, 0x1618(%rbx)
jne 0x7de4b
movq %r14, %rdi
movq %r15, %rsi
callq 0x22250
testl %eax, %eax
je 0x7dea9
movq %r14, %rdi
movq %rbp, %rsi
callq 0x22250
testl %eax, %eax
je 0x7df02
movq %r14, %rdi
leaq 0xb0101(%rip), %rsi     # 0x12df1b
callq 0x22250
testl %eax, %eax
je 0x7df16
movq %r14, %rdi
leaq 0x7417b(%rip), %rsi     # 0xf1fac
callq 0x22250
testl %eax, %eax
jne 0x7df28
movq %rbx, %rdi
callq 0x80dba
jmp 0x7df28
movq %r14, %rdi
movq %r15, %rsi
callq 0x22250
testl %eax, %eax
je 0x7def8
movq %r14, %rdi
movq %rbp, %rsi
callq 0x22250
testl %eax, %eax
je 0x7df0c
movq %r14, %rdi
leaq 0xb00a0(%rip), %rsi     # 0x12df1b
callq 0x22250
testl %eax, %eax
je 0x7df20
movq %r14, %rdi
leaq 0x7411a(%rip), %rsi     # 0xf1fac
callq 0x22250
testl %eax, %eax
jne 0x7df28
movq %rbx, %rdi
callq 0x8487c
jmp 0x7df28
movq %rbx, %rdi
callq 0x7dfe0
cmpl $0x3, 0x1614(%rbx)
jb 0x7df28
movl $0xb, %edx
movq %r12, %rdi
leaq 0x80d04(%rip), %rsi     # 0xfebcd
callq 0x22ab0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r12, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
jmp 0x7df28
movq %rbx, %rdi
callq 0x8114a
jmp 0x7df28
movq %rbx, %rdi
callq 0x7e7e0
jmp 0x7df28
movq %rbx, %rdi
callq 0x81fbe
jmp 0x7df28
movq %rbx, %rdi
callq 0x7f146
jmp 0x7df28
movq %rbx, %rdi
callq 0x82c0e
cmpl $0x4, 0x1614(%rbx)
jb 0x7df6d
movl $0x23, %edx
movq %r12, %rdi
leaq 0x80c99(%rip), %rsi     # 0xfebd9
callq 0x22ab0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r12, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq %rbx, %rdi
callq 0x86b24
cmpl $0x4, 0x1614(%rbx)
jb 0x7dfb6
movl $0x1f, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x22ab0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r12, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl 0x13ec(%rbx), %eax
incl %eax
movl %eax, 0x13ec(%rbx)
cmpl 0x1638(%rbx), %eax
jbe 0x7ddd9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop