// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: create_kernel_dataset
int create_kernel_dataset(char* datasetname, char* classes, char* directoryname, char* datafilename, char* kernelfilename)
{
 Datasetptr tmp;
 int i, j, classcode;
 char* fname, *st, myline[READLINELENGTH];
 FILE* infile;
 tmp = search_dataset(Datasets, datasetname);
 if (tmp)
  {
   printf(m1120);
   delete_dataset(datasetname);
  }
 tmp = empty_dataset(datasetname, directoryname, datafilename, ' ');
 tmp->storetype = STORE_KERNEL;
 stringlist(kernelfilename, ";", tmp->kernelfiles, &(tmp->kernelcount));
 for (i = 0; i < MAXCLASSES; i++)
   tmp->classcounts[i] = 0;
 stringlist(classes, ";", tmp->classes, &(tmp->classno));
 if (tmp->classno > MAXCLASSES)
  {
   printf(m1419, tmp->classno);
   return 0;
  }
 fname = dataset_file_name(tmp);
 infile = fopen(fname, "r");
 if (!infile)
  {
   printf(m1121, fname);
   free_dataset(tmp);
   safe_free(fname);
   return 0;
  }
 j = 0;
 while (fgets(myline, READLINELENGTH, infile))
  {
   if (strlen(myline) <= 1)
     continue;
   myline[strlen(myline) - 1] = '\0';
   st = strtok(myline, " ");
   i = 0;
   while (st)
    {
     if (i == 0 && atoi(st) != j)
      {
       printf(m1475, j + 1);
       free_dataset(tmp);
       safe_free(fname);
       return 0;
      }
     if (i == 1 && tmp->classno)
      {
       classcode = listindex(st, tmp->classes, tmp->classno);
       if (classcode == -1)
        {
         printf(m1260, j, 1);
         free_dataset(tmp);
         safe_free(fname);
         return 0;
        }
       tmp->classcounts[classcode]++;
      }
     i++;
     st = strtok(NULL, " ");
    }
   j++;
  }
 fclose(infile);
 tmp->datacount = j;
 tmp->active = NO;
 tmp->classdefno = 1;
 tmp->featurecount = 2;
 tmp->features[0].type = REAL;
 tmp->features[0].min.floatvalue = 0.0;
 tmp->features[0].max.floatvalue = tmp->datacount - 1.0;
 if (tmp->classno)
  {
   tmp->features[1].type = CLASSDEF;
   for (i = 0; i < tmp->classno; i++)
     tmp->features[1].strings[i] = strcopy(tmp->features[1].strings[i], tmp->classes[i]);
   tmp->features[1].valuecount = tmp->classno;
  }
 else
   tmp->features[1].type = REGDEF;
 add_dataset(tmp);
 tmp->kernel = NULL;
 printf(m1126);
 safe_free(fname);
 return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7a190, %rsp          # imm = 0x7A190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
leaq 0xe4a12(%rip), %rax     # 0x105848
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1db80
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x20e64
leaq 0xc2ce8(%rip), %rdi     # 0xe3b3c
movb $0x0, %al
callq 0x4030
movq -0x10(%rbp), %rdi
callq 0x21250
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl $0x20, %ecx
callq 0x1e640
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x3, 0x140713c(%rax)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
addq $0x1407218, %rdx        # imm = 0x1407218
movq -0x38(%rbp), %rcx
addq $0x1407268, %rcx        # imm = 0x1407268
leaq 0xc4775(%rip), %rsi     # 0xe5622
callq 0x54bf0
movl $0x0, -0x3c(%rbp)
cmpl $0x32, -0x3c(%rbp)
jge 0x20edd
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl $0x0, 0x1407140(%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x20eb9
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rdx
addq $0x18, %rdx
movq -0x38(%rbp), %rcx
addq $0x10, %rcx
leaq 0xc472a(%rip), %rsi     # 0xe5622
callq 0x54bf0
movq -0x38(%rbp), %rax
cmpl $0x32, 0x10(%rax)
jle 0x20f28
movq -0x38(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0xc2c8b(%rip), %rdi     # 0xe3ba0
movb $0x0, %al
callq 0x4030
movl $0x0, -0x4(%rbp)
jmp 0x2123a
movq -0x38(%rbp), %rdi
callq 0x1fc90
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
leaq 0xc7266(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0x7a188(%rbp)
cmpq $0x0, -0x7a188(%rbp)
jne 0x20f86
movq -0x50(%rbp), %rsi
leaq 0xc2c6a(%rip), %rdi     # 0xe3bcb
movb $0x0, %al
callq 0x4030
movq -0x38(%rbp), %rdi
callq 0x1b710
movq -0x50(%rbp), %rdi
callq 0x52e80
movl $0x0, -0x4(%rbp)
jmp 0x2123a
movl $0x0, -0x40(%rbp)
leaq -0x7a180(%rbp), %rdi
movq -0x7a188(%rbp), %rdx
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x40f0
cmpq $0x0, %rax
je 0x210f8
leaq -0x7a180(%rbp), %rdi
callq 0x4150
cmpq $0x1, %rax
ja 0x20fc3
jmp 0x20f8d
leaq -0x7a180(%rbp), %rdi
callq 0x4150
subq $0x1, %rax
movb $0x0, -0x7a180(%rbp,%rax)
leaq -0x7a180(%rbp), %rdi
leaq 0xc429c(%rip), %rsi     # 0xe5285
callq 0x4230
movq %rax, -0x58(%rbp)
movl $0x0, -0x3c(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x210ea
cmpl $0x0, -0x3c(%rbp)
jne 0x2104a
movq -0x58(%rbp), %rdi
callq 0x41c0
cmpl -0x40(%rbp), %eax
je 0x2104a
movl -0x40(%rbp), %esi
addl $0x1, %esi
leaq 0xc2bc4(%rip), %rdi     # 0xe3be9
movb $0x0, %al
callq 0x4030
movq -0x38(%rbp), %rdi
callq 0x1b710
movq -0x50(%rbp), %rdi
callq 0x52e80
movl $0x0, -0x4(%rbp)
jmp 0x2123a
cmpl $0x1, -0x3c(%rbp)
jne 0x210c8
movq -0x38(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x210c8
movq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x18, %rsi
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x54910
movl %eax, -0x44(%rbp)
cmpl $-0x1, -0x44(%rbp)
jne 0x210af
movl -0x40(%rbp), %esi
leaq 0xc2ba1(%rip), %rdi     # 0xe3c26
movl $0x1, %edx
movb $0x0, %al
callq 0x4030
movq -0x38(%rbp), %rdi
callq 0x1b710
movq -0x50(%rbp), %rdi
callq 0x52e80
movl $0x0, -0x4(%rbp)
jmp 0x2123a
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl 0x1407140(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x1407140(%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq 0xc41a9(%rip), %rsi     # 0xe5285
callq 0x4230
movq %rax, -0x58(%rbp)
jmp 0x20ff9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x20f8d
movq -0x7a188(%rbp), %rdi
callq 0x4250
movl -0x40(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1407120(%rax)
movq -0x38(%rbp), %rax
movl $0x0, (%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x1407128(%rax)
movq -0x38(%rbp), %rax
movl $0x2, 0x1bc(%rax)
movq -0x38(%rbp), %rax
movl $0x2, 0x30f08(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30f10(%rax)
movq -0x38(%rbp), %rax
cvtsi2sdl 0x1407120(%rax), %xmm0
movsd 0xc0eb0(%rip), %xmm1    # 0xe2018
subsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, 0x30f18(%rax)
movq -0x38(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x211f6
movq -0x38(%rbp), %rax
movl $0x3, 0x31248(%rax)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x211e3
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x31268(%rax,%rcx,8), %rdi
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, 0x31268(%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x21197
movq -0x38(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x31260(%rax)
jmp 0x21204
movq -0x38(%rbp), %rax
movl $0x4, 0x31248(%rax)
movq -0x38(%rbp), %rdi
callq 0x1eaf0
movq -0x38(%rbp), %rax
movq $0x0, 0x1407210(%rax)
leaq 0xc2a40(%rip), %rdi     # 0xe3c63
movb $0x0, %al
callq 0x4030
movq -0x50(%rbp), %rdi
callq 0x52e80
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x7a190, %rsp          # imm = 0x7A190
popq %rbp
retq
nopw %cs:(%rax,%rax)