// File: /workspace/github_c_makefile_star2_O1/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, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
leaq 0xbb720(%rip), %rax     # 0xd2878
movq (%rax), %r15
testq %r15, %r15
je 0x1718d
movq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x4260
testl %eax, %eax
je 0x17179
movq 0x1407270(%r15), %r15
jmp 0x1715b
leaq 0x8d4d7(%rip), %rdi     # 0xa4657
callq 0x4090
movq %rbp, %rdi
callq 0x170a0
movsbl (%r12), %ecx
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x15559
movq %rax, %rbx
movl $0x1, 0x1407120(%rax)
movl $0x0, 0x1b8(%rax)
movl $0x4, 0x140713c(%rax)
movq 0x8(%rsp), %rax
movl %eax, 0x1407128(%rbx)
leaq 0x1407140(%rbx), %rdi
xorl %r13d, %r13d
movl $0xc8, %edx
xorl %esi, %esi
callq 0x4050
movq %r14, %rdi
callq 0x3115a
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x16285
movq %rax, %r15
leaq 0x9168e(%rip), %rsi     # 0xa888f
movq %rax, %rdi
callq 0x40f0
testq %rax, %rax
je 0x17340
movq %rax, %rbp
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %rax, %rdx
callq 0x4120
testq %rax, %rax
je 0x17363
movq %rbp, 0x10(%rsp)
movq %r14, %rdi
callq 0x4190
movb $0x0, -0x1(%rax,%r14)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4280
testq %rax, %rax
je 0x17315
movq %rax, %r14
leaq 0x30f08(%rbx), %rbp
leaq 0x8cd4a(%rip), %r13     # 0xa3fb5
movq %r14, %rdi
movq %r13, %rsi
callq 0x4260
testl %eax, %eax
je 0x1739a
movl 0x1b8(%rbx), %esi
cmpl 0x8(%rsp), %esi
jge 0x172f9
movq 0x18(%rsp), %rdi
callq 0x3113e
testl %eax, %eax
je 0x172b0
movslq 0x1b8(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movl $0x1, (%rbp,%rax)
jmp 0x172e3
movq %r14, %rdi
callq 0x3992c
movslq 0x1b8(%rbx), %rcx
testl %eax, %eax
je 0x172d4
imulq $0x340, %rcx, %rax      # imm = 0x340
movl $0x0, (%rbp,%rax)
jmp 0x172e3
imulq $0x340, %rcx, %rax      # imm = 0x340
movl $0x2, (%rbp,%rax)
movslq 0x1b8(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movl $0x1, 0x1c(%rbp,%rax)
incl 0x1b8(%rbx)
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
testq %rax, %rax
jne 0x1726b
movl 0x1b8(%rbx), %eax
movq 0x8(%rsp), %rcx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1737c
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
leaq 0x8d289(%rip), %rdi     # 0xa45c7
jmp 0x173b1
leaq 0x8cbd6(%rip), %rdi     # 0xa3f1d
movq %r15, %rsi
xorl %eax, %eax
callq 0x4030
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
jmp 0x173b9
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
leaq 0x8d21d(%rip), %rdi     # 0xa4597
jmp 0x173b1
cmpl $0x1, %eax
jg 0x173ce
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
leaq 0x8d263(%rip), %rdi     # 0xa45fb
jmp 0x173b1
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
leaq 0x8d27c(%rip), %rdi     # 0xa462d
callq 0x4090
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x7a158, %rsp          # imm = 0x7A158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x61a9, %eax           # imm = 0x61A9
jl 0x173fe
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
movl 0x1b8(%rbx), %esi
leaq 0x8cbc5(%rip), %rdi     # 0xa3fb7
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x4030
jmp 0x173b9
subl 0x8(%rsp), %eax
movl %eax, 0x10(%rbx)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x10(%rsp), %rdx
callq 0x4120
testq %rax, %rax
je 0x1750f
movq %rbx, %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq %rax, 0x20(%rsp)
movslq 0x8(%rsp), %rbp
movq %r15, 0x28(%rsp)
movq %r14, %rdi
callq 0x4190
cmpq $0x1, %rax
jbe 0x174f4
movb $0x0, -0x1(%rax,%r14)
incl 0x1407120(%rbx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4280
testq %rax, %rax
je 0x174df
movq %rax, %r14
movq 0x20(%rsp), %r15
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x8cb35(%rip), %rsi     # 0xa3fb5
callq 0x4260
testl %eax, %eax
setne %al
cmpq %rbp, %r13
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x174bc
cmpl $0x0, (%r15)
jne 0x174bc
movq %r14, %rdi
callq 0x3992c
testl %eax, %eax
jne 0x174bc
movq %r14, %rdi
callq 0x398e1
testl %eax, %eax
je 0x174bc
movl $0x2, (%r15)
incq %r13
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
addq $0x340, %r15            # imm = 0x340
testq %rax, %rax
jne 0x17476
movq 0x28(%rsp), %r15
jmp 0x174e2
xorl %r13d, %r13d
cmpl 0x1b8(%rbx), %r13d
leaq 0x30(%rsp), %r14
jne 0x175a1
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x10(%rsp), %rdx
callq 0x4120
testq %rax, %rax
jne 0x1743d
movq 0x8(%rsp), %rax
movl %eax, 0x1b8(%rbx)
movl %eax, 0x1bc(%rbx)
testl %eax, %eax
jle 0x17540
xorl %eax, %eax
movl $0x1, 0x1c4(%rbx,%rax,4)
incq %rax
movslq 0x1bc(%rbx), %rcx
cmpq %rcx, %rax
jl 0x17526
movq 0x10(%rsp), %rdi
callq 0x42a0
movl $0x0, (%rbx)
leaq 0xbb321(%rip), %rcx     # 0xd2878
movq (%rcx), %rax
testq %rax, %rax
je 0x17575
movq %rax, %rcx
movq 0x1407270(%rax), %rax
testq %rax, %rax
jne 0x1755f
addq $0x1407270, %rcx        # imm = 0x1407270
movq %rbx, (%rcx)
leaq 0x8d13b(%rip), %rdi     # 0xa46ba
callq 0x4090
movq %r15, %rdi
callq 0x39194
movq 0x18(%rsp), %rdi
callq 0x31110
movl $0x1, %r13d
jmp 0x173b9
movq %rbx, %rdi
callq 0x13765
movq %r15, %rdi
callq 0x39194
movl 0x1407120(%rbx), %esi
movl 0x1b8(%rbx), %edx
leaq 0x8ca21(%rip), %rdi     # 0xa3fe5
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x4030
jmp 0x173b9