// File: /workspace/github_c_makefile_star2_O3/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 0x51fe7(%rip), %rsi     # 0xab95b
callq 0x40f0
testq %rax, %rax
je 0x59ad5
movq %rax, %r14
leaq 0x51394(%rip), %rdx     # 0xaad20
movl $0x2, %edi
movl $0x8, %esi
movl $0x7, %ecx
callq 0x3a1fc
movq %rax, %rbx
leaq 0x5138e(%rip), %rsi     # 0xaad38
leaq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x4070
cmpl $-0x1, %eax
je 0x59adc
movsd 0x4c961(%rip), %xmm1    # 0xa6330
movsd 0x4c3f1(%rip), %xmm2    # 0xa5dc8
leaq 0x5135a(%rip), %r12     # 0xaad38
leaq 0x28(%rsp), %r13
leaq 0x30(%rsp), %rbp
movaps %xmm2, %xmm3
movaps %xmm1, %xmm4
movsd %xmm3, 0x8(%rsp)
movsd %xmm4, 0x18(%rsp)
movsd %xmm2, 0x10(%rsp)
movsd %xmm1, 0x20(%rsp)
movslq (%r15), %rax
leaq 0x1(%rax), %rdx
movl %edx, (%r15)
movq (%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x3a0b4
movq %rax, (%rbx)
movq 0x8(%rbx), %rdi
movslq (%r15), %rdx
movq %rdx, %rsi
shlq $0x3, %rsi
callq 0x3a0b4
movq %rax, 0x8(%rbx)
movsd 0x28(%rsp), %xmm0
movq (%rbx), %rcx
movslq (%r15), %rdx
movsd %xmm0, -0x8(%rcx,%rdx,8)
movsd 0x30(%rsp), %xmm1
movsd %xmm1, -0x8(%rax,%rdx,8)
movsd 0x28(%rsp), %xmm2
movapd %xmm2, %xmm0
maxsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
minsd 0x18(%rsp), %xmm2
movsd %xmm2, 0x18(%rsp)
movapd %xmm1, %xmm0
maxsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
minsd 0x20(%rsp), %xmm1
movsd %xmm1, 0x20(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x4070
movsd 0x10(%rsp), %xmm6
movsd 0x18(%rsp), %xmm5
movsd 0x20(%rsp), %xmm0
movaps %xmm6, %xmm2
movsd 0x8(%rsp), %xmm3
movaps %xmm0, %xmm1
movaps %xmm5, %xmm4
cmpl $-0x1, %eax
jne 0x599ee
jmp 0x59af8
xorl %ebx, %ebx
jmp 0x59b75
movsd 0x4c2e4(%rip), %xmm1    # 0xa5dc8
movsd 0x4c844(%rip), %xmm5    # 0xa6330
movaps %xmm5, %xmm0
movsd %xmm1, 0x8(%rsp)
movaps %xmm1, %xmm6
movsd %xmm6, 0x10(%rsp)
movsd %xmm5, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %r14, %rdi
callq 0x42a0
leaq 0x35859f(%rip), %rax    # 0x3b20b8
movsd 0x8(%rsp), %xmm0
ucomisd 0x18(%rax), %xmm0
jbe 0x59b2b
movsd %xmm0, 0x18(%rax)
movsd 0x10(%rax), %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x59b41
movsd %xmm1, 0x10(%rax)
movsd 0x10(%rsp), %xmm0
ucomisd 0x88(%rax), %xmm0
jbe 0x59b59
movsd %xmm0, 0x88(%rax)
movsd 0x80(%rax), %xmm0
movsd 0x20(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x59b75
movsd %xmm1, 0x80(%rax)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq