// File: /workspace/github_c_makefile_star2_O2/kernfel[P]fNEAT/network.c
// Function: dump_pNetwork
void dump_pNetwork( pNetwork *net, FILE *fp ) {
	unsigned int i;
	int j;

	char coords[DIMENSIONS*8];
	char c_part[8];

	int block = -1, index;
	for ( i=0; i<net->num_nodes; i++ ) {
		index = i % BLOCKSIZE_NODES;
		if ( ! index )
			block++;
		coords[0] = '\0';
		for ( j=0; j<N_OUTPUTS; j++ ) {
			sprintf( c_part, j<DIMENSIONS-1 ? "%+5.4f, " : "%+5.4f", net->p_nodes[block][index].x[j] );
			strcat( coords, c_part );
		}
		fprintf( fp, "0x%08x | %s | %d | %s\n",
			(unsigned int) &net->p_nodes[block][index],
			i<net->num_inputs ? "input" : i<net->num_inputs+net->num_outputs ? "output" : "hidden",
			net->p_nodes[block][index].used,
			coords
		);
	}

	char readout[N_OUTPUTS*9];
	char r_part[9];

	block = -1;
	for ( i=0; i<net->num_links; i++ ) {
		index = i % BLOCKSIZE_LINKS;
		if ( ! index )
			block++;
		readout[0] = '\0';
		for ( j=0; j<N_OUTPUTS; j++ ) {
			sprintf( r_part, j<N_OUTPUTS-1 ? "%+6.4f, " : "%+6.4f", net->p_links[block][index].r[j] );
			strcat( readout, r_part );
		}
		fprintf( fp, "0x%08x | %d | 0x%08x > 0x%08x | %s\n",
			(unsigned int) &net->p_links[block][index],
			net->p_links[block][index].used,
			(unsigned int) net->p_links[block][index].from,
			(unsigned int) net->p_links[block][index].to,
			readout
		);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, 0x18(%rsp)
movq %rdi, %r14
pushq $-0x1
popq %r15
xorl %ebp, %ebp
cmpl (%r14), %ebp
jae 0x4906
movzbl %bpl, %eax
cmpl $0x1, %eax
adcl $0x0, %r15d
movb $0x0, 0x30(%rsp)
movq 0x10(%r14), %rcx
movslq %r15d, %r13
movq (%rcx,%r13,8), %rcx
imulq $0x18, %rax, %r12
movsd (%rcx,%r12), %xmm0
leaq 0x47(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1ac6(%rip), %rsi      # 0x6360
movb $0x1, %al
callq 0x1160
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x1140
movl 0x18(%r14), %eax
leaq 0x1ac7(%rip), %rcx      # 0x6380
cmpl %eax, %ebp
jb 0x48d5
addl 0x1c(%r14), %eax
cmpl %eax, %ebp
leaq 0x1ac3(%rip), %rcx      # 0x638d
leaq 0x1ab5(%rip), %rax      # 0x6386
cmovbq %rax, %rcx
movq 0x10(%r14), %rax
movq (%rax,%r13,8), %rax
leal (%r12,%rax), %edx
movzbl 0x10(%rax,%r12), %r8d
movq 0x18(%rsp), %rdi
leaq 0x1a76(%rip), %rsi      # 0x6369
leaq 0x30(%rsp), %r9
xorl %eax, %eax
callq 0x10b0
incl %ebp
jmp 0x485d
pushq $-0x1
popq %rax
movl %eax, 0x14(%rsp)
xorl %ebp, %ebp
cmpl 0x20(%r14), %ebp
jae 0x49a6
movl %ebp, %ebx
andl $0x3ff, %ebx            # imm = 0x3FF
cmpl $0x1, %ebx
movl 0x14(%rsp), %ecx
adcl $0x0, %ecx
movb $0x0, 0x27(%rsp)
movq 0x30(%r14), %rax
movl %ecx, 0x14(%rsp)
movslq %ecx, %r12
movq (%rax,%r12,8), %rax
shll $0x5, %ebx
movsd 0x10(%rax,%rbx), %xmm0
leaq 0x4f(%rsp), %r13
movq %r13, %rdi
leaq 0x1a3d(%rip), %rsi      # 0x6394
movb $0x1, %al
callq 0x1160
leaq 0x27(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x1140
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %rax
leaq (%rax,%rbx), %rdx
movzbl 0x18(%rax,%rbx), %ecx
movl (%rax,%rbx), %r8d
movl 0x8(%rax,%rbx), %r9d
movq %r15, (%rsp)
movq 0x18(%rsp), %rdi
leaq 0x1a03(%rip), %rsi      # 0x639b
xorl %eax, %eax
callq 0x10b0
incl %ebp
jmp 0x490f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq