// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/geometry.c
// Function: Place123_X
void Place123_X(float *Coord1, float *Coord2, float *Coord3, float Dist3X, float Ang23X, 
	       float *CoordX)
{

/*

   Atom1
     \                     AtomX
      \ ^UnVect2            /
       \|                  /
       Atom2----------Atom3->UnVect1

*/

  float Length_23, Length_12;
  float Proj3X_1, Proj3X_2, Proj12_1, Proj12_2, Rad1, Rad2;
  float UnVect1[3], UnVect2[3];
  int i;

  Length_23 = Dist(Coord3,Coord2);
  Length_12 = Dist(Coord2,Coord1);
  Rad1 = RAD(180.0-Ang23X);
  Rad2 = RAD(Ang(Coord1,Coord2,Coord3)-90.0); 
  Proj3X_1 = Dist3X*cos(Rad1);
  Proj3X_2 = Dist3X*sin(Rad1);
  Proj12_2 = cos(Rad2)*Length_12;
  Proj12_1 = sin(Rad2)*Length_12;

  for( i=0; i<3; i++ ) {
    UnVect1[i] = (Coord3[i]-Coord2[i])/Length_23;
    UnVect2[i] = ((Coord1[i]-Coord2[i]) - ( -UnVect1[i]*Proj12_1))/Proj12_2;
  }

  for( i=0; i<3; i++ ) 
    CoordX[i] = Proj3X_1*UnVect1[i]+Proj3X_2*UnVect2[i]+Coord3[i];
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movss %xmm0, 0x5c(%rsp)
movss %xmm1, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x4a30
movss %xmm0, 0x4c(%rsp)
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x4a30
movss %xmm0, 0x48(%rsp)
movss 0x58(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x26590(%rip), %xmm0    # 0x2b810
subsd %xmm1, %xmm0
movsd 0x2658c(%rip), %xmm1    # 0x2b818
mulsd %xmm1, %xmm0
movsd 0x26578(%rip), %xmm1    # 0x2b810
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%rsp)
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0x4ad0
cvtss2sd %xmm0, %xmm0
movsd 0x2655a(%rip), %xmm1    # 0x2b820
subsd %xmm1, %xmm0
movsd 0x26546(%rip), %xmm1    # 0x2b818
mulsd %xmm1, %xmm0
movsd 0x26532(%rip), %xmm1    # 0x2b810
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x5c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movss 0x34(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x20f0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x5c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movss 0x34(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x21b0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x30(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x20f0
movss 0x48(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rsp)
movss 0x30(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x21b0
movss 0x48(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x3c(%rsp)
movl $0x0, 0x14(%rsp)
cmpl $0x3, 0x14(%rsp)
jge 0x5458
movq 0x60(%rsp), %rax
movslq 0x14(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x68(%rsp), %rax
movslq 0x14(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
divss 0x4c(%rsp), %xmm0
movslq 0x14(%rsp), %rax
movss %xmm0, 0x24(%rsp,%rax,4)
movq 0x70(%rsp), %rax
movslq 0x14(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
movq 0x68(%rsp), %rax
movslq 0x14(%rsp), %rcx
subss (%rax,%rcx,4), %xmm1
movslq 0x14(%rsp), %rax
movss 0x24(%rsp,%rax,4), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss 0x3c(%rsp), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
divss 0x38(%rsp), %xmm0
movslq 0x14(%rsp), %rax
movss %xmm0, 0x18(%rsp,%rax,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x53ac
movl $0x0, 0x14(%rsp)
cmpl $0x3, 0x14(%rsp)
jge 0x54bc
movss 0x44(%rsp), %xmm0
movslq 0x14(%rsp), %rax
movss 0x24(%rsp,%rax,4), %xmm2
movss 0x40(%rsp), %xmm1
movslq 0x14(%rsp), %rax
mulss 0x18(%rsp,%rax,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x60(%rsp), %rax
movslq 0x14(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movq 0x50(%rsp), %rax
movslq 0x14(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x5460
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)