// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %r14d
movl %esi, %ebp
leaq 0x28(%rsp), %rsi
andq $0x0, (%rsi)
movq %rdi, %rbx
andq $0x0, 0x8(%rsp)
callq 0x5577a
movl %r14d, 0x18(%rsp)
testl %r14d, %r14d
je 0x188e9
movq 0x28(%rsp), %rdi
callq 0xfc81
movq %rbx, %rdi
callq 0x11d5c
movq 0x28(%rsp), %rax
leaq 0x10(%rsp), %rcx
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x30(%rsp)
movq %rax, (%rcx)
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rbx, 0x20(%rsp)
movslq 0x10(%rbx), %rax
cmpq %rax, %rbp
jge 0x18a21
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
callq 0x2cd37
cvtsi2sdl 0x1407140(%rbx,%rbp,4), %xmm0
cvtsi2sdl 0x1407120(%rbx), %xmm1
divsd %xmm1, %xmm0
mulsd 0x30(%rsp), %xmm0
cvttsd2si %xmm0, %ebx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
leal (%r12,%rbx), %eax
movl %eax, 0x1c(%rsp)
subl $0x1, %ebx
jb 0x189fd
xorl %eax, %eax
callq 0x35c7f
cltd
movq 0x20(%rsp), %r15
idivl 0x1407140(%r15,%rbp,4)
movl %edx, %r14d
xorl %eax, %eax
callq 0x35c7f
cltd
idivl 0x1407140(%r15,%rbp,4)
movl %edx, %r15d
xorpd %xmm0, %xmm0
movsd 0x7cb6f(%rip), %xmm1    # 0x95520
callq 0x35cae
movsd %xmm0, 0x38(%rsp)
movq 0x8(%rsp), %rdi
movl %r14d, %esi
callq 0x2d761
movq %rax, %r14
movq 0x8(%rsp), %rdi
movl %r15d, %esi
callq 0x2d761
movq %r14, %rdi
movq %rax, %rsi
movsd 0x38(%rsp), %xmm0
callq 0x1155b
movq %r13, 0x10(%rax)
movl %r12d, 0x18(%rax)
incl %r12d
movq %rax, %r13
jmp 0x18971
movq 0x8(%rsp), %rdi
callq 0x2c010
andq $0x0, 0x8(%rsp)
incq %rbp
movl 0x1c(%rsp), %eax
movl %eax, %r12d
movq 0x20(%rsp), %rbx
jmp 0x1890d
cmpl $0x0, 0x18(%rsp)
je 0x18a30
movq %rbx, %rdi
callq 0x11d5c
movq %r13, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq