// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/dataset.c
// Function: create_multi_label_dataset
int create_multi_label_dataset(char* datasetname, char* separator, int class_start, char* directoryname, char* filename, char* discretefeatures)
{
 Datasetptr tmp;
 int i;
 char* fname, *st, myline[READLINELENGTH];
 FILE* infile;
 Intervalptr intervals;
 tmp = search_dataset(Datasets, datasetname);
 if (tmp)
  {
  printf(m1120);
  delete_dataset(datasetname);
  }
 tmp = empty_dataset(datasetname, directoryname, filename, separator[0]);
 tmp->datacount = 1;
 tmp->allfeatures = 0;
 tmp->storetype = STORE_MULTILABEL;
 tmp->classdefno = class_start;
 for (i = 0; i < MAXCLASSES; i++)
   tmp->classcounts[i] = 0;
 intervals = create_intervals(discretefeatures);
 fname = dataset_file_name(tmp);
 infile = fopen(fname, "r");
 if (!infile)
  {
   printf(m1121, fname);
   free_dataset(tmp);
   safe_free(fname);
   return 0;
  }
 if (fgets(myline, READLINELENGTH, infile))
  {
   myline[strlen(myline) - 1]='\0';
   st = strtok(myline, separator);
   while (st)
    {
     if (strcmp(st,"?") == 0)
      {
       free_dataset(tmp);
       safe_free(fname);
       printf(m1127);
       return 0;
      }
     if (tmp->allfeatures < class_start)
      {
       if (is_in_interval(intervals, tmp->allfeatures))
         tmp->features[tmp->allfeatures].type = STRING;
       else
         if (isinteger(st))
           tmp->features[tmp->allfeatures].type = INTEGER;
         else
           tmp->features[tmp->allfeatures].type = REAL;
       tmp->features[tmp->allfeatures].selected = YES;
      }
     tmp->allfeatures++;
     st = strtok(NULL, separator);
    }
   if (tmp->allfeatures < class_start + 2)
    {
     free_dataset(tmp);
     safe_free(fname);
     printf(m1125);
     return 0;
    }
   if (tmp->allfeatures <= 1)
    {
     free_dataset(tmp);
     safe_free(fname);
     printf(m1123);
     return 0;
    }
   if (tmp->allfeatures > MAXFEATURES)
    {
     free_dataset(tmp);
     safe_free(fname);
     printf(m1421, tmp->allfeatures);
     return 0;
    }
   tmp->classno = tmp->allfeatures - class_start;
  }
 else
  {
   free_dataset(tmp);
   safe_free(fname);
   printf(m1122);
   return 0;
  }
 while (fgets(myline, READLINELENGTH, infile))
  {
   if (strlen(myline) <= 1)
     continue;
   myline[strlen(myline) - 1] = '\0';
   tmp->datacount++;
   st = strtok(myline, separator);
   i = 0;
   while (st)
    {
     if (strcmp(st, "?") != 0 && i < class_start)
       switch (tmp->features[i].type)
        {
         case  INTEGER:if (!isinteger(st) && isfloat(st))
                         tmp->features[i].type = REAL;
                       break;
        }
     i++;
     st = strtok(NULL, separator);
    }
   if (i != tmp->allfeatures)
    {
     free_dataset(tmp);
     safe_free(fname);
     printf(m1261, tmp->datacount, tmp->allfeatures);
     return 0;
    }
  }
 tmp->allfeatures = class_start;
 tmp->featurecount = tmp->allfeatures;
 for (i = 0; i < tmp->featurecount; i++)
   tmp->availability[i] = 1;
 fclose(infile);
 tmp->active = NO;
 add_dataset(tmp);
 printf(m1126);
 safe_free(fname);
 free_intervals(intervals);
 return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a158, %rsp          # imm = 0x7A158
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, 0x18(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
leaq 0xb7b05(%rip), %rax     # 0xcd878
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x13da6
testq %rax, %rax
je 0x15d97
leaq 0x818af(%rip), %rdi     # 0x97639
callq 0x4090
movq %rbp, %rdi
callq 0x15cdf
movsbl (%r12), %ecx
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x1434b
movq %rax, %rbx
movl $0x1, 0x1407120(%rax)
andl $0x0, 0x1b8(%rax)
movl $0x4, 0x140713c(%rax)
movq 0x18(%rsp), %r13
movl %r13d, 0x1407128(%rax)
movl $0x501c50, %eax         # imm = 0x501C50
cmpq $0x501c82, %rax         # imm = 0x501C82
je 0x15dea
andl $0x0, (%rbx,%rax,4)
incq %rax
jmp 0x15dd9
movq %r14, %rdi
callq 0x2d8d0
movq %rax, %rbp
movq %rbx, %rdi
callq 0x14f75
movq %rax, %r15
leaq 0x85a78(%rip), %rsi     # 0x9b87f
movq %rax, %rdi
callq 0x40f0
testq %rax, %rax
je 0x15f08
movq %rax, %r14
movq %r15, 0x8(%rsp)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %rax, %rdx
callq 0x4120
testq %rax, %rax
je 0x15f59
movq %r14, 0x10(%rsp)
movq %r15, %rdi
callq 0x4190
movb $0x0, -0x1(%rax,%r15)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
movq %rbx, %r15
addq $0x30f08, %r15          # imm = 0x30F08
testq %r14, %r14
je 0x15f30
cmpb $0x3f, (%r14)
jne 0x15e83
cmpb $0x0, 0x1(%r14)
je 0x15f94
movl 0x1b8(%rbx), %esi
cmpl %r13d, %esi
jge 0x15eee
movq %rbp, %rdi
callq 0x2d8b6
testl %eax, %eax
je 0x15eb4
movl 0x1b8(%rbx), %esi
movslq %esi, %rcx
imulq $0x340, %rcx, %rax      # imm = 0x340
movl $0x1, (%r15,%rax)
jmp 0x15ede
movq %r14, %rdi
callq 0x356ca
movl 0x1b8(%rbx), %esi
movslq %esi, %rcx
imulq $0x340, %rcx, %rdx      # imm = 0x340
addq %r15, %rdx
testl %eax, %eax
je 0x15ed8
andl $0x0, (%rdx)
jmp 0x15ede
movl $0x2, (%rdx)
imulq $0x340, %rcx, %rax      # imm = 0x340
movl $0x1, 0x1c(%r15,%rax)
incl %esi
movl %esi, 0x1b8(%rbx)
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
jmp 0x15e69
leaq 0x80ff2(%rip), %rdi     # 0x96f01
xorl %ebp, %ebp
movq %r15, %rsi
xorl %eax, %eax
callq 0x4030
movq %rbx, %rdi
callq 0x12723
movq %r15, %rdi
callq 0x34ff7
jmp 0x15fb4
movl 0x1b8(%rbx), %eax
leal 0x2(%r13), %ecx
cmpl %ecx, %eax
jge 0x15f74
movq %rbx, %rdi
callq 0x12723
movq 0x8(%rsp), %rdi
callq 0x34ff7
leaq 0x81652(%rip), %rdi     # 0x975a9
jmp 0x15fad
movq %rbx, %rdi
callq 0x12723
movq 0x8(%rsp), %rdi
callq 0x34ff7
leaq 0x81607(%rip), %rdi     # 0x97579
jmp 0x15fad
cmpl $0x1, %eax
jg 0x15fc8
movq %rbx, %rdi
callq 0x12723
movq 0x8(%rsp), %rdi
callq 0x34ff7
leaq 0x8164b(%rip), %rdi     # 0x975dd
jmp 0x15fad
movq %rbx, %rdi
callq 0x12723
movq 0x8(%rsp), %rdi
callq 0x34ff7
leaq 0x81662(%rip), %rdi     # 0x9760f
callq 0x4090
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x7a158, %rsp          # imm = 0x7A158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x61a9, %eax           # imm = 0x61A9
jb 0x15ff9
movq %rbx, %rdi
callq 0x12723
movq 0x8(%rsp), %rdi
callq 0x34ff7
movl 0x1b8(%rbx), %esi
leaq 0x80fab(%rip), %rdi     # 0x96f99
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4030
jmp 0x15fb4
movq %r15, 0x20(%rsp)
subl %r13d, %eax
movl %eax, 0x10(%rbx)
movslq %r13d, %r13
movq 0x10(%rsp), %r14
leaq 0x30(%rsp), %r15
movq %rbp, 0x28(%rsp)
movq %r15, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %r14, %rdx
callq 0x4120
testq %rax, %rax
je 0x1610e
movq %r15, %rdi
callq 0x4190
cmpq $0x2, %rax
jb 0x16016
movb $0x0, -0x1(%rax,%r15)
incl 0x1407120(%rbx)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
movq 0x20(%rsp), %rbp
xorl %r15d, %r15d
testq %r14, %r14
je 0x160bf
movb $0x1, %al
cmpb $0x3f, (%r14)
jne 0x16074
cmpb $0x0, 0x1(%r14)
setne %al
cmpq %r13, %r15
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x160a6
cmpl $0x0, (%rbp)
jne 0x160a6
movq %r14, %rdi
callq 0x356ca
testl %eax, %eax
jne 0x160a6
movq %r14, %rdi
callq 0x3567d
testl %eax, %eax
je 0x160a6
movl $0x2, (%rbp)
incq %r15
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
addq $0x340, %rbp            # imm = 0x340
jmp 0x1605f
cmpl %r15d, 0x1b8(%rbx)
movq 0x28(%rsp), %rbp
movq 0x10(%rsp), %r14
leaq 0x30(%rsp), %r15
je 0x16016
movq %rbx, %rdi
callq 0x12723
movq 0x8(%rsp), %rdi
callq 0x34ff7
movl 0x1407120(%rbx), %esi
movl 0x1b8(%rbx), %edx
leaq 0x80ec7(%rip), %rdi     # 0x96fc7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4030
jmp 0x15fb4
movq 0x18(%rsp), %rax
movl %eax, 0x1b8(%rbx)
movl %eax, 0x1bc(%rbx)
xorl %eax, %eax
cmpq %r13, %rax
jge 0x16136
movl $0x1, 0x1c4(%rbx,%rax,4)
incq %rax
jmp 0x16121
movq %r14, %rdi
callq 0x42a0
andl $0x0, (%rbx)
movq %rbx, %rdi
callq 0x145cf
leaq 0x8154c(%rip), %rdi     # 0x9769c
callq 0x4090
movq 0x8(%rsp), %rdi
callq 0x34ff7
movq %rbp, %rdi
callq 0x2d888
pushq $0x1
popq %rbp
jmp 0x15fb4