// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/dataset.c
// Function: generate_random_dataset
Datasetptr generate_random_dataset(char* name, int featurecount, char* featuretypes, int* featurevaluecounts, int numberofclasses)
{
 /*!Last Changed 15.03.2007 added selected field*/
 /*!Last Changed 24.09.2006 added string type*/
 /*!Last Changed 09.03.2006*/
 /*featurecount does not include the class definition feature*/
 int i, count;
 char st[3];
 Datasetptr newdataset;
 newdataset = empty_dataset(name, "random", "random.txt", ' ');
 newdataset->allfeatures = featurecount + 1;
 newdataset->featurecount = featurecount + 1;
 count = 1; /*For class feature*/
 for (i = 0; i < featurecount; i++)
   count += featurevaluecounts[i];
 newdataset->multifeaturecount = count;
 for (i = 0; i < featurecount + 1; i++)
   newdataset->availability[i] = YES;
 newdataset->classdefno = featurecount;
 newdataset->newclassdefno = count - 1;
 newdataset->classno = numberofclasses;
 for (i = 0; i < numberofclasses; i++)
  {
   sprintf(st, "%d", i);
   newdataset->classes[i] = strcopy(newdataset->classes[i], st);
  }
 for (i = 0; i < featurecount; i++)
  {
   switch (featuretypes[i])
    {
     case 'R':newdataset->features[i].max.floatvalue = 1.0;
              newdataset->features[i].min.floatvalue = -1.0;
              newdataset->features[i].type = REAL;
              newdataset->features[i].oldtype = REAL;
              newdataset->features[i].valuecount = 0;
              break;
     case 'D':newdataset->features[i].type = STRING;
              newdataset->features[i].oldtype = STRING;
              newdataset->features[i].valuecount = featurevaluecounts[i];
              break;
    }
   newdataset->features[i].selected = YES;
  }
 newdataset->features[featurecount].type = CLASSDEF; 
 newdataset->features[featurecount].oldtype = CLASSDEF; 
 newdataset->features[featurecount].valuecount = numberofclasses;
 for (i = 0; i < numberofclasses; i++)
  {
   sprintf(st, "%d", i);
   newdataset->features[featurecount].strings[i] = strcopy(newdataset->features[featurecount].strings[i], st);
  }
 return newdataset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movl %esi, %r15d
leaq 0x911ef(%rip), %rsi     # 0xa68b4
leaq 0x911ef(%rip), %rdx     # 0xa68bb
movl $0x20, %ecx
callq 0x155f1
movq %rax, %rbx
leal 0x1(%r15), %ecx
movl %ecx, 0x1b8(%rax)
movl %ecx, 0x1bc(%rax)
movl %r15d, %r12d
movl $0x1, %eax
testl %r15d, %r15d
jle 0x15704
xorl %edx, %edx
addl (%r14,%rdx,4), %eax
incq %rdx
cmpq %rdx, %r12
jne 0x156f8
movl %eax, 0x1c0(%rbx)
testl %r15d, %r15d
js 0x15821
movl %ecx, %ecx
leaq -0x1(%rcx), %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0xc(,%rcx,4), %rcx
andq $-0x10, %rcx
movdqa 0x90cf9(%rip), %xmm1    # 0xa6430
movdqa 0x90d01(%rip), %xmm2    # 0xa6440
xorl %edx, %edx
movdqa 0x90d07(%rip), %xmm3    # 0xa6450
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x90d07(%rip), %xmm5    # 0xa6460
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x15799
movl $0x1, 0x1c4(%rbx,%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x157b3
movl $0x1, 0x1c8(%rbx,%rdx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %esi
testb $0x1, %sil
je 0x157f6
movl $0x1, 0x1cc(%rbx,%rdx)
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x1580c
movl $0x1, 0x1d0(%rbx,%rdx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rdx
cmpq %rdx, %rcx
jne 0x15759
movq %r14, 0x20(%rsp)
movq %r15, 0x18(%rsp)
movl %r15d, 0x1407128(%rbx)
decl %eax
movl %eax, 0x1407138(%rbx)
movl %ebp, 0x10(%rbx)
movl %ebp, %r13d
movl %ebp, 0xc(%rsp)
testl %ebp, %ebp
jle 0x15881
leaq 0x9b3a6(%rip), %r14     # 0xb0bf5
leaq 0x9(%rsp), %rbp
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x41b0
movq 0x18(%rbx,%r15,8), %rdi
movq %rbp, %rsi
callq 0x3b494
movq %rax, 0x18(%rbx,%r15,8)
incq %r15
cmpq %r15, %r13
jne 0x15857
movq 0x18(%rsp), %r10
testl %r10d, %r10d
movl 0xc(%rsp), %r8d
movq 0x20(%rsp), %r9
movq 0x10(%rsp), %r11
jle 0x158f9
leaq 0x30f08(%rbx), %rax
xorl %ecx, %ecx
movabsq $0x100000001, %rdx      # imm = 0x100000001
movdqa 0x90bbb(%rip), %xmm0    # 0xa6470
movabsq $0x200000002, %rsi      # imm = 0x200000002
movzbl (%r11,%rcx), %edi
cmpl $0x44, %edi
je 0x158da
cmpl $0x52, %edi
jne 0x158e4
movdqu %xmm0, 0x8(%rax)
movq %rsi, (%rax)
xorl %edi, %edi
jmp 0x158e1
movq %rdx, (%rax)
movl (%r9,%rcx,4), %edi
movl %edi, 0x18(%rax)
movl $0x1, 0x1c(%rax)
incq %rcx
addq $0x340, %rax            # imm = 0x340
cmpq %rcx, %r12
jne 0x158bf
movslq %r10d, %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movabsq $0x300000003, %rcx      # imm = 0x300000003
movq %rcx, 0x30f08(%rbx,%rax)
movl %r8d, 0x30f20(%rbx,%rax)
testl %r8d, %r8d
jle 0x15966
leaq (%rbx,%rax), %rbp
addq $0x30f08, %rbp          # imm = 0x30F08
leaq 0x9b2c1(%rip), %r14     # 0xb0bf5
leaq 0x9(%rsp), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x41b0
movq 0x20(%rbp,%r12,8), %rdi
movq %r15, %rsi
callq 0x3b494
movq %rax, 0x20(%rbp,%r12,8)
incq %r12
cmpq %r12, %r13
jne 0x1593c
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq