// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/plot.c
// Function: plotsigmoid
void plotsigmoid(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];
 char st[2], st2[3], *legendname;
 double *observations[2], a, b;
 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), "plotsigmoid", 13);
 observations[1] = (double *)safemalloc(datacount * sizeof(double), "plotsigmoid", 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_sigmoid(observations, datacount, &a, &b);
 sprintf(varvalue,"%5.2f",a);
 set_variable("aout1[1]", varvalue);
 sprintf(varvalue,"%5.2f",b);
 set_variable("aout2[1]", varvalue);
 safe_free(observations[0]);
 safe_free(observations[1]);
 p1.x = img.xaxis.lim.min;
 p1.y = sigmoid(p1.x * a + b);
 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 = sigmoid(p1.x * a + b);
   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 $0x7a1a0, %rsp          # imm = 0x7A1A0
movq %rdi, -0x8(%rbp)
leaq 0x6c252(%rip), %rdi     # 0xe7308
callq 0x79440
cmpl $0x0, %eax
jne 0x7b0c7
movb $0x0, %al
callq 0x41a40
movq -0x8(%rbp), %rdi
callq 0x510a0
movq %rax, -0x7a140(%rbp)
leaq 0x366faa(%rip), %rax    # 0x3e2088
movl 0xec(%rax), %eax
movl %eax, -0x7a16c(%rbp)
movslq -0x7a16c(%rbp), %rcx
leaq 0x89f38(%rip), %rax     # 0x105030
movb (%rax,%rcx), %al
movb %al, -0x7a132(%rbp)
movb $0x0, -0x7a131(%rbp)
movl -0x7a16c(%rbp), %eax
addl $0x41, %eax
movq -0x7a140(%rbp), %rsi
movsbl %al, %edi
callq 0x3efa0
movq -0x7a140(%rbp), %rdi
callq 0x52e80
movq -0x8(%rbp), %rdi
callq 0x50f90
movl %eax, -0x7a164(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x6d060(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0x7a198(%rbp)
cmpq $0x0, -0x7a198(%rbp)
jne 0x7b161
jmp 0x7b4ed
movslq -0x7a164(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x6c56d(%rip), %rsi     # 0xe76e0
movl $0xd, %edx
callq 0x52d70
movq %rax, -0x7a150(%rbp)
movslq -0x7a164(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x6c54a(%rip), %rsi     # 0xe76e0
movl $0xe, %edx
callq 0x52d70
movq %rax, -0x7a148(%rbp)
movl $0x0, -0x7a168(%rbp)
movl -0x7a168(%rbp), %eax
cmpl -0x7a164(%rbp), %eax
jge 0x7b20f
movq -0x7a198(%rbp), %rdi
movq -0x7a150(%rbp), %rdx
movslq -0x7a168(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x7a148(%rbp), %rcx
movslq -0x7a168(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
leaq 0x6a2a3(%rip), %rsi     # 0xe549a
movb $0x0, %al
callq 0x4070
movl -0x7a168(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a168(%rbp)
jmp 0x7b1b1
movq -0x7a198(%rbp), %rdi
callq 0x4250
movl $0x0, -0x7a168(%rbp)
movl -0x7a168(%rbp), %eax
cmpl -0x7a164(%rbp), %eax
jge 0x7b2d7
movq -0x7a150(%rbp), %rax
movslq -0x7a168(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a180(%rbp)
movsd -0x7a180(%rbp), %xmm0
movsd -0x7a178(%rbp), %xmm1
callq 0x41560
movq -0x7a148(%rbp), %rax
movslq -0x7a168(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a178(%rbp)
leaq -0x7a132(%rbp), %rsi
movsd -0x7a180(%rbp), %xmm0
movsd -0x7a178(%rbp), %xmm1
movsd 0x89d9f(%rip), %xmm2    # 0x105040
movsd 0x89d9f(%rip), %xmm3    # 0x105048
movsd 0x89d8f(%rip), %xmm4    # 0x105040
movsd 0x89d8f(%rip), %xmm5    # 0x105048
movl $0x1, %edi
callq 0x3f100
movl -0x7a168(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a168(%rbp)
jmp 0x7b225
leaq -0x7a150(%rbp), %rdi
movl -0x7a164(%rbp), %esi
leaq -0x7a158(%rbp), %rdx
leaq -0x7a160(%rbp), %rcx
callq 0x7ad00
leaq -0x7a130(%rbp), %rdi
movsd -0x7a158(%rbp), %xmm0
leaq 0x6c3df(%rip), %rsi     # 0xe76ec
movb $0x1, %al
callq 0x4170
leaq -0x7a130(%rbp), %rsi
leaq 0x6c3d0(%rip), %rdi     # 0xe76f2
callq 0x493b0
leaq -0x7a130(%rbp), %rdi
movsd -0x7a160(%rbp), %xmm0
leaq 0x6c3af(%rip), %rsi     # 0xe76ec
movb $0x1, %al
callq 0x4170
leaq -0x7a130(%rbp), %rsi
leaq 0x6c3a9(%rip), %rdi     # 0xe76fb
callq 0x493b0
movq -0x7a150(%rbp), %rdi
callq 0x52e80
movq -0x7a148(%rbp), %rdi
callq 0x52e80
leaq 0x366d12(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x7a180(%rbp)
movsd -0x7a180(%rbp), %xmm0
movsd -0x7a158(%rbp), %xmm2
movsd -0x7a160(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x7aab0
movsd %xmm0, -0x7a178(%rbp)
leaq -0x7a135(%rbp), %rdi
movl -0x7a16c(%rbp), %edx
addl $0x41, %edx
leaq 0x6b551(%rip), %rsi     # 0xe6918
movb $0x0, %al
callq 0x4170
movl $0x1, -0x7a168(%rbp)
cmpl $0x1f4, -0x7a168(%rbp)  # imm = 0x1F4
jge 0x7b4e6
leaq 0x366c99(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm1
cvtsi2sdl -0x7a168(%rbp), %xmm0
leaq 0x366c85(%rip), %rax    # 0x3e2088
movsd 0x18(%rax), %xmm2
leaq 0x366c79(%rip), %rax    # 0x3e2088
subsd 0x10(%rax), %xmm2
movsd 0x69564(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a190(%rbp)
movsd -0x7a180(%rbp), %xmm0
movsd -0x7a158(%rbp), %xmm2
movsd -0x7a160(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x7aab0
movsd %xmm0, -0x7a188(%rbp)
leaq -0x7a135(%rbp), %rsi
movsd -0x7a180(%rbp), %xmm0
movsd -0x7a178(%rbp), %xmm1
movsd -0x7a190(%rbp), %xmm2
movsd -0x7a188(%rbp), %xmm3
movsd 0x89bb4(%rip), %xmm4    # 0x105040
movsd 0x89bb4(%rip), %xmm5    # 0x105048
xorl %edi, %edi
callq 0x3f100
movq %rax, -0x7a1a0(%rbp)
movl -0x7a16c(%rbp), %ecx
movq -0x7a1a0(%rbp), %rax
movl %ecx, 0x18(%rax)
movsd -0x7a190(%rbp), %xmm0
movsd %xmm0, -0x7a180(%rbp)
movsd -0x7a188(%rbp), %xmm0
movsd %xmm0, -0x7a178(%rbp)
movl -0x7a168(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a168(%rbp)
jmp 0x7b3d8
movb $0x0, %al
callq 0x42280
addq $0x7a1a0, %rsp          # imm = 0x7A1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)