// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: dimension_reduced_dataset
Datasetptr dimension_reduced_dataset(Datasetptr d, int dimension, Instanceptr reduceddata, char* datasetname)
{
 /*dimension includes the class definition feature*/
 Datasetptr newdataset;
 int i;
 newdataset = empty_dataset(datasetname, datasetname, "dataset.txt", ' ');
 if (d->classdefno == -1)
   dimension--;
 newdataset->allfeatures = dimension;
 newdataset->featurecount = dimension;
 newdataset->multifeaturecount = dimension;
 for (i = 0; i < dimension; i++)
  {
   newdataset->availability[i] = YES;
   newdataset->features[i].selected = YES;
  }
 if (d->classdefno != -1)
   newdataset->classdefno = newdataset->newclassdefno = dimension - 1;
 else
   newdataset->classdefno = newdataset->newclassdefno = -1;
 newdataset->classno = d->classno;
 for (i = 0; i < d->classno; i++)
   newdataset->classes[i] = strcopy(newdataset->classes[i], d->classes[i]);
 if (d->classdefno == -1)
   dimension++;
 for (i = 0; i < dimension - 1; i++)
  {
   newdataset->features[i].type = REAL;
   newdataset->features[i].oldtype = REAL;
   find_bounds_of_feature(newdataset, reduceddata, i, &(newdataset->features[i].min.floatvalue), &(newdataset->features[i].max.floatvalue));
   newdataset->features[i].valuecount = 0;
  }
 if (d->classdefno != -1)
  {
   newdataset->features[dimension - 1].type = CLASSDEF; 
   newdataset->features[dimension - 1].oldtype = CLASSDEF; 
   newdataset->features[dimension - 1].valuecount = d->classno;
   for (i = 0; i < d->classno; i++)
     if (d->classdefno == d->newclassdefno)
       newdataset->features[dimension - 1].strings[i] = strcopy(newdataset->features[dimension - 1].strings[i], d->features[d->classdefno].strings[i]);
     else
       newdataset->features[dimension - 1].strings[i] = strcopy(newdataset->features[dimension - 1].strings[i], d->features[d->newclassdefno].strings[i]);
  }
 newdataset->traincount = d->traincount;
 newdataset->datacount = d->datacount;
 for (i = 0; i < d->classno; i++)
   newdataset->classcounts[i] = d->classcounts[i];
 return newdataset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xc52b8(%rip), %rdx     # 0xe34ae
movl $0x20, %ecx
callq 0x1e640
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x1407128(%rax)
jne 0x1e21a
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1b8(%rax)
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1bc(%rax)
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c0(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1e28d
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl $0x1, 0x1c4(%rax,%rcx,4)
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x2c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x1, 0x1c(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1e248
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x1407128(%rax)
je 0x1e2b6
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1407138(%rax)
movq -0x28(%rbp), %rax
movl %ecx, 0x1407128(%rax)
jmp 0x1e2d2
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x1407138(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x1407128(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x10(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1e32d
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1e2e7
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x1407128(%rax)
jne 0x1e343
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1e40f
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x2c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x2, (%rax)
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x2c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x2, 0x4(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq -0x28(%rbp), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movslq -0x2c(%rbp), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
addq %rax, %rcx
addq $0x8, %rcx
movq -0x28(%rbp), %r8
addq $0x30f08, %r8           # imm = 0x30F08
movslq -0x2c(%rbp), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
addq %rax, %r8
addq $0x10, %r8
callq 0x178c0
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x2c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1e34a
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x1407128(%rax)
je 0x1e5c7
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x3, (%rax)
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x3, 0x4(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1e5c5
movq -0x8(%rbp), %rax
movl 0x1407128(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1407138(%rcx), %eax
jne 0x1e539
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x8(%rbp), %rcx
movslq 0x1407128(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
jmp 0x1e5b5
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x8(%rbp), %rcx
movslq 0x1407138(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
jmp 0x1e5b7
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1e495
jmp 0x1e5c7
movq -0x8(%rbp), %rax
movl 0x1407124(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1407124(%rax)
movq -0x8(%rbp), %rax
movl 0x1407120(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1407120(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1e62b
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl 0x1407140(%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, 0x1407140(%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1e5f6
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)