// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/dataset.c
// Function: read_kernel_of_dataset
int read_kernel_of_dataset(Datasetptr d)
{
 int i, j;
 char *st, myline[READLINELENGTH], *kernelfilename;
 FILE* infile;
 kernelfilename = kernel_file_name(d); 
 infile = fopen(kernelfilename, "r");
 if (!infile)
  {
   printf(m1476, kernelfilename);
   safe_free(kernelfilename);
   return 0;
  }
 if (d->kernel != NULL)
  {
   matrix_free(*(d->kernel));
   safe_free(d->kernel);
  }
 d->kernel = safemalloc(sizeof(matrix), "read_kernel_of_dataset", 10);
 *(d->kernel) = matrix_alloc(d->datacount, d->datacount);
 i = 0;
 while (fgets(myline, READLINELENGTH, infile))
  {
   if (strlen(myline) <= 1)
     continue;
   myline[strlen(myline) - 1] = '\0';
   st = strtok(myline, " ");
   j = 0;
   while (st)
    {
     d->kernel->values[i][j] = atof(st);
     j++;
     st = strtok(NULL, " ");
    }
   if (j != d->datacount)
    {
     printf(m1469, i + 1, d->datacount);
     matrix_free(*(d->kernel));
     safe_free(d->kernel);
     d->kernel = NULL;
     safe_free(kernelfilename);
     return 0;
    }
   i++;
  }
 if (i != d->datacount)
  {
   printf(m1470, d->datacount);
   matrix_free(*(d->kernel));
   safe_free(d->kernel);
   d->kernel = NULL;
   safe_free(kernelfilename);
   return 0;
  }
 fclose(infile);
 return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a138, %rsp          # imm = 0x7A138
movq %rdi, %r14
callq 0x15975
movq %rax, %rbx
leaq 0x860a1(%rip), %rsi     # 0x9b87f
movq %rax, %rdi
callq 0x40f0
testq %rax, %rax
je 0x158f0
movq %rax, %r15
movq %rbx, 0x8(%rsp)
movq 0x1407210(%r14), %rax
testq %rax, %rax
je 0x1581b
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x3929f
movq 0x1407210(%r14), %rdi
callq 0x34ff7
leaq 0x815f9(%rip), %rsi     # 0x96e1b
pushq $0x10
popq %rdi
pushq $0xa
popq %rdx
callq 0x34f59
movq %rax, %r12
movq %rax, 0x1407210(%r14)
movl 0x1407120(%r14), %edi
movl %edi, %esi
callq 0x380d3
movq %rax, (%r12)
movq %rdx, 0x8(%r12)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x82e08(%rip), %rbp     # 0x98665
movq %r13, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %r15, %rdx
callq 0x4120
testq %rax, %rax
je 0x158d7
movq %r13, %rdi
callq 0x4190
cmpq $0x2, %rax
jb 0x1585d
movb $0x0, -0x1(%rax,%r13)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4280
xorl %ebx, %ebx
testq %rax, %rax
je 0x158c3
movq %rax, %rdi
callq 0x4130
movq 0x1407210(%r14), %rax
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%rbx,8)
incq %rbx
xorl %edi, %edi
movq %rbp, %rsi
callq 0x4280
jmp 0x15893
movl 0x1407120(%r14), %edx
cmpl %ebx, %edx
jne 0x1595d
incq %r12
jmp 0x1585d
movl 0x1407120(%r14), %esi
cmpl %r12d, %esi
jne 0x15908
movq %r15, %rdi
callq 0x42a0
pushq $0x1
popq %rbp
jmp 0x15949
leaq 0x81505(%rip), %rdi     # 0x96dfc
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4030
movq %rbx, %rdi
jmp 0x15944
leaq 0x81555(%rip), %rdi     # 0x96e64
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4030
movq 0x1407210(%r14), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x3929f
movq 0x1407210(%r14), %rdi
callq 0x34ff7
andq $0x0, 0x1407210(%r14)
movq 0x8(%rsp), %rdi
callq 0x34ff7
movl %ebp, %eax
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %r12d
leaq 0x814cb(%rip), %rdi     # 0x96e32
xorl %ebp, %ebp
movl %r12d, %esi
xorl %eax, %eax
callq 0x4030
jmp 0x15918