// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movq %rsi, %rbp
movq %rdi, %r13
leaq 0xbe3fc(%rip), %rax     # 0xd5878
movq (%rax), %r15
testq %r15, %r15
je 0x174b1
movq 0x8(%r15), %rdi
movq %r13, %rsi
callq 0x4260
testl %eax, %eax
je 0x1749d
movq 0x1407270(%r15), %r15
jmp 0x1747f
leaq 0x901f5(%rip), %rdi     # 0xa7699
callq 0x4090
movq %r13, %rdi
callq 0x173c4
movsbl (%rbp), %ecx
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x155f1
movq %rax, %rbx
movl $0x1, 0x1407120(%rax)
movl $0x0, 0x1b8(%rax)
movl $0x4, 0x140713c(%rax)
movq 0x10(%rsp), %rax
movl %eax, 0x1407128(%rbx)
leaq 0x1407140(%rbx), %rdi
xorl %r14d, %r14d
movl $0xc8, %edx
xorl %esi, %esi
callq 0x4050
movq %r12, %rdi
callq 0x31a5a
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x16542
movq %rax, %r15
leaq 0x94437(%rip), %rsi     # 0xab95b
movq %rax, %rdi
callq 0x40f0
testq %rax, %rax
je 0x17654
movq %rax, %r12
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %rax, %rdx
callq 0x4120
testq %rax, %rax
je 0x17677
movq %r12, 0x8(%rsp)
movq %r14, %rdi
callq 0x4190
movb $0x0, -0x1(%rax,%r14)
movq %r14, %rdi
movq %rbp, %rsi
callq 0x4280
testq %rax, %rax
movq 0x10(%rsp), %r12
je 0x1762c
movq %rax, %r14
leaq 0x30f08(%rbx), %r13
cmpb $0x3f, (%r14)
jne 0x1759d
cmpb $0x0, 0x1(%r14)
je 0x176ae
movl 0x1b8(%rbx), %esi
cmpl %r12d, %esi
jge 0x1760e
movq 0x18(%rsp), %rdi
callq 0x31a3e
testl %eax, %eax
je 0x175d1
movl 0x1b8(%rbx), %esi
movslq %esi, %rcx
imulq $0x340, %rcx, %rax      # imm = 0x340
movl $0x1, (%r13,%rax)
jmp 0x175fe
movq %r14, %rdi
callq 0x3a938
movl 0x1b8(%rbx), %esi
movslq %esi, %rcx
imulq $0x340, %rcx, %rdx      # imm = 0x340
addq %r13, %rdx
testl %eax, %eax
je 0x175f8
movl $0x0, (%rdx)
jmp 0x175fe
movl $0x2, (%rdx)
imulq $0x340, %rcx, %rax      # imm = 0x340
movl $0x1, 0x1c(%r13,%rax)
incl %esi
movl %esi, 0x1b8(%rbx)
xorl %edi, %edi
movq %rbp, %rsi
callq 0x4280
movq %rax, %r14
testq %rax, %rax
jne 0x1758c
movl 0x1b8(%rbx), %eax
leal 0x2(%r12), %ecx
cmpl %ecx, %eax
jge 0x17690
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
leaq 0x8ffb7(%rip), %rdi     # 0xa7609
jmp 0x176c5
leaq 0x8f906(%rip), %rdi     # 0xa6f61
movq %r15, %rsi
xorl %eax, %eax
callq 0x4030
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
jmp 0x176cd
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
leaq 0x8ff4b(%rip), %rdi     # 0xa75d9
jmp 0x176c5
cmpl $0x1, %eax
jg 0x176e2
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
leaq 0x8ff91(%rip), %rdi     # 0xa763d
jmp 0x176c5
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
leaq 0x8ffaa(%rip), %rdi     # 0xa766f
callq 0x4090
xorl %r14d, %r14d
movl %r14d, %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 0x17712
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
movl 0x1b8(%rbx), %esi
leaq 0x8f8f3(%rip), %rdi     # 0xa6ff9
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4030
jmp 0x176cd
subl %r12d, %eax
movl %eax, 0x10(%rbx)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x8(%rsp), %rdx
callq 0x4120
testq %rax, %rax
je 0x17821
movq %rbx, %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq %rax, 0x20(%rsp)
movslq %r12d, %r13
movq %r15, 0x28(%rsp)
movq %r14, %rdi
callq 0x4190
cmpq $0x1, %rax
jbe 0x17806
movb $0x0, -0x1(%rax,%r14)
incl 0x1407120(%rbx)
movq %r14, %rdi
movq %rbp, %rsi
callq 0x4280
testq %rax, %rax
je 0x177ec
movq %rax, %r14
movq 0x20(%rsp), %r15
xorl %r12d, %r12d
movb $0x1, %al
cmpb $0x3f, (%r14)
jne 0x17797
cmpb $0x0, 0x1(%r14)
setne %al
cmpq %r13, %r12
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x177c9
cmpl $0x0, (%r15)
jne 0x177c9
movq %r14, %rdi
callq 0x3a938
testl %eax, %eax
jne 0x177c9
movq %r14, %rdi
callq 0x3a8ed
testl %eax, %eax
je 0x177c9
movl $0x2, (%r15)
incq %r12
xorl %edi, %edi
movq %rbp, %rsi
callq 0x4280
movq %rax, %r14
addq $0x340, %r15            # imm = 0x340
testq %rax, %rax
jne 0x17787
movq 0x28(%rsp), %r15
jmp 0x177ef
xorl %r12d, %r12d
cmpl 0x1b8(%rbx), %r12d
movq 0x10(%rsp), %r12
leaq 0x30(%rsp), %r14
jne 0x179a3
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x8(%rsp), %rdx
callq 0x4120
testq %rax, %rax
jne 0x1774e
movl %r12d, 0x1b8(%rbx)
movl %r12d, 0x1bc(%rbx)
testl %r12d, %r12d
jle 0x17942
movl %r12d, %eax
addl $0x3, %r12d
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %r12d
shlq $0x4, %r12
movdqa 0x8ebd4(%rip), %xmm1    # 0xa6430
movdqa 0x8ebdc(%rip), %xmm2    # 0xa6440
xorl %eax, %eax
movdqa 0x8ebe2(%rip), %xmm3    # 0xa6450
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x8ebe2(%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, %ecx
notl %ecx
testb $0x1, %cl
je 0x178bd
movl $0x1, 0x1c4(%rbx,%rax)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %ecx
testb $0x1, %cl
je 0x178d6
movl $0x1, 0x1c8(%rbx,%rax)
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, %ecx
testb $0x1, %cl
je 0x17918
movl $0x1, 0x1cc(%rbx,%rax)
pextrw $0x4, %xmm6, %ecx
testb $0x1, %cl
je 0x1792d
movl $0x1, 0x1d0(%rbx,%rax)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rax
cmpq %rax, %r12
jne 0x1787e
movq 0x8(%rsp), %rdi
callq 0x42a0
movl $0x0, (%rbx)
leaq 0xbdf1f(%rip), %rcx     # 0xd5878
movq (%rcx), %rax
testq %rax, %rax
je 0x17977
movq %rax, %rcx
movq 0x1407270(%rax), %rax
testq %rax, %rax
jne 0x17961
addq $0x1407270, %rcx        # imm = 0x1407270
movq %rbx, (%rcx)
leaq 0x8fd7b(%rip), %rdi     # 0xa76fc
callq 0x4090
movq %r15, %rdi
callq 0x3a180
movq 0x18(%rsp), %rdi
callq 0x31a10
movl $0x1, %r14d
jmp 0x176cd
movq %rbx, %rdi
callq 0x1376b
movq %r15, %rdi
callq 0x3a180
movl 0x1407120(%rbx), %esi
movl 0x1b8(%rbx), %edx
leaq 0x8f661(%rip), %rdi     # 0xa7027
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4030
jmp 0x176cd