// File: /workspace/github_c_makefile_star2_O1/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)
movq %rax, 0x10(%rsp)
callq 0x5c7af
movl %ebx, 0x1c(%rsp)
testl %ebx, %ebx
je 0x1a25f
movq 0x20(%rsp), %rdi
callq 0x10964
leaq 0x1407128(%r14), %rdi
leaq 0x1407138(%r14), %rsi
callq 0x395a3
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x10(%r14)
jle 0x1a3a5
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
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 %r13d, %ecx
callq 0x30465
xorps %xmm0, %xmm0
cvtsi2sdl 0x1407140(%r14,%r13,4), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x1407120(%r14), %xmm1
divsd %xmm1, %xmm0
mulsd 0x28(%rsp), %xmm0
cvttsd2si %xmm0, %ebx
testl %ebx, %ebx
jle 0x1a37a
movq %r12, 0x38(%rsp)
xorl %eax, %eax
callq 0x39f18
cltd
idivl 0x1407140(%r14,%r13,4)
movl %edx, %ebp
xorl %eax, %eax
callq 0x39f18
cltd
idivl 0x1407140(%r14,%r13,4)
movq %r13, %r12
movq %r14, %r13
movl %edx, %r14d
xorpd %xmm0, %xmm0
movsd 0x88204(%rip), %xmm1    # 0xa2520
callq 0x39f62
movsd %xmm0, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x30fe5
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movl %r14d, %esi
movq %r13, %r14
movq %r12, %r13
callq 0x30fe5
movq %rbp, %rdi
movq %rax, %rsi
movsd 0x30(%rsp), %xmm0
callq 0x12399
movq %rax, %rbp
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbp)
movl %r15d, 0x18(%rbp)
incl %r15d
movq %rbp, %r12
decl %ebx
jne 0x1a2e0
jmp 0x1a37d
movq %r12, %rbp
movq 0x8(%rsp), %rdi
callq 0x2f616
movq $0x0, 0x8(%rsp)
incq %r13
movslq 0x10(%r14), %rax
movq %rbp, %r12
cmpq %rax, %r13
jl 0x1a287
jmp 0x1a3a7
xorl %ebp, %ebp
cmpl $0x0, 0x1c(%rsp)
je 0x1a3c4
leaq 0x1407128(%r14), %rdi
addq $0x1407138, %r14        # imm = 0x1407138
movq %r14, %rsi
callq 0x395a3
movq %rbp, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq