// File: /workspace/github_cpp_makefile_star2_O1/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 0x85bb4
leaq 0xa0(%rsp), %rdi
movq %rbp, %rsi
callq 0x85a82
leaq 0x68(%r15), %rbp
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x85bb4
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x85a82
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x85bb4
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x85a82
leaq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x85436
leaq 0x38(%rsp), %r14
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r14, %rdi
callq 0x85436
leaq 0xd0(%rsp), %r12
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r12, %rdi
callq 0x85436
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 0x52144
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 0x85436
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4ba43
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 0x4ba50
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x5052c
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x85436
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4bab5
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 0x4bac2
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x5052c
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x80(%rsp), %xmm2
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x85436
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4bb21
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 0x4bb2e
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x5052c
leaq 0xb8(%rsp), %r12
movsd 0x10351a(%rip), %xmm0   # 0x14f058
movq %r12, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x85436
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 0x52144
movq 0x10(%r12), %rax
movq %rax, 0x30(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movaps 0x107a26(%rip), %xmm3   # 0x1535b0
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 0x85436
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4bbf6
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 0x4bc03
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x5052c
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
movaps 0x10798b(%rip), %xmm3   # 0x1535b0
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x85436
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4bc76
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 0x4bc83
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x5052c
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x80(%rsp), %xmm2
movaps 0x107911(%rip), %xmm3   # 0x1535b0
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x85436
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4bcf0
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 0x4bcfd
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x5052c
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq