// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/plot.c
// Function: plotgauss
void plotgauss(char* names)
{
 /*!Last Changed 20.09.2006*/
 /*!Last Changed 07.10.2004 added img.xaxis.lim and img.yaxis.lim*/
 /*!Last Changed 02.02.2004 added safemalloc*/
 double obs, sum, divisionx, startx;
 double means;
 double variances;
 double* observations = NULL;
 Point p1, p2;
 char st2[3], *legendname;
 FILE* myfile;
 int datacount, j, color;
 Objectptr obj;
 if (!get_parameter_o("hold"))
   clear_image();
 legendname = file_only_name(names);
 color = img.imagelegend.legendcount;
 add_legend((char)('A' + color), legendname);
 safe_free(legendname);
 datacount = 0;
 sum = 0;
 myfile = fopen(names, "r");
 if (!myfile)
   return;
 while (fscanf(myfile,"%lf\n",&obs)!=EOF)
  {
   datacount++;
   observations = alloc(observations,datacount*sizeof(double),datacount);
   observations[datacount-1]=obs;
   sum += obs;
  }
 if (datacount != 0)
   means = sum / datacount;
 else
   means = 0;
 sum = 0;
 for (j = 0;j < datacount;j++)
   sum += (observations[j] - means) * (observations[j] - means);
 if (datacount > 1)
   variances = sqrt(sum / (datacount - 1));
 else
   variances = 0;
 safe_free(observations);
 fclose(myfile);
 img.yaxis.available = 0;
 img.height = (img.imagelegend.legendcount + 1) * 20 + MARGIN + 20;
 if (img.yaxis.lim.min > img.yaxis.lim.max)
  {
   img.yaxis.lim.min = 0;
   img.yaxis.lim.max = 1;
  }
 divisionx = variances * 6 / PARTITIONS;
 startx = means - 3 * variances;
 p1.x = startx;
 p1.y = gaussian(p1.x, means, variances);
 sprintf(st2, "%c", 'A' + color);
 for (j = 1; j < PARTITIONS; j++)
  {
   p2.x = startx + divisionx * j;
   p2.y = gaussian(p1.x, means, variances);
   obj = add_object(OBJECT_LINE, p1, p2, dummyp, st2);
   obj->fnt.fontcolor = color;
   p1.x = p2.x;
   p1.y = p2.y;
  }
 export_image();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x40(%rbp)
leaq 0x6976a(%rip), %rdi     # 0xe7308
callq 0x79440
cmpl $0x0, %eax
jne 0x7dbaf
movb $0x0, %al
callq 0x41a40
movq -0x8(%rbp), %rdi
callq 0x510a0
movq %rax, -0x70(%rbp)
leaq 0x3644c5(%rip), %rax    # 0x3e2088
movl 0xec(%rax), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
addl $0x41, %eax
movq -0x70(%rbp), %rsi
movsbl %al, %edi
callq 0x3efa0
movq -0x70(%rbp), %rdi
callq 0x52e80
movl $0x0, -0x7c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x6a59f(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x7dc1c
jmp 0x7dee8
jmp 0x7dc1e
movq -0x78(%rbp), %rdi
leaq 0x69b7d(%rip), %rsi     # 0xe77a6
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x4070
cmpl $-0x1, %eax
je 0x7dc82
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0x40(%rbp), %rdi
movslq -0x7c(%rbp), %rsi
shlq $0x3, %rsi
movl -0x7c(%rbp), %edx
callq 0x52d10
movq %rax, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x40(%rbp), %rax
movl -0x7c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x10(%rbp), %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x7dc1e
cmpl $0x0, -0x7c(%rbp)
je 0x7dc9d
movsd -0x18(%rbp), %xmm0
cvtsi2sdl -0x7c(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x7dca5
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jge 0x7dcfd
movq -0x40(%rbp), %rax
movslq -0x80(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd -0x30(%rbp), %xmm0
movq -0x40(%rbp), %rax
movslq -0x80(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
subsd -0x30(%rbp), %xmm2
movsd -0x18(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x7dcb4
cmpl $0x1, -0x7c(%rbp)
jle 0x7dd22
movsd -0x18(%rbp), %xmm0
movl -0x7c(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x42a0
movsd %xmm0, -0x38(%rbp)
jmp 0x7dd2a
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x40(%rbp), %rdi
callq 0x52e80
movq -0x78(%rbp), %rdi
callq 0x4250
leaq 0x364345(%rip), %rax    # 0x3e2088
movl $0x0, 0x78(%rax)
leaq 0x364337(%rip), %rax    # 0x3e2088
movl 0xec(%rax), %eax
addl $0x1, %eax
imull $0x14, %eax, %ecx
addl $0x50, %ecx
addl $0x14, %ecx
leaq 0x36431e(%rip), %rax    # 0x3e2088
movl %ecx, (%rax)
leaq 0x364315(%rip), %rax    # 0x3e2088
movsd 0x80(%rax), %xmm0
leaq 0x364306(%rip), %rax    # 0x3e2088
ucomisd 0x88(%rax), %xmm0
jbe 0x7ddb5
leaq 0x3642f5(%rip), %rax    # 0x3e2088
xorps %xmm0, %xmm0
movsd %xmm0, 0x80(%rax)
leaq 0x3642e3(%rip), %rax    # 0x3e2088
movsd 0x6426b(%rip), %xmm0    # 0xe2018
movsd %xmm0, 0x88(%rax)
movsd 0x66aab(%rip), %xmm0    # 0xe4868
mulsd -0x38(%rbp), %xmm0
movsd 0x66bb6(%rip), %xmm1    # 0xe4980
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
movsd 0x698d3(%rip), %xmm2    # 0xe76b8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
callq 0xc2650
movsd %xmm0, -0x48(%rbp)
leaq -0x63(%rbp), %rdi
movl -0x84(%rbp), %edx
addl $0x41, %edx
leaq 0x68aef(%rip), %rsi     # 0xe6918
movb $0x0, %al
callq 0x4170
movl $0x1, -0x80(%rbp)
cmpl $0x1f4, -0x80(%rbp)     # imm = 0x1F4
jge 0x7dee1
movsd -0x28(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
cvtsi2sdl -0x80(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x50(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
callq 0xc2650
movsd %xmm0, -0x58(%rbp)
leaq -0x63(%rbp), %rsi
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
movsd -0x58(%rbp), %xmm3
movsd 0x871a7(%rip), %xmm4    # 0x105040
movsd 0x871a7(%rip), %xmm5    # 0x105048
xorl %edi, %edi
callq 0x3f100
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %ecx
movq -0x90(%rbp), %rax
movl %ecx, 0x18(%rax)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x7de37
movb $0x0, %al
callq 0x42280
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)