// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/allostery.c
// Function: Make_profile
float *Make_profile(float **Mat, int N, char PROF_TYPE, char *what)
{
  printf("Computing profiles of %s type %c\n", what, PROF_TYPE);
  float *prof=malloc(N*sizeof(float)); int i;
  float weight[N], sum_weight=0;
  if(PROF_TYPE=='A'){
    sum_weight=N; for(i=0; i<N; i++)weight[i]=1;
  }else{
    double **Mat2=Get_matrix_positive(Mat, N);
    if(PROF_TYPE=='P'){
      PE_profile(weight, Mat2, N);
    }else if(PROF_TYPE=='C'){
      float *c=EC_profile(NULL, Mat2, N, what);
      for(i=0; i<N; i++)weight[i]=c[i];
      free(c);
    }
    for(i=0; i<N; i++)sum_weight+=weight[i];
    Empty_matrix_d(Mat2, N);
  }
  for(i=0; i<N; i++){
    double sum=0; float *Ca=Mat[i];
    for(int j=0; j<N; j++)if(j!=i)sum+=Ca[j]*weight[j];
    prof[i]=sum/(sum_weight-weight[i]);
  }
  return(prof);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movb %al, -0xd(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movsbl -0xd(%rbp), %edx
leaq 0x1ff87(%rip), %rdi     # 0x8290e
xorl %eax, %eax
callq 0x10d0
movslq -0xc(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x30(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq %rcx, %rsp
movq %rax, -0x38(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
movsbl -0xd(%rbp), %eax
cmpl $0x41, %eax
jne 0x62a15
cvtsi2ssl -0xc(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x62a10
movq -0x70(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x13690(%rip), %xmm0    # 0x76090
movss %xmm0, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x629e8
jmp 0x62add
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x67140
movq %rax, -0x48(%rbp)
movsbl -0xd(%rbp), %eax
cmpl $0x50, %eax
jne 0x62a40
movq -0x70(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0xc(%rbp), %edx
callq 0x65930
jmp 0x62aa0
movsbl -0xd(%rbp), %eax
cmpl $0x43, %eax
jne 0x62a9e
movq -0x48(%rbp), %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edi
callq 0x73f20
movq %rax, -0x50(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x62a95
movq -0x70(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movslq -0x24(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x62a68
movq -0x50(%rbp), %rdi
callq 0x1040
jmp 0x62aa0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x62ad1
movq -0x70(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
addss -0x3c(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x62aa7
movq -0x48(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x692a0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x62b92
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x62b54
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
je 0x62b47
movq -0x70(%rbp), %rax
movq -0x60(%rbp), %rcx
movslq -0x64(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movslq -0x64(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x62b49
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x62b0f
movq -0x70(%rbp), %rax
movsd -0x58(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movslq -0x24(%rbp), %rcx
subss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x62ae4
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)