// File: /workspace/github_c_makefile_star2_O1/markpeerdeman[P]mbemm/src/emath/contactc.c
// Function: make_a_old
void make_a_old(point row_node, hypermatrix crow, hypermatrix erow, cmesh theCMesh)
{ vector B;
  point current_node;
  restraint r;
  restraint t;
  float t1, t2, t3;
  matrix tramat;

  B=(vector)newvector(3); 
  tramat=(matrix)newmatrix(3,3);
  fillvector(B,ZEROFILL);
 

  /* Do for all node in the mesh: */
  current_node=(point)point_dll(theCMesh->merged_mesh->mesh_p,START,0);
  while (current_node!=(point)NULL)
  {  
    /* row_node and current_node are on the same body: */
    if(( (row_node->label<=theCMesh->nr_of_nodes_basemesh) &&
         (current_node->label<=theCMesh->nr_of_nodes_basemesh) ) 
       ||
       ( (row_node->label>theCMesh->nr_of_nodes_basemesh) &&
         (current_node->label>theCMesh->nr_of_nodes_basemesh) ) )
    {  
      if (current_node->type==CNODE)
      { makelocalsystem(tramat,current_node); 
        if (current_node->label<=theCMesh->nr_of_nodes_basemesh)
        { matcopy3x3(crow->data[current_node->label],ctemp); matmul(crow->data[current_node->label],ctemp,tramat);
          matcopy3x3(erow->data[current_node->label],ctemp); matmul(erow->data[current_node->label],ctemp,tramat);
          H(crow,1,2,current_node->label)=-H(erow,1,2,current_node->label);
          H(crow,2,2,current_node->label)=-H(erow,2,2,current_node->label);
          H(crow,3,2,current_node->label)=-H(erow,3,2,current_node->label);
          H(crow,1,3,current_node->label)=-H(erow,1,3,current_node->label);
          H(crow,2,3,current_node->label)=-H(erow,2,3,current_node->label);
          H(crow,3,3,current_node->label)=-H(erow,3,3,current_node->label);
        }
        else
        { matcopy3x3(crow->data[current_node->label],ctemp); matmul(crow->data[current_node->label],ctemp,tramat);
          matcopy3x3(erow->data[current_node->label],ctemp); matmul(erow->data[current_node->label],ctemp,tramat);
          matcopy3x3(erow->data[current_node->label],crow->data[current_node->label]);
          scalemat3x3(crow->data[current_node->label],-1.0);
        }
      }
      else /* if current_node is not a CNODE */
      { r=(restraint)restraint_dll(theCMesh->merged_mesh->mesh_d,SEARCH,current_node->label);
        if (r==(restraint)NULL) /* i.e. the traction is prescribed */
        { t=(restraint)restraint_dll(theCMesh->merged_mesh->mesh_t,SEARCH,current_node->label); 
          if (t==(restraint)NULL) { t1=0.0; t2=0.0; t3=0.0; } else { t1=t->f1; t2=t->f2; t3=t->f3; }
          V(B,1)=V(B,1)-H(crow,1,1,current_node->label)*t1 
                       -H(crow,1,2,current_node->label)*t2
                       -H(crow,1,3,current_node->label)*t3;
          V(B,2)=V(B,2)-H(crow,2,1,current_node->label)*t1 
                       -H(crow,2,2,current_node->label)*t2
                       -H(crow,2,3,current_node->label)*t3;
          V(B,3)=V(B,3)-H(crow,3,1,current_node->label)*t1 
                       -H(crow,3,2,current_node->label)*t2
                       -H(crow,3,3,current_node->label)*t3;
          matcopy3x3(erow->data[current_node->label],crow->data[current_node->label]);
          scalemat3x3(crow->data[current_node->label],-1.0);
        }
        else /* i.e. the displacement is prescribed */
        { V(B,1)=V(B,1)+H(erow,1,1,current_node->label)*r->u1 
                       +H(erow,1,2,current_node->label)*r->u2
                       +H(erow,1,3,current_node->label)*r->u3;
          V(B,2)=V(B,2)+H(erow,2,1,current_node->label)*r->u1 
                       +H(erow,2,2,current_node->label)*r->u2
                       +H(erow,2,3,current_node->label)*r->u3;
          V(B,3)=V(B,3)+H(erow,3,1,current_node->label)*r->u1 
                       +H(erow,3,2,current_node->label)*r->u2
                       +H(erow,3,3,current_node->label)*r->u3;
        } 
      }
    } /* if */
    /* row_node and current node are not on the same body: */
    else
    {  
      if (current_node->label<=theCMesh->nr_of_nodes_basemesh) 
      { if (current_node->type==CNODE)
        { makelocalsystem(tramat,current_node); 
          matcopy3x3(crow->data[current_node->label],ctemp); matmul(crow->data[current_node->label],ctemp,tramat);
          matcopy3x3(erow->data[current_node->label],ctemp); matmul(erow->data[current_node->label],ctemp,tramat);
          H(crow,1,1,current_node->label)=-H(crow,1,1,current_node->label);
          H(crow,2,1,current_node->label)=-H(crow,2,1,current_node->label);
          H(crow,3,1,current_node->label)=-H(crow,3,1,current_node->label);
          H(crow,1,2,current_node->label)=0.0;
          H(crow,2,2,current_node->label)=0.0;
          H(crow,3,2,current_node->label)=0.0;
          H(crow,1,3,current_node->label)=0.0;
          H(crow,2,3,current_node->label)=0.0;
          H(crow,3,3,current_node->label)=0.0;
        }
        else 
        { fillmatrix(crow->data[current_node->label],ZEROFILL) ;
        }
      }
      else /* i.e. nodes not on the same body, current_node on body 2 */
      { if (current_node->type==CNODE)
        { makelocalsystem(tramat,current_node); 
          matcopy3x3(crow->data[current_node->label],ctemp); matmul(crow->data[current_node->label],ctemp,tramat);
          matcopy3x3(erow->data[current_node->label],ctemp); matmul(erow->data[current_node->label],ctemp,tramat);
          fillmatrix(crow->data[current_node->label],ZEROFILL);
          H(crow,1,1,current_node->label)=-H(erow,1,1,current_node->label);
          H(crow,2,1,current_node->label)=-H(erow,2,1,current_node->label);
          H(crow,3,1,current_node->label)=-H(erow,3,1,current_node->label);
        }
        else 
        { fillmatrix(crow->data[current_node->label],ZEROFILL);
        }
      }
    } /* else */

  current_node=current_node->NEXT;
  }

  V(main_f,row_node->label*3-2)=V(B,1);
  V(main_f,row_node->label*3-1)=V(B,2);
  V(main_f,row_node->label*3  )=V(B,3);

  
  delvector(B);
  delmatrix(tramat); 

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movl $0x3, %edi
callq 0xbde7
movq %rax, %rbx
movl $0x3, %edi
movl $0x3, %esi
callq 0xbcb0
movq %rax, %r15
movq %rbx, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc2f3
movq (%r12), %rax
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xcf07
testq %rax, %rax
je 0x8163
movq %rax, %rbx
movl 0x10(%r14), %ecx
movl 0x8(%r12), %eax
cmpl %eax, %ecx
jle 0x7be4
cmpl %eax, 0x10(%rbx)
jle 0x7bf1
jmp 0x7cf0
cmpl %eax, 0x10(%rbx)
jle 0x7cf0
cmpl %eax, %ecx
jg 0x7bda
movslq 0x10(%rbx), %rcx
movl 0x14(%rbx), %edx
cmpl %eax, %ecx
jle 0x7e60
cmpl $0xf, %edx
jne 0x7f40
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7804
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xdb71(%rip), %rsi      # 0x15798
callq 0xc92e
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xdb59(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xdb3e(%rip), %rsi      # 0x15798
callq 0xc92e
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xdb26(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
callq 0xbf13
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
movsd (%rdx), %xmm0
movapd 0x6374(%rip), %xmm1     # 0xe020
xorpd %xmm1, %xmm0
movq 0x8(%rbp), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rdx
movlpd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movsd (%rdx), %xmm0
xorpd %xmm1, %xmm0
movq 0x8(%rcx), %rdx
movlpd %xmm0, (%rdx)
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
xorpd %xmm1, %xmm0
movq 0x10(%rcx), %rax
movlpd %xmm0, (%rax)
jmp 0x8156
cmpl $0xf, 0x14(%rbx)
jne 0x7d8f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7804
movslq 0x10(%rbx), %rax
movq 0xda88(%rip), %rsi      # 0x15798
cmpl 0x8(%r12), %eax
jle 0x7f54
movq 0x8(%rbp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0xc92e
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xda5d(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xda42(%rip), %rsi      # 0x15798
callq 0xc92e
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xda2a(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rbp), %rax
movq (%rax,%rcx,8), %rsi
jmp 0x8138
movq (%r12), %rax
movq 0x10(%rax), %rdi
movl 0x10(%rbx), %edx
movl $0x2, %esi
callq 0xd1d1
movslq 0x10(%rbx), %rdx
testq %rax, %rax
je 0x8044
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%r13), %rsi
movq (%rsi,%rdx,8), %rdx
movq 0x8(%rdx), %rdx
movq (%rdx), %rsi
movsd (%rsi), %xmm0
movsd 0x8(%rsi), %xmm1
mulsd 0x30(%rax), %xmm0
addsd (%rcx), %xmm0
mulsd 0x38(%rax), %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsi), %xmm0
mulsd 0x40(%rax), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
movq 0x8(%rdx), %rsi
movsd (%rsi), %xmm0
mulsd 0x30(%rax), %xmm0
addsd 0x8(%rcx), %xmm0
movsd 0x8(%rsi), %xmm1
mulsd 0x38(%rax), %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsi), %xmm0
mulsd 0x40(%rax), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rcx)
movq 0x10(%rdx), %rdx
movsd (%rdx), %xmm0
movsd 0x8(%rdx), %xmm1
mulsd 0x30(%rax), %xmm0
addsd 0x10(%rcx), %xmm0
mulsd 0x38(%rax), %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rdx), %xmm0
mulsd 0x40(%rax), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rcx)
jmp 0x8156
cmpl $0xf, %edx
jne 0x7f40
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7804
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd911(%rip), %rsi      # 0x15798
callq 0xc92e
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd8f9(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd8de(%rip), %rsi      # 0x15798
callq 0xc92e
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd8c6(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movsd (%rcx), %xmm0
movapd 0x6127(%rip), %xmm1     # 0xe020
xorpd %xmm1, %xmm0
movlpd %xmm0, (%rcx)
movq 0x8(%rax), %rdx
movsd (%rdx), %xmm0
xorpd %xmm1, %xmm0
movlpd %xmm0, (%rdx)
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
xorpd %xmm1, %xmm0
movlpd %xmm0, (%rax)
xorl %esi, %esi
movq %rsi, 0x8(%rcx)
movq %rsi, 0x8(%rdx)
movq %rsi, 0x8(%rax)
movq %rsi, 0x10(%rcx)
movq %rsi, 0x10(%rdx)
movq %rsi, 0x10(%rax)
jmp 0x8156
movq 0x8(%rbp), %rax
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
callq 0xbf13
jmp 0x8156
movq 0x8(%rbp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0xc92e
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd824(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd809(%rip), %rsi      # 0x15798
callq 0xc92e
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xd7f1(%rip), %rsi      # 0x15798
movq %r15, %rdx
callq 0xc421
movq 0x8(%r13), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
movsd 0x8(%rdx), %xmm0
movapd 0x6051(%rip), %xmm1     # 0xe020
xorpd %xmm1, %xmm0
movq 0x8(%rbp), %rsi
movq (%rsi,%rcx,8), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rsi
movlpd %xmm0, 0x8(%rsi)
movq 0x8(%rax), %rdi
movsd 0x8(%rdi), %xmm0
xorpd %xmm1, %xmm0
movq 0x8(%rcx), %r8
movlpd %xmm0, 0x8(%r8)
movq 0x10(%rax), %rax
movsd 0x8(%rax), %xmm0
xorpd %xmm1, %xmm0
movq 0x10(%rcx), %rcx
movlpd %xmm0, 0x8(%rcx)
movsd 0x10(%rdx), %xmm0
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x10(%rsi)
movsd 0x10(%rdi), %xmm0
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x10(%r8)
movsd 0x10(%rax), %xmm0
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x10(%rcx)
jmp 0x8156
movq (%r12), %rax
movq 0x18(%rax), %rdi
movl $0x2, %esi
callq 0xd1d1
testq %rax, %rax
je 0x8078
movupd 0x18(%rax), %xmm0
cvtpd2ps %xmm0, %xmm0
xorps %xmm2, %xmm2
cvtsd2ss 0x28(%rax), %xmm2
cvtps2pd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
jmp 0x807f
xorpd %xmm1, %xmm1
xorps %xmm0, %xmm0
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rbp), %rdx
movslq 0x10(%rbx), %rcx
movq (%rdx,%rcx,8), %rsi
movq 0x8(%rsi), %rdx
movq (%rdx), %rdi
movsd (%rdi), %xmm2
mulsd %xmm1, %xmm2
movsd (%rax), %xmm3
subsd %xmm2, %xmm3
movsd 0x8(%rax), %xmm4
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
movsd 0x8(%rdi), %xmm5
mulsd %xmm2, %xmm5
subsd %xmm5, %xmm3
movsd 0x10(%rdi), %xmm5
mulsd %xmm0, %xmm5
subsd %xmm5, %xmm3
movsd %xmm3, (%rax)
movq 0x8(%rdx), %rdi
movsd (%rdi), %xmm3
mulsd %xmm1, %xmm3
subsd %xmm3, %xmm4
movsd 0x8(%rdi), %xmm3
mulsd %xmm2, %xmm3
subsd %xmm3, %xmm4
movsd 0x10(%rdi), %xmm3
mulsd %xmm0, %xmm3
subsd %xmm3, %xmm4
movsd %xmm4, 0x8(%rax)
movsd 0x10(%rax), %xmm3
movq 0x10(%rdx), %rdx
movsd (%rdx), %xmm4
mulsd %xmm1, %xmm4
mulsd 0x8(%rdx), %xmm2
subsd %xmm4, %xmm3
subsd %xmm2, %xmm3
mulsd 0x10(%rdx), %xmm0
subsd %xmm0, %xmm3
movsd %xmm3, 0x10(%rax)
movq 0x8(%r13), %rax
movq (%rax,%rcx,8), %rdi
callq 0xc92e
movq 0x8(%rbp), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movsd 0x6eaf(%rip), %xmm0     # 0xf000
callq 0xc558
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x7bcd
movq (%rsp), %rdi
movq 0x8(%rdi), %rax
movsd (%rax), %xmm0
leaq 0xd2d2(%rip), %rcx      # 0x15448
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
movslq 0x10(%r14), %rdx
leaq (%rdx,%rdx,2), %rdx
movsd %xmm0, -0x18(%rcx,%rdx,8)
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x10(%rcx,%rdx,8)
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x8(%rcx,%rdx,8)
callq 0xbef3
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbe4b