// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, %r14
cmpl $0x0, (%rdi)
je 0x4d4c
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x40(%rsp), %rbx
xorl %r12d, %r12d
movzbl %r12b, %r13d
cmpl $0x1, %r13d
adcl $0x0, %ecx
movb $0x0, 0x40(%rsp)
movq 0x10(%r14), %rax
movl %ecx, 0x1c(%rsp)
movslq %ecx, %rcx
movq %rcx, 0x28(%rsp)
movq (%rax,%rcx,8), %rax
leal (,%r13,8), %ecx
leaq (%rcx,%rcx,2), %r15
movsd (%rax,%r15), %xmm0
leaq 0x57(%rsp), %rbp
movq %rbp, %rdi
leaq 0x25b7(%rip), %rsi      # 0x7279
movb $0x1, %al
callq 0x1160
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1140
movl 0x18(%r14), %eax
leaq 0x25ba(%rip), %rcx      # 0x7299
cmpl %eax, %r12d
jb 0x4cfd
addl 0x1c(%r14), %eax
cmpl %eax, %r12d
leaq 0x25b4(%rip), %rcx      # 0x72a6
leaq 0x25a6(%rip), %rax      # 0x729f
cmovbq %rax, %rcx
movq 0x10(%r14), %rax
movq 0x28(%rsp), %rdx
movq (%rax,%rdx,8), %rax
addl %eax, %r15d
leaq (,%r13,2), %rdx
addq %r13, %rdx
movzbl 0x10(%rax,%rdx,8), %r8d
movq 0x20(%rsp), %rdi
leaq 0x2558(%rip), %rsi      # 0x7282
movl %r15d, %edx
leaq 0x40(%rsp), %rbx
movq %rbx, %r9
xorl %eax, %eax
callq 0x10b0
incl %r12d
cmpl (%r14), %r12d
movl 0x1c(%rsp), %ecx
jb 0x4c7d
cmpl $0x0, 0x20(%r14)
je 0x4dfe
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %ebp, %ebp
movq %r14, 0x10(%rsp)
movl %ebp, %ebx
andl $0x3ff, %ebx            # imm = 0x3FF
cmpl $0x1, %ebx
adcl $0x0, %r15d
movb $0x0, 0x37(%rsp)
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movslq %r15d, %r12
movq (%rax,%r12,8), %rax
shll $0x5, %ebx
movsd 0x10(%rax,%rbx), %xmm0
leaq 0x5f(%rsp), %r13
movq %r13, %rdi
leaq 0x250d(%rip), %rsi      # 0x72ad
movb $0x1, %al
callq 0x1160
leaq 0x37(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x1140
movq 0x10(%rsp), %rax
movq 0x30(%rax), %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 %r14, (%rsp)
movq 0x20(%rsp), %rdi
leaq 0x24ce(%rip), %rsi      # 0x72b4
xorl %eax, %eax
callq 0x10b0
movq 0x10(%rsp), %r14
incl %ebp
cmpl 0x20(%r14), %ebp
jb 0x4d64
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq