// File: /workspace/github_c_makefile_star2_O2/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 0xc3a0
movq %rax, %r12
testq %r12, %r12
je 0x9d06
movq 0x8(%r15), %rax
movslq 0x14(%r12), %rcx
movq (%rax,%rcx,8), %rdi
movsd 0x4311(%rip), %xmm0     # 0xdfd0
callq 0xb77b
movq 0x8(%r14), %rax
movslq 0x14(%r12), %rcx
movq (%rax,%rcx,8), %rdi
movsd 0x42f7(%rip), %xmm0     # 0xdfd0
callq 0xb77b
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
jmp 0x9ca5
movl 0xab7c(%rip), %eax      # 0x14888
leaq 0xa72d(%rip), %rcx      # 0x14440
movq (%rcx), %rcx
leaq 0xa71b(%rip), %rdx      # 0x14438
movq (%rdx), %rdx
xorl %esi, %esi
testl %eax, %eax
cmovlel %esi, %eax
pushq $0x10
popq %rdi
cmpq %rsi, %rax
je 0x9e42
movq 0x8(%rcx), %r8
movsd -0x10(%r8,%rdi), %xmm0
movq 0x8(%r14), %r9
movq 0x8(%r9,%rsi,8), %r9
movq 0x8(%r9), %r11
movq (%r11), %r15
movq 0x8(%rdx), %r9
movslq 0x10(%rbx), %r10
mulsd (%r15), %xmm0
imulq $0x18, %r10, %r10
addsd -0x18(%r9,%r10), %xmm0
movsd %xmm0, -0x18(%r9,%r10)
movsd -0x8(%r8,%rdi), %xmm1
mulsd 0x8(%r15), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x18(%r9,%r10)
movsd (%r8,%rdi), %xmm0
mulsd 0x10(%r15), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%r9,%r10)
movsd -0x10(%r8,%rdi), %xmm0
movq 0x8(%r11), %r15
mulsd (%r15), %xmm0
addsd -0x10(%r9,%r10), %xmm0
movsd %xmm0, -0x10(%r9,%r10)
movsd -0x8(%r8,%rdi), %xmm1
mulsd 0x8(%r15), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x10(%r9,%r10)
movsd (%r8,%rdi), %xmm0
mulsd 0x10(%r15), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%r9,%r10)
movsd -0x10(%r8,%rdi), %xmm0
movq 0x10(%r11), %r11
mulsd (%r11), %xmm0
addsd -0x8(%r9,%r10), %xmm0
movsd %xmm0, -0x8(%r9,%r10)
movsd -0x8(%r8,%rdi), %xmm1
mulsd 0x8(%r11), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x8(%r9,%r10)
movsd (%r8,%rdi), %xmm0
mulsd 0x10(%r11), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%r9,%r10)
addq $0x18, %rdi
incq %rsi
jmp 0x9d2a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq