// File: /workspace/github_cpp_makefile_star2_O3/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 0x7d720
movq 0xf88be(%rip), %r14     # 0x175fa8
leaq 0x8152e(%rip), %rsi     # 0xfec1f
movl $0x1d, %edx
movq %r14, %rdi
callq 0x22ab0
movl 0x1638(%rbx), %esi
movq %r14, %rdi
callq 0x22650
leaq 0xa49e6(%rip), %rsi     # 0x1220f9
movl $0x2, %edx
movq %rax, %rdi
callq 0x22ab0
movl $0x0, 0x13ec(%rbx)
leaq 0x14e0(%rbx), %r14
leaq 0x74851(%rip), %r15     # 0xf1f89
movq 0xf8869(%rip), %r12     # 0x175fa8
leaq 0x8182c(%rip), %rbp     # 0xfef72
movq %rbx, %rdi
callq 0x7a0be
movb 0x1618(%rbx), %r13b
movq %r14, %rdi
movq %r15, %rsi
callq 0x22250
cmpb $0x1, %r13b
jne 0x7d7bc
testl %eax, %eax
je 0x7d812
movq %r14, %rdi
movq %rbp, %rsi
callq 0x22250
testl %eax, %eax
je 0x7d86f
movq %r14, %rdi
leaq 0xb0770(%rip), %rsi     # 0x12defb
callq 0x22250
testl %eax, %eax
je 0x7d883
movq %r14, %rdi
leaq 0x747ea(%rip), %rsi     # 0xf1f8c
callq 0x22250
testl %eax, %eax
jne 0x7d895
movq %rbx, %rdi
callq 0x8066c
jmp 0x7d895
testl %eax, %eax
je 0x7d865
movq %r14, %rdi
movq %rbp, %rsi
callq 0x22250
testl %eax, %eax
je 0x7d879
movq %r14, %rdi
leaq 0xb071a(%rip), %rsi     # 0x12defb
callq 0x22250
testl %eax, %eax
je 0x7d88d
movq %r14, %rdi
leaq 0x74794(%rip), %rsi     # 0xf1f8c
callq 0x22250
testl %eax, %eax
jne 0x7d895
movq %rbx, %rdi
callq 0x84064
jmp 0x7d895
movq %rbx, %rdi
callq 0x7d950
cmpl $0x3, 0x1614(%rbx)
jb 0x7d8da
movl $0xb, %edx
movq %r12, %rdi
leaq 0x81407(%rip), %rsi     # 0xfec3d
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 0x7d895
movq %rbx, %rdi
callq 0x809f8
jmp 0x7d895
movq %rbx, %rdi
callq 0x7e114
jmp 0x7d895
movq %rbx, %rdi
callq 0x81860
jmp 0x7d895
movq %rbx, %rdi
callq 0x7ea48
jmp 0x7d895
movq %rbx, %rdi
callq 0x82492
cmpl $0x4, 0x1614(%rbx)
jb 0x7d8da
movl $0x23, %edx
movq %r12, %rdi
leaq 0x8139c(%rip), %rsi     # 0xfec49
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 0x86314
cmpl $0x4, 0x1614(%rbx)
jb 0x7d927
movl $0x1f, %edx
movq %r12, %rdi
leaq 0x81373(%rip), %rsi     # 0xfec6d
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 0x7d746
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq