// File: /workspace/github_c_makefile_star2_O1/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 0x51c78(%rip), %rdi     # 0xa7715
callq 0x536e7
testl %eax, %eax
jne 0x55aad
xorl %eax, %eax
callq 0x2da74
leaq 0x359604(%rip), %rax    # 0x3af0b8
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 0x7bd58(%rip), %r15     # 0xd1830
movq 0x10(%r15,%rbx,8), %rsi
movsbl %al, %edi
callq 0x2c324
movw $0x2e, 0xe(%rsp)
cmpl $0x0, 0x1c(%r15,%rbx,8)
je 0x55b28
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 0x55b2a
sqrtsd %xmm0, %xmm0
jmp 0x55b2f
jmp 0x55b35
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 0x152fc
movq %rax, %r12
movl $0x1f4, %r15d           # imm = 0x1F4
leaq 0x520b6(%rip), %rbp     # 0xa7c17
leaq 0xe(%rsp), %r13
xorps %xmm0, %xmm0
sqrtsd (%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
xorpd %xmm1, %xmm1
movq 0x20(%rsp), %r14
leaq 0x359534(%rip), %rax    # 0x3af0b8
movsd 0x10(%rax), %xmm0
movsd 0x18(%rax), %xmm2
subsd %xmm0, %xmm2
divsd 0x4f1f6(%rip), %xmm2    # 0xa4d90
movsd %xmm1, 0x68(%rsp)
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
cmpl $0x0, 0x1c(%rbx)
movsd %xmm2, 0x18(%rsp)
movapd %xmm2, %xmm0
je 0x55bca
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 0x536e7
movsd 0x10(%rsp), %xmm1
testl %eax, %eax
je 0x55c37
movsd (%rsp), %xmm0
ucomisd 0x4d0f3(%rip), %xmm0    # 0xa2d08
movsd 0x28(%rsp), %xmm1
jae 0x55c2b
movsd (%rsp), %xmm0
callq 0x4300
movapd %xmm0, %xmm1
mulsd 0x10(%rsp), %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x7c431(%rip), %xmm2    # 0xd2070
movsd 0x7c431(%rip), %xmm3    # 0xd2078
movl $0x8, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x50(%rsp), %xmm4
movq %r13, %rsi
callq 0x2c3cc
movl %r14d, %edi
movl $0x2, %esi
movl $0x7d8, %edx            # imm = 0x7D8
movl $0x7d9, %ecx            # imm = 0x7D9
xorl %eax, %eax
callq 0x39a80
testl %eax, %eax
je 0x55d99
movq %rbp, %rdi
callq 0x536e7
movl %eax, %r14d
leaq 0x4cdb5(%rip), %rdi     # 0xa2a48
callq 0x534b6
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
testl %r14d, %r14d
je 0x55cdc
movsd (%rsp), %xmm0
ucomisd 0x4d054(%rip), %xmm0    # 0xa2d08
movsd 0x28(%rsp), %xmm0
jae 0x55cd2
movsd (%rsp), %xmm0
movsd %xmm1, 0x40(%rsp)
callq 0x4300
movsd 0x40(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x7c38c(%rip), %xmm2    # 0xd2070
movsd 0x7c38c(%rip), %xmm3    # 0xd2078
movl $0x8, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x4ee39(%rip), %xmm4    # 0xa4b38
movq %r13, %rsi
callq 0x2c3cc
movq %rbp, %rdi
callq 0x536e7
movl %eax, %r14d
leaq 0x4cd2f(%rip), %rdi     # 0xa2a48
callq 0x534b6
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
testl %r14d, %r14d
je 0x55d69
movsd (%rsp), %xmm0
ucomisd 0x4cfce(%rip), %xmm0    # 0xa2d08
movsd 0x28(%rsp), %xmm0
movq 0x20(%rsp), %r14
jae 0x55d5d
movsd (%rsp), %xmm0
movsd %xmm1, 0x10(%rsp)
callq 0x4300
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
jmp 0x55d6e
movq 0x20(%rsp), %r14
movsd 0x7c2fa(%rip), %xmm2    # 0xd2070
movsd 0x7c2fa(%rip), %xmm3    # 0xd2078
movl $0x8, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x4eda7(%rip), %xmm4    # 0xa4b38
movq %r13, %rsi
callq 0x2c3cc
movsd 0x68(%rsp), %xmm1
addsd 0x4c779(%rip), %xmm1    # 0xa2520
decl %r15d
jne 0x55b7d
xorl %eax, %eax
callq 0x2de4a
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq