// File: /workspace/github_c_makefile_star2_O2/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, %r14
andl $0x0, (%rsi)
leaq 0x49e3a(%rip), %rsi     # 0x9b87f
callq 0x40f0
testq %rax, %rax
je 0x51bc5
movq %rax, %r15
leaq 0x491f3(%rip), %rdx     # 0x9ac50
pushq $0x2
popq %rdi
pushq $0x8
popq %rsi
pushq $0x7
popq %rcx
callq 0x35067
movq %rax, %rbx
movsd 0x4435a(%rip), %xmm1    # 0x95dd0
movsd 0x448b2(%rip), %xmm0    # 0x96330
leaq 0x491e3(%rip), %r12     # 0x9ac68
leaq 0x28(%rsp), %r13
leaq 0x30(%rsp), %rbp
movsd %xmm0, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x4070
cmpl $-0x1, %eax
je 0x51b58
movslq (%r14), %rax
leaq 0x1(%rax), %rdx
movl %edx, (%r14)
movq (%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x34f30
movq %rax, (%rbx)
movq 0x8(%rbx), %rdi
movslq (%r14), %rdx
movq %rdx, %rsi
shlq $0x3, %rsi
callq 0x34f30
movq %rax, 0x8(%rbx)
movsd 0x28(%rsp), %xmm0
movq (%rbx), %rcx
movslq (%r14), %rdx
movsd %xmm0, -0x8(%rcx,%rdx,8)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, -0x8(%rax,%rdx,8)
movsd 0x28(%rsp), %xmm1
movapd %xmm1, %xmm2
maxsd 0x8(%rsp), %xmm2
minsd 0x18(%rsp), %xmm1
movapd %xmm0, %xmm3
maxsd 0x10(%rsp), %xmm3
minsd 0x20(%rsp), %xmm0
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movsd %xmm2, 0x8(%rsp)
movsd %xmm3, 0x10(%rsp)
jmp 0x51aa7
movq %r15, %rdi
callq 0x42a0
leaq 0x358551(%rip), %rax    # 0x3aa0b8
movsd 0x8(%rsp), %xmm0
ucomisd 0x18(%rax), %xmm0
jbe 0x51b79
movsd %xmm0, 0x18(%rax)
movsd 0x10(%rax), %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm0
jbe 0x51b95
movsd %xmm1, 0x10(%rax)
ucomisd 0x88(%rax), %xmm0
jbe 0x51ba7
movsd %xmm0, 0x88(%rax)
movsd 0x80(%rax), %xmm0
movsd 0x20(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x51bc7
movsd %xmm1, 0x80(%rax)
jmp 0x51bc7
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq