// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/process.c
// Function: autoencoder
void autoencoder()
{
 int i, j, li;
 FILE* outfile;
 Mlpparameters parameters;
 Mlpnetwork neuralnetwork;
 matrix train, cv, test;
 matrixptr* hidden_matrices;
 double sum;
 Instanceptr tmpdata;
 mustrealize = YES;
 mustnormalize = YES;
 current_dataset = search_dataset(Datasets, params[0]);
 if (!current_dataset)
  {
   printf(m1320);
   return;
  }
 if (current_dataset->active == NO)
   return;
 mysrand(atoi(params[1]));
 parameters = prepare_Mlpparameters(NULL, NULL, get_parameter_o("weightdecay"), get_parameter_f("decayalpha"), get_parameter_i("hiddenlayers"), (int *) get_parameter_a("hiddennodes"), 0, 0.0, 0.0, get_parameter_i("maxhidden"), AUTOENCODER);
 read_from_train_file(current_dataset, &traindata);
 pre_process();
 create_cvdata();
 divide_instancelist(&traindata, &testdata, &tmpdata, 4);
 traindata = tmpdata;
 parameters.inputnum = data_size(traindata);
 parameters.trnum = parameters.inputnum;
 parameters.cvnum = data_size(cvdata);
 train = instancelist_to_matrix(traindata, CLASSIFICATION, -1, MULTIVARIATE_LINEAR);
 cv = instancelist_to_matrix(cvdata, CLASSIFICATION, -1, MULTIVARIATE_LINEAR);
 test = instancelist_to_matrix(testdata, CLASSIFICATION, -1, MULTIVARIATE_LINEAR);
 neuralnetwork = mlpn_general(train, cv, &parameters, AUTOENCODER);
 set_default_variable("out1", testMlpnNetwork_autoencoder(test, neuralnetwork) + 0.0);
 matrix_rowwise_merge(&train, cv);
 matrix_rowwise_merge(&train, test);
 matrix_free(cv);
 matrix_free(test);
 merge_instancelist(&traindata, cvdata);
 merge_instancelist(&traindata, testdata);
 outfile = fopen(params[2], "w");
 if (!outfile)
   return;
 print_class_information(outfile, traindata);
 fclose(outfile);
 outfile = fopen(params[3], "w");
 if (!outfile)
   return;
 hidden_matrices = safemalloc(train.row * sizeof(matrixptr), "autoencoder", 20);
 for (i = 0; i < train.row; i++)
  {
   hidden_matrices[i] = allocate_hiddens(neuralnetwork.P);
   for (li = 0; li < neuralnetwork.P.layernum; li++)
    {
     if (li == 0)
       calculate_hidden_values(train.values[i], neuralnetwork.weights[0], &(hidden_matrices[i][0]));
     else
       calculate_hidden_values(hidden_matrices[i][li - 1].values[0], neuralnetwork.weights[li], &(hidden_matrices[i][li]));
    }
  }
 for (i = 0; i < train.row; i++)
  {
   for (j = 0; j < train.row; j++)
    {
     sum = 0.0;
     for (li = 0; li < hidden_matrices[i][0].col; li++)
      {
       sum += hidden_matrices[i][0].values[0][li] * hidden_matrices[j][0].values[0][li];
      }
     if (j != train.row - 1)
       fprintf(outfile, "%.6f ", sum);
     else
       fprintf(outfile, "%.6f", sum);
    }
   fprintf(outfile, "\n");
  }
 fclose(outfile);
 for (i = 0; i < train.row; i++)
   free_hiddens(hidden_matrices[i], neuralnetwork.P.layernum);
 safe_free(hidden_matrices);
 deallocate(traindata);
 traindata = NULL;
 testdata = NULL;
 cvdata = NULL;
 matrix_free(train);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movl $0x1, %eax
movl %eax, 0x34fe57(%rip)    # 0x3b1fa4
movl %eax, 0x2d5d1d(%rip)    # 0x337e70
movq 0x7371e(%rip), %rdi     # 0xd5878
movq 0x733cf(%rip), %rsi     # 0xd5530
callq 0x14fb7
movq %rax, 0x73703(%rip)     # 0xd5870
testq %rax, %rax
je 0x625ee
cmpl $0x0, (%rax)
je 0x625dc
movq 0x733b2(%rip), %rdi     # 0xd5538
callq 0x4200
movl %eax, %edi
callq 0x3af63
leaq 0x43826(%rip), %rdi     # 0xa59bf
callq 0x54bec
movl %eax, %ebx
leaq 0x43824(%rip), %rdi     # 0xa59cb
callq 0x549ba
movsd %xmm0, 0xb0(%rsp)
leaq 0x4381a(%rip), %rdi     # 0xa59d6
callq 0x54920
movl %eax, %ebp
leaq 0x437e9(%rip), %rdi     # 0xa59b3
callq 0x54c89
movq %rax, %r15
leaq 0x4380a(%rip), %rdi     # 0xa59e3
callq 0x54920
movl $0x2, %r14d
movl %r14d, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, (%rsp)
leaq 0x158(%rsp), %r12
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %ebx, %ecx
movsd 0xb0(%rsp), %xmm0
movl %ebp, %r8d
movq %r15, %r9
callq 0x445fb
movq 0x73649(%rip), %rdi     # 0xd5870
leaq 0x2d5c02(%rip), %r15    # 0x337e30
movq %r15, %rsi
callq 0x5dcbd
callq 0x5f670
callq 0x5f530
leaq 0x2d5bf1(%rip), %rsi    # 0x337e38
leaq 0xb8(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rdx
movl $0x4, %ecx
callq 0x31019
movq (%rbx), %rdi
movq %rdi, 0x2d5bc7(%rip)    # 0x337e30
callq 0x30309
movl %eax, 0x8(%r12)
movl %eax, 0x10(%r12)
movq 0x2d5bc1(%rip), %rdi    # 0x337e40
callq 0x30309
movl %eax, 0xc(%r12)
movq 0x2d5ba0(%rip), %rdi    # 0x337e30
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x3008b
leaq 0xa0(%rsp), %r15
movq %rax, (%r15)
movq %rdx, 0x8(%r15)
movq 0x2d5b89(%rip), %rdi    # 0x337e40
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x3008b
movq %rax, %r12
movq %rdx, %r13
movq 0x2d5b63(%rip), %rdi    # 0x337e38
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x3008b
movq %rax, %rbp
movq %rdx, %rbx
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movl %r14d, (%rsp)
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
movq %r13, %r8
leaq 0x158(%rsp), %r9
callq 0x43e30
movl $0x13, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x46a32
addsd 0x439d2(%rip), %xmm0    # 0xa5d08
leaq 0x46cab(%rip), %rdi     # 0xa8fe8
callq 0x34a17
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x4021e
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x4021e
movq %r12, %rdi
movq %r13, %rsi
callq 0x3ed51
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3ed51
movq 0x2d5ac5(%rip), %rsi    # 0x337e40
leaq 0x2d5aae(%rip), %rbx    # 0x337e30
movq %rbx, %rdi
callq 0x30648
movq 0x2d5aa7(%rip), %rsi    # 0x337e38
movq %rbx, %rdi
callq 0x30648
movq 0x731a0(%rip), %rdi     # 0xd5540
leaq 0x495c6(%rip), %rsi     # 0xab96d
callq 0x40f0
testq %rax, %rax
je 0x625dc
movq %rax, %rbx
movq 0x2d5a71(%rip), %rsi    # 0x337e30
movq %rax, %rdi
callq 0x3035b
movq %rbx, %rdi
callq 0x42a0
movq 0x73172(%rip), %rdi     # 0xd5548
leaq 0x49590(%rip), %rsi     # 0xab96d
callq 0x40f0
testq %rax, %rax
je 0x625dc
movq %rax, %r14
movslq 0xa0(%rsp), %rdi
shlq $0x3, %rdi
leaq 0x497c7(%rip), %rsi     # 0xabbc8
movl $0x14, %edx
callq 0x3a0e1
movq %rax, %rbx
cmpl $0x0, 0xa0(%rsp)
jle 0x62567
leaq 0xc8(%rsp), %r15
xorl %r12d, %r12d
movl $0x12, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x4559d
movq %rax, (%rbx,%r12,8)
cmpl $0x0, 0x11c(%rsp)
jle 0x624ac
xorl %r13d, %r13d
xorl %ebp, %ebp
testq %r13, %r13
je 0x62474
movq (%rbx,%r12,8), %rcx
movq -0x8(%rcx,%r13), %rax
addq %r13, %rcx
movq (%rax), %rdi
movq 0xc0(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
jmp 0x62493
movq 0xa8(%rsp), %rax
movq (%rax,%r12,8), %rdi
movq 0xc0(%rsp), %rax
movq (%rbx,%r12,8), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x44d21
incq %rbp
movslq 0x11c(%rsp), %rax
addq $0x10, %r13
cmpq %rax, %rbp
jl 0x6244d
incq %r12
movslq 0xa0(%rsp), %rax
cmpq %rax, %r12
jl 0x62427
testl %eax, %eax
jle 0x62567
xorl %r15d, %r15d
leaq 0x4dd78(%rip), %r12     # 0xb024a
leaq 0x4e2a8(%rip), %r13     # 0xb0781
testl %eax, %eax
jle 0x62546
xorl %ebp, %ebp
movq (%rbx,%r15,8), %rdx
movslq 0x4(%rdx), %rcx
testq %rcx, %rcx
jle 0x6251c
movq 0x8(%rdx), %rdx
movq (%rdx), %rdx
movq (%rbx,%rbp,8), %rsi
movq 0x8(%rsi), %rsi
movq (%rsi), %rsi
xorpd %xmm0, %xmm0
xorl %edi, %edi
movsd (%rdx,%rdi,8), %xmm1
mulsd (%rsi,%rdi,8), %xmm1
addsd %xmm1, %xmm0
incq %rdi
cmpq %rdi, %rcx
jne 0x62504
jmp 0x62520
xorpd %xmm0, %xmm0
decl %eax
cmpq %rax, %rbp
movq %r13, %rsi
cmoveq %r12, %rsi
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
incq %rbp
movslq 0xa0(%rsp), %rax
cmpq %rax, %rbp
jl 0x624df
movl $0xa, %edi
movq %r14, %rsi
callq 0x4150
incq %r15
movslq 0xa0(%rsp), %rax
cmpq %rax, %r15
jl 0x624d9
movq %r14, %rdi
callq 0x42a0
cmpl $0x0, 0xa0(%rsp)
jle 0x6259c
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
movl 0x11c(%rsp), %esi
callq 0x45692
incq %r14
movslq 0xa0(%rsp), %rax
cmpq %rax, %r14
jl 0x6257c
movq %rbx, %rdi
callq 0x3a180
movq 0x2d5885(%rip), %rdi    # 0x337e30
callq 0x2ff55
xorl %eax, %eax
movq %rax, 0x2d5877(%rip)    # 0x337e30
movq %rax, 0x2d5878(%rip)    # 0x337e38
movq %rax, 0x2d5879(%rip)    # 0x337e40
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x3ed51
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4c19d(%rip), %rdi     # 0xae792
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4090