// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/ray.cc
// Function: calcPlanesToCell(ATOM_NETWORK*, std::vector<Plane, std::allocator<Plane>>&)
void calcPlanesToCell(ATOM_NETWORK *cell,vector<Plane> &p)
{
  XYZ norm1 = cell->v_a.cross(cell->v_b).unit();
  XYZ norm2 = cell->v_c.cross(cell->v_a).unit();
  XYZ norm3 = cell->v_b.cross(cell->v_c).unit();
  
  Plane face;
  //Each face with abc point 0,0,0
  face.point = cell->abc_to_xyz(Point(0,0,0));
  
  face.normal = Point(norm1.x,norm1.y,norm1.z);
  p.push_back(face);
  
  face.normal = Point(norm2.x,norm2.y,norm2.z);
  p.push_back(face);
  
  face.normal = Point(norm3.x,norm3.y,norm3.z);
  p.push_back(face);
  
  //Each face with point abc point 1,1,1 (Notice that normals are reversed this is so that a vector can easily be determined if
  //it hit within the unit cell
  face.point = cell->abc_to_xyz(Point(1,1,1));
  
  face.normal = Point(-norm1.x,-norm1.y,-norm1.z);
  p.push_back(face);
  
  face.normal = Point(-norm2.x,-norm2.y,-norm2.z);
  p.push_back(face);
  
  face.normal = Point(-norm3.x,-norm3.y,-norm3.z);
  p.push_back(face);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x38(%rdi), %r13
leaq 0x50(%rdi), %r14
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x844a2
leaq 0xa0(%rsp), %rdi
movq %rbp, %rsi
callq 0x84458
leaq 0x68(%r15), %rbp
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x844a2
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x84458
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x844a2
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x84458
leaq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x83f68
leaq 0x38(%rsp), %r14
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r14, %rdi
callq 0x83f68
leaq 0xd0(%rsp), %r12
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r12, %rdi
callq 0x83f68
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x51d04
movq 0x10(%r12), %rax
movq %rax, -0x8(%r14)
movups (%r12), %xmm0
movaps %xmm0, -0x18(%r14)
leaq 0xa0(%rsp), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x83f68
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4b757
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x30, 0x8(%rbx)
jmp 0x4b764
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x50204
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x83f68
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4b7c9
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x30, 0x8(%rbx)
jmp 0x4b7d6
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x50204
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x80(%rsp), %xmm2
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x83f68
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4b835
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x30, 0x8(%rbx)
jmp 0x4b842
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x50204
leaq 0xb8(%rsp), %r12
movsd 0x101806(%rip), %xmm0   # 0x14d058
movq %r12, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x83f68
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x51d04
movq 0x10(%r12), %rax
movq %rax, 0x30(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movaps 0x105da2(%rip), %xmm3   # 0x151640
movsd 0xa0(%rsp), %xmm0
movsd 0xa8(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm2
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x83f68
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4b90a
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x30, 0x8(%rbx)
jmp 0x4b917
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x50204
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
movaps 0x105d07(%rip), %xmm3   # 0x151640
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x83f68
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4b98a
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x30, 0x8(%rbx)
jmp 0x4b997
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x50204
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x80(%rsp), %xmm2
movaps 0x105c8d(%rip), %xmm3   # 0x151640
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x83f68
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4ba04
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x30, 0x8(%rbx)
jmp 0x4ba11
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x50204
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq