// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/main_tnm.c
// Function: Apo_interactions
struct interaction *Apo_interactions(int *N_int_apo,
				     struct interaction **Int_list_inter,
				     int *N_int_inter,
				     struct interaction *Int_list, int N_int,
				     atom *atoms, int *apo_chain_num,
				     int n_apo, int Nchain)
{
  struct interaction *Int_list_apo=
    malloc(N_int*sizeof(struct interaction)), *tmp=Int_list;
  *N_int_apo=0; *N_int_inter=0;
  for(int k=0; k<N_int; k++){
    if(atoms[tmp->i1].chain!=atoms[tmp->i2].chain){
      int apo1=Belong_to_apo(atoms[tmp->i1].chain, apo_chain_num, n_apo);
      int apo2=Belong_to_apo(atoms[tmp->i2].chain, apo_chain_num, n_apo);
      if((apo1 && apo2==0) || (apo1==0 && apo2)){
	(*N_int_inter)++; goto next_int;
      }
    }
    Int_list_apo[*N_int_apo]=*tmp; (*N_int_apo)++; 
  next_int:
    tmp++;
  }
  printf("%d interactions belong to the interface "
	 "between %d chains and %d chains\n",
	 N_int-*N_int_apo, n_apo, Nchain-n_apo);

  *Int_list_inter=malloc(*N_int_inter*sizeof(struct interaction));
  int n=0; tmp=Int_list; struct interaction *store=*Int_list_inter;
  for(int k=0; k<N_int; k++){
    if(atoms[tmp->i1].chain!=atoms[tmp->i2].chain){
      int apo1=Belong_to_apo(atoms[tmp->i1].chain, apo_chain_num, n_apo);
      int apo2=Belong_to_apo(atoms[tmp->i2].chain, apo_chain_num, n_apo);
      if((apo1 && apo2==0) || (apo1==0 && apo2)){
	*store=*tmp; store++; n++; 
      }
    }
    tmp++;
  }
  if(n!=*N_int_inter){printf("ERROR of Interface interactions\n"); exit(8);}

  return(Int_list_apo);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movslq -0x24(%rbp), %rax
imulq $0xc8, %rax, %rdi
callq 0x1180
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xabd4
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %eax
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
movslq 0x4(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x6c(%rcx), %eax
je 0xab8a
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %edi
movq 0x10(%rbp), %rsi
movl 0x18(%rbp), %edx
callq 0xb1e0
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq 0x4(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %edi
movq 0x10(%rbp), %rsi
movl 0x18(%rbp), %edx
callq 0xb1e0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0xab6f
cmpl $0x0, -0x4c(%rbp)
je 0xab7b
cmpl $0x0, -0x48(%rbp)
jne 0xab88
cmpl $0x0, -0x4c(%rbp)
je 0xab88
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xabb8
jmp 0xab8a
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq (%rax), %rax
imulq $0xc8, %rax, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
movl $0xc8, %edx
callq 0x1160
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
addq $0xc8, %rax
movq %rax, -0x40(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xaae1
movl -0x24(%rbp), %esi
movq -0x8(%rbp), %rax
subl (%rax), %esi
movl 0x18(%rbp), %edx
movl 0x20(%rbp), %ecx
subl 0x18(%rbp), %ecx
leaq 0x6fe5d(%rip), %rdi     # 0x7aa4a
movb $0x0, %al
callq 0x10d0
movq -0x18(%rbp), %rax
movslq (%rax), %rax
imulq $0xc8, %rax, %rdi
callq 0x1180
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xad17
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %eax
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
movslq 0x4(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x6c(%rcx), %eax
je 0xacfb
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %edi
movq 0x10(%rbp), %rsi
movl 0x18(%rbp), %edx
callq 0xb1e0
movl %eax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movslq 0x4(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %edi
movq 0x10(%rbp), %rsi
movl 0x18(%rbp), %edx
callq 0xb1e0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x60(%rbp)
je 0xacc4
cmpl $0x0, -0x64(%rbp)
je 0xacd0
cmpl $0x0, -0x60(%rbp)
jne 0xacf9
cmpl $0x0, -0x64(%rbp)
je 0xacf9
movq -0x58(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl $0xc8, %edx
callq 0x1160
movq -0x58(%rbp), %rax
addq $0xc8, %rax
movq %rax, -0x58(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xacfb
movq -0x40(%rbp), %rax
addq $0xc8, %rax
movq %rax, -0x40(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xac32
movl -0x50(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0xad3a
leaq 0x6fd6a(%rip), %rdi     # 0x7aa93
movb $0x0, %al
callq 0x10d0
movl $0x8, %edi
callq 0x1210
movq -0x38(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)