// File: /workspace/github_cpp_makefile_star2_O2/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 0x6dccf
movq 0xf82f2(%rip), %rdi     # 0x165f98
leaq 0x6f0d2(%rip), %rsi     # 0xdcd7f
callq 0x289f0
movl 0x1638(%rbx), %esi
movq %rax, %rdi
callq 0x286e0
leaq 0x92930(%rip), %rsi     # 0x1005f7
movq %rax, %rdi
callq 0x289f0
leaq 0x14e0(%rbx), %r14
xorl %eax, %eax
leaq 0x622ca(%rip), %r15     # 0xcffa9
movq 0xf82b2(%rip), %r12     # 0x165f98
leaq 0x6f0e0(%rip), %r13     # 0xdcdcd
movl %eax, 0x13ec(%rbx)
cmpl 0x1638(%rbx), %eax
ja 0x6de65
movq %rbx, %rdi
callq 0x6be6e
movb 0x1618(%rbx), %bpl
movq %r14, %rdi
movq %r15, %rsi
callq 0x3357b
cmpb $0x1, %bpl
jne 0x6dd54
testb %al, %al
je 0x6dd65
movq %rbx, %rdi
callq 0x6de74
cmpl $0x3, 0x1614(%rbx)
jb 0x6de34
movq %r12, %rdi
leaq 0x6f05b(%rip), %rsi     # 0xdcd9d
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
jmp 0x6de14
testb %al, %al
je 0x6dd85
movq %rbx, %rdi
callq 0x6f774
jmp 0x6de14
movq %r14, %rdi
leaq 0x6f363(%rip), %rsi     # 0xdd0d2
callq 0x3357b
testb %al, %al
je 0x6dda2
movq %rbx, %rdi
callq 0x6e200
jmp 0x6de14
movq %r14, %rdi
leaq 0x6f343(%rip), %rsi     # 0xdd0d2
callq 0x3357b
testb %al, %al
je 0x6ddbf
movq %rbx, %rdi
callq 0x6fe76
jmp 0x6de14
movq %r14, %rdi
leaq 0x9e6af(%rip), %rsi     # 0x10c45b
callq 0x3357b
testb %al, %al
je 0x6dddc
movq %rbx, %rdi
callq 0x6e65e
jmp 0x6de14
movq %r14, %rdi
leaq 0x9e692(%rip), %rsi     # 0x10c45b
callq 0x3357b
testb %al, %al
je 0x6ddf9
movq %rbx, %rdi
callq 0x7044e
jmp 0x6de14
movq %r14, %rdi
leaq 0x621c6(%rip), %rsi     # 0xcffac
callq 0x3357b
testb %al, %al
je 0x6de14
movq %rbx, %rdi
callq 0x6f506
jmp 0x6de14
movq %r14, %rdi
leaq 0x621a9(%rip), %rsi     # 0xcffac
callq 0x3357b
testb %al, %al
je 0x6de14
movq %rbx, %rdi
callq 0x712e6
cmpl $0x4, 0x1614(%rbx)
jb 0x6de34
movq %r12, %rdi
leaq 0x6ef82(%rip), %rsi     # 0xdcda9
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %rbx, %rdi
callq 0x728ee
cmpl $0x4, 0x1614(%rbx)
jb 0x6de58
movq %r12, %rdi
movq %r13, %rsi
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movl 0x13ec(%rbx), %eax
incl %eax
jmp 0x6dced
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq