// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/contact_map.c
// Function: ContactMap
void ContactMap(CHAIN **Chain, int NChain, COMMAND *Cmd )
{

  register int Res1, Res2;
  int Cn1, Cn2, CA1, CA2;
  float D;
  
  for( Cn1=0; Cn1<NChain; Cn1++ ) {
    
    if( !Chain[Cn1]->Valid )
      continue;


    for( Cn2=0; Cn2<NChain; Cn2++ ) {

      if( !Chain[Cn2]->Valid )
	continue;

      for( Res1=0; Res1<Chain[Cn1]->NRes; Res1++ ) {

	if( !FindAtom(Chain[Cn1],Res1,"CA",&CA1) )
	  continue;

	for( Res2=0; Res2<Chain[Cn2]->NRes; Res2++ ) {
	  
	  if( !FindAtom(Chain[Cn2],Res2,"CA",&CA2) )
	    continue;

	  D = Dist(Chain[Cn1]->Rsd[Res1]->Coord[CA1],
		   Chain[Cn2]->Rsd[Res2]->Coord[CA2]);
	  printf("%c %d <-> %c %d : %7.3f\n",
		 SpaceToDash(Chain[Cn1]->Id),Res1,
		 SpaceToDash(Chain[Cn2]->Id),Res2,D);
	}
      }
    }
  }
  exit(0);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jge 0x2a300
movq 0x40(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x2a121
jmp 0x2a2f0
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jge 0x2a2ee
movq 0x40(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x2a150
jmp 0x2a2de
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x40(%rsp), %rcx
movslq 0x24(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x2a2dc
movq 0x40(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x2c(%rsp), %esi
leaq 0x2ab5(%rip), %rdx      # 0x2cc40
leaq 0x1c(%rsp), %rcx
callq 0x6140
cmpl $0x0, %eax
jne 0x2a19f
jmp 0x2a2cc
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x40(%rsp), %rcx
movslq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x2a2ca
movq 0x40(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x28(%rsp), %esi
leaq 0x2a66(%rip), %rdx      # 0x2cc40
leaq 0x18(%rsp), %rcx
callq 0x6140
cmpl $0x0, %eax
jne 0x2a1ee
jmp 0x2a2ba
movq 0x40(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x188, %rdi            # imm = 0x188
movslq 0x1c(%rsp), %rax
imulq $0xc, %rax, %rax
addq %rax, %rdi
movq 0x40(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x188, %rsi            # imm = 0x188
movslq 0x18(%rsp), %rax
imulq $0xc, %rax, %rax
addq %rax, %rsi
callq 0x4a30
movss %xmm0, 0x14(%rsp)
movq 0x40(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movsbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
movsbl %al, %ecx
movl 0x28(%rsp), %r8d
movss 0x14(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2caa(%rip), %rdi      # 0x2cf5d
movb $0x1, %al
callq 0x20d0
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x2a1a7
jmp 0x2a2cc
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x2a158
jmp 0x2a2de
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x2a129
jmp 0x2a2f0
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x2a0fa
xorl %edi, %edi
callq 0x2210