// File: /workspace/github_c_makefile_star2_O0/kernfel[P]fNEAT/cppn.c
// Function: create_CPPN
int create_CPPN( CPPN *net, struct NEAT_Params *params )
{
	int i, j, err=0;
	
	// Determine number of nodes and links
	net->num_outputs = N_OUTPUTS;
	net->num_inputs = 2*DIMENSIONS + ((params->flags & CFL_USE_DIST)? 1:0) + ((params->flags & CFL_USE_BIAS)? 1:0);
	net->num_hidden = 0;
	if ( params->flags & CFL_MASK_INIT_UNLINKED ) {
		net->num_links = net->num_inputs * net->num_outputs;
	} else {
		net->num_links = 0;
		for ( i=0; i<net->num_outputs; i++ )
			if ( params->initially_linked_outputs[i] )
				net->num_links += net->num_inputs;
	}
	
	// Allocate the storage necessary
	if (( err = allocate_CPPN( net ) ))
		return err;

	// Create input and output nodes
	for ( i=0; i<net->num_inputs; i++ )
		net->nodes[i].func = CF_LINEAR;
	for ( i=0; i<net->num_outputs; i++ )
		net->nodes[i+net->num_inputs].func = params->output_funcs[i];

	// Create links from input to output nodes, where applicable
	for ( i=0; i<net->num_outputs; i++ ) {
		if ( ! (params->flags & CFL_MASK_INIT_UNLINKED) && ! params->initially_linked_outputs[i] )
			continue;
		for ( j=0; j<net->num_inputs; j++ ) {
			net->links[j].innov_id = ++params->innov_counter;
			net->links[j].from = j;
			net->links[j].to = i+net->num_inputs;
			net->links[j].weight = 0;
			net->links[j].is_disabled = ! params->initially_linked_outputs[i];
		}
	}

	return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edx
andl $0x1, %edx
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
addl $0x4, %ecx
movq -0x18(%rbp), %rax
movl (%rax), %esi
andl $0x4, %esi
xorl %eax, %eax
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x204d
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
imull 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x209a
movq -0x10(%rbp), %rax
movl $0x0, 0x20(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x2098
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpl $0x0, 0x3c(%rax,%rcx,4)
je 0x208b
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
jmp 0x208d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x205f
jmp 0x209a
movq -0x10(%rbp), %rdi
callq 0x2260
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x20b6
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2252
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x20ec
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x3, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x20bd
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x2133
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x38(%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rsi
addl 0x8(%rsi), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x20f3
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x224c
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x216e
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpl $0x0, 0x3c(%rax,%rcx,4)
jne 0x216e
jmp 0x223e
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x223c
movq -0x18(%rbp), %rax
movl 0x108(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x108(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpl $0x0, 0x3c(%rax,%rcx,4)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x2175
jmp 0x223e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x213a
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)