// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dimreduction.c
// Function: dimension_reduction_lle
Instanceptr dimension_reduction_lle(Datasetptr d, Instanceptr traindata, void* parameters, Datasetptr* new_dataset, char* new_dataset_name)
{
 /*!Last Changed 19.01.2008*/
 int howmany;
 matrix eigenvectors, neighborhood, w, M;
 double *eigenvalues;
 Isomap_parameterptr pisomap = (Isomap_parameterptr) parameters;
 Instanceptr newlist; 
 switch (pisomap->neighborhood_type)
  {
   case NEIGHBORHOOD_TYPE_EPSILON:neighborhood = determine_neighborhood_epsilon(traindata, pisomap->epsilon);
                                  break;
   case       NEIGHBORHOOD_TYPE_K:neighborhood = determine_neighborhood_k(traindata, pisomap->k);
                                  break;
  }
 w = local_contributions_of_neighbors(d, traindata, neighborhood);
 matrix_free(neighborhood);
 M = calculate_m_for_lle(w);
 matrix_free(w);
 switch (pisomap->ppca.reduction_type)
  {
   case REDUCTION_TYPE_FEATURE :eigenvalues = find_eigenvalues_eigenvectors_symmetric(&eigenvectors, M);
                                howmany = pisomap->ppca.featurecount;
                                break;
   case REDUCTION_TYPE_VARIANCE:eigenvalues = find_eigenvalues_eigenvectors(&eigenvectors, M, &howmany, 1 - pisomap->ppca.variance_explained);
                                break;
  }
 matrix_free(M);
 newlist = reduce_dimension_of_instancelist_lle(traindata, howmany, eigenvectors, eigenvalues);
 *new_dataset = dimension_reduced_dataset(d, howmany + 1, newlist, new_dataset_name);
 return newlist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0xcc(%rbp)
testl %eax, %eax
je 0x2be57
jmp 0x2be4a
movl -0xcc(%rbp), %eax
subl $0x1, %eax
je 0x2be8f
jmp 0x2bec3
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm0
callq 0x2c610
movq %rax, -0x98(%rbp)
movq %rdx, -0x90(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x2bec3
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x2c310
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x2d110
movq %rax, -0xb8(%rbp)
movq %rdx, -0xb0(%rbp)
movups -0xb8(%rbp), %xmm0
movaps %xmm0, -0x60(%rbp)
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x59ea0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2d2a0
movq %rax, -0xc8(%rbp)
movq %rdx, -0xc0(%rbp)
movups -0xc8(%rbp), %xmm0
movaps %xmm0, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x59ea0
movq -0x80(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xd0(%rbp)
testl %eax, %eax
je 0x2bf51
jmp 0x2bf44
movl -0xd0(%rbp), %eax
subl $0x1, %eax
je 0x2bf71
jmp 0x2bf9b
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x5fb50
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x2bf9b
movq -0x80(%rbp), %rax
movsd 0xb609b(%rip), %xmm0    # 0xe2018
subsd 0x8(%rax), %xmm0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x40(%rbp), %rdi
leaq -0x2c(%rbp), %rcx
callq 0x5fba0
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x59ea0
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x78(%rbp), %r8
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x2ccd0
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
addl $0x1, %esi
movq -0x88(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1e1d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x88(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)