// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/geometry.c
// Function: Project4_123
void Project4_123(float *Coord1, float *Coord2, float *Coord3, float *Coord4, 
		 float *Coord_Proj4_123)
{

/*
                          Atom4
   Atom3                  .
   \                     .
    \                   .    
     \                 .  .Proj4_123
      \               .. 
      Atom2-------Atom1

*/


  float Vector21[3], Vector23[3], Vector14[3], VectorNormal_123[3];
  float Length_21 = 0.0, Length_23 = 0.0, Length_14 = 0.0, NormalLength;
  float COS_Norm_14, Proj_14_Norm;
  int i;

  for( i=0; i<3; i++ ) {
    Vector21[i] = Coord1[i] - Coord2[i];
    Vector23[i] = Coord3[i] - Coord2[i];
    Vector14[i] = Coord4[i] - Coord1[i];
    Length_21 += Vector21[i]*Vector21[i];
    Length_23 += Vector23[i]*Vector23[i];
    Length_14 += Vector14[i]*Vector14[i];
  }
  
  Length_21 = sqrt(Length_21);
  Length_23 = sqrt(Length_23);
  Length_14 = sqrt(Length_14);

  NormalLength = VectorProduct(Vector21,Vector23,VectorNormal_123);

  for( i=0; i<3; i++ ) 
    VectorNormal_123[i] /= NormalLength;

  COS_Norm_14 = 0.0;

  for( i=0; i<3; i++ ) 
    COS_Norm_14 += VectorNormal_123[i]*Vector14[i];

  COS_Norm_14 /= (Length_14*NormalLength);

  if( COS_Norm_14 < 0.0 ) {
    COS_Norm_14 = fabs(COS_Norm_14);
    for( i=0; i<3; i++ ) 
      VectorNormal_123[i] = -VectorNormal_123[i];
  }

  Proj_14_Norm = Length_14*COS_Norm_14;

  for( i=0; i<3; i++ ) {
    VectorNormal_123[i] *= Proj_14_Norm;
    Coord_Proj4_123[i] = (Vector14[i] - VectorNormal_123[i]) + Coord1[i];
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x3, 0x4(%rsp)
jge 0x5734
movq 0x70(%rsp), %rax
movslq 0x4(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x68(%rsp), %rax
movslq 0x4(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movslq 0x4(%rsp), %rax
movss %xmm0, 0x44(%rsp,%rax,4)
movq 0x60(%rsp), %rax
movslq 0x4(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x68(%rsp), %rax
movslq 0x4(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movslq 0x4(%rsp), %rax
movss %xmm0, 0x38(%rsp,%rax,4)
movq 0x58(%rsp), %rax
movslq 0x4(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x70(%rsp), %rax
movslq 0x4(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movslq 0x4(%rsp), %rax
movss %xmm0, 0x2c(%rsp,%rax,4)
movslq 0x4(%rsp), %rax
movss 0x44(%rsp,%rax,4), %xmm0
movslq 0x4(%rsp), %rax
movss 0x44(%rsp,%rax,4), %xmm2
movss 0x1c(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movslq 0x4(%rsp), %rax
movss 0x38(%rsp,%rax,4), %xmm0
movslq 0x4(%rsp), %rax
movss 0x38(%rsp,%rax,4), %xmm2
movss 0x18(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x18(%rsp)
movslq 0x4(%rsp), %rax
movss 0x2c(%rsp,%rax,4), %xmm0
movslq 0x4(%rsp), %rax
movss 0x2c(%rsp,%rax,4), %xmm2
movss 0x14(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x5620
movss 0x1c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x2220
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x18(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x2220
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x14(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x2220
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
leaq 0x44(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x54d0
movss %xmm0, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x3, 0x4(%rsp)
jge 0x57d0
movss 0x10(%rsp), %xmm1
movslq 0x4(%rsp), %rax
movss 0x20(%rsp,%rax,4), %xmm0
divss %xmm1, %xmm0
movss %xmm0, 0x20(%rsp,%rax,4)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x57a1
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x3, 0x4(%rsp)
jge 0x581f
movslq 0x4(%rsp), %rax
movss 0x20(%rsp,%rax,4), %xmm0
movslq 0x4(%rsp), %rax
movss 0x2c(%rsp,%rax,4), %xmm2
movss 0xc(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x57e1
movss 0x14(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movss 0xc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x58ae
movss 0xc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0x25ff1(%rip), %xmm1    # 0x2b850
pand %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x3, 0x4(%rsp)
jge 0x58ac
movslq 0x4(%rsp), %rax
movss 0x20(%rsp,%rax,4), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movslq 0x4(%rsp), %rax
movss %xmm0, 0x20(%rsp,%rax,4)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x5875
jmp 0x58ae
movss 0x14(%rsp), %xmm0
mulss 0xc(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x3, 0x4(%rsp)
jge 0x5927
movss 0x8(%rsp), %xmm0
movslq 0x4(%rsp), %rax
mulss 0x20(%rsp,%rax,4), %xmm0
movss %xmm0, 0x20(%rsp,%rax,4)
movslq 0x4(%rsp), %rax
movss 0x2c(%rsp,%rax,4), %xmm0
movslq 0x4(%rsp), %rax
subss 0x20(%rsp,%rax,4), %xmm0
movq 0x70(%rsp), %rax
movslq 0x4(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movq 0x50(%rsp), %rax
movslq 0x4(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x58c8
addq $0x78, %rsp
retq
nopl (%rax)