// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movl $0x1, 0x35677f(%rip)    # 0x3e1f74
movl $0x1, 0x2dc641(%rip)    # 0x367e40
movq 0x7a042(%rip), %rdi     # 0x105848
movq 0x79cf3(%rip), %rsi     # 0x105500
callq 0x1db80
movq %rax, 0x7a027(%rip)     # 0x105840
cmpq $0x0, 0x7a01f(%rip)     # 0x105840
jne 0x8b836
leaq 0x5cc29(%rip), %rdi     # 0xe8453
movb $0x0, %al
callq 0x4030
jmp 0x8bebd
movq 0x7a003(%rip), %rax     # 0x105840
cmpl $0x0, (%rax)
jne 0x8b847
jmp 0x8bebd
movq 0x79cba(%rip), %rdi     # 0x105508
callq 0x41c0
movl %eax, %edi
callq 0x54580
leaq 0x56ed3(%rip), %rdi     # 0xe2734
callq 0x79440
movl %eax, -0x30c(%rbp)
leaq 0x56ecd(%rip), %rdi     # 0xe2740
callq 0x79040
movsd %xmm0, -0x308(%rbp)
leaq 0x56ec4(%rip), %rdi     # 0xe274b
callq 0x78f10
movl %eax, -0x2fc(%rbp)
leaq 0x56e8f(%rip), %rdi     # 0xe2728
callq 0x79530
movq %rax, -0x2f8(%rbp)
leaq 0x56eac(%rip), %rdi     # 0xe2758
callq 0x78f10
movl -0x30c(%rbp), %ecx
movsd -0x308(%rbp), %xmm0
movl -0x2fc(%rbp), %r8d
movq -0x2f8(%rbp), %r9
leaq -0x218(%rbp), %rdi
xorl %edx, %edx
xorl %esi, %esi
xorps %xmm2, %xmm2
movq %rdx, %rsi
movl $0x0, (%rsp)
movaps %xmm2, %xmm1
movl %eax, 0x8(%rsp)
movl $0x2, 0x10(%rsp)
callq 0x61f60
leaq -0xa8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
movl $0x90, %edx
callq 0x42b0
movq 0x79f28(%rip), %rdi     # 0x105840
leaq 0x2dc4e1(%rip), %rsi    # 0x367e00
callq 0x85c60
callq 0x87c40
callq 0x87a60
leaq 0x2dc4cb(%rip), %rdi    # 0x367e00
leaq 0x2dc4cc(%rip), %rsi    # 0x367e08
leaq -0x188(%rbp), %rdx
movl $0x4, %ecx
callq 0x45f60
movq -0x188(%rbp), %rax
movq %rax, 0x2dc4a5(%rip)    # 0x367e00
movq 0x2dc49e(%rip), %rdi    # 0x367e00
callq 0x449f0
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0x98(%rbp)
movq 0x2dc490(%rip), %rdi    # 0x367e10
callq 0x449f0
movl %eax, -0x9c(%rbp)
movq 0x2dc46e(%rip), %rdi    # 0x367e00
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x44720
movq %rax, -0x228(%rbp)
movq %rdx, -0x220(%rbp)
movq -0x228(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x148(%rbp)
movq 0x2dc43c(%rip), %rdi    # 0x367e10
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x44720
movq %rax, -0x238(%rbp)
movq %rdx, -0x230(%rbp)
movq -0x238(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x230(%rbp), %rax
movq %rax, -0x158(%rbp)
movq 0x2dc3f2(%rip), %rdi    # 0x367e08
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x44720
movq %rax, -0x248(%rbp)
movq %rdx, -0x240(%rbp)
movq -0x248(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x240(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
movq -0x160(%rbp), %rcx
movq -0x158(%rbp), %r8
leaq -0x2e0(%rbp), %rdi
leaq -0xa8(%rbp), %r9
movl $0x2, (%rsp)
callq 0x61710
leaq -0x140(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
movl $0x98, %edx
callq 0x42b0
movq -0x170(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq %rsp, %rdi
movl $0x13, %ecx
leaq -0x140(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2f0(%rbp), %rsi
movq -0x2e8(%rbp), %rdi
callq 0x652c0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
leaq 0x5a09a(%rip), %rdi     # 0xe5b88
callq 0x4b070
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
leaq -0x150(%rbp), %rdi
callq 0x5ba40
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
leaq -0x150(%rbp), %rdi
callq 0x5ba40
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rsi
callq 0x59ea0
movq -0x170(%rbp), %rdi
movq -0x168(%rbp), %rsi
callq 0x59ea0
movq 0x2dc2bc(%rip), %rsi    # 0x367e10
leaq 0x2dc2a5(%rip), %rdi    # 0x367e00
callq 0x44f40
movq 0x2dc2a1(%rip), %rsi    # 0x367e08
leaq 0x2dc292(%rip), %rdi    # 0x367e00
callq 0x44f40
movq 0x79996(%rip), %rdi     # 0x105510
leaq 0x5c63d(%rip), %rsi     # 0xe81be
callq 0x40c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8bb96
jmp 0x8bebd
movq -0x18(%rbp), %rdi
movq 0x2dc25f(%rip), %rsi    # 0x367e00
callq 0x44a90
movq -0x18(%rbp), %rdi
callq 0x4250
movq 0x79962(%rip), %rdi     # 0x105518
leaq 0x5c601(%rip), %rsi     # 0xe81be
callq 0x40c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8bbd2
jmp 0x8bebd
movslq -0x150(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x5c898(%rip), %rsi     # 0xe847c
movl $0x14, %edx
callq 0x52d70
movq %rax, -0x178(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x150(%rbp), %eax
jge 0x8bd05
leaq -0x140(%rbp), %rsi
addq $0x8, %rsi
movq %rsp, %rdi
movl $0x12, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0x63970
movq %rax, %rdx
movq -0x178(%rbp), %rax
movslq -0x4(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x8bcf5
cmpl $0x0, -0xc(%rbp)
jne 0x8bc87
movq -0x148(%rbp), %rax
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x140(%rbp), %rax
movq -0x178(%rbp), %rcx
movslq -0x4(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x62ac0
jmp 0x8bce5
movq -0x178(%rbp), %rax
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x140(%rbp), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x178(%rbp), %rcx
movslq -0x4(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0xc(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x62ac0
jmp 0x8bce7
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8bc3f
jmp 0x8bcf7
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x8bbfc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x150(%rbp), %eax
jge 0x8be31
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x150(%rbp), %eax
jge 0x8be11
xorps %xmm0, %xmm0
movsd %xmm0, -0x180(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x178(%rbp), %rcx
movslq -0x4(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x4(%rcx), %eax
jge 0x8bdbb
movq -0x178(%rbp), %rax
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x178(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x180(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x180(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8bd43
movl -0x8(%rbp), %eax
movl -0x150(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x8bde7
movq -0x18(%rbp), %rdi
movsd -0x180(%rbp), %xmm0
leaq 0x61013(%rip), %rsi     # 0xecdf1
movb $0x1, %al
callq 0x4280
jmp 0x8be01
movq -0x18(%rbp), %rdi
movsd -0x180(%rbp), %xmm0
leaq 0x60ac0(%rip), %rsi     # 0xec8ba
movb $0x1, %al
callq 0x4280
jmp 0x8be03
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x8bd22
movq -0x18(%rbp), %rdi
leaq 0x59f1f(%rip), %rsi     # 0xe5d3b
movb $0x0, %al
callq 0x4280
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x8bd0c
movq -0x18(%rbp), %rdi
callq 0x4250
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x150(%rbp), %eax
jge 0x8be71
movq -0x178(%rbp), %rax
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0xe4(%rbp), %esi
callq 0x63b40
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x8be41
movq -0x178(%rbp), %rdi
callq 0x52e80
movq 0x2dbf7c(%rip), %rdi    # 0x367e00
callq 0x44510
movq $0x0, 0x2dbf6c(%rip) # 0x367e00
movq $0x0, 0x2dbf69(%rip) # 0x367e08
movq $0x0, 0x2dbf66(%rip) # 0x367e10
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x59ea0
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
nopw %cs:(%rax,%rax)