// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/allostery.c
// Function: Deformation_propagation
void Deformation_propagation(float **Deformation_coupling, int Na,
			    char **pdbres, char *amm, char *chain,
			    char *nameout)
{
  char namefile[200];
  sprintf(namefile, "%s.perturbation_propagation.dat", nameout);
  FILE *file_out=fopen(namefile, "w");
  printf("Writing %s\n", namefile);
  fprintf(file_out, "# Predicted deformation produced on sites j by a ");
  fprintf(file_out, "perturbation applied at site i:\n");
  fprintf(file_out, "# Def(i->j)~Allo_i exp(-|i-j|/prop_length_i)\n");
  fprintf(file_out, "#AA res chain Allo prop_length C.c.\n");
  float *d=malloc(Na*sizeof(float));
  float *y=malloc(Na*sizeof(float));
  float slope, offset, r; int i, j;
  for(i=0; i<Na; i++){
    float *Ci=Deformation_coupling[i];
    for(j=0; j<Na; j++){
      if(i>j){d[j]=i-j;}else{d[j]=j-i;}
      y[j]=log(Ci[j]);
    }
    r=Corr_coeff(d, y, Na, &slope, &offset);
    fprintf(file_out, "%c\t%s\t%c\t%.3f\t%.3f\t%.3f\n",
	    amm[i], pdbres[i], chain[i], exp(offset), -1/slope, r);
  }
  fclose(file_out);
  free(d); free(y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x100(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x1b65c(%rip), %rsi     # 0x82930
movb $0x0, %al
callq 0x1200
leaq -0x100(%rbp), %rdi
leaq 0x15089(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0x108(%rbp)
leaq -0x100(%rbp), %rsi
leaq 0x101eb(%rip), %rdi     # 0x774ee
movb $0x0, %al
callq 0x10d0
movq -0x108(%rbp), %rdi
leaq 0x1b638(%rip), %rsi     # 0x82950
movb $0x0, %al
callq 0x1150
movq -0x108(%rbp), %rdi
leaq 0x1b655(%rip), %rsi     # 0x82982
movb $0x0, %al
callq 0x1150
movq -0x108(%rbp), %rdi
leaq 0x1b661(%rip), %rsi     # 0x829a3
movb $0x0, %al
callq 0x1150
movq -0x108(%rbp), %rdi
leaq 0x1b67a(%rip), %rsi     # 0x829d1
movb $0x0, %al
callq 0x1150
movslq -0xc(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, -0x110(%rbp)
movslq -0xc(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, -0x118(%rbp)
movl $0x0, -0x128(%rbp)
movl -0x128(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x67553
movq -0x8(%rbp), %rax
movslq -0x128(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x138(%rbp)
movl $0x0, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x6746b
movl -0x128(%rbp), %eax
cmpl -0x12c(%rbp), %eax
jle 0x67401
movl -0x128(%rbp), %eax
subl -0x12c(%rbp), %eax
cvtsi2ss %eax, %xmm0
movq -0x110(%rbp), %rax
movslq -0x12c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x67424
movl -0x12c(%rbp), %eax
subl -0x128(%rbp), %eax
cvtsi2ss %eax, %xmm0
movq -0x110(%rbp), %rax
movslq -0x12c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x138(%rbp), %rax
movslq -0x12c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x10f0
cvtsd2ss %xmm0, %xmm0
movq -0x118(%rbp), %rax
movslq -0x12c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x673bf
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq -0x11c(%rbp), %rcx
leaq -0x120(%rbp), %r8
callq 0x15750
movss %xmm0, -0x124(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x20(%rbp), %rax
movslq -0x128(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x14c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x128(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x148(%rbp)
movq -0x28(%rbp), %rax
movslq -0x128(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x13c(%rbp)
movss -0x120(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x1230
movq -0x158(%rbp), %rdi
movl -0x14c(%rbp), %edx
movq -0x148(%rbp), %rcx
movl -0x13c(%rbp), %r8d
movss 0xeb57(%rip), %xmm1     # 0x76070
divss -0x11c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x124(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x1b4be(%rip), %rsi     # 0x829f6
movb $0x3, %al
callq 0x1150
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x67390
movq -0x108(%rbp), %rdi
callq 0x10a0
movq -0x110(%rbp), %rdi
callq 0x1040
movq -0x118(%rbp), %rdi
callq 0x1040
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq