// File: /workspace/github_c_makefile_star2_O1/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 0x16cd3
movq %rax, %rbx
leaq 0x91d5c(%rip), %rsi     # 0xa888f
movq %rax, %rdi
callq 0x40f0
testq %rax, %rax
je 0x16c4b
movq %rax, %r15
movq %rbx, 0x8(%rsp)
movq 0x1407210(%r14), %rax
testq %rax, %rax
je 0x16b70
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x3dbad
movq 0x1407210(%r14), %rdi
callq 0x39194
leaq 0x8d2c0(%rip), %rsi     # 0xa3e37
movl $0x10, %edi
movl $0xa, %edx
callq 0x390f5
movq %rax, %r12
movq %rax, 0x1407210(%r14)
movl 0x1407120(%r14), %edi
movl %edi, %esi
callq 0x3c6e5
movq %rax, (%r12)
movq %rdx, 0x8(%r12)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x8ead7(%rip), %rbp     # 0xa568d
movq %r13, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %r15, %rdx
callq 0x4120
testq %rax, %rax
je 0x16c30
movq %r13, %rdi
callq 0x4190
cmpq $0x2, %rax
jb 0x16bb6
movb $0x0, -0x1(%rax,%r13)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4280
xorl %ebx, %ebx
testq %rax, %rax
je 0x16c1c
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 0x16bec
movl 0x1407120(%r14), %edx
cmpl %edx, %ebx
jne 0x16cbb
incq %r12
jmp 0x16bb6
movl 0x1407120(%r14), %esi
cmpl %r12d, %esi
jne 0x16c63
movq %r15, %rdi
callq 0x42a0
movl $0x1, %ebp
jmp 0x16ca7
leaq 0x8d1c6(%rip), %rdi     # 0xa3e18
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4030
movq %rbx, %rdi
jmp 0x16ca2
leaq 0x8d216(%rip), %rdi     # 0xa3e80
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4030
movq 0x1407210(%r14), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x3dbad
movq 0x1407210(%r14), %rdi
callq 0x39194
movq $0x0, 0x1407210(%r14)
movq 0x8(%rsp), %rdi
callq 0x39194
movl %ebp, %eax
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %r12d
leaq 0x8d189(%rip), %rdi     # 0xa3e4e
xorl %ebp, %ebp
movl %r12d, %esi
xorl %eax, %eax
callq 0x4030
jmp 0x16c73