// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/plot.c
// Function: plot_regression_model
void plot_regression_model(void* model, void* parameters, int algorithm, Instance mean, Instance variance, double outputmean, double outputvariance)
{
 int i, color;
 char st[2];
 double meanx, stdevx;
 Instanceptr currentinstance;
 Point p, p3, p4;
 Prediction predicted;
 if (!get_parameter_o("hold"))
   clear_image();
 color = img.imagelegend.legendcount;
 add_legend((char)('A' + color), regression_algorithms[algorithm - ONEFEATURE].name);
 p4.x = GRAY;
 p3.x = color;
 st[0] = '.';
 st[1] = '\0';
 if (regression_algorithms[algorithm - ONEFEATURE].mustnormalize)
  {
   meanx = mean.values[0].floatvalue;
   stdevx = sqrt(variance.values[0].floatvalue);
  }
 currentinstance = empty_instance(2);
 for (i = 0; i < MESHDEPTH * PARTITIONS; i++)
  {
   p.x = img.xaxis.lim.min + i * ((img.xaxis.lim.max - img.xaxis.lim.min) / (MESHDEPTH * PARTITIONS));
   if (regression_algorithms[algorithm - ONEFEATURE].mustnormalize)
     currentinstance->values[0].floatvalue = (p.x - meanx) / stdevx;
   else
     currentinstance->values[0].floatvalue = p.x;
   predicted = regression_algorithms[algorithm - ONEFEATURE].test_algorithm(currentinstance, model, parameters, NULL);
   if (get_parameter_o("normalizeoutput"))
     p.y = predicted.regvalue * sqrt(outputvariance) + outputmean;
   else
     p.y = predicted.regvalue;
   add_object(OBJECT_POINT, p, dummyp, p3, st);
   if (in_list(algorithm, 2, SVMREG, SIMPLEXSVMREG))
    {
     if (get_parameter_o("normalizeoutput"))
       p.y = (predicted.regvalue - get_parameter_f("svmepsilon")) * sqrt(outputvariance) + outputmean;
     else
       p.y = predicted.regvalue - get_parameter_f("svmepsilon");
     add_object(OBJECT_POINT, p, dummyp, p4, st);      
     if (get_parameter_o("normalizeoutput"))
       p.y = (predicted.regvalue + get_parameter_f("svmepsilon")) * sqrt(outputvariance) + outputmean;
     else
       p.y = predicted.regvalue + get_parameter_f("svmepsilon");
     add_object(OBJECT_POINT, p, dummyp, p4, st);      
    }
  }
 export_image();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movsd %xmm1, (%rsp)
movsd %xmm0, 0x30(%rsp)
movl %edx, %ebx
movq %rsi, 0x60(%rsp)
movq %rdi, 0x58(%rsp)
leaq 0x4b3f7(%rip), %rdi     # 0x9a6e5
callq 0x4cff1
testl %eax, %eax
jne 0x4f2fe
xorl %eax, %eax
callq 0x2a510
leaq 0x35adb3(%rip), %rax    # 0x3aa0b8
movl 0xec(%rax), %r14d
leal 0x41(%r14), %eax
movq %rbx, 0x20(%rsp)
leal -0x7d0(%rbx), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %r15
leaq 0x7d507(%rip), %rbx     # 0xcc830
movq 0x10(%rbx,%r15), %rsi
movsbl %al, %edi
callq 0x28ee8
movw $0x2e, 0xe(%rsp)
cmpl $0x0, 0x1c(%rbx,%r15)
je 0x4f379
leaq 0x110(%rsp), %rax
leaq 0xe0(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x48(%rsp)
movq (%rax), %rax
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4f37b
sqrtsd %xmm0, %xmm0
jmp 0x4f380
jmp 0x4f386
callq 0x4300
movsd %xmm0, 0x38(%rsp)
addq %r15, %rbx
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x50(%rsp)
pushq $0x2
popq %rdi
callq 0x140fd
movq %rax, %r12
movl $0x1f4, %ebp            # imm = 0x1F4
pushq $0x8
popq %r13
leaq 0xe(%rsp), %r14
sqrtsd (%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
xorpd %xmm1, %xmm1
movq 0x20(%rsp), %r15
subl $0x1, %ebp
jb 0x4f5fd
leaq 0x35ace7(%rip), %rax    # 0x3aa0b8
movsd 0x10(%rax), %xmm0
movsd 0x18(%rax), %xmm2
subsd %xmm0, %xmm2
divsd 0x489b1(%rip), %xmm2    # 0x97d98
movsd %xmm1, 0x68(%rsp)
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
cmpl $0x0, 0x1c(%rbx)
movsd %xmm2, 0x18(%rsp)
movapd %xmm2, %xmm0
je 0x4f417
movsd 0x18(%rsp), %xmm0
subsd 0x48(%rsp), %xmm0
divsd 0x38(%rsp), %xmm0
movq (%r12), %rax
movsd %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
movq 0x58(%rsp), %rdx
movq 0x60(%rsp), %rcx
xorl %r8d, %r8d
callq *0x8(%rbx)
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x4b7ad(%rip), %rdi     # 0x9abf7
callq 0x4cff1
movsd 0x10(%rsp), %xmm1
testl %eax, %eax
je 0x4f488
movsd (%rsp), %xmm0
ucomisd 0x468b2(%rip), %xmm0    # 0x95d18
movsd 0x28(%rsp), %xmm1
jae 0x4f47c
movsd (%rsp), %xmm0
callq 0x4300
movapd %xmm0, %xmm1
mulsd 0x10(%rsp), %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x7dbe0(%rip), %xmm2    # 0xcd070
movsd 0x7dbe0(%rip), %xmm3    # 0xcd078
movl %r13d, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x50(%rsp), %xmm4
movq %r14, %rsi
callq 0x28f8d
movl %r15d, %edi
pushq $0x2
popq %rsi
movl $0x7d8, %edx            # imm = 0x7D8
movl $0x7d9, %ecx            # imm = 0x7D9
xorl %eax, %eax
callq 0x35812
testl %eax, %eax
je 0x4f5ea
leaq 0x4b722(%rip), %rdi     # 0x9abf7
callq 0x4cff1
movl %eax, %r15d
leaq 0x46564(%rip), %rdi     # 0x95a48
callq 0x4cdcf
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
testl %r15d, %r15d
je 0x4f52d
movsd (%rsp), %xmm0
ucomisd 0x46813(%rip), %xmm0    # 0x95d18
movsd 0x28(%rsp), %xmm0
jae 0x4f523
movsd (%rsp), %xmm0
movsd %xmm1, 0x40(%rsp)
callq 0x4300
movsd 0x40(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x7db3b(%rip), %xmm2    # 0xcd070
movsd 0x7db3b(%rip), %xmm3    # 0xcd078
movl %r13d, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x48622(%rip), %xmm4    # 0x97b70
movq %r14, %rsi
callq 0x28f8d
leaq 0x4b69a(%rip), %rdi     # 0x9abf7
callq 0x4cff1
movl %eax, %r15d
leaq 0x464dc(%rip), %rdi     # 0x95a48
callq 0x4cdcf
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
testl %r15d, %r15d
je 0x4f5bc
movsd (%rsp), %xmm0
ucomisd 0x4678b(%rip), %xmm0    # 0x95d18
movsd 0x28(%rsp), %xmm0
movq 0x20(%rsp), %r15
jae 0x4f5b0
movsd (%rsp), %xmm0
movsd %xmm1, 0x10(%rsp)
callq 0x4300
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
jmp 0x4f5c1
movq 0x20(%rsp), %r15
movsd 0x7daa7(%rip), %xmm2    # 0xcd070
movsd 0x7daa7(%rip), %xmm3    # 0xcd078
movl %r13d, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x4858e(%rip), %xmm4    # 0x97b70
movq %r14, %rsi
callq 0x28f8d
movsd 0x68(%rsp), %xmm1
addsd 0x45f28(%rip), %xmm1    # 0x95520
jmp 0x4f3c1
xorl %eax, %eax
callq 0x2a858
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq