// File: samuel500[P]NEAT/individual.cpp
// Function: Individual::Individual(int*, int*, int*, int*)
Individual::Individual(int *isize, int *osize, int *gen, int *innnum){ //, vector<Node*> *allnodes, vector<Connection*> *allconnections){

	in_size = new int;
	in_size = isize;
	out_size = new int;
	out_size = osize;

	
	generation = new int;
	generation = gen;

	innov_num = new int;
	innov_num = innnum;


	fitness = 0.;

	// all_nodes = allnodes;
	// all_connections = allconnections;


	Node *new_node;

	for(int i=0; i<*in_size; i++){
		new_node = new Node(INPUT, i, *generation);
		
		// all_nodes->push_back(new_node);
		
		inputs.push_back(new_node);
		nodes.push_back(new_node);
	}

	for(int i=0; i<*out_size; i++){
		new_node = new Node(OUTPUT, *in_size+i, *generation);
		// all_nodes->push_back(new_node);

		outputs.push_back(new_node);
		nodes.push_back(new_node);

	}

	// mutate_add_connection();

	// mutate_add_connection();
	// mutate_add_node();

	// mutate_add_connection();
	// mutate_add_node();
	// mutate_add_connection();
	// mutate_add_node();



}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
addq $0x18, %rdi
movq %rdi, -0x78(%rbp)
callq 0x3950
movq -0x60(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x70(%rbp)
callq 0x3950
movq -0x60(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x68(%rbp)
callq 0x3950
movq -0x60(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x58(%rbp)
callq 0x3970
movl $0x4, %edi
callq 0x10e0
movq %rax, -0x50(%rbp)
jmp 0x113a7
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x80(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x80(%rax)
movl $0x4, %edi
callq 0x10e0
movq %rax, -0x80(%rbp)
jmp 0x113d1
movq -0x60(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, 0x88(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x88(%rax)
movl $0x4, %edi
callq 0x10e0
movq %rax, -0x88(%rbp)
jmp 0x113fe
movq -0x60(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0x90(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x90(%rax)
movl $0x4, %edi
callq 0x10e0
movq %rax, -0x90(%rbp)
jmp 0x1142e
movq -0x60(%rbp), %rax
movq -0x90(%rbp), %rcx
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x78(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x44(%rbp)
movq -0x60(%rbp), %rcx
movl -0x44(%rbp), %eax
movq 0x80(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x11510
movl $0x48, %edi
callq 0x10e0
movq %rax, -0x98(%rbp)
jmp 0x1147c
movq -0x98(%rbp), %rdi
movq -0x60(%rbp), %rax
movl -0x44(%rbp), %edx
movq 0x90(%rax), %rax
movl (%rax), %ecx
xorl %esi, %esi
callq 0x13870
jmp 0x1149c
movq -0x60(%rbp), %rdi
movq -0x98(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x30, %rdi
leaq -0x40(%rbp), %rsi
callq 0x3ae0
jmp 0x114ba
movq -0x60(%rbp), %rdi
addq $0x18, %rdi
leaq -0x40(%rbp), %rsi
callq 0x3ae0
jmp 0x114cd
jmp 0x114cf
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x11453
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x115d7
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x48, %esi
callq 0x10f0
jmp 0x115d7
movl $0x0, -0x48(%rbp)
movq -0x60(%rbp), %rcx
movl -0x48(%rbp), %eax
movq 0x88(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x115ce
movl $0x48, %edi
callq 0x10e0
movq %rax, -0xa0(%rbp)
jmp 0x11540
movq -0xa0(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x80(%rax), %rcx
movq 0x90(%rax), %rax
movl (%rcx), %edx
movl -0x48(%rbp), %ecx
addl %ecx, %edx
movl (%rax), %ecx
movl $0x1, %esi
callq 0x13870
jmp 0x1156e
movq -0x60(%rbp), %rdi
movq -0xa0(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x48, %rdi
leaq -0x40(%rbp), %rsi
callq 0x3ae0
jmp 0x1158c
movq -0x60(%rbp), %rdi
addq $0x18, %rdi
leaq -0x40(%rbp), %rsi
callq 0x3ae0
jmp 0x1159f
jmp 0x115a1
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x11517
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x48, %esi
callq 0x10f0
jmp 0x115d7
addq $0xa0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3e70
movq -0x68(%rbp), %rdi
callq 0x3ed0
movq -0x70(%rbp), %rdi
callq 0x3ed0
movq -0x78(%rbp), %rdi
callq 0x3ed0
movq -0x30(%rbp), %rdi
callq 0x1180
nopw %cs:(%rax,%rax)