// File: samuel500[P]NEAT/population.cpp
// Function: Population::speciate()
void Population::speciate(){

	vector<Individual*>::iterator curInd;
	vector<Species*>::iterator spePtr;

	bool accepted;

	for(curInd=individuals.begin(); curInd!=individuals.end(); ++curInd){
		// cout << "spe1" << endl;

		accepted = false;
		if(species.size()==0){
			Species *new_species = new Species(*curInd);
			// cout << "spe2" << endl;

			species.push_back(new_species);
		}
		else{
			// cout << "spe3" << endl;

			for(spePtr=species.begin(); spePtr!=species.end(); ++spePtr){
				// cout << "spe4" << endl;

				accepted = (*spePtr)->add_member(*curInd);
				// cout << "spe5" << endl;

				if(accepted) break;
			}
			if(!accepted){
				// cout << "spe6" << endl;

				Species *new_species = new Species(*curInd);
				species.push_back(new_species);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x41f0
leaq -0x18(%rbp), %rdi
callq 0x42f0
movq -0x68(%rbp), %rdi
callq 0x4210
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x68(%rbp), %rdi
callq 0x4280
movq %rax, -0x30(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4240
testb $0x1, %al
jne 0x3701
jmp 0x38bf
movq -0x68(%rbp), %rdi
movb $0x0, -0x19(%rbp)
addq $0x50, %rdi
callq 0x17c0
cmpq $0x0, %rax
jne 0x379d
movl $0x48, %edi
callq 0x10e0
movq %rax, -0x70(%rbp)
movq %rax, -0x78(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x42b0
movq -0x70(%rbp), %rdi
movq (%rax), %rsi
movsd 0x11912(%rip), %xmm1    # 0x15058
movsd 0x11912(%rip), %xmm2    # 0x15060
movsd 0x11912(%rip), %xmm3    # 0x15068
movaps %xmm1, %xmm0
callq 0xc7e0
jmp 0x3760
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rax
movq %rax, -0x38(%rbp)
addq $0x50, %rdi
leaq -0x38(%rbp), %rsi
callq 0x4a10
jmp 0x38af
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x48, %esi
callq 0x10f0
jmp 0x38c8
movq -0x68(%rbp), %rdi
addq $0x50, %rdi
callq 0x4380
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x68(%rbp), %rdi
addq $0x50, %rdi
callq 0x43f0
movq %rax, -0x58(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x43b0
testb $0x1, %al
jne 0x37da
jmp 0x3819
leaq -0x18(%rbp), %rdi
callq 0x4420
movq (%rax), %rax
movq %rax, -0x80(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x42b0
movq -0x80(%rbp), %rdi
movq (%rax), %rsi
callq 0xd690
andb $0x1, %al
movb %al, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
je 0x380c
jmp 0x3819
jmp 0x380e
leaq -0x18(%rbp), %rdi
callq 0x4440
jmp 0x37b6
testb $0x1, -0x19(%rbp)
jne 0x38ad
movl $0x48, %edi
callq 0x10e0
movq %rax, -0x88(%rbp)
movq %rax, -0x90(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x42b0
movq -0x88(%rbp), %rdi
movq (%rax), %rsi
movsd 0x11802(%rip), %xmm1    # 0x15058
movsd 0x11802(%rip), %xmm2    # 0x15060
movsd 0x11802(%rip), %xmm3    # 0x15068
movaps %xmm1, %xmm0
callq 0xc7e0
jmp 0x3870
movq -0x68(%rbp), %rdi
movq -0x90(%rbp), %rax
movq %rax, -0x60(%rbp)
addq $0x50, %rdi
leaq -0x60(%rbp), %rsi
callq 0x4a10
jmp 0x38ad
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x48, %esi
callq 0x10f0
jmp 0x38c8
jmp 0x38af
jmp 0x38b1
leaq -0x10(%rbp), %rdi
callq 0x42d0
jmp 0x36de
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x1180
nopw %cs:(%rax,%rax)