// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/mlp.c
// Function: testMlpnInput_cls
double testMlpnInput_cls(double *Test, matrix* testY, Mlpnetwork N, int* correctlyclassified, double* prob)
{
	/*!Last Changed 09.02.2004 Oya*/
	double sqrderror;
	matrix output_error;
	matrixptr testH;
	int li, output, classno;		
	output_error = matrix_alloc(1, N.P.classnum);
	*testY = matrix_alloc(1, N.P.classnum);
	testH = allocate_hiddens(N.P);
	/*calculate hidden layers*/
	for (li=0; li<N.P.layernum; li++)
	 {
 		if (li == 0)
  			calculate_hidden_values(Test, N.weights[0], &testH[0]);
	 	else
	  		calculate_hidden_values(testH[li-1].values[0], N.weights[li], &testH[li]);
	 }
	/*calculate outputs*/
	if (N.P.layernum == 0)
  	calculate_output_values_cls(Test, N.weights[N.P.layernum], testY);
	else
		 calculate_output_values_cls(testH[N.P.layernum-1].values[0], N.weights[N.P.layernum], testY);
	/*calculate error*/
	sqrderror = calculate_error_values_cls(Test[N.P.dimnum], *testY, &output_error);
	output = findMaxOutput(testY->values[0], N.P.classnum);
	classno = (int)Test[N.P.dimnum];
	*prob = testY->values[0][classno];
	matrix_free(output_error);
	free_hiddens(testH, N.P.layernum);	
	if (classno == output)
		 *correctlyclassified = 1;
	else
		 *correctlyclassified = 0;
	return sqrderror;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
leaq 0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl 0x8(%rax), %esi
movl $0x1, %edi
callq 0x57fc0
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq -0x60(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq -0x58(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movl 0x8(%rax), %esi
movl $0x1, %edi
callq 0x57fc0
movq -0x80(%rbp), %rsi
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x70(%rbp)
movq %rdx, -0x68(%rbp)
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x8, %rsi
movq %rsp, %rdi
movl $0x12, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0x63970
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x80(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x5c(%rcx), %eax
jge 0x64d3c
cmpl $0x0, -0x44(%rbp)
jne 0x64ce4
movq -0x80(%rbp), %rax
movq -0x8(%rbp), %rdi
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x62ac0
jmp 0x64d2c
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
movl -0x44(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rdi
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x40(%rbp), %rcx
movslq -0x44(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x62ac0
jmp 0x64d2e
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x64cb5
movq -0x80(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
jne 0x64d6e
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rdi
movq (%rcx), %rax
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x62b90
jmp 0x64dab
movq -0x80(%rbp), %rcx
movq -0x40(%rbp), %rax
movl 0x5c(%rcx), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq (%rcx), %rax
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x62b90
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rax
movslq 0xc(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
leaq -0x38(%rbp), %rdx
callq 0x63ba0
movq -0x80(%rbp), %rax
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rdi
movl 0x8(%rax), %esi
callq 0x505f0
movq -0x80(%rbp), %rcx
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movslq 0xc(%rcx), %rcx
cvttsd2si (%rax,%rcx,8), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x59ea0
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rdi
movl 0x5c(%rax), %esi
callq 0x63b40
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jne 0x64e50
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x64e5a
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movsd -0x28(%rbp), %xmm0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax,%rax)