// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: lp_separability
double lp_separability(Datasetptr d, double* trainerror, double* testerror)
{
 /*!Last Changed 10.05.2006 Oya*/
 Instanceptr traindata, testdata;
 Instance mean, variance;
 double result, loglikelihood, losstrain = 0, losstest = 0;
 int performance;
 Mlpparameters mlpparams;
 Mlpnetwork neuralnetwork;
 matrix train, test; 
 testdata = create_linear_test_set(d, d->datacount / 2, YES);
 read_from_train_file(d, &traindata);
 realize(traindata);
 exchange_classdefno(d);
 mean = find_mean(traindata);
 variance = find_variance(traindata);
 normalize(traindata, mean, variance);
 normalize(testdata, mean, variance);               
 mlpparams = prepare_Mlpparameters(traindata, traindata, 0, 0.0, 0, NULL, 0, 0.0, 0.0, 0, CLASSIFICATION);
 train = instancelist_to_matrix(traindata, CLASSIFICATION, -1, MULTIVARIATE_LINEAR);
 test = instancelist_to_matrix(testdata, CLASSIFICATION, -1, MULTIVARIATE_LINEAR);
 neuralnetwork = mlpn_general(train, train, &mlpparams, AUTOENCODER);
 neuralnetwork.P = mlpparams;
 performance = testMlpnNetwork2_cls(train, neuralnetwork, &loglikelihood, &losstrain);
 *trainerror = 1 - (performance / (train.row + 0.0));
 neuralnetwork.P = mlpparams;
 performance = testMlpnNetwork2_cls(test, neuralnetwork, &loglikelihood, &losstest); 
 *testerror = 1 - (performance / (test.row + 0.0));
 free_mlpnnetwork(&neuralnetwork);               
 safe_free(mean.values);
 safe_free(variance.values);
 matrix_free(train);
 matrix_free(test);
 exchange_classdefno(d);
 deallocate(traindata); 
 deallocate(testdata); 
 result = losstrain;
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x1407120(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl $0x1, %edx
callq 0x255a0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x85c60
movq -0x20(%rbp), %rdi
callq 0x17090
movq -0x8(%rbp), %rdi
callq 0x1a880
movq -0x20(%rbp), %rsi
leaq -0x228(%rbp), %rdi
callq 0x19b30
leaq -0x58(%rbp), %rdi
leaq -0x228(%rbp), %rsi
movl $0x30, %edx
callq 0x42b0
movq -0x20(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x1a0a0
leaq -0x88(%rbp), %rdi
leaq -0x258(%rbp), %rsi
movl $0x30, %edx
callq 0x42b0
movq -0x20(%rbp), %rdi
movups -0x88(%rbp), %xmm0
movups -0x78(%rbp), %xmm1
movups -0x68(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x50(%rax)
movups %xmm1, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups -0x38(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x16db0
movq -0x28(%rbp), %rdi
movups -0x88(%rbp), %xmm0
movups -0x78(%rbp), %xmm1
movups -0x68(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x50(%rax)
movups %xmm1, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups -0x38(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x16db0
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x2e8(%rbp), %rdi
xorl %r8d, %r8d
xorps %xmm2, %xmm2
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %ecx
movaps %xmm2, %xmm0
movl $0x0, (%rsp)
movaps %xmm2, %xmm1
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x61f60
leaq -0x140(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
movl $0x90, %edx
callq 0x42b0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x44720
movq %rax, -0x2f8(%rbp)
movq %rdx, -0x2f0(%rbp)
movq -0x2f8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x2f0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x44720
movq %rax, -0x308(%rbp)
movq %rdx, -0x300(%rbp)
movq -0x308(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x300(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x1e8(%rbp), %rsi
movq -0x1e0(%rbp), %rdx
movq -0x1e8(%rbp), %rcx
movq -0x1e0(%rbp), %r8
leaq -0x3a0(%rbp), %rdi
leaq -0x140(%rbp), %r9
movl $0x2, (%rsp)
callq 0x61710
leaq -0x1d8(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
movl $0x98, %edx
callq 0x42b0
leaq -0x1d8(%rbp), %rdi
addq $0x8, %rdi
leaq -0x140(%rbp), %rsi
movl $0x90, %edx
callq 0x42b0
movq -0x1e8(%rbp), %rax
movq %rax, -0x3b8(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x3c0(%rbp)
movq %rsp, %rdi
movl $0x13, %ecx
leaq -0x1d8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x3c0(%rbp), %rsi
movq -0x3b8(%rbp), %rdi
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
callq 0x651b0
movl %eax, -0xac(%rbp)
cvtsi2sdl -0xac(%rbp), %xmm1
cvtsi2sdl -0x1e8(%rbp), %xmm0
xorps %xmm2, %xmm2
addsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movsd 0xbbea6(%rip), %xmm0    # 0xe2018
subsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, (%rax)
leaq -0x1d8(%rbp), %rdi
addq $0x8, %rdi
leaq -0x140(%rbp), %rsi
movl $0x90, %edx
callq 0x42b0
movq -0x1f8(%rbp), %rax
movq %rax, -0x3a8(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x3b0(%rbp)
movq %rsp, %rdi
movl $0x13, %ecx
leaq -0x1d8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x3b0(%rbp), %rsi
movq -0x3a8(%rbp), %rdi
leaq -0x98(%rbp), %rdx
leaq -0xa8(%rbp), %rcx
callq 0x651b0
movl %eax, -0xac(%rbp)
cvtsi2sdl -0xac(%rbp), %xmm1
cvtsi2sdl -0x1f8(%rbp), %xmm0
xorps %xmm2, %xmm2
addsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movsd 0xbbe06(%rip), %xmm0    # 0xe2018
subsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x63ab0
movq -0x58(%rbp), %rdi
callq 0x52e80
movq -0x88(%rbp), %rdi
callq 0x52e80
movq -0x1e8(%rbp), %rdi
movq -0x1e0(%rbp), %rsi
callq 0x59ea0
movq -0x1f8(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
callq 0x59ea0
movq -0x8(%rbp), %rdi
callq 0x1a880
movq -0x20(%rbp), %rdi
callq 0x44510
movq -0x28(%rbp), %rdi
callq 0x44510
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)