// File: /workspace/github_c_makefile_star2_O3/markpeerdeman[P]mbemm/src/emath/linearc.c
// Function: remap
void remap(hypermatrix crow, hypermatrix erow, point sourcenode, mesh theMesh)
{ restraint d;
  matrix tmp;
  int i;

  /* swap some matrix items: */
  d=(restraint)restraint_dll(theMesh->mesh_d,START,0);
  while (d!=(restraint)NULL)
  { scalemat3x3(erow->data[d->label],-1.0);
    scalemat3x3(crow->data[d->label],-1.0);
    tmp = erow->data[d->label];
    erow->data[d->label]=crow->data[d->label];
    crow->data[d->label]=tmp;
    d=d->NEXT;
  }

  /* multiply the known side away: */
  for (i=1; i<=n_nodes; i++)
  { V(main_f,sourcenode->label*3-2)+=V(main_u,i*3-2)*H(crow,1,1,i);
    V(main_f,sourcenode->label*3-2)+=V(main_u,i*3-1)*H(crow,1,2,i);
    V(main_f,sourcenode->label*3-2)+=V(main_u,i*3  )*H(crow,1,3,i);

    V(main_f,sourcenode->label*3-1)+=V(main_u,i*3-2)*H(crow,2,1,i);
    V(main_f,sourcenode->label*3-1)+=V(main_u,i*3-1)*H(crow,2,2,i);
    V(main_f,sourcenode->label*3-1)+=V(main_u,i*3  )*H(crow,2,3,i);

    V(main_f,sourcenode->label*3  )+=V(main_u,i*3-2)*H(crow,3,1,i);
    V(main_f,sourcenode->label*3  )+=V(main_u,i*3-1)*H(crow,3,2,i);
    V(main_f,sourcenode->label*3  )+=V(main_u,i*3  )*H(crow,3,3,i);
  }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rcx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xcee9
testq %rax, %rax
je 0xa668
movq %rax, %r12
movq 0x8(%r15), %rax
movslq 0x14(%r12), %rcx
movq (%rax,%rcx,8), %rdi
movsd 0x49e2(%rip), %xmm0     # 0xf000
callq 0xc288
movq 0x8(%r14), %rax
movslq 0x14(%r12), %rcx
movq (%rax,%rcx,8), %rdi
movsd 0x49c8(%rip), %xmm0     # 0xf000
callq 0xc288
movq 0x8(%r15), %rax
movslq 0x14(%r12), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%r14), %rsi
movq (%rsi,%rcx,8), %rsi
movq %rsi, (%rax,%rcx,8)
movq 0x8(%r14), %rax
movq %rdx, (%rax,%rcx,8)
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0xa609
movl 0xb22a(%rip), %eax      # 0x15898
testl %eax, %eax
jle 0xa797
leaq 0xadd3(%rip), %rcx      # 0x15450
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%r14), %rdx
leaq 0xadb9(%rip), %rsi      # 0x15448
movq (%rsi), %rsi
movq 0x8(%rsi), %rsi
movslq 0x10(%rbx), %rdi
leaq (%rdi,%rdi,2), %rdi
movsd -0x18(%rsi,%rdi,8), %xmm0
movsd -0x10(%rsi,%rdi,8), %xmm1
movsd -0x8(%rsi,%rdi,8), %xmm2
incq %rax
addq $0x10, %rcx
movl $0x1, %r8d
movsd -0x10(%rcx), %xmm3
movq (%rdx,%r8,8), %r9
movq 0x8(%r9), %r9
movq (%r9), %r10
mulsd (%r10), %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, -0x18(%rsi,%rdi,8)
movsd -0x8(%rcx), %xmm4
mulsd 0x8(%r10), %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, -0x18(%rsi,%rdi,8)
movsd (%rcx), %xmm0
mulsd 0x10(%r10), %xmm0
addsd %xmm4, %xmm0
movsd %xmm0, -0x18(%rsi,%rdi,8)
movsd -0x10(%rcx), %xmm3
movq 0x8(%r9), %r10
mulsd (%r10), %xmm3
addsd %xmm1, %xmm3
movsd %xmm3, -0x10(%rsi,%rdi,8)
movsd -0x8(%rcx), %xmm4
mulsd 0x8(%r10), %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, -0x10(%rsi,%rdi,8)
movsd (%rcx), %xmm1
mulsd 0x10(%r10), %xmm1
addsd %xmm4, %xmm1
movsd %xmm1, -0x10(%rsi,%rdi,8)
movsd -0x10(%rcx), %xmm3
movq 0x10(%r9), %r9
mulsd (%r9), %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, -0x8(%rsi,%rdi,8)
movsd -0x8(%rcx), %xmm4
mulsd 0x8(%r9), %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, -0x8(%rsi,%rdi,8)
movsd (%rcx), %xmm2
mulsd 0x10(%r9), %xmm2
addsd %xmm4, %xmm2
movsd %xmm2, -0x8(%rsi,%rdi,8)
incq %r8
addq $0x18, %rcx
cmpq %r8, %rax
jne 0xa6bd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq