// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/interactions_tnm.c
// Function: Print_contact_matrix
void Print_contact_matrix(struct interaction *Int_list, int N_int,
			  atom *atoms, struct residue *res,
			  char *name, char *pdb)
{
  char nameout[100]; sprintf(nameout, "%s_%s_Cont_Mat.txt", pdb,name);
  FILE *file_out=fopen(nameout, "w");
  printf("Writing contact matrix in %s\n", nameout);
  int i, SCR=0, ALL=1;
  if((strncmp(name,"SCR",3)==0))SCR=1;
  if((strncmp(name,"CA",2)==0)||(strncmp(name,"CB",2)==0)||
     (strncmp(name,"SCA",3)==0)||(strncmp(name,"SCB",3)==0))ALL=0;
  fprintf(file_out, "#res1\tres2\td");
  if(SCR)fprintf(file_out, "\tw");
  if(ALL)fprintf(file_out, "\tatom1\tatom2");
  fprintf(file_out, "\tcontacts=%d\n",N_int);
  for(i=0; i<N_int; i++){
    int ij=abs(atoms[Int_list[i].i1].res-atoms[Int_list[i].i2].res);
    if(ij<=2)continue;
    fprintf(file_out, "%s\t%s\t%.2f",
	    res[atoms[Int_list[i].i1].res].pdbres,
	    res[atoms[Int_list[i].i2].res].pdbres,
	    Int_list[i].r0);
    if(SCR)fprintf(file_out, "\t%.4f", Int_list[i].sec_der);
    if(ALL)fprintf(file_out, "\t%s\t%s",
		   atoms[Int_list[i].i1].name,
		   atoms[Int_list[i].i2].name);
    fprintf(file_out, "\n");
  }
  fclose(file_out);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
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 -0xa0(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x59eeb(%rip), %rsi     # 0x7c333
movb $0x0, %al
callq 0x1200
leaq -0xa0(%rbp), %rdi
leaq 0x59f15(%rip), %rsi     # 0x7c372
callq 0x11b0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rsi
leaq 0x59ecf(%rip), %rdi     # 0x7c346
movb $0x0, %al
callq 0x10d0
movl $0x0, -0xb0(%rbp)
movl $0x1, -0xb4(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x60dd2(%rip), %rsi     # 0x8326f
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x224b6
movl $0x1, -0xb0(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x53e47(%rip), %rsi     # 0x76308
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x2251e
movq -0x28(%rbp), %rdi
leaq 0x53e6e(%rip), %rsi     # 0x76349
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x2251e
movq -0x28(%rbp), %rdi
leaq 0x53e12(%rip), %rsi     # 0x76307
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x2251e
movq -0x28(%rbp), %rdi
leaq 0x53e39(%rip), %rsi     # 0x76348
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x22528
movl $0x0, -0xb4(%rbp)
movq -0xa8(%rbp), %rdi
leaq 0x59e2e(%rip), %rsi     # 0x7c364
movb $0x0, %al
callq 0x1150
cmpl $0x0, -0xb0(%rbp)
je 0x2255b
movq -0xa8(%rbp), %rdi
leaq 0x59e1d(%rip), %rsi     # 0x7c371
movb $0x0, %al
callq 0x1150
cmpl $0x0, -0xb4(%rbp)
je 0x22579
movq -0xa8(%rbp), %rdi
leaq 0x59e02(%rip), %rsi     # 0x7c374
movb $0x0, %al
callq 0x1150
movq -0xa8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x59df7(%rip), %rsi     # 0x7c381
movb $0x0, %al
callq 0x1150
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2277c
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq -0xac(%rbp), %rdx
imulq $0xc8, %rdx, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x64(%rax), %eax
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0xac(%rbp), %rsi
imulq $0xc8, %rsi, %rsi
addq %rsi, %rdx
movslq 0x4(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rcx
subl 0x64(%rcx), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0xb8(%rbp)
cmpl $0x2, -0xb8(%rbp)
jg 0x22612
jmp 0x22768
movq -0xa8(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq -0xac(%rbp), %rsi
imulq $0xc8, %rsi, %rsi
addq %rsi, %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movslq 0x64(%rax), %rax
shlq $0x5, %rax
addq %rax, %rdx
addq $0xd, %rdx
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rsi
movslq -0xac(%rbp), %r8
imulq $0xc8, %r8, %r8
addq %r8, %rsi
movslq 0x4(%rsi), %rsi
imulq $0x70, %rsi, %rsi
addq %rsi, %rax
movslq 0x64(%rax), %rax
shlq $0x5, %rax
addq %rax, %rcx
addq $0xd, %rcx
movq -0x8(%rbp), %rax
movslq -0xac(%rbp), %rsi
imulq $0xc8, %rsi, %rsi
addq %rsi, %rax
movsd 0x20(%rax), %xmm0
leaq 0x59ce8(%rip), %rsi     # 0x7c38f
movb $0x1, %al
callq 0x1150
cmpl $0x0, -0xb0(%rbp)
je 0x226e6
movq -0xa8(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0xac(%rbp), %rcx
imulq $0xc8, %rcx, %rcx
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
leaq 0x5ba56(%rip), %rsi     # 0x7e135
movb $0x1, %al
callq 0x1150
cmpl $0x0, -0xb4(%rbp)
je 0x22753
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq -0xac(%rbp), %rcx
imulq $0xc8, %rcx, %rcx
addq %rcx, %rax
movslq (%rax), %rax
imulq $0x70, %rax, %rax
addq %rax, %rdx
addq $0x18, %rdx
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movslq -0xac(%rbp), %rsi
imulq $0xc8, %rsi, %rsi
addq %rsi, %rax
movslq 0x4(%rax), %rax
imulq $0x70, %rax, %rax
addq %rax, %rcx
addq $0x18, %rcx
leaq 0x59c4e(%rip), %rsi     # 0x7c39a
movb $0x0, %al
callq 0x1150
movq -0xa8(%rbp), %rdi
leaq 0x5b917(%rip), %rsi     # 0x7e078
movb $0x0, %al
callq 0x1150
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x2259b
movq -0xa8(%rbp), %rdi
callq 0x10a0
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)