// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xc4d44(%rip), %rsi     # 0xe34ba
leaq 0xc4d44(%rip), %rdx     # 0xe34c1
movl $0x20, %ecx
callq 0x1e640
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1b8(%rax)
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1bc(%rax)
movl $0x1, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1e7dd
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1e7b9
movl -0x2c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1c0(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1e81c
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x1, 0x1c4(%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1e7f1
movl -0xc(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1407128(%rax)
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1407138(%rax)
movl -0x24(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x10(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1e898
leaq -0x2f(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq 0xcea05(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rdi
leaq -0x2f(%rbp), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1e84a
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1ea0b
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
subl $0x44, %eax
je 0x1e97b
jmp 0x1e8c5
movl -0x3c(%rbp), %eax
subl $0x52, %eax
jne 0x1e9de
jmp 0x1e8d3
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movsd 0xc3725(%rip), %xmm0    # 0xe2018
movsd %xmm0, 0x10(%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movsd 0xc4130(%rip), %xmm0    # 0xe2a48
movsd %xmm0, 0x8(%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x2, (%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x2, 0x4(%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x0, 0x18(%rax)
jmp 0x1e9de
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x1, 0x4(%rax)
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x1, 0x1c(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1e89f
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x3, (%rax)
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl $0x3, 0x4(%rax)
movl -0x24(%rbp), %ecx
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1eae3
leaq -0x2f(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq 0xce7e2(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x28(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rdi
leaq -0x2f(%rbp), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x38(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movslq -0x28(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1ea6d
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)