// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PlanarGrid.cpp
// Function: gaps::R3PlanarGrid::Reset(gaps::R3Plane const&, gaps::R3Affine const&, int, int, gaps::R2Box const&)
void R3PlanarGrid::
Reset(const R3Plane& plane, 
  const R3Affine& world_to_xyplane, 
  int xres, int yres, const R2Box& xyplane_bbox)
{
  // Update stuff
  this->plane = plane;
  this->transformation = world_to_xyplane;
  this->grid.Resample(xres, yres);
  this->grid.SetWorldToGridTransformation(xyplane_bbox);
  
  // Update world bbox
  bbox = R3null_box;
  R2Box xybox = grid.WorldBox();
  R3Point p00(xybox[0][0], xybox[0][1], 0); p00.InverseTransform(world_to_xyplane); bbox.Union(p00);
  R3Point p01(xybox[0][0], xybox[1][1], 0); p01.InverseTransform(world_to_xyplane); bbox.Union(p01);
  R3Point p10(xybox[1][0], xybox[0][1], 0); p10.InverseTransform(world_to_xyplane); bbox.Union(p10);
  R3Point p11(xybox[1][0], xybox[1][1], 0); p11.InverseTransform(world_to_xyplane); bbox.Union(p11);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, %r12
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x84fe2
movsd 0x18(%r15), %xmm0
movsd %xmm0, 0x18(%rbx)
leaq 0x28(%rbx), %rdi
leaq 0x8(%r14), %rsi
callq 0x73f22
leaq 0xa8(%rbx), %rdi
leaq 0x88(%r14), %rsi
callq 0x73f22
movq 0x108(%r14), %rax
movq %rax, 0x128(%rbx)
leaq 0x130(%rbx), %r15
movq %r15, %rdi
movl %r13d, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x96588
movq %r15, %rdi
movq %r12, %rsi
callq 0x90e72
leaq 0x208(%rbx), %rdi
leaq 0xbf72a(%rip), %r12     # 0x1349c8
leaq 0x8(%r12), %rsi
callq 0x8412a
leaq 0x220(%rbx), %rdi
addq $0x20, %r12
movq %r12, %rsi
callq 0x8412a
leaq 0x70(%rsp), %r12
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %r12, %rdi
callq 0xa2542
movl 0x1f0(%rbx), %eax
decl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl 0x1f4(%rbx), %eax
decl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
leaq 0x58(%rsp), %r13
movq %r13, %rdi
callq 0xa2542
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x97fd0
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x97fd0
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x9f766
movsd 0x8(%r15), %xmm0
movsd 0x10(%r15), %xmm1
leaq 0x70(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x83dc2
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x846ea
addq $0x200, %rbx            # imm = 0x200
leaq 0x70(%rsp), %rsi
movq %rbx, %rdi
callq 0x6dd46
movsd 0x8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
leaq 0x58(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x83dc2
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x846ea
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x6dd46
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
leaq 0x40(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x83dc2
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x846ea
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x6dd46
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
leaq 0x28(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x83dc2
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x846ea
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x6dd46
movq %rsp, %rdi
callq 0xa00b0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x75436
jmp 0x75436
jmp 0x75436
movq %rax, %rbx
movq %rsp, %rdi
callq 0xa00b0
movq %rbx, %rdi
callq 0x138b0
nop