// File: /workspace/github_c_makefile_star2_O0/markpeerdeman[P]mbemm/src/emath/singular.c
// Function: rotate_element
int rotate_element( const element e, const int l )
{ /* IN:          element e, integer l
   * OUT:         the number of node rotations applied, i.e. 0, 1 or 2.
   * USES:        theElement
   * MODIFIES:    theElement
   * DESCRIPTION: The function rotates the nodes with associated data in the
   *              element structure in such a way that the singular point 
   *              coincides with node 1 of the element e.
   */
int i;  /* :temporary variabeles: */
double r;


   if (e->p1==l) 
   { /* printf("No targeting applied.\n"); */
	 return(0); /* no rotation necessary */
   }

   if (e->p2==l)
   { /* rotate once: */
	  /* printf("Rotating over one node.\n"); */
	  i=theElement->p3;
	  theElement->p3=theElement->p1; theElement->p1=theElement->p2;
	  theElement->p2=i;
	  r=theElement->alpha3;
	  theElement->alpha3=theElement->alpha1;
	  theElement->alpha1=theElement->alpha2;
	  theElement->alpha2=r;
	  r=theElement->z3;
	  theElement->z3=theElement->z1; theElement->z1=theElement->z2;
	  theElement->z2=r;
	  r=theElement->p3x;
	  theElement->p3x=theElement->p1x; theElement->p1x=theElement->p2x;
	  theElement->p2x=r;
	  r=theElement->p3y;
	  theElement->p3y=theElement->p1y; theElement->p1y=theElement->p2y;
	  theElement->p2y=r;
	  r=theElement->p3z;
	  theElement->p3z=theElement->p1z; theElement->p1z=theElement->p2z;
	  theElement->p2z=r;
	  return(1); /* after rotating once. */
   }
   if (e->p3==l)
   { /* rotate twice: */
	  /* printf("Rotating over two nodes.\n"); */
	  i=theElement->p1;
	  theElement->p1=theElement->p3; theElement->p3=theElement->p2;
	  theElement->p2=i;
	  r=theElement->alpha1;
	  theElement->alpha1=theElement->alpha3;
	  theElement->alpha3=theElement->alpha2;
	  theElement->alpha2=r;
	  r=theElement->z1;
	  theElement->z1=theElement->z3; theElement->z3=theElement->z2;
	  theElement->z2=r;
	  r=theElement->p1x;
	  theElement->p1x=theElement->p3x; theElement->p3x=theElement->p2x;
	  theElement->p2x=r;
	  r=theElement->p1y;
	  theElement->p1y=theElement->p3y; theElement->p3y=theElement->p2y;
	  theElement->p2y=r;
	  r=theElement->p1z;
	  theElement->p1z=theElement->p3z; theElement->p3z=theElement->p2z;
	  theElement->p2z=r;
	  return(2);
   }
   return(-1);
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movq -0x10(%rsp), %rax
movl 0x18(%rax), %eax
cmpl -0x14(%rsp), %eax
jne 0xdd64
movl $0x0, -0x4(%rsp)
jmp 0xe1a7
movq -0x10(%rsp), %rax
movl 0x1c(%rax), %eax
cmpl -0x14(%rsp), %eax
jne 0xdf83
movq 0x10a13(%rip), %rax     # 0x1e790
movl 0x20(%rax), %eax
movl %eax, -0x18(%rsp)
movq 0x10a05(%rip), %rax     # 0x1e790
movl 0x18(%rax), %ecx
movq 0x109fb(%rip), %rax     # 0x1e790
movl %ecx, 0x20(%rax)
movq 0x109f1(%rip), %rax     # 0x1e790
movl 0x1c(%rax), %ecx
movq 0x109e7(%rip), %rax     # 0x1e790
movl %ecx, 0x18(%rax)
movl -0x18(%rsp), %ecx
movq 0x109d9(%rip), %rax     # 0x1e790
movl %ecx, 0x1c(%rax)
movq 0x109cf(%rip), %rax     # 0x1e790
movsd 0x80(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x109ba(%rip), %rax     # 0x1e790
movsd 0x70(%rax), %xmm0
movq 0x109ae(%rip), %rax     # 0x1e790
movsd %xmm0, 0x80(%rax)
movq 0x1099f(%rip), %rax     # 0x1e790
movsd 0x78(%rax), %xmm0
movq 0x10993(%rip), %rax     # 0x1e790
movsd %xmm0, 0x70(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x10981(%rip), %rax     # 0x1e790
movsd %xmm0, 0x78(%rax)
movq 0x10975(%rip), %rax     # 0x1e790
movsd 0x98(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x10960(%rip), %rax     # 0x1e790
movsd 0x88(%rax), %xmm0
movq 0x10951(%rip), %rax     # 0x1e790
movsd %xmm0, 0x98(%rax)
movq 0x10942(%rip), %rax     # 0x1e790
movsd 0x90(%rax), %xmm0
movq 0x10933(%rip), %rax     # 0x1e790
movsd %xmm0, 0x88(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x1091e(%rip), %rax     # 0x1e790
movsd %xmm0, 0x90(%rax)
movq 0x1090f(%rip), %rax     # 0x1e790
movsd 0x58(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x108fd(%rip), %rax     # 0x1e790
movsd 0x28(%rax), %xmm0
movq 0x108f1(%rip), %rax     # 0x1e790
movsd %xmm0, 0x58(%rax)
movq 0x108e5(%rip), %rax     # 0x1e790
movsd 0x40(%rax), %xmm0
movq 0x108d9(%rip), %rax     # 0x1e790
movsd %xmm0, 0x28(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x108c7(%rip), %rax     # 0x1e790
movsd %xmm0, 0x40(%rax)
movq 0x108bb(%rip), %rax     # 0x1e790
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x108a9(%rip), %rax     # 0x1e790
movsd 0x30(%rax), %xmm0
movq 0x1089d(%rip), %rax     # 0x1e790
movsd %xmm0, 0x60(%rax)
movq 0x10891(%rip), %rax     # 0x1e790
movsd 0x48(%rax), %xmm0
movq 0x10885(%rip), %rax     # 0x1e790
movsd %xmm0, 0x30(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x10873(%rip), %rax     # 0x1e790
movsd %xmm0, 0x48(%rax)
movq 0x10867(%rip), %rax     # 0x1e790
movsd 0x68(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x10855(%rip), %rax     # 0x1e790
movsd 0x38(%rax), %xmm0
movq 0x10849(%rip), %rax     # 0x1e790
movsd %xmm0, 0x68(%rax)
movq 0x1083d(%rip), %rax     # 0x1e790
movsd 0x50(%rax), %xmm0
movq 0x10831(%rip), %rax     # 0x1e790
movsd %xmm0, 0x38(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x1081f(%rip), %rax     # 0x1e790
movsd %xmm0, 0x50(%rax)
movl $0x1, -0x4(%rsp)
jmp 0xe1a7
movq -0x10(%rsp), %rax
movl 0x20(%rax), %eax
cmpl -0x14(%rsp), %eax
jne 0xe19f
movq 0x107f4(%rip), %rax     # 0x1e790
movl 0x18(%rax), %eax
movl %eax, -0x18(%rsp)
movq 0x107e6(%rip), %rax     # 0x1e790
movl 0x20(%rax), %ecx
movq 0x107dc(%rip), %rax     # 0x1e790
movl %ecx, 0x18(%rax)
movq 0x107d2(%rip), %rax     # 0x1e790
movl 0x1c(%rax), %ecx
movq 0x107c8(%rip), %rax     # 0x1e790
movl %ecx, 0x20(%rax)
movl -0x18(%rsp), %ecx
movq 0x107ba(%rip), %rax     # 0x1e790
movl %ecx, 0x1c(%rax)
movq 0x107b0(%rip), %rax     # 0x1e790
movsd 0x70(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x1079e(%rip), %rax     # 0x1e790
movsd 0x80(%rax), %xmm0
movq 0x1078f(%rip), %rax     # 0x1e790
movsd %xmm0, 0x70(%rax)
movq 0x10783(%rip), %rax     # 0x1e790
movsd 0x78(%rax), %xmm0
movq 0x10777(%rip), %rax     # 0x1e790
movsd %xmm0, 0x80(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x10762(%rip), %rax     # 0x1e790
movsd %xmm0, 0x78(%rax)
movq 0x10756(%rip), %rax     # 0x1e790
movsd 0x88(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x10741(%rip), %rax     # 0x1e790
movsd 0x98(%rax), %xmm0
movq 0x10732(%rip), %rax     # 0x1e790
movsd %xmm0, 0x88(%rax)
movq 0x10723(%rip), %rax     # 0x1e790
movsd 0x90(%rax), %xmm0
movq 0x10714(%rip), %rax     # 0x1e790
movsd %xmm0, 0x98(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x106ff(%rip), %rax     # 0x1e790
movsd %xmm0, 0x90(%rax)
movq 0x106f0(%rip), %rax     # 0x1e790
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x106de(%rip), %rax     # 0x1e790
movsd 0x58(%rax), %xmm0
movq 0x106d2(%rip), %rax     # 0x1e790
movsd %xmm0, 0x28(%rax)
movq 0x106c6(%rip), %rax     # 0x1e790
movsd 0x40(%rax), %xmm0
movq 0x106ba(%rip), %rax     # 0x1e790
movsd %xmm0, 0x58(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x106a8(%rip), %rax     # 0x1e790
movsd %xmm0, 0x40(%rax)
movq 0x1069c(%rip), %rax     # 0x1e790
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x1068a(%rip), %rax     # 0x1e790
movsd 0x60(%rax), %xmm0
movq 0x1067e(%rip), %rax     # 0x1e790
movsd %xmm0, 0x30(%rax)
movq 0x10672(%rip), %rax     # 0x1e790
movsd 0x48(%rax), %xmm0
movq 0x10666(%rip), %rax     # 0x1e790
movsd %xmm0, 0x60(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x10654(%rip), %rax     # 0x1e790
movsd %xmm0, 0x48(%rax)
movq 0x10648(%rip), %rax     # 0x1e790
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movq 0x10636(%rip), %rax     # 0x1e790
movsd 0x68(%rax), %xmm0
movq 0x1062a(%rip), %rax     # 0x1e790
movsd %xmm0, 0x38(%rax)
movq 0x1061e(%rip), %rax     # 0x1e790
movsd 0x50(%rax), %xmm0
movq 0x10612(%rip), %rax     # 0x1e790
movsd %xmm0, 0x68(%rax)
movsd -0x20(%rsp), %xmm0
movq 0x10600(%rip), %rax     # 0x1e790
movsd %xmm0, 0x50(%rax)
movl $0x2, -0x4(%rsp)
jmp 0xe1a7
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
movl -0x4(%rsp), %eax
retq
nopl (%rax)