// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/ridge_regression.c
// Function: Print_make_fit
void Print_make_fit(struct ridge_fit *F, float Lambda, char *what,
		    FILE *file_out, char *nameout, float *eval, float **evec,
		    float *yalpha, float *D, float **X, float *Y, float *ya2,
		    float E0, float Y2, float *A_ref, float *A_inf,
		    int Npar, int N, double *sum_x, double var_y)
{
  F->Lambda=Lambda;
  Score_computation(F, eval,evec,yalpha,ya2,D,E0,Y2,A_ref,A_inf,Npar,N);
  int a; for(a=0; a<Npar; a++)F->A[a]/=D[a];
  /*double sum=0; for(a=0; a<Npar; a++)sum+=F->A[a]*sum_x[a];
  F->dof[0]=F->A[0]*sum_x[0]/sum; // Internal fraction
  F->dof[1]=F->A[1]*N/sum;  // Translations
  F->dof[2]=1-F->dof[0]-F->dof[1]; // Rotations*/
  // Print
  fprintf(file_out,
	  "#\t%.3g\t%.3g\t%.3g\t%.3g\t%.3g\t%10s",
	  F->Lambda, F->Cv, F->E/var_y, F->LF_csi, F->LF_inf, what);
  if(P_FIT)for(a=0; a<Npar; a++)fprintf(file_out, "\t%.3g", F->A[a]);
  fprintf(file_out, "\n");

  if(VB2){
    char namefile[200];
    sprintf(namefile, "%s_%s.dat", nameout, what);
    FILE *file_o=fopen(namefile, "w"); int i, a;
    printf("Writing %s fit in %s\n", what, namefile);
    fprintf(file_o, "#A= ");
    for(i=0; i<Npar; i++)fprintf(file_o, " %.3g",F->A[i]);
    fprintf(file_o, "\n# Y ");
    for(i=0; i<Npar; i++)fprintf(file_o, " X%d", i+1);
    fprintf(file_o, "\n");
    fprintf(file_o, "#nu= %.3f\n", F->nu);
    fprintf(file_o, "#eval= ");
    for(i=0; i<Npar; i++)fprintf(file_o, " %.3g",eval[i]);
    fprintf(file_o, "\n");
    fprintf(file_o, "#Complete only_internal\n");
    for(i=0; i<N; i++){
      double Y=0;
      for(a=0; a<Npar; a++)Y+=F->A[a]*X[i][a];
      fprintf(file_o, "%.3f %.3f\n", Y, F->A[0]*X[i][0]);
    }
    fclose(file_o);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm3, (%rsp)
movq %r9, %r10
movq %r8, %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0x60(%rsp), %r13d
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %r9
movq 0x58(%rsp), %r11
movl 0x68(%rsp), %r12d
movss %xmm0, 0xc(%rdi)
subq $0x8, %rsp
movq %rcx, %rsi
movq %rax, %rdx
movq %r10, %rcx
movaps %xmm1, %xmm0
movaps %xmm2, %xmm1
pushq %r12
pushq %r13
pushq %r11
callq 0x2bfbc
addq $0x20, %rsp
movl %r13d, %r12d
testl %r13d, %r13d
jle 0x2bf1f
movq (%r14), %rax
xorl %ecx, %ecx
movss (%rax,%rcx,4), %xmm0
divss (%rbp,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x2bf07
xorps %xmm0, %xmm0
cvtss2sd 0xc(%r14), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x14(%r14), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x10(%r14), %xmm2
divsd (%rsp), %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x18(%r14), %xmm3
cvtss2sd 0x1c(%r14), %xmm4
leaq 0x2dd25(%rip), %rsi     # 0x59c7a
movq %rbx, %rdi
movq %r15, %rdx
movb $0x5, %al
callq 0x2190
cmpl $0x0, 0x3cf47(%rip)     # 0x68eb0
sete %al
testl %r13d, %r13d
setle %cl
orb %al, %cl
jne 0x2bfa1
xorl %r13d, %r13d
leaq 0x2b944(%rip), %r15     # 0x578c4
movq (%r14), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x2190
incq %r13
cmpq %r13, %r12
jne 0x2bf80
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2140