// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/confchange.c
// Function: RMSD_Lasso_confchange
float RMSD_Lasso_confchange(float lambda, float *cnew, double *d_phi,
			    float *coord_all, float *coord_new,
			    float *c, double c2_sum,
			    struct Normal_Mode *NM, struct bond *bonds,
			    atom *atoms, int natoms,
			    struct Reference Ref, float *coord_2)
{
  int naxes=NM->N_axes, k, i; double norm=0;
  for(k=0; k<NM->N; k++){
    if(fabs(c[k])<lambda){cnew[k]=0; continue;}
    else{cnew[k]=c[k]*(1-lambda/fabs(c[k]));}
    norm+=cnew[k]*cnew[k];
  }
  norm=c2_sum/norm; for(k=0; k<NM->N; k++)if(cnew[k])cnew[k]/=norm;
  // angular distance
  for(i=0; i<naxes; i++)d_phi[i]=0;
  for(k=0; k<NM->N; k++){
    if(cnew[k]==0)continue;
    float *mode=NM->Tors[k];
    for(i=0; i<naxes; i++)d_phi[i]+=cnew[k]*mode[i];
  }
  Set_bonds_measure(bonds, natoms, atoms);
  Build_up(bonds, natoms, d_phi, naxes);
  Put_coord(coord_all, bonds, natoms);
  Write_ref_coord(coord_new, Ref.N_ref, coord_all, Ref.atom_num);
  float rmsd2=rmsd_mclachlan_f(coord_2, coord_new, Ref.mass_atom, Ref.N_ref);
  return(rmsd2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x58(%rbp), %rax
leaq 0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movss %xmm0, -0x4(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movsd %xmm1, -0x38(%rbp)
movq %r9, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x44(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x48dba
movq -0x30(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movaps 0x3378f(%rip), %xmm0    # 0x7c490
pand %xmm0, %xmm1
movss -0x4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x48d29
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0x48dac
movq -0x30(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movq -0x30(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movaps 0x33735(%rip), %xmm3    # 0x7c490
pand %xmm3, %xmm1
divsd %xmm1, %xmm2
movsd 0x2d2dd(%rip), %xmm1    # 0x76048
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x48cda
movsd -0x38(%rbp), %xmm0
divsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x48e24
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x48df4
jp 0x48df4
jmp 0x48e17
movsd -0x58(%rbp), %xmm1
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0x48e19
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x48dd0
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x48e4e
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x48e2b
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x48eeb
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x48e7d
jp 0x48e7d
jmp 0x48edd
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x48edb
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x60(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x48e98
jmp 0x48edd
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x48e55
movq 0x10(%rbp), %rdi
movl 0x20(%rbp), %esi
movq 0x18(%rbp), %rdx
callq 0x1bf00
movq 0x10(%rbp), %rdi
movl 0x20(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x44(%rbp), %ecx
callq 0x1c4f0
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rsi
movl 0x20(%rbp), %edx
callq 0x49770
movq -0x70(%rbp), %rax
movq -0x28(%rbp), %rdi
movl (%rax), %esi
movq -0x20(%rbp), %rdx
movq 0x28(%rax), %rcx
callq 0x4a1d0
movq -0x70(%rbp), %rax
movq 0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x10(%rax), %rdx
movl (%rax), %ecx
callq 0x70af0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x64(%rbp)
movss -0x64(%rbp), %xmm0
addq $0x70, %rsp
popq %rbp
retq