// File: /workspace/github_c_makefile_star2_O3/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 0x16fff
movq %rax, %rbx
leaq 0x94afc(%rip), %rsi     # 0xab95b
movq %rax, %rdi
callq 0x40f0
testq %rax, %rax
je 0x16f77
movq %rax, %r15
movq %rbx, 0x8(%rsp)
movq 0x1407210(%r14), %rax
testq %rax, %rax
je 0x16e9c
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x3ed51
movq 0x1407210(%r14), %rdi
callq 0x3a180
leaq 0x8ffd8(%rip), %rsi     # 0xa6e7b
movl $0x10, %edi
movl $0xa, %edx
callq 0x3a0e1
movq %rax, %r12
movq %rax, 0x1407210(%r14)
movl 0x1407120(%r14), %edi
movl %edi, %esi
callq 0x3d79d
movq %rax, (%r12)
movq %rdx, 0x8(%r12)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x91803(%rip), %rbp     # 0xa86e5
movq %r13, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %r15, %rdx
callq 0x4120
testq %rax, %rax
je 0x16f5c
movq %r13, %rdi
callq 0x4190
cmpq $0x2, %rax
jb 0x16ee2
movb $0x0, -0x1(%rax,%r13)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4280
xorl %ebx, %ebx
testq %rax, %rax
je 0x16f48
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 0x16f18
movl 0x1407120(%r14), %edx
cmpl %edx, %ebx
jne 0x16fe7
incq %r12
jmp 0x16ee2
movl 0x1407120(%r14), %esi
cmpl %r12d, %esi
jne 0x16f8f
movq %r15, %rdi
callq 0x42a0
movl $0x1, %ebp
jmp 0x16fd3
leaq 0x8fede(%rip), %rdi     # 0xa6e5c
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4030
movq %rbx, %rdi
jmp 0x16fce
leaq 0x8ff2e(%rip), %rdi     # 0xa6ec4
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4030
movq 0x1407210(%r14), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x3ed51
movq 0x1407210(%r14), %rdi
callq 0x3a180
movq $0x0, 0x1407210(%r14)
movq 0x8(%rsp), %rdi
callq 0x3a180
movl %ebp, %eax
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %r12d
leaq 0x8fea1(%rip), %rdi     # 0xa6e92
xorl %ebp, %ebp
movl %r12d, %esi
xorl %eax, %eax
callq 0x4030
jmp 0x16f9f