// File: samuel500[P]NEAT/main.cpp
// Function: main
int main(int argc, char *argv[]){
	srand(time(0));

	int population_size = 150;

	Population population = Population(population_size, 3, 1);

	for(int i=0; i<1000; ++i){
		cout << "gen " << i+1 << endl;
		// cout << "m1" << endl;
		// cout << "m2" << endl;

		population.xor_epoch();

		// cout << "m3" << endl;

		cout << "spe size " << population.species.size() << endl;

		// cout << "m4" << endl;

		cout << "fin innov_num " << *(population.innov_num) << endl;

		cout << "elite " << population.elite->fitness << endl;
		// population.test_elite();
		cout << "max f " << population.max_fitness << endl;

		cout << "pop size " << population.individuals.size() << endl;
		if(population.max_fitness>15.9){

			vector<Connection*>::iterator conPtr;
			for(conPtr=population.elite->connections.begin(); conPtr!=population.elite->connections.end(); ++conPtr){
				cout << "w " << (*conPtr)->weight << endl; 
			}
			break;
		}
	}

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x10b0
movl %eax, %edi
callq 0x10c0
movl $0x96, -0x14(%rbp)
movl -0x14(%rbp), %esi
leaq -0xa0(%rbp), %rdi
movl $0x3, %edx
movl $0x1, %ecx
callq 0x1990
movl $0x0, -0xa4(%rbp)
cmpl $0x3e8, -0xa4(%rbp)     # imm = 0x3E8
jge 0x1795
movq 0x1cb3e(%rip), %rdi     # 0x1dfd8
leaq 0x13b6f(%rip), %rsi     # 0x15010
callq 0x10d0
movq %rax, -0xd8(%rbp)
jmp 0x14af
movq -0xd8(%rbp), %rdi
movl -0xa4(%rbp), %esi
incl %esi
callq 0x1160
movq %rax, -0xe0(%rbp)
jmp 0x14cc
movq -0xe0(%rbp), %rdi
movq 0x1caee(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x14e1
leaq -0xa0(%rbp), %rdi
callq 0x26d0
jmp 0x14ef
movq 0x1cae2(%rip), %rdi     # 0x1dfd8
leaq 0x13b18(%rip), %rsi     # 0x15015
callq 0x10d0
movq %rax, -0xe8(%rbp)
jmp 0x150b
leaq -0x50(%rbp), %rdi
callq 0x17c0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x1030
movq %rax, -0xf0(%rbp)
jmp 0x152c
movq -0xf0(%rbp), %rdi
movq 0x1ca8e(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x1541
movq 0x1ca90(%rip), %rdi     # 0x1dfd8
leaq 0x13ad0(%rip), %rsi     # 0x1501f
callq 0x10d0
movq %rax, -0xf8(%rbp)
jmp 0x155d
movq -0xf8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %esi
callq 0x1160
movq %rax, -0x100(%rbp)
jmp 0x1578
movq -0x100(%rbp), %rdi
movq 0x1ca42(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x158d
movq 0x1ca44(%rip), %rdi     # 0x1dfd8
leaq 0x13a93(%rip), %rsi     # 0x1502e
callq 0x10d0
movq %rax, -0x108(%rbp)
jmp 0x15a9
movq -0x108(%rbp), %rdi
movq -0x58(%rbp), %rax
movsd (%rax), %xmm0
callq 0x11a0
movq %rax, -0x110(%rbp)
jmp 0x15c6
movq -0x110(%rbp), %rdi
movq 0x1c9f4(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x15db
movq 0x1c9f6(%rip), %rdi     # 0x1dfd8
leaq 0x13a4c(%rip), %rsi     # 0x15035
callq 0x10d0
movq %rax, -0x118(%rbp)
jmp 0x15f7
movq -0x118(%rbp), %rdi
movsd -0x20(%rbp), %xmm0
callq 0x11a0
movq %rax, -0x120(%rbp)
jmp 0x1611
movq -0x120(%rbp), %rdi
movq 0x1c9a9(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x1626
movq 0x1c9ab(%rip), %rdi     # 0x1dfd8
leaq 0x13a08(%rip), %rsi     # 0x1503c
callq 0x10d0
movq %rax, -0x128(%rbp)
jmp 0x1642
leaq -0xa0(%rbp), %rdi
callq 0x17e0
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x1030
movq %rax, -0x130(%rbp)
jmp 0x1666
movq -0x130(%rbp), %rdi
movq 0x1c954(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x167b
movsd -0x20(%rbp), %xmm0
movsd 0x13980(%rip), %xmm1    # 0x15008
ucomisd %xmm1, %xmm0
jbe 0x177f
leaq -0xc0(%rbp), %rdi
callq 0x1800
movq -0x58(%rbp), %rdi
addq $0x60, %rdi
callq 0x1820
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x58(%rbp), %rdi
addq $0x60, %rdi
callq 0x1890
movq %rax, -0xd0(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1850
testb $0x1, %al
jne 0x16f0
jmp 0x177d
movq 0x1c8e1(%rip), %rdi     # 0x1dfd8
leaq 0x13948(%rip), %rsi     # 0x15046
callq 0x10d0
movq %rax, -0x138(%rbp)
jmp 0x170c
leaq -0xc0(%rbp), %rdi
callq 0x18c0
movq -0x138(%rbp), %rdi
movq (%rax), %rax
movsd 0x10(%rax), %xmm0
callq 0x11a0
movq %rax, -0x140(%rbp)
jmp 0x1735
movq -0x140(%rbp), %rdi
movq 0x1c885(%rip), %rsi     # 0x1dfc8
callq 0x1100
jmp 0x174a
jmp 0x174c
leaq -0xc0(%rbp), %rdi
callq 0x18e0
jmp 0x16c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x38e0
jmp 0x17b4
jmp 0x1795
jmp 0x1781
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1483
movl $0x0, -0x4(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x38e0
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x1180