// File: /workspace/github_c_makefile_star2_O2/markpeerdeman[P]mbemm/src/emath/singular.c
// Function: make_C
void make_C( const matrix A, const matrix B, const vector v, const hypermatrix C )
{ /* IN:          matrices A, B, hypermatrix C, vector v 
   * OUT:         nothing
   * MODIFIES:    hypermatrix C
   * USES:        data from theElement
   * DESCRIPTION: 
   * This function calculates the hypermatrix C_kij
   */

int  k, i; /* counters */
double scalefactor;

     /*scalefactor=theElement->z1/(1.0-NU);
	 scalefactor=theElement->area/scalefactor; */

	 scalefactor = theElement->area*(1.0+NU)/theElement->z1;

     for (k=1; k<=3; k++)
	 { for (i=1; i<=3; i++)
	   { H(C,k,i,1) = M(A,k,i);
		 H(C,k,i,2) = M(A,k,i)*cosA3 + M(B,k,i)*sinA3;
		 H(C,k,i,2) = H(C,k,i,2) * theElement->z2/theElement->z1;
		 H(C,k,i,3) = M(A,k,i)*cosA2 - M(B,k,i)*sinA2;
		 H(C,k,i,3) = H(C,k,i,3) * theElement->z3/theElement->z1;
		 if (k==i)
		 { H(C,k,i,1) += (3.0-4.0*NU)*V(v,1);
		   H(C,k,i,2) += (3.0-4.0*NU)*V(v,2);
		   H(C,k,i,3) += (3.0-4.0*NU)*V(v,3);
		 } 
		 H(C,k,i,1)=H(C,k,i,1)*scalefactor;
		 H(C,k,i,2)=H(C,k,i,2)*scalefactor;
		 H(C,k,i,3)=H(C,k,i,3)*scalefactor;
	   } /* for i */
	 } /* for k */

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0xc4b5(%rip), %rax      # 0x147b0
leaq 0xc0fe(%rip), %r8       # 0x14400
movsd (%r8), %xmm0
addsd 0x4cf9(%rip), %xmm0     # 0xd008
mulsd 0xb8(%rax), %xmm0
divsd 0x88(%rax), %xmm0
movq 0x8(%rdi), %rdi
movq %rdi, -0x8(%rsp)
movq 0x8(%rcx), %rdi
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %r9
movq 0x8(%rcx), %rcx
movq %rcx, -0x10(%rsp)
movq 0x8(%rsi), %rsi
movq 0x8(%r9), %r9
movq 0x18(%rdi), %rdi
movq 0x8(%rdi), %r10
movabsq $0x1, %r11
xorl %ebx, %ebx
movsd 0x5ea7(%rip), %xmm1     # 0xe208
movsd 0x50ef(%rip), %xmm2     # 0xd458
cmpq $0x4, %r11
je 0x84cd
movq -0x8(%rsp), %rcx
movq -0x8(%rcx,%r11,8), %r14
movq -0x10(%rsp), %rcx
movq -0x8(%rcx,%r11,8), %r15
movq -0x8(%rsi,%r11,8), %r12
movq -0x8(%r9,%r11,8), %r13
movq -0x8(%r10,%r11,8), %rbp
xorl %edi, %edi
cmpq $0x18, %rdi
je 0x84c1
movsd (%r14,%rdi), %xmm3
movsd %xmm3, (%r15,%rdi)
movsd (%r12,%rdi), %xmm4
mulsd 0xc41c(%rip), %xmm4     # 0x147d8
mulsd 0xc41c(%rip), %xmm3     # 0x147e0
addsd %xmm4, %xmm3
movsd %xmm3, (%r13,%rdi)
mulsd 0x90(%rax), %xmm3
divsd 0x88(%rax), %xmm3
movsd %xmm3, (%r13,%rdi)
movsd (%r14,%rdi), %xmm3
movsd 0xc3d4(%rip), %xmm4     # 0x147c8
mulsd (%r12,%rdi), %xmm4
mulsd 0xc3ce(%rip), %xmm3     # 0x147d0
subsd %xmm4, %xmm3
movsd %xmm3, (%rbp,%rdi)
mulsd 0x98(%rax), %xmm3
divsd 0x88(%rax), %xmm3
movsd %xmm3, (%rbp,%rdi)
cmpq %rdi, %rbx
jne 0x8486
movsd (%r8), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movq 0x8(%rdx), %rcx
mulsd (%rcx), %xmm3
addsd (%r15,%rdi), %xmm3
movsd %xmm3, (%r15,%rdi)
movsd (%r8), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd 0x8(%rcx), %xmm3
addsd (%r13,%rdi), %xmm3
movsd %xmm3, (%r13,%rdi)
movsd (%r8), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd 0x10(%rcx), %xmm3
addsd (%rbp,%rdi), %xmm3
movsd %xmm3, (%rbp,%rdi)
movsd (%r15,%rdi), %xmm3
mulsd %xmm0, %xmm3
movsd %xmm3, (%r15,%rdi)
movsd (%r13,%rdi), %xmm3
mulsd %xmm0, %xmm3
movsd %xmm3, (%r13,%rdi)
movsd (%rbp,%rdi), %xmm3
mulsd %xmm0, %xmm3
movsd %xmm3, (%rbp,%rdi)
addq $0x8, %rdi
jmp 0x8398
incq %r11
addq $0x8, %rbx
jmp 0x8369
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq