// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: create_linear_test_set
Instanceptr create_linear_test_set(Datasetptr d, int numexp, int mustrealize)
{
 /*!Last Changed 07.05.2006 Oya*/
 Instanceptr temptr, traindata = NULL, testdata = NULL, tempinst1, tempinst2, currentinstance;
 Instanceptr classdata = NULL, rest = NULL;
 int i, j, k, stratifiedcount, d1, d2;
 double prm;
 read_from_train_file(d, &traindata);
 if (mustrealize)
  {
   realize(traindata);
   exchange_classdefno(d);
  }
 rest = traindata;
 k = 0;
 for (i = 0; i < d->classno; i++)
  {
   temptr = rest;
   rest = NULL;
   divide_instancelist_one_vs_rest(&temptr, &classdata, &rest, i);
   stratifiedcount = (int) (((d->classcounts[i] + 0.0) / d->datacount) * numexp);
   /*generate stratifiedcount many examples from class i*/
   for (j = 0; j < stratifiedcount; j++)
    {
     /*chose two random points from class i*/
     d1 = myrand() % d->classcounts[i];
     d2 = myrand() % d->classcounts[i];
     prm = produce_random_value(0.0, 1.0);
     tempinst1 = data_x(classdata, d1);
     tempinst2 = data_x(classdata, d2);
     /*find new point by linear interpolation*/
     currentinstance = find_linear_interpolation_data(tempinst1, tempinst2, prm);
     /*add it to the test set*/
     currentinstance->next = testdata;
     currentinstance->index = k;
     testdata = currentinstance;
     k++;
    }
   deallocate(classdata);
   classdata = NULL;
  }
 if (mustrealize)
   exchange_classdefno(d);
 return testdata;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x85c60
cmpl $0x0, -0x10(%rbp)
je 0x255f7
movq -0x20(%rbp), %rdi
callq 0x17090
movq -0x8(%rbp), %rdi
callq 0x1a880
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x2575f
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x50(%rbp)
movl -0x54(%rbp), %ecx
leaq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x45b50
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
cvtsi2sdl 0x1407140(%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
cvtsi2sdl 0x1407120(%rax), %xmm1
divsd %xmm1, %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x25740
movb $0x0, %al
callq 0x54550
movq -0x8(%rbp), %rcx
movslq -0x54(%rbp), %rsi
cltd
idivl 0x1407140(%rcx,%rsi,4)
movl %edx, -0x64(%rbp)
movb $0x0, %al
callq 0x54550
movq -0x8(%rbp), %rcx
movslq -0x54(%rbp), %rsi
cltd
idivl 0x1407140(%rcx,%rsi,4)
movl %edx, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd 0xbc94d(%rip), %xmm1    # 0xe2018
callq 0x545a0
movsd %xmm0, -0x70(%rbp)
movq -0x48(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x46c40
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x46c40
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movsd -0x70(%rbp), %xmm0
callq 0x198d0
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x5c(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x25680
movq -0x48(%rbp), %rdi
callq 0x44510
movq $0x0, -0x48(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2560d
cmpl $0x0, -0x10(%rbp)
je 0x2576e
movq -0x8(%rbp), %rdi
callq 0x1a880
movq -0x28(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)