// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/plot.c
// Function: plotinvgauss
void plotinvgauss(char* names)
{
 /*!Last Changed 20.09.2006*/
 /*!Last Changed 26.12.2004 added aout1, aout2 array values*/
 /*!Last Changed 27.10.2004*/
 char varvalue[MAXLENGTH], pst[READLINELENGTH];
 char st[2], st2[3], *legendname;
 double *observations[2], mean, stdev;
 int datacount, j, color;
 Point p1, p2;
 FILE *infile;
 Objectptr obj;
 if (!get_parameter_o("hold"))
   clear_image();
 legendname = file_only_name(names);
 color = img.imagelegend.legendcount;
 st[0] = plots[color];
 st[1] = '\0';
 add_legend((char)('A' + color), legendname);
 safe_free(legendname);
 datacount = file_length(names);
 infile = fopen(names, "r");
 if (!infile)
   return;
 observations[0] = (double *)safemalloc(datacount * sizeof(double), "plotinvgauss", 13);
 observations[1] = (double *)safemalloc(datacount * sizeof(double), "plotinvgauss", 14);
 for (j = 0; j < datacount; j++)
   fscanf(infile, "%lf %lf", &(observations[0][j]), &(observations[1][j]));
 fclose(infile);
 for (j = 0; j < datacount; j++)
  {
   p1.x = (double) observations[0][j];
   check_x_range(p1);   
   p1.y = (double) observations[1][j];
   add_object(OBJECT_STRING, p1, dummyp, dummyp, st);
  }
 solve_inv_gauss(observations, datacount, img.xaxis.lim.min, img.xaxis.lim.max, 0, img.xaxis.lim.max - img.xaxis.lim.min, &mean, &stdev);
 set_precision(pst, NULL, NULL);
 sprintf(varvalue, pst, mean);
 set_variable("aout1[1]", varvalue);
 set_precision(pst, NULL, NULL);
 sprintf(varvalue, pst, stdev);
 set_variable("aout2[1]", varvalue);
 safe_free(observations[0]);
 safe_free(observations[1]);
 p1.x = img.xaxis.lim.min;
 p1.y = 1 - stdev * sqrt(2 * PI) * gaussian(p1.x, mean, stdev);
 sprintf(st2, "%c", 'A' + color); 
 for (j = 1; j < PARTITIONS; j++)
  {
   p2.x = img.xaxis.lim.min + j * ((img.xaxis.lim.max - img.xaxis.lim.min) / PARTITIONS);
   p2.y = 1 - stdev * sqrt(2 * PI) * gaussian(p1.x, mean, stdev);
   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 $0xf42e0, %rsp          # imm = 0xF42E0
movq %rdi, -0x8(%rbp)
leaq 0x6a992(%rip), %rdi     # 0xe7308
callq 0x79440
cmpl $0x0, %eax
jne 0x7c987
movb $0x0, %al
callq 0x41a40
movq -0x8(%rbp), %rdi
callq 0x510a0
movq %rax, -0xf4260(%rbp)
leaq 0x3656ea(%rip), %rax    # 0x3e2088
movl 0xec(%rax), %eax
movl %eax, -0xf428c(%rbp)
movslq -0xf428c(%rbp), %rcx
leaq 0x88678(%rip), %rax     # 0x105030
movb (%rax,%rcx), %al
movb %al, -0xf4252(%rbp)
movb $0x0, -0xf4251(%rbp)
movl -0xf428c(%rbp), %eax
addl $0x41, %eax
movq -0xf4260(%rbp), %rsi
movsbl %al, %edi
callq 0x3efa0
movq -0xf4260(%rbp), %rdi
callq 0x52e80
movq -0x8(%rbp), %rdi
callq 0x50f90
movl %eax, -0xf4284(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x6b7a0(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0xf42b8(%rbp)
cmpq $0x0, -0xf42b8(%rbp)
jne 0x7ca21
jmp 0x7cec2
movslq -0xf4284(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x6ad04(%rip), %rsi     # 0xe7737
movl $0xd, %edx
callq 0x52d70
movq %rax, -0xf4270(%rbp)
movslq -0xf4284(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x6ace1(%rip), %rsi     # 0xe7737
movl $0xe, %edx
callq 0x52d70
movq %rax, -0xf4268(%rbp)
movl $0x0, -0xf4288(%rbp)
movl -0xf4288(%rbp), %eax
cmpl -0xf4284(%rbp), %eax
jge 0x7cacf
movq -0xf42b8(%rbp), %rdi
movq -0xf4270(%rbp), %rdx
movslq -0xf4288(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0xf4268(%rbp), %rcx
movslq -0xf4288(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
leaq 0x689e3(%rip), %rsi     # 0xe549a
movb $0x0, %al
callq 0x4070
movl -0xf4288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4288(%rbp)
jmp 0x7ca71
movq -0xf42b8(%rbp), %rdi
callq 0x4250
movl $0x0, -0xf4288(%rbp)
movl -0xf4288(%rbp), %eax
cmpl -0xf4284(%rbp), %eax
jge 0x7cb97
movq -0xf4270(%rbp), %rax
movslq -0xf4288(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xf42a0(%rbp)
movsd -0xf42a0(%rbp), %xmm0
movsd -0xf4298(%rbp), %xmm1
callq 0x41560
movq -0xf4268(%rbp), %rax
movslq -0xf4288(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xf4298(%rbp)
leaq -0xf4252(%rbp), %rsi
movsd -0xf42a0(%rbp), %xmm0
movsd -0xf4298(%rbp), %xmm1
movsd 0x884df(%rip), %xmm2    # 0x105040
movsd 0x884df(%rip), %xmm3    # 0x105048
movsd 0x884cf(%rip), %xmm4    # 0x105040
movsd 0x884cf(%rip), %xmm5    # 0x105048
movl $0x1, %edi
callq 0x3f100
movl -0xf4288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4288(%rbp)
jmp 0x7cae5
leaq -0xf4270(%rbp), %rdi
movl -0xf4284(%rbp), %esi
leaq 0x3654dd(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm0
leaq 0x3654d1(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm1
leaq 0x3654c5(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm3
leaq 0x3654b9(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm3
xorps %xmm2, %xmm2
leaq -0xf4278(%rbp), %rdx
leaq -0xf4280(%rbp), %rcx
callq 0x7ae90
leaq -0xf4250(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x53310
leaq -0x7a130(%rbp), %rdi
leaq -0xf4250(%rbp), %rsi
movsd -0xf4278(%rbp), %xmm0
movb $0x1, %al
callq 0x4170
leaq -0x7a130(%rbp), %rsi
leaq 0x6aaca(%rip), %rdi     # 0xe76f2
callq 0x493b0
leaq -0xf4250(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x53310
leaq -0x7a130(%rbp), %rdi
leaq -0xf4250(%rbp), %rsi
movsd -0xf4280(%rbp), %xmm0
movb $0x1, %al
callq 0x4170
leaq -0x7a130(%rbp), %rsi
leaq 0x6aa90(%rip), %rdi     # 0xe76fb
callq 0x493b0
movq -0xf4270(%rbp), %rdi
callq 0x52e80
movq -0xf4268(%rbp), %rdi
callq 0x52e80
leaq 0x3653f9(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xf42a0(%rbp)
movsd -0xf4280(%rbp), %xmm0
movsd %xmm0, -0xf42d0(%rbp)
movsd 0x6a9fc(%rip), %xmm0    # 0xe76b0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0xf42d0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0xf42c8(%rbp)
movsd -0xf42a0(%rbp), %xmm0
movsd -0xf4278(%rbp), %xmm1
movsd -0xf4280(%rbp), %xmm2
callq 0xc2650
movaps %xmm0, %xmm1
movsd -0xf42c8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm1, %xmm0
movsd 0x652fd(%rip), %xmm1    # 0xe2018
addsd %xmm1, %xmm0
movsd %xmm0, -0xf4298(%rbp)
leaq -0xf4255(%rbp), %rdi
movl -0xf428c(%rbp), %edx
addl $0x41, %edx
leaq 0x69bda(%rip), %rsi     # 0xe6918
movb $0x0, %al
callq 0x4170
movl $0x1, -0xf4288(%rbp)
cmpl $0x1f4, -0xf4288(%rbp)  # imm = 0x1F4
jge 0x7cebb
leaq 0x365322(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm1
cvtsi2sdl -0xf4288(%rbp), %xmm0
leaq 0x36530e(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm2
leaq 0x365302(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm2
movsd 0x67bed(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xf42b0(%rbp)
movsd -0xf4280(%rbp), %xmm0
movsd %xmm0, -0xf42e0(%rbp)
movsd 0x6a8f1(%rip), %xmm0    # 0xe76b0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0xf42e0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0xf42d8(%rbp)
movsd -0xf42a0(%rbp), %xmm0
movsd -0xf4278(%rbp), %xmm1
movsd -0xf4280(%rbp), %xmm2
callq 0xc2650
movaps %xmm0, %xmm1
movsd -0xf42d8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm1, %xmm0
movsd 0x651f2(%rip), %xmm1    # 0xe2018
addsd %xmm1, %xmm0
movsd %xmm0, -0xf42a8(%rbp)
leaq -0xf4255(%rbp), %rsi
movsd -0xf42a0(%rbp), %xmm0
movsd -0xf4298(%rbp), %xmm1
movsd -0xf42b0(%rbp), %xmm2
movsd -0xf42a8(%rbp), %xmm3
movsd 0x881df(%rip), %xmm4    # 0x105040
movsd 0x881df(%rip), %xmm5    # 0x105048
xorl %edi, %edi
callq 0x3f100
movq %rax, -0xf42c0(%rbp)
movl -0xf428c(%rbp), %ecx
movq -0xf42c0(%rbp), %rax
movl %ecx, 0x18(%rax)
movsd -0xf42b0(%rbp), %xmm0
movsd %xmm0, -0xf42a0(%rbp)
movsd -0xf42a8(%rbp), %xmm0
movsd %xmm0, -0xf4298(%rbp)
movl -0xf4288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4288(%rbp)
jmp 0x7cd4f
movb $0x0, %al
callq 0x42280
addq $0xf42e0, %rsp          # imm = 0xF42E0
popq %rbp
retq
nopl (%rax,%rax)