// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/plot.c
// Function: plot_covariance
void plot_covariance(matrix avg, matrix covariance, int contour, int color, double maxdist)
{
 int i, j, oldbin, newbin;
 double avgdist, predicted, predictedx, predictedy;
 Point p, dummyp;
 char st[2];
 matrix x;
 st[0] = '.';
 st[1] = '\0';
 dummyp.x = color;
 if (maxdist == 0.0)
   maxdist = 0.5 * pow(matrix_determinant(covariance), 0.25);
 else
   maxdist /= 2.0;
 avgdist = maxdist / contour;
 x = matrix_alloc(1, 2);
 for (i = 1; i < MESHDEPTH * PARTITIONS; i++)
  {
   p.x = img.xaxis.lim.min + i * ((img.xaxis.lim.max - img.xaxis.lim.min) / (MESHDEPTH * PARTITIONS));
   x.values[0][0] = p.x;
   for (j = 1; j < MESHDEPTH * PARTITIONS; j++)
    {
     p.y = img.yaxis.lim.min + j * ((img.yaxis.lim.max - img.yaxis.lim.min) / (MESHDEPTH * PARTITIONS));
     x.values[0][1] = p.y;
     predicted = sqrt(mahalanobis_distance(x, avg, covariance));
     oldbin = ((int)(predictedy / avgdist));
     newbin = ((int)(predicted / avgdist));
     if ((oldbin != newbin) && (newbin < contour) && (j != 1))
       add_object(OBJECT_POINT, p, dummyp, dummyp, st);
     predictedy = predicted;
    }
  }
 for (i = 1; i < MESHDEPTH * PARTITIONS; i++)
  {
   p.x = img.xaxis.lim.max - i * ((img.xaxis.lim.max - img.xaxis.lim.min) / (MESHDEPTH * PARTITIONS));
   x.values[0][0] = p.x;
   for (j = 1; j < MESHDEPTH * PARTITIONS; j++)
    {
     p.y = img.yaxis.lim.max - j * ((img.yaxis.lim.max - img.yaxis.lim.min) / (MESHDEPTH * PARTITIONS));
     x.values[0][1] = p.y;
     predicted = sqrt(mahalanobis_distance(x, avg, covariance));
     oldbin = ((int)(predictedy / avgdist));
     newbin = ((int)(predicted / avgdist));
     if ((oldbin != newbin) && (newbin < contour) && (j != 1))
       add_object(OBJECT_POINT, p, dummyp, dummyp, st);
     predictedy = predicted;
    }
  }
 for (i = 1; i < MESHDEPTH * PARTITIONS; i++)
  {
   p.y = img.yaxis.lim.min + i * ((img.yaxis.lim.max - img.yaxis.lim.min) / (MESHDEPTH * PARTITIONS));
   x.values[0][1] = p.y;
   for (j = 1; j < MESHDEPTH * PARTITIONS; j++)
    {
     p.x = img.xaxis.lim.min + j * ((img.xaxis.lim.max - img.xaxis.lim.min) / (MESHDEPTH * PARTITIONS));
     x.values[0][0] = p.x;
     predicted = sqrt(mahalanobis_distance(x, avg, covariance));
     oldbin = ((int)(predictedx / avgdist));
     newbin = ((int)(predicted / avgdist));
     if ((oldbin != newbin) && (newbin < contour) && (j != 1))
       add_object(OBJECT_POINT, p, dummyp, dummyp, st);
     predictedx = predicted;
    }
  }
 for (i = 1; i < MESHDEPTH * PARTITIONS; i++)
  {
   p.y = img.yaxis.lim.max - i * ((img.yaxis.lim.max - img.yaxis.lim.min) / (MESHDEPTH * PARTITIONS));
   x.values[0][1] = p.y;
   for (j = 1; j < MESHDEPTH * PARTITIONS; j++)
    {
     p.x = img.xaxis.lim.max - j * ((img.xaxis.lim.max - img.xaxis.lim.min) / (MESHDEPTH * PARTITIONS));
     x.values[0][0] = p.x;
     predicted = sqrt(mahalanobis_distance(x, avg, covariance));
     oldbin = ((int)(predictedx / avgdist));
     newbin = ((int)(predicted / avgdist));
     if ((oldbin != newbin) && (newbin < contour) && (j != 1))
       add_object(OBJECT_POINT, p, dummyp, dummyp, st);
     predictedx = predicted;
    }
  }
 matrix_free(x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movsd %xmm0, -0x30(%rbp)
movb $0x2e, -0x82(%rbp)
movb $0x0, -0x81(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7cf50
jp 0x7cf50
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5c130
movsd 0x65a7b(%rip), %xmm1    # 0xe29b0
callq 0x4290
movaps %xmm0, %xmm1
movsd 0x65a73(%rip), %xmm0    # 0xe29b8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x7cf66
movsd -0x30(%rbp), %xmm0
movsd 0x65d43(%rip), %xmm1    # 0xe2ca0
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x1, %edi
movl $0x2, %esi
callq 0x57fc0
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x1, -0x34(%rbp)
cmpl $0x1f4, -0x34(%rbp)     # imm = 0x1F4
jge 0x7d14a
leaq 0x3650bb(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm0
leaq 0x3650aa(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm2
leaq 0x36509e(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm2
movsd 0x67989(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x38(%rbp)
cmpl $0x1f4, -0x38(%rbp)     # imm = 0x1F4
jge 0x7d13a
leaq 0x365052(%rip), %rax    # 0x3e2088
movsd 0x80(%rax), %xmm1
cvtsi2sdl -0x38(%rbp), %xmm0
leaq 0x36503e(%rip), %rax    # 0x3e2088
movsd 0x88(%rax), %xmm2
leaq 0x36502f(%rip), %rax    # 0x3e2088
subsd 0x80(%rax), %xmm2
movsd 0x67917(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, 0x8(%rax)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
callq 0x5c2f0
callq 0x42a0
movsd %xmm0, -0x50(%rbp)
movsd -0x60(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movsd -0x50(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x7d122
movl -0x40(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7d122
cmpl $0x1, -0x38(%rbp)
je 0x7d122
leaq -0x82(%rbp), %rsi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
movsd -0x78(%rbp), %xmm3
movsd -0x80(%rbp), %xmm4
movsd -0x78(%rbp), %xmm5
movl $0x8, %edi
callq 0x3f100
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7d022
jmp 0x7d13c
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7cfb9
movl $0x1, -0x34(%rbp)
cmpl $0x1f4, -0x34(%rbp)     # imm = 0x1F4
jge 0x7d310
leaq 0x364f23(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm0
leaq 0x364f12(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm2
leaq 0x364f06(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm2
movsd 0x677f1(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x38(%rbp)
cmpl $0x1f4, -0x38(%rbp)     # imm = 0x1F4
jge 0x7d300
leaq 0x364ea3(%rip), %rax    # 0x3e2088
movsd 0x88(%rax), %xmm1
cvtsi2sdl -0x38(%rbp), %xmm0
leaq 0x364e8f(%rip), %rax    # 0x3e2088
movsd 0x88(%rax), %xmm2
leaq 0x364e80(%rip), %rax    # 0x3e2088
subsd 0x80(%rax), %xmm2
movsd 0x67768(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, 0x8(%rax)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
callq 0x5c2f0
callq 0x42a0
movsd %xmm0, -0x50(%rbp)
movsd -0x60(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movsd -0x50(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x7d2e8
movl -0x40(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7d2e8
cmpl $0x1, -0x38(%rbp)
je 0x7d2e8
leaq -0x82(%rbp), %rsi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
movsd -0x78(%rbp), %xmm3
movsd -0x80(%rbp), %xmm4
movsd -0x78(%rbp), %xmm5
movl $0x8, %edi
callq 0x3f100
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7d1d1
jmp 0x7d302
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7d151
movl $0x1, -0x34(%rbp)
cmpl $0x1f4, -0x34(%rbp)     # imm = 0x1F4
jge 0x7d4a8
leaq 0x364d5d(%rip), %rax    # 0x3e2088
movsd 0x80(%rax), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm0
leaq 0x364d49(%rip), %rax    # 0x3e2088
movsd 0x88(%rax), %xmm2
leaq 0x364d3a(%rip), %rax    # 0x3e2088
subsd 0x80(%rax), %xmm2
movsd 0x67622(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, 0x8(%rax)
movl $0x1, -0x38(%rbp)
cmpl $0x1f4, -0x38(%rbp)     # imm = 0x1F4
jge 0x7d498
leaq 0x364cea(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm1
cvtsi2sdl -0x38(%rbp), %xmm0
leaq 0x364cd9(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm2
leaq 0x364ccd(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm2
movsd 0x675b8(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, (%rax)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
callq 0x5c2f0
callq 0x42a0
movsd %xmm0, -0x50(%rbp)
movsd -0x58(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movsd -0x50(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x7d480
movl -0x40(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7d480
cmpl $0x1, -0x38(%rbp)
je 0x7d480
leaq -0x82(%rbp), %rsi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
movsd -0x78(%rbp), %xmm3
movsd -0x80(%rbp), %xmm4
movsd -0x78(%rbp), %xmm5
movl $0x8, %edi
callq 0x3f100
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7d38a
jmp 0x7d49a
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7d317
movl $0x1, -0x34(%rbp)
cmpl $0x1f4, -0x34(%rbp)     # imm = 0x1F4
jge 0x7d66e
leaq 0x364bc5(%rip), %rax    # 0x3e2088
movsd 0x88(%rax), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm0
leaq 0x364bb1(%rip), %rax    # 0x3e2088
movsd 0x88(%rax), %xmm2
leaq 0x364ba2(%rip), %rax    # 0x3e2088
subsd 0x80(%rax), %xmm2
movsd 0x6748a(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, 0x8(%rax)
movl $0x1, -0x38(%rbp)
cmpl $0x1f4, -0x38(%rbp)     # imm = 0x1F4
jge 0x7d65e
leaq 0x364b3b(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm1
cvtsi2sdl -0x38(%rbp), %xmm0
leaq 0x364b2a(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm2
leaq 0x364b1e(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm2
movsd 0x67409(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movq -0x90(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, (%rax)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
callq 0x5c2f0
callq 0x42a0
movsd %xmm0, -0x50(%rbp)
movsd -0x58(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movsd -0x50(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x7d646
movl -0x40(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7d646
cmpl $0x1, -0x38(%rbp)
je 0x7d646
leaq -0x82(%rbp), %rsi
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
movsd -0x78(%rbp), %xmm3
movsd -0x80(%rbp), %xmm4
movsd -0x78(%rbp), %xmm5
movl $0x8, %edi
callq 0x3f100
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7d539
jmp 0x7d660
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7d4af
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x59ea0
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)