// File: 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
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
addq $0x38, %rsi
movq -0x8(%rbp), %rdx
addq $0x50, %rdx
leaq -0x40(%rbp), %rdi
callq 0xeab30
leaq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xeaa90
movq -0x8(%rbp), %rsi
addq $0x68, %rsi
movq -0x8(%rbp), %rdx
addq $0x38, %rdx
leaq -0x70(%rbp), %rdi
callq 0xeab30
leaq -0x58(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xeaa90
movq -0x8(%rbp), %rsi
addq $0x50, %rsi
movq -0x8(%rbp), %rdx
addq $0x68, %rdx
leaq -0xa0(%rbp), %rdi
callq 0xeab30
leaq -0x88(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xeaa90
leaq -0xd0(%rbp), %rdi
callq 0x91c80
movq -0x8(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x100(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
movq -0x1d0(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
leaq -0x100(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x961d0
movq -0xe8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
movsd -0x18(%rbp), %xmm2
leaq -0x118(%rbp), %rdi
callq 0xe9c70
movq -0x118(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x91cc0
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
leaq -0x130(%rbp), %rdi
callq 0xe9c70
movq -0x130(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x91cc0
movsd -0x88(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
movsd -0x78(%rbp), %xmm2
leaq -0x148(%rbp), %rdi
callq 0xe9c70
movq -0x148(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x91cc0
movq -0x8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x178(%rbp), %rdi
movsd 0x16552d(%rip), %xmm2   # 0x1f2050
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
movq -0x1c8(%rbp), %rsi
leaq -0x160(%rbp), %rdi
leaq -0x178(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x961d0
movq -0x160(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0xc0(%rbp)
movsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x20(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd -0x18(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
leaq -0x190(%rbp), %rdi
callq 0xe9c70
movq -0x190(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x91cc0
movsd -0x58(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x50(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd -0x48(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
leaq -0x1a8(%rbp), %rdi
callq 0xe9c70
movq -0x1a8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x1a0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x91cc0
movsd -0x88(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x80(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd -0x78(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
leaq -0x1c0(%rbp), %rdi
callq 0xe9c70
movq -0x1c0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x1b8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x91cc0
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
nopw %cs:(%rax,%rax)