// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/plot.c
// Function: read_2d_observations
double** read_2d_observations(char* filename, int* counts)
{
 double** observations;
 FILE* myfile;
 double obs1, obs2, minobsx = +LONG_MAX, minobsy = +LONG_MAX, maxobsx = -LONG_MAX, maxobsy = -LONG_MAX;
 *counts = 0;
 myfile = fopen(filename, "r");
 if (!myfile)
   return NULL;
 observations = safecalloc(2, sizeof(double*), "read_2d_observations", 7);
 while (fscanf(myfile, "%lf %lf\n", &obs1, &obs2) != EOF)
  {
   (*counts)++;
   observations[0] = alloc(observations[0], (*counts) * sizeof(double), *counts);
   observations[1] = alloc(observations[1], (*counts) * sizeof(double), *counts);
   observations[0][(*counts) - 1] = obs1;
   observations[1][(*counts) - 1] = obs2;
   if (obs1 > maxobsx)
     maxobsx = obs1;
   if (obs1 < minobsx)
     minobsx = obs1;
   if (obs2 > maxobsy)
     maxobsy = obs2;
   if (obs2 < minobsy)
     minobsy = obs2;
  }
 fclose(myfile);
 if (maxobsx > img.xaxis.lim.max)
   img.xaxis.lim.max = maxobsx;
 if (minobsx < img.xaxis.lim.min)
   img.xaxis.lim.min = minobsx;
 if (maxobsy > img.yaxis.lim.max)
   img.yaxis.lim.max = maxobsy;
 if (minobsy < img.yaxis.lim.min)
   img.yaxis.lim.min = minobsy;
 return observations;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movl $0x0, (%rsi)
leaq 0x504b7(%rip), %rsi     # 0xa888f
callq 0x40f0
testq %rax, %rax
je 0x5853f
movq %rax, %r14
leaq 0x4f880(%rip), %rdx     # 0xa7c70
movl $0x2, %edi
movl $0x8, %esi
movl $0x7, %ecx
callq 0x39210
movq %rax, %rbx
leaq 0x4f87a(%rip), %rsi     # 0xa7c88
leaq 0x30(%rsp), %rdx
leaq 0x28(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x4070
cmpl $-0x1, %eax
je 0x58546
movsd 0x4aefd(%rip), %xmm0    # 0xa3330
movsd 0x4a98d(%rip), %xmm1    # 0xa2dc8
leaq 0x4f846(%rip), %r12     # 0xa7c88
leaq 0x30(%rsp), %r13
leaq 0x28(%rsp), %rbp
movaps %xmm1, %xmm2
movaps %xmm0, %xmm3
movsd %xmm2, 0x8(%rsp)
movsd %xmm3, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x20(%rsp)
movslq (%r15), %rax
leaq 0x1(%rax), %rdx
movl %edx, (%r15)
movq (%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x390c8
movq %rax, (%rbx)
movq 0x8(%rbx), %rdi
movslq (%r15), %rdx
movq %rdx, %rsi
shlq $0x3, %rsi
callq 0x390c8
movq %rax, 0x8(%rbx)
movsd 0x30(%rsp), %xmm0
movq (%rbx), %rcx
movslq (%r15), %rdx
movsd %xmm0, -0x8(%rcx,%rdx,8)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, -0x8(%rax,%rdx,8)
movsd 0x30(%rsp), %xmm1
movapd %xmm1, %xmm0
maxsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
minsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
movapd %xmm0, %xmm1
maxsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x10(%rsp)
minsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x4070
movsd 0x10(%rsp), %xmm6
movsd 0x20(%rsp), %xmm5
movsd 0x18(%rsp), %xmm4
movaps %xmm6, %xmm1
movsd 0x8(%rsp), %xmm2
movaps %xmm5, %xmm0
movaps %xmm4, %xmm3
cmpl $-0x1, %eax
jne 0x58452
jmp 0x58562
xorl %ebx, %ebx
jmp 0x585df
movsd 0x4a87a(%rip), %xmm0    # 0xa2dc8
movsd 0x4adda(%rip), %xmm4    # 0xa3330
movaps %xmm4, %xmm5
movsd %xmm0, 0x8(%rsp)
movaps %xmm0, %xmm6
movsd %xmm6, 0x10(%rsp)
movsd %xmm4, 0x18(%rsp)
movsd %xmm5, 0x20(%rsp)
movq %r14, %rdi
callq 0x42a0
leaq 0x356b35(%rip), %rax    # 0x3af0b8
movsd 0x8(%rsp), %xmm0
ucomisd 0x18(%rax), %xmm0
jbe 0x58595
movsd %xmm0, 0x18(%rax)
movsd 0x10(%rax), %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x585ab
movsd %xmm1, 0x10(%rax)
movsd 0x10(%rsp), %xmm0
ucomisd 0x88(%rax), %xmm0
jbe 0x585c3
movsd %xmm0, 0x88(%rax)
movsd 0x80(%rax), %xmm0
movsd 0x20(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x585df
movsd %xmm1, 0x80(%rax)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq