// File: /workspace/github_cpp_makefile_star2_O1/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 0x85fc2
movsd 0x18(%r15), %xmm0
movsd %xmm0, 0x18(%rbx)
leaq 0x28(%rbx), %rdi
leaq 0x8(%r14), %rsi
callq 0x74c36
leaq 0xa8(%rbx), %rdi
leaq 0x88(%r14), %rsi
callq 0x74c36
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 0x977b2
movq %r15, %rdi
movq %r12, %rsi
callq 0x91fce
leaq 0x208(%rbx), %rdi
leaq 0xbfa16(%rip), %r12     # 0x1359c8
leaq 0x8(%r12), %rsi
callq 0x850ec
leaq 0x220(%rbx), %rdi
addq $0x20, %r12
movq %r12, %rsi
callq 0x850ec
leaq 0x70(%rsp), %r12
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %r12, %rdi
callq 0xa3776
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 0xa3776
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x99214
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x99214
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xa0992
movsd 0x8(%r15), %xmm0
movsd 0x10(%r15), %xmm1
leaq 0x70(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x84d7e
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x856ac
addq $0x200, %rbx            # imm = 0x200
leaq 0x70(%rsp), %rsi
movq %rbx, %rdi
callq 0x6e9a6
movsd 0x8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
leaq 0x58(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x84d7e
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x856ac
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x6e9a6
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
leaq 0x40(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x84d7e
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x856ac
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x6e9a6
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
leaq 0x28(%rsp), %rdi
xorps %xmm2, %xmm2
callq 0x84d7e
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x856ac
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x6e9a6
movq %rsp, %rdi
callq 0xa12e4
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7614a
jmp 0x7614a
jmp 0x7614a
movq %rax, %rbx
movq %rsp, %rdi
callq 0xa12e4
movq %rbx, %rdi
callq 0x138b0
nop