// File: /workspace/github_c_makefile_star2_O3/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 0x537e7(%rip), %rdi     # 0xaa7b5
callq 0x54bec
testl %eax, %eax
jne 0x56fde
xorl %eax, %eax
callq 0x2e342
leaq 0x35b0d3(%rip), %rax    # 0x3b20b8
movl 0xec(%rax), %r14d
leal 0x41(%r14), %eax
movq %rbx, 0x20(%rsp)
leal -0x7d0(%rbx), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rbx
leaq 0x7d827(%rip), %r15     # 0xd4830
movq 0x10(%r15,%rbx,8), %rsi
movsbl %al, %edi
callq 0x2cbc4
movw $0x2e, 0xe(%rsp)
cmpl $0x0, 0x1c(%r15,%rbx,8)
je 0x57059
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 0x5705b
sqrtsd %xmm0, %xmm0
jmp 0x57060
jmp 0x57066
callq 0x4300
movsd %xmm0, 0x38(%rsp)
leaq (%r15,%rbx,8), %rbx
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x50(%rsp)
movl $0x2, %edi
callq 0x15391
movq %rax, %r12
movl $0x1f4, %r15d           # imm = 0x1F4
leaq 0x53c35(%rip), %rbp     # 0xaacc7
leaq 0xe(%rsp), %r13
xorps %xmm0, %xmm0
sqrtsd (%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
xorpd %xmm1, %xmm1
movq 0x20(%rsp), %r14
leaq 0x35b003(%rip), %rax    # 0x3b20b8
movsd 0x10(%rax), %xmm0
movsd 0x18(%rax), %xmm2
subsd %xmm0, %xmm2
divsd 0x50d4d(%rip), %xmm2    # 0xa7e18
movsd %xmm1, 0x68(%rsp)
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
cmpl $0x0, 0x1c(%rbx)
movsd %xmm2, 0x18(%rsp)
movapd %xmm2, %xmm0
je 0x570fb
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)
movq %rbp, %rdi
callq 0x54bec
movsd 0x10(%rsp), %xmm1
testl %eax, %eax
je 0x57168
movsd (%rsp), %xmm0
ucomisd 0x4ebc2(%rip), %xmm0    # 0xa5d08
movsd 0x28(%rsp), %xmm1
jae 0x5715c
movsd (%rsp), %xmm0
callq 0x4300
movapd %xmm0, %xmm1
mulsd 0x10(%rsp), %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x7df00(%rip), %xmm2    # 0xd5070
movsd 0x7df00(%rip), %xmm3    # 0xd5078
movl $0x8, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x50(%rsp), %xmm4
movq %r13, %rsi
callq 0x2cc6c
movl %r14d, %edi
movl $0x2, %esi
movl $0x7d8, %edx            # imm = 0x7D8
movl $0x7d9, %ecx            # imm = 0x7D9
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x572ca
movq %rbp, %rdi
callq 0x54bec
movl %eax, %r14d
leaq 0x4e884(%rip), %rdi     # 0xa5a48
callq 0x549ba
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
testl %r14d, %r14d
je 0x5720d
movsd (%rsp), %xmm0
ucomisd 0x4eb23(%rip), %xmm0    # 0xa5d08
movsd 0x28(%rsp), %xmm0
jae 0x57203
movsd (%rsp), %xmm0
movsd %xmm1, 0x40(%rsp)
callq 0x4300
movsd 0x40(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x7de5b(%rip), %xmm2    # 0xd5070
movsd 0x7de5b(%rip), %xmm3    # 0xd5078
movl $0x8, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x509c0(%rip), %xmm4    # 0xa7bf0
movq %r13, %rsi
callq 0x2cc6c
movq %rbp, %rdi
callq 0x54bec
movl %eax, %r14d
leaq 0x4e7fe(%rip), %rdi     # 0xa5a48
callq 0x549ba
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
testl %r14d, %r14d
je 0x5729a
movsd (%rsp), %xmm0
ucomisd 0x4ea9d(%rip), %xmm0    # 0xa5d08
movsd 0x28(%rsp), %xmm0
movq 0x20(%rsp), %r14
jae 0x5728e
movsd (%rsp), %xmm0
movsd %xmm1, 0x10(%rsp)
callq 0x4300
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
jmp 0x5729f
movq 0x20(%rsp), %r14
movsd 0x7ddc9(%rip), %xmm2    # 0xd5070
movsd 0x7ddc9(%rip), %xmm3    # 0xd5078
movl $0x8, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x5092e(%rip), %xmm4    # 0xa7bf0
movq %r13, %rsi
callq 0x2cc6c
movsd 0x68(%rsp), %xmm1
addsd 0x4e248(%rip), %xmm1    # 0xa5520
decl %r15d
jne 0x570ae
xorl %eax, %eax
callq 0x2e6d0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq