// File: /workspace/github_c_makefile_star2_O3/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, %ebx
movl %esi, %ebp
movq %rdi, %r14
xorl %eax, %eax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rax, 0x8(%rsp)
callq 0x5dcbd
movl %ebx, 0x18(%rsp)
testl %ebx, %ebx
je 0x1a789
movq 0x20(%rsp), %rdi
callq 0x10954
leaq 0x1407128(%r14), %rdi
leaq 0x1407138(%r14), %rsi
callq 0x3a5af
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x10(%r14)
jle 0x1a8cd
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movl %ebx, %ecx
callq 0x30d3f
xorps %xmm0, %xmm0
cvtsi2sdl 0x1407140(%r14,%rbx,4), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x1407120(%r14), %xmm1
divsd %xmm1, %xmm0
mulsd 0x28(%rsp), %xmm0
cvttsd2si %xmm0, %r12d
testl %r12d, %r12d
jle 0x1a8a8
leal (%r15,%r12), %eax
movl %eax, 0x1c(%rsp)
movq %rbp, 0x38(%rsp)
xorl %eax, %eax
callq 0x3af20
cltd
idivl 0x1407140(%r14,%rbx,4)
movl %edx, %ebp
xorl %eax, %eax
callq 0x3af20
cltd
idivl 0x1407140(%r14,%rbx,4)
movq %r14, %r13
movl %edx, %r14d
xorpd %xmm0, %xmm0
movsd 0x8acd6(%rip), %xmm1    # 0xa5520
callq 0x3af6a
movsd %xmm0, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x31851
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movl %r14d, %esi
movq %r13, %r14
callq 0x31851
movq %rbp, %rdi
movq %rax, %rsi
movsd 0x30(%rsp), %xmm0
callq 0x122fb
movq %rax, %rbp
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbp)
movl %r15d, 0x18(%rbp)
incl %r15d
decl %r12d
jne 0x1a811
movl 0x1c(%rsp), %eax
movl %eax, %r15d
movq 0x8(%rsp), %rdi
callq 0x2ff55
movq $0x0, 0x8(%rsp)
incq %rbx
movslq 0x10(%r14), %rax
cmpq %rax, %rbx
jl 0x1a7af
jmp 0x1a8cf
xorl %ebp, %ebp
cmpl $0x0, 0x18(%rsp)
je 0x1a8ec
leaq 0x1407128(%r14), %rdi
addq $0x1407138, %r14        # imm = 0x1407138
movq %r14, %rsi
callq 0x3a5af
movq %rbp, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq