LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Intersects(gaps::R3Ray const&, gaps::R3Shape**, gaps::R3Point*, gaps::R3Vector*, double*, double, double) const
RNBoolean R3SceneElement::
Intersects(const R3Ray& ray, R3Shape **hit_shape,
  R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t,
  RNScalar min_t, RNScalar max_t) const
{
  // Variables
  RNScalar bbox_t;
  RNScalar closest_t = max_t;
  R3Point point;
  R3Vector normal;
  RNScalar t;

  // Check if ray intersects bounding box
  if (!R3Intersects(ray, BBox(), NULL, NULL, &bbox_t)) return FALSE;
  if (RNIsGreater(bbox_t, max_t)) return FALSE;

  // Intersect with shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    if (shape->Intersects(ray, &point, &normal, &t)) {
      if ((t >= min_t) && (t <= closest_t)) {
        if (hit_shape) *hit_shape = shape;
        if (hit_point) *hit_point = point;
        if (hit_normal) *hit_normal = normal;
        if (hit_t) *hit_t = t;
        closest_t = t;
      }
    }
  }

  // Return whether hit any shape
  return (closest_t == max_t) ? FALSE : TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movsd %xmm1, (%rsp)
movsd %xmm0, 0x38(%rsp)
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, 0x30(%rsp)
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x60(%rsp), %rdi
callq 0x762b8
leaq 0x48(%rsp), %rdi
callq 0x76d50
movsd 0x30(%rbp), %xmm0
ucomisd 0x9fc76(%rip), %xmm0    # 0xddba0
jne 0x3df36
jp 0x3df36
movq %rbp, %rdi
callq 0x3e114
leaq 0x28(%rbp), %rsi
xorl %ebx, %ebx
leaq 0x40(%rsp), %r8
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4870a
testl %eax, %eax
je 0x3e074
movsd 0x40(%rsp), %xmm0
leaq 0x102176(%rip), %rax    # 0x1400d8
movsd (%rsp), %xmm1
subsd %xmm1, %xmm0
ucomisd (%rax), %xmm0
ja 0x3e074
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
cmpl $0x0, 0x1c(%rbp)
movsd %xmm1, 0x8(%rsp)
jle 0x3e061
xorl %r15d, %r15d
leaq 0x60(%rsp), %rbx
leaq 0x48(%rsp), %r14
movsd %xmm1, 0x8(%rsp)
movq 0x10(%rbp), %rax
movq (%rax,%r15,8), %r12
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
leaq 0x10(%rsp), %r8
callq *0x1d8(%rax)
testl %eax, %eax
je 0x3e04c
movsd 0x10(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
jb 0x3e04c
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movsd (%rsp), %xmm1
jb 0x3e051
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x3dffa
movq %r12, (%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
movq 0x28(%rsp), %r12
je 0x3e016
movq %rbx, %rsi
callq 0x76628
movsd (%rsp), %xmm1
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3e02d
movq %r14, %rsi
callq 0x774fe
movsd (%rsp), %xmm1
testq %r12, %r12
je 0x3e03e
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%r12)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x3e051
movsd (%rsp), %xmm1
incq %r15
movslq 0x1c(%rbp), %rax
cmpq %rax, %r15
jl 0x3dfa7
movsd 0x8(%rsp), %xmm0
cmpneqsd %xmm1, %xmm0
movq %xmm0, %rbx
andl $0x1, %ebx
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Draw(gaps::RNFlags, gaps::RNArray<gaps::R3Material*> const*) const
void R3SceneElement::
Draw(const R3DrawFlags draw_flags, const RNArray<R3Material *> *materials) const
{
  // Check shapes
  if (NShapes() == 0) return;

  // Draw material
  if (material && draw_flags[R3_SURFACE_MATERIAL_DRAW_FLAG]) {
    int material_index = material->SceneIndex();
    if (materials && (material_index >= 0) && (material_index < materials->NEntries()) && materials->Kth(material_index)) materials->Kth(material_index)->Draw();
    else material->Draw();
  }

  // Draw shapes
  if (0 && (draw_flags == R3_DEFAULT_DRAW_FLAGS)) {
    // Create display list
    if (opengl_id == 0) {
      // Begin display list
      R3SceneElement *element = (R3SceneElement *) this;
      element->opengl_id = glGenLists(1);
      glNewList(opengl_id, GL_COMPILE);
      
      // Draw shapes
      for (int i = 0; i < NShapes(); i++) {
        R3Shape *shape = Shape(i);
        shape->Draw(draw_flags);
      }

      // End display list
      glEndList();
    }

    // Call display list
    glCallList(opengl_id);
  }
  else {
    // Draw shapes with non-default draw flags
    for (int i = 0; i < NShapes(); i++) {
      R3Shape *shape = Shape(i);
      shape->Draw(draw_flags);
    }
  }
}

// Assembly:
cmpl $0x0, 0x1c(%rdi)
je 0x3e112
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
sete %cl
testb $0x40, %bl
sete %sil
orb %cl, %sil
jne 0x3e0e3
movslq 0x8(%rax), %rcx
testq %rcx, %rcx
sets %sil
testq %rdx, %rdx
sete %dil
orb %sil, %dil
jne 0x3e0d9
cmpl 0xc(%rdx), %ecx
jge 0x3e0d9
movq (%rdx), %rdx
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
jne 0x3e0dc
movq %rax, %rdi
xorl %esi, %esi
callq 0x442d0
cmpl $0x0, 0x1c(%r14)
jle 0x3e10d
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0xa8(%rax)
incq %r15
movslq 0x1c(%r14), %rax
cmpq %rax, %r15
jl 0x3e0ed
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::UpdateBBox()
void R3SceneElement::
UpdateBBox(void)
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    bbox.Union(shape->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
addq $0x30, %rdi
leaq 0x1093eb(%rip), %r14    # 0x147518
leaq 0x8(%r14), %rsi
callq 0x76628
leaq 0x48(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0x76628
cmpl $0x0, 0x1c(%rbx)
jle 0x3e189
leaq 0x28(%rbx), %r14
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq (%rsi), %rax
movq %r15, %rdi
callq *0x88(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e5d4
movq %r15, %rdi
callq 0x6e944
incq %r12
movslq 0x1c(%rbx), %rax
cmpq %rax, %r12
jl 0x3e156
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6e944
movq %rbx, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::SetCamera(gaps::R3Camera const&)
void R3Viewer::
SetCamera(const R3Camera& camera)
{
    // Set viewer's camera
    this->camera = camera;
    RNScalar aspect = ((RNScalar) viewport.Height()) / ((RNScalar) viewport.Width());
    this->camera.SetYFOV(atan(aspect * tan(camera.XFOV())));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
movq %r15, %rdi
callq 0x40908
cvtdq2pd 0xa0(%r14), %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
divsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movsd 0x60(%rbx), %xmm0
callq 0x214c0
mulsd (%rsp), %xmm0
callq 0x21730
movq %r15, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4088e
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::SetViewport(gaps::R2Viewport const&)
void R3Viewer::
SetViewport(const R2Viewport& viewport)
{
    // Set viewer's viewport
    this->viewport = viewport;

    // Adjust camera field of view to match viewport aspect ratio
    RNScalar aspect = (RNScalar) viewport.Height() / (RNScalar) viewport.Width();
    camera.SetYFOV(atan(aspect * tan(camera.XFOV())));
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movups (%rsi), %xmm0
movups %xmm0, 0x98(%rdi)
cvtdq2pd 0x8(%rsi), %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
divsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movsd 0x68(%rdi), %xmm0
addq $0x8, %rbx
callq 0x214c0
mulsd (%rsp), %xmm0
callq 0x21730
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x4088e
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ResizeViewport(int, int)
void R3Viewer::
ResizeViewport (int width, int height) 
{
    // Resize viewport
    viewport.Resize(width, height);

    // Adjust camera field of view to match viewport aspect ratio
    RNScalar aspect = (RNScalar) height / (RNScalar) width;
    camera.SetYFOV(atan(aspect * tan(camera.XFOV())));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
addq $0x98, %rdi
callq 0x40c2a
cvtsi2sd %ebx, %xmm1
cvtsi2sd %ebp, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x68(%r14), %xmm0
addq $0x8, %r14
callq 0x214c0
mulsd 0x8(%rsp), %xmm0
callq 0x21730
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4088e
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ResizeViewport(int, int, int, int)
void R3Viewer::
ResizeViewport (int xmin, int ymin, int width, int height) 
{
    // Resize viewport
    viewport.Resize(xmin, ymin, width, height);

    // Adjust camera field of view to match viewport aspect ratio
    RNScalar aspect = (RNScalar) height / (RNScalar) width;
    camera.SetYFOV(atan(aspect * tan(camera.XFOV())));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebx
movl %ecx, %ebp
movq %rdi, %r14
addq $0x98, %rdi
callq 0x40c32
cvtsi2sd %ebx, %xmm1
cvtsi2sd %ebp, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x68(%r14), %xmm0
addq $0x8, %r14
callq 0x214c0
mulsd 0x8(%rsp), %xmm0
callq 0x21730
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4088e
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ScaleWorld(gaps::R3Point const&, double)
void R3Viewer::
ScaleWorld (const R3Point& origin, RNScalar factor)
{
    // Scale world by factor - translate camera
    assert(factor > 0.0);
    factor = (factor - 1.0) / factor;
    camera.Translate((origin - camera.Origin()) * factor);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movsd 0x9dd24(%rip), %xmm1    # 0xdc4d0
addsd %xmm0, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
addq $0x8, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x7651c
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x77722
movq %rbx, %rdi
movq %r15, %rsi
callq 0x408a0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateWorld(gaps::R3Point const&, gaps::R3Vector const&, double)
void R3Viewer::
RotateWorld (const R3Point& origin, const R3Vector& axis, RNAngle dtheta)
{
    // Rotate camera around line (origin, axis)
    R3Line axis_line = R3Line(origin, axis);
    R3Point apex = camera.Origin();
    apex.Rotate(axis_line, dtheta);
    R3Vector towards = camera.Towards();
    towards.Rotate(axis, dtheta);
    R3Vector up = camera.Up();
    up.Rotate(axis, dtheta);
    camera.Reset(apex, towards, up);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdx, %rbx
movq %rdi, %r12
leaq 0x58(%rsp), %r13
movq %r13, %rdi
xorl %ecx, %ecx
callq 0x75fd0
leaq 0x8(%r12), %r14
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x762ca
movq %r15, %rdi
movq %r13, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x76b58
leaq 0x50(%r12), %rsi
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x779e8
movq %r13, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x7751e
addq $0x38, %r12
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x76d62
movq %rbp, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x7751e
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x405a6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::TranslateWorld(double, gaps::R3Point const&, int, int, int, int)
void R3Viewer::
TranslateWorld(RNScalar factor, const R3Point& origin, int, int, int dx, int dy)
{
    // Translate world based on mouse (dx,dy)
    if ((dx == 0) && (dy == 0)) return;
    RNLength length = factor * R3Distance(origin, camera.Origin()) * tan(camera.XFOV());
    RNLength vx = length * (RNLength) dx / (RNLength) viewport.Width();
    RNLength vy = length * (RNLength) dy / (RNLength) viewport.Height();
    R3Vector vector = (camera.Right() * vx) + (camera.Up() * vy);
    TranslateWorld(vector);
}

// Assembly:
movl %r9d, %eax
orl %r8d, %eax
je 0x3e9a8
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %r9d, %ebp
movl %r8d, %r15d
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq %rsi, %rdi
movq %rbx, %rsi
movsd %xmm0, (%rsp)
callq 0x4ec74
mulsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x68(%r14), %xmm0
callq 0x214c0
movapd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
mulsd (%rsp), %xmm2
mulsd %xmm2, %xmm0
cvtsi2sdl 0xa0(%r14), %xmm1
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
mulsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsi2sdl 0xa4(%r14), %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, (%rsp)
leaq 0x20(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x77722
addq $0x38, %r14
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
callq 0x77722
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x77a08
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x779e8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x408a0
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ScaleWorld(double, gaps::R3Point const&, int, int, int, int)
void R3Viewer::
ScaleWorld(RNScalar factor, const R3Point& origin, int, int, int dx, int dy)
{
    // Scale world based on mouse dx
    if ((dx == 0) && (dy == 0)) return;
    RNScalar motion = (RNScalar) dx / (RNScalar) viewport.Width() + (RNScalar) dy / (RNScalar) viewport.Height();
    RNScalar scale = exp(2.0 * factor * motion);
    ScaleWorld(origin, scale);
}

// Assembly:
movl %r9d, %eax
orl %r8d, %eax
je 0x3ea05
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movd %r9d, %xmm1
movd %r8d, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2pd 0xa0(%rdi), %xmm1
cvtdq2pd %xmm2, %xmm2
divpd %xmm1, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
addsd %xmm0, %xmm0
mulsd %xmm1, %xmm0
callq 0x22120
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3e798
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateWorld(double, gaps::R3Point const&, int, int, int, int)
void R3Viewer::
RotateWorld(RNScalar factor, const R3Point& origin, int, int, int dx, int dy)
{
    // Rotate world based on mouse (dx)
    if ((dx == 0) && (dy == 0)) return;
    RNLength vx = (RNLength) dx / (RNLength) viewport.Width();
    RNLength vy = (RNLength) dy / (RNLength) viewport.Height();
    RNAngle theta = factor * 4.0 * (fabs(vx) + fabs(vy));
    R3Vector vector = (camera.Right() * vx) + (camera.Up() * vy);
    R3Vector axis = camera.Towards() % vector;
    axis.Normalize();
    RotateWorld(origin, axis, theta);
}

// Assembly:
movl %r9d, %eax
orl %r8d, %eax
je 0x3eafb
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movd %r9d, %xmm1
movd %r8d, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2pd %xmm2, %xmm3
mulsd 0x9f181(%rip), %xmm0    # 0xddbc0
cvtdq2pd 0xa0(%rdi), %xmm1
divpd %xmm1, %xmm3
movapd 0x9f19d(%rip), %xmm1    # 0xddbf0
andpd %xmm3, %xmm1
movapd %xmm3, (%rsp)
pshufd $0xee, %xmm1, %xmm2     # xmm2 = xmm1[2,3,2,3]
addsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm2, 0x10(%rsp)
leaq 0x20(%rdi), %rsi
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movapd %xmm3, %xmm0
callq 0x77722
leaq 0x38(%r14), %rsi
movaps (%rsp), %xmm0
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x77722
leaq 0x58(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x77a08
leaq 0x50(%r14), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x779e8
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x776a6
movq %r12, %rdi
callq 0x77074
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movaps 0x10(%rsp), %xmm0
callq 0x3e7fa
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateCamera(double, int, int, int, int)
void R3Viewer::
RotateCamera(RNScalar factor, int x, int y, int, int)
{
    // Rotate camera based on mouse (x,y)                                                                                           
    RNLength vx = (RNLength) ((2 * x) - viewport.Width()) / (RNLength) viewport.Width();
    RNLength vy = (RNLength) ((2 * y) - viewport.Height()) / (RNLength) viewport.Height();
    RNAngle theta = factor * (RN_PI/64.0) * (vx*vx + vy*vy);
    R3Vector vector = (camera.Right() * vx) + (camera.Up() * vy);
    R3Vector axis = camera.Towards() % vector;
    axis.Normalize();
    RotateCamera(axis, theta);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movapd %xmm0, %xmm3
movq %rdi, %rbx
addl %esi, %esi
movl 0xa0(%rdi), %eax
subl %eax, %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movl 0xa4(%rdi), %ecx
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addl %edx, %edx
subl %ecx, %edx
cvtsi2sd %edx, %xmm2
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, 0x8(%rsp)
leaq 0xa11bb(%rip), %rax     # 0xdfe48
movsd (%rax), %xmm1
mulsd 0x9ef2f(%rip), %xmm1    # 0xddbc8
mulsd %xmm1, %xmm3
movapd %xmm2, %xmm1
mulsd %xmm2, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
mulsd %xmm2, %xmm3
movsd %xmm3, 0x10(%rsp)
leaq 0x8(%rdi), %r14
leaq 0x20(%rdi), %rsi
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x77722
leaq 0x38(%rbx), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x77722
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x77a08
addq $0x50, %rbx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x779e8
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x776a6
movq %rbx, %rdi
callq 0x77074
movq %r14, %rdi
movq %rbx, %rsi
movsd 0x10(%rsp), %xmm0
callq 0x408a6
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateCameraPitch(double, int, int, int, int)
void R3Viewer::
RotateCameraPitch(RNScalar factor, int x, int, int, int)
{
    // Rotate camera based on mouse (x)
    RNLength vx = (RNLength) ((2 * x) - viewport.Width()) / (RNLength) viewport.Width();
    RNAngle dpitch = factor * (RN_PI/64.0) * vx * ((vx < 0.0) ? -vx : vx); // vx*vx*vx;
    camera.RotatePitch(-dpitch);
}

// Assembly:
addl %esi, %esi
movl 0xa0(%rdi), %eax
subl %eax, %esi
cvtsi2sd %esi, %xmm1
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm1
leaq 0xa10e3(%rip), %rax     # 0xdfe48
movsd (%rax), %xmm2
movapd 0x9d7bf(%rip), %xmm3    # 0xdc530
xorpd %xmm1, %xmm3
maxsd %xmm1, %xmm3
mulsd 0x9ee4f(%rip), %xmm2    # 0xddbd0
addq $0x8, %rdi
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm3, %xmm0
leaq 0x105cd0(%rip), %rsi    # 0x144a68
jmp 0x408a6
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateCameraYaw(double, int, int, int, int)
void R3Viewer::
RotateCameraYaw(RNScalar factor, int, int y, int, int)
{
    // Rotate camera based on mouse (x,y)
    RNLength vy = (RNLength) ((2 * y) - viewport.Height()) / (RNLength) viewport.Height();
    RNAngle dyaw = factor * (RN_PI/64.0) * vy * ((vy < 0.0) ? -vy : vy); // vy*vy*vy;
    camera.RotateYaw(dyaw);
}

// Assembly:
addl %edx, %edx
movl 0xa4(%rdi), %eax
subl %eax, %edx
cvtsi2sd %edx, %xmm1
cvtsi2sd %eax, %xmm2
leaq 0xa1091(%rip), %rax     # 0xdfe48
movsd (%rax), %xmm3
mulsd 0x9ee05(%rip), %xmm3    # 0xddbc8
divsd %xmm2, %xmm1
mulsd %xmm3, %xmm0
mulsd %xmm1, %xmm0
movapd 0x9d759(%rip), %xmm2    # 0xdc530
xorpd %xmm1, %xmm2
maxsd %xmm1, %xmm2
mulsd %xmm2, %xmm0
leaq 0x8(%rdi), %rax
leaq 0x20(%rdi), %rsi
movq %rax, %rdi
jmp 0x408a6
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateCameraRoll(double, int, int, int, int)
void R3Viewer::
RotateCameraRoll(RNScalar factor, int x, int, int, int)
{
    // Rotate camera based on mouse (x,y)
    RNLength vx = (RNLength) ((2 * x) - viewport.Width()) / (RNLength) viewport.Width();
    RNAngle droll = factor * (RN_PI/64.0) * vx * ((vx < 0.0) ? -vx : vx); // vx*vx*vx;
    camera.RotateRoll(droll);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
addl %esi, %esi
movl 0xa0(%rdi), %eax
subl %eax, %esi
cvtsi2sd %esi, %xmm1
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm1
leaq 0xa1030(%rip), %rax     # 0xdfe48
movsd (%rax), %xmm2
mulsd 0x9eda4(%rip), %xmm2    # 0xddbc8
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movapd 0x9d6fc(%rip), %xmm2    # 0xdc530
xorpd %xmm1, %xmm2
maxsd %xmm1, %xmm2
mulsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x8(%rdi), %rbx
leaq 0x50(%rdi), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x779e8
movq %rbx, %rdi
movq %r14, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x408a6
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::WorldRay(double, double) const
const R3Ray R3Viewer::
WorldRay(RNCoord x, RNCoord y) const
{
    // Return ray from camera origin to appropriate point on far plane
#if FALSE
    // This also works
    RNScalar dx = (RNScalar) (2 * (x - viewport.XCenter())) / (RNScalar) viewport.Width();
    RNScalar dy = (RNScalar) (2 * (y - viewport.YCenter())) / (RNScalar) viewport.Height();
    R3Vector v = camera.Towards();
    v.Rotate(camera.Up(), dx * camera.XFOV());
    v.Rotate(camera.Left(), dy * camera.YFOV());
    return R3Ray(camera.Origin(), v);
#else
    RNScalar dx = (RNScalar) (2 * (x - viewport.XCenter())) / (RNScalar) viewport.Width();
    RNScalar dy = (RNScalar) (2 * (y - viewport.YCenter())) / (RNScalar) viewport.Height();
    R3Point far_org = camera.Origin() + camera.Towards() * camera.Far();
    R3Vector far_right = camera.Right() * camera.Far() * tan(camera.XFOV());
    R3Vector far_up = camera.Up() * camera.Far() * tan(camera.YFOV());
    R3Point far_point = far_org + (far_right * dx) + (far_up * dy);
    return R3Ray(camera.Origin(), far_point);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl 0xa0(%rsi), %ecx
movl 0xa4(%rsi), %eax
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
addl 0x98(%rsi), %edx
cvtsi2sd %edx, %xmm2
subsd %xmm2, %xmm0
addsd %xmm0, %xmm0
movapd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl 0x9c(%rsi), %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd %xmm0, %xmm3
movsd %xmm3, (%rsp)
subsd %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd %xmm1, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x8(%rsi), %r14
addq $0x50, %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x779e8
movsd 0x80(%r15), %xmm0
leaq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x77722
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x76605
leaq 0x20(%r15), %rsi
movsd 0x80(%r15), %xmm0
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
callq 0x77722
movsd 0x68(%r15), %xmm0
callq 0x214c0
leaq 0x40(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x77722
leaq 0x38(%r15), %rsi
movsd 0x80(%r15), %xmm0
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x77722
movsd 0x70(%r15), %xmm0
callq 0x214c0
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x77722
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movsd (%rsp), %xmm0
callq 0x77722
leaq 0x88(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x76605
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x77722
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x76605
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x75eae
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ViewportPoint(gaps::R3Point const&) const
const R2Point R3Viewer::
ViewportPoint(const R3Point& point) const 
{
    // Transform 3D point into canonical coordinate system
    R3Point p = Camera().CoordSystem().InverseMatrix() * point;
    if (RNIsPositiveOrZero(p.Z())) return R2infinite_point;

    // Compute 2D point projected onto viewport
    RNCoord x = viewport.XCenter() + 0.5 * viewport.Width() * p.X() / -(p.Z() * tan(Camera().XFOV()));
    RNCoord y = viewport.YCenter() + 0.5 * viewport.Height() * p.Y() / -(p.Z() * tan(Camera().YFOV()));

    // Return point projected onto viewport
    return R2Point(x, y);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rsi
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0x7101a
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x74cb2
movsd 0x10(%r13), %xmm1
leaq 0x100af6(%rip), %rax    # 0x1400d8
movsd (%rax), %xmm0
xorpd 0x9cf42(%rip), %xmm0    # 0xdc530
ucomisd %xmm0, %xmm1
jae 0x3f6e8
movl 0xa0(%r14), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl 0x98(%r14), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x9c9f5(%rip), %xmm0    # 0xdc020
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x68(%r14), %xmm0
movsd %xmm1, 0x8(%rsp)
callq 0x214c0
mulsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movl 0xa4(%r14), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl 0x9c(%r14), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x9c985(%rip), %xmm0    # 0xdc020
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x70(%r14), %xmm0
callq 0x214c0
mulsd 0x20(%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
divsd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm1
subsd %xmm2, %xmm1
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x82a96
jmp 0x3f6f7
leaq 0x108e31(%rip), %rsi    # 0x148520
movq %rbx, %rdi
callq 0x82aa0
movq %rbx, %rax
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ViewportBCircle(gaps::R3Shape const&) const
const R2Circle R3Viewer::
ViewportBCircle(const R3Shape& shape) const 
{
    // Return bounding circle of shape projection on viewport
    R3Sphere bsphere(shape.BSphere());
    R3Point p = Camera().CoordSystem().InverseMatrix() * bsphere.Center();
    if (RNIsPositiveOrZero(p.Z())) return R2infinite_circle;

    // Compute sphere center projection
    RNCoord x = viewport.XCenter() + 0.5 * viewport.Width() * p.X() / -(p.Z() * tan(Camera().XFOV()));
    RNCoord y = viewport.YCenter() + 0.5 * viewport.Height() * p.Y() / -(p.Z() * tan(Camera().YFOV()));
    R2Point center(x, y);

    // Compute sphere radius projection
    RNScalar fov = (Camera().XFOV() > Camera().YFOV()) ? Camera().XFOV() : Camera().YFOV();
    RNScalar radius = 0.5 * viewport.Width() * bsphere.Radius() / -(p.Z() * fov);

    // Return bounding circle of projection
    return R2Circle(center, radius);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdx), %rax
leaq 0x40(%rsp), %rdi
movq %rdx, %rsi
callq *0x90(%rax)
leaq 0x8(%r14), %rsi
leaq 0x68(%rsp), %rdi
callq 0x7101a
leaq 0x48(%rsp), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x74cb2
movsd 0x38(%rsp), %xmm1
leaq 0x100656(%rip), %rax    # 0x1400d8
movsd (%rax), %xmm0
xorpd 0x9caa2(%rip), %xmm0    # 0xdc530
ucomisd %xmm0, %xmm1
jae 0x3fbc7
movl 0xa0(%r14), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl 0x98(%r14), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x9c555(%rip), %xmm0    # 0xdc020
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x68(%r14), %xmm0
movsd %xmm1, 0x8(%rsp)
callq 0x214c0
mulsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movl 0xa4(%r14), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
addl 0x9c(%r14), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x9c4e5(%rip), %xmm0    # 0xdc020
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x70(%r14), %xmm0
callq 0x214c0
mulsd 0x20(%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
divsd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm1
subsd %xmm2, %xmm1
leaq 0x68(%rsp), %rdi
movsd 0x18(%rsp), %xmm0
callq 0x82a96
movsd 0x68(%r14), %xmm1
maxsd 0x70(%r14), %xmm1
xorps %xmm0, %xmm0
cvtsi2sdl 0xa0(%r14), %xmm0
mulsd 0x9e040(%rip), %xmm0    # 0xddbe8
mulsd 0x60(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x80d84
jmp 0x3fbd6
leaq 0x108352(%rip), %rsi    # 0x147f20
movq %rbx, %rdi
callq 0x80d38
leaq 0x40(%rsp), %rdi
callq 0x6e944
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
jmp 0x3fbf4
jmp 0x3fbf4
jmp 0x3fbf4
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6e944
movq %rbx, %rdi
callq 0x220d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ViewportArea(gaps::R3Shape const&) const
const RNArea R3Viewer::
ViewportArea(const R3Shape& shape) const 
{
    // Return area of shape projection on viewport
    R2Circle bcircle(ViewportBCircle(shape));
    if (bcircle.IsFinite()) return bcircle.Area();
    else return 0.0;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3fa32
movsd 0x18(%rbx), %xmm3
leaq 0x1004ba(%rip), %rax    # 0x1400e8
movsd (%rax), %xmm1
movapd 0x9c8f6(%rip), %xmm2    # 0xdc530
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
xorps %xmm0, %xmm0
jbe 0x3fc57
ucomisd %xmm3, %xmm1
jbe 0x3fc57
leaq 0x10(%rsp), %rdi
callq 0x80e12
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x81944
movsd 0x8(%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x81944
movq %rbx, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::DrawText(double, double, char const*, void*)
void R3Viewer::
DrawText(double x, double y, const char *str, void *font)
{
  // Draw text string s and position p
  R3Ray ray = WorldRay(x, y);
  R3Point position = ray.Point(2 * Camera().Near());
  R3DrawText(position, str, font);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3f3f2
movsd 0x78(%r15), %xmm0
addsd %xmm0, %xmm0
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x75eba
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movsd 0x10(%r15), %xmm2
callq 0x212b0
testq %r14, %r14
jne 0x3fce6
leaq 0x108aba(%rip), %r14    # 0x1487a0
movb (%rbx), %al
testb %al, %al
je 0x3fd03
incq %rbx
movsbl %al, %esi
movq %r14, %rdi
callq 0xcf544
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x3fcef
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::R3Camera(gaps::R3Point const&, double, double, double, double, double, double, double)
R3Camera::
R3Camera(const R3Point& origin, RNAngle pitch, RNAngle yaw, RNAngle roll,
		  RNAngle xfov, RNAngle yfov, RNLength neardist, RNLength fardist)
    : xfov(xfov),
      yfov(yfov),
      neardist(neardist),
      fardist(fardist),
      value(0),
      data(NULL)
{
    // Clamp yaw (roll is undefined at +-PI/2)
    const RNAngle max_yaw = 0.99 * RN_PI_OVER_TWO;
    if (yaw > max_yaw) yaw = max_yaw;
    if (yaw < -max_yaw) yaw = -max_yaw;

    // Derive  triad from pitch, yaw, and roll
    RNScalar cos_yaw = cos(yaw);
    R3Vector towards = R3Vector(cos_yaw * cos(pitch), cos_yaw * sin(pitch), sin(yaw));
    R3Vector up = R3posz_vector;
    up.Rotate(towards, roll);
    R3Triad triad(towards, up);

    // Set coordinate system
    cs = R3CoordSystem(origin, triad);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movsd %xmm6, 0x20(%rsp)
movsd %xmm5, 0x10(%rsp)
movsd %xmm4, 0x38(%rsp)
movsd %xmm3, 0x30(%rsp)
movsd %xmm2, 0x40(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
callq 0x70f2c
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x60(%rbx)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x68(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x78(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
leaq 0x9fe68(%rip), %rax     # 0xdfe58
movsd (%rax), %xmm0
mulsd 0x9dc1c(%rip), %xmm0    # 0xddc18
movapd %xmm0, %xmm1
minsd 0x8(%rsp), %xmm1
xorpd 0x9c522(%rip), %xmm0    # 0xdc530
maxsd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
callq 0x221e0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x221e0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x21170
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movaps 0x20(%rsp), %xmm0
callq 0x21170
movaps %xmm0, %xmm2
leaq 0xc0(%rsp), %r15
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x76d52
leaq 0x9ed4b(%rip), %rsi     # 0xdedd0
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
callq 0x76d62
movq %r12, %rdi
movq %r15, %rsi
movsd 0x40(%rsp), %xmm0
callq 0x7751e
leaq 0xd8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7146a
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x70f6c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x76628
leaq 0x18(%rbx), %rdi
leaq 0x60(%rsp), %rsi
callq 0x774fe
leaq 0x78(%rsp), %rsi
leaq 0x30(%rbx), %rdi
callq 0x774fe
leaq 0x90(%rsp), %rsi
addq $0x48, %rbx
movq %rbx, %rdi
callq 0x774fe
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Pitch() const
const RNAngle R3Camera::
Pitch(void) const
{
    // Return pitch angle
    R3Vector v1(Towards());
    RNAngle yaw = Yaw();
    if (RNIsNotZero(yaw)) v1.Rotate(Left(), yaw);
    RNAngle pitch = R3InteriorAngle(R3default_camera_towards_vector, v1);
    if (v1.Dot(R3default_camera_right_vector) > 0.0) pitch = -pitch;
    return pitch;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x779e8
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x779e8
leaq 0x104918(%rip), %rdi    # 0x144a68
movq %r15, %rsi
callq 0x514f3
leaq 0x9fcf9(%rip), %rax     # 0xdfe58
movsd (%rax), %xmm1
subsd %xmm0, %xmm1
leaq 0xfff6a(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm1
ja 0x40186
xorpd 0x9c3b0(%rip), %xmm0    # 0xdc530
ucomisd %xmm1, %xmm0
jbe 0x401b1
addq $0x18, %rbx
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movsd %xmm1, (%rsp)
callq 0x779e8
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
callq 0x7751e
leaq 0x104898(%rip), %rdi    # 0x144a50
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x514f3
movapd %xmm0, (%rsp)
leaq 0x104867(%rip), %rsi    # 0x144a38
movq %rbx, %rdi
callq 0x76fea
movapd 0x9c34f(%rip), %xmm2    # 0xdc530
movapd (%rsp), %xmm3
xorpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm0, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Roll() const
const RNAngle R3Camera::
Roll(void) const
{
#if FALSE
    // Return roll angle
    R3Vector v2(Right());
    RNAngle yaw = Yaw();
    if (RNIsNotZero(yaw)) v2.Rotate(Left(), yaw);
    RNAngle roll = R3InteriorAngle(R3default_camera_up_vector, v2) - RN_PI_OVER_TWO;
    return roll;
#else
    // Return roll angle
    R3Vector v2 = Towards() % R3default_camera_up_vector; // Right vector if no roll
    RNAngle roll = R3InteriorAngle(Right(), v2);
    if (v2.Dot(Up()) > 0.0) roll = -roll;
    return roll;
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x779e8
leaq 0x1047f8(%rip), %rdx    # 0x144a68
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x776a6
leaq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x514f3
movapd %xmm0, (%rsp)
addq $0x30, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x76fea
movapd 0x9c288(%rip), %xmm2    # 0xdc530
movapd (%rsp), %xmm3
xorpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm0, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Halfspace(int, int) const
const R3Halfspace R3Camera::
Halfspace(RNDirection dir, RNDimension dim) const
{
    R3Vector normal;
    switch (dim) {
    case RN_X:
        normal = cs.Axes().Axis(RN_X); 
	if (dir == RN_LO) normal.Rotate(cs.Axes().Axis(RN_Y), xfov);
	else normal.Rotate(cs.Axes().Axis(RN_Y), RN_PI - xfov);
	return R3Halfspace(Origin(), normal);
        break;

    case RN_Y:
        normal = cs.Axes().Axis(RN_Y); 
	if (dir == RN_LO) normal.Rotate(cs.Axes().Axis(RN_X), -yfov);
	else normal.Rotate(cs.Axes().Axis(RN_X), yfov - RN_PI);
	return R3Halfspace(Origin(), normal);
        break;

    case RN_Z:
        if (dir == RN_LO) return R3Halfspace(Origin() - cs.Axes().Axis(RN_Z) * neardist, -cs.Axes().Axis(RN_Z));
	else return R3Halfspace(Origin() - cs.Axes().Axis(RN_Z) * fardist, cs.Axes().Axis(RN_Z));
        break;
    }

    // Should never get here
    RNAbort("Invalid dim in camera halfspace query");
    return R3null_halfspace;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x76d50
cmpl $0x2, %r15d
je 0x40372
cmpl $0x1, %r15d
je 0x40346
testl %r15d, %r15d
jne 0x403af
leaq 0x18(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x774fe
leaq 0x30(%r14), %rsi
movsd 0x60(%r14), %xmm0
testl %ebp, %ebp
je 0x4033e
leaq 0x9fb16(%rip), %rax     # 0xdfe48
movsd (%rax), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
movq %r15, %rdi
jmp 0x403dc
leaq 0x18(%r14), %r12
leaq 0x30(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x774fe
movsd 0x68(%r14), %xmm0
testl %ebp, %ebp
je 0x403ce
leaq 0x9fadc(%rip), %rax     # 0xdfe48
subsd (%rax), %xmm0
jmp 0x403d6
leaq 0x48(%r14), %r15
testl %ebp, %ebp
je 0x40401
movsd 0x78(%r14), %xmm0
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x77722
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x76ce1
movq %rbx, %rdi
movq %r13, %rsi
jmp 0x403e7
leaq 0x9d89a(%rip), %rdi     # 0xddc50
xorl %eax, %eax
callq 0x8b45e
leaq 0x10751c(%rip), %rsi    # 0x1478e0
movq %rbx, %rdi
callq 0x74d56
jmp 0x403ef
xorpd 0x9c15a(%rip), %xmm0    # 0xdc530
movq %r15, %rdi
movq %r12, %rsi
callq 0x7751e
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x74d6e
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x70(%r14), %xmm0
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x77722
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x76ce1
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x779e8
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
jmp 0x403ea
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Perspective() const
const R4Matrix R3Camera::
Perspective(void) const
{
#if FALSE
    // Return 4x4 perspective matrix
    double m[4][4];
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    gluPerspective(2.0 * RN_RAD2DEG(yfov), tan(xfov) / tan(yfov), neardist, fardist);
    glGetDoublev(GL_PROJECTION_MATRIX, m);
    glPopMatrix();
    glMatrixMode(GL_MODELVIEW);
    return R4Matrix(m);
#else 
    // Return 4x4 perspective matrix -- derived from OpenGL Programming Guide
    RNScalar A = 1.0 / tan(xfov);
    RNScalar B = 1.0 / tan(yfov);
    RNScalar C = -(fardist + neardist) / (fardist - neardist);
    RNScalar D = -2.0 * neardist * fardist / (fardist - neardist);
    return R4Matrix(  A, 0.0,  0.0, 0.0,
		    0.0,   B,  0.0, 0.0,
		    0.0, 0.0,    C,   D,
		    0.0, 0.0, -1.0, 0.0);
#endif
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movsd 0x60(%rsi), %xmm0
callq 0x214c0
movsd 0x9bbb3(%rip), %xmm2    # 0xdc018
divsd %xmm0, %xmm2
movsd %xmm2, 0x40(%rsp)
movsd 0x68(%r14), %xmm0
callq 0x214c0
movsd 0x70(%r14), %xmm1
movsd 0x78(%r14), %xmm2
movapd %xmm2, %xmm3
addsd %xmm1, %xmm3
xorpd 0x9c09a(%rip), %xmm3    # 0xdc530
movsd 0x9bb7a(%rip), %xmm5    # 0xdc018
divsd %xmm0, %xmm5
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
divsd %xmm0, %xmm3
mulsd 0x9d76a(%rip), %xmm1    # 0xddc20
mulsd %xmm2, %xmm1
divsd %xmm0, %xmm1
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x30(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rsp)
movupd %xmm0, (%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm3, 0x10(%rsp)
movq $0x0, 0x38(%rsp)
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
xorps %xmm4, %xmm4
xorps %xmm6, %xmm6
xorps %xmm7, %xmm7
movq %rbx, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x72c56
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::operator==(gaps::R3Camera const&) const
const RNBoolean R3Camera::
operator==(const R3Camera& camera) const
{
    // Return whether camera is equal
    return (cs == camera.cs) && 
           (xfov == camera.xfov) &&
           (yfov == camera.yfov) &&
           (neardist == camera.neardist) &&
           (fardist == camera.fardist);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x76380
xorl %ebx, %ebx
testl %eax, %eax
je 0x4059d
leaq 0x18(%r14), %rdi
leaq 0x18(%r15), %rsi
callq 0x77010
testl %eax, %eax
je 0x4059d
leaq 0x30(%r14), %rdi
leaq 0x30(%r15), %rsi
callq 0x77010
testl %eax, %eax
je 0x4059d
movsd 0x60(%r14), %xmm0
ucomisd 0x60(%r15), %xmm0
jne 0x4059d
jp 0x4059d
movsd 0x68(%r14), %xmm0
ucomisd 0x68(%r15), %xmm0
jne 0x4059d
jp 0x4059d
movsd 0x70(%r14), %xmm0
ucomisd 0x70(%r15), %xmm0
jne 0x4059d
jp 0x4059d
movsd 0x78(%r15), %xmm0
cmpeqsd 0x78(%r14), %xmm0
movq %xmm0, %rbx
andl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Reorient(double, double, double)
void R3Camera::
Reorient(RNAngle pitch, RNAngle yaw, RNAngle roll)
{
    // Set orientation
    SetPitch(pitch);
    SetYaw(yaw);
    SetRoll(roll);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x4011c
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
leaq 0x104422(%rip), %rsi    # 0x144a68
movq %rbx, %rdi
movapd %xmm1, %xmm0
callq 0x71116
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x406aa
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
addq $0x20, %rsp
popq %rbx
jmp 0x40708
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Transform(gaps::R3Transformation const&)
void R3Camera::
Transform(const R3Transformation& transformation)
{
    // Transform near and far distances
    R3Vector zaxis(cs.Axes().Axis(RN_Z));
    zaxis.Transform(transformation);
    RNLength scale = zaxis.Length();
    neardist *= scale;
    fardist *= scale;
    
    // Transform coordinate system
    cs.Transform(transformation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x48(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x76d62
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7792e
movq %r15, %rdi
callq 0x76e58
movupd 0x70(%r14), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
movupd %xmm0, 0x70(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x71170
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::operator=(gaps::R3Camera const&)
R3Camera& R3Camera::
operator=(const R3Camera& camera)
{
    // Copy camera 
    this->cs = camera.cs;
    this->xfov = camera.xfov;
    this->yfov = camera.yfov;
    this->neardist = camera.neardist;
    this->fardist = camera.fardist;
    this->value = camera.value;
    return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x76628
leaq 0x18(%rbx), %rdi
leaq 0x18(%r14), %rsi
callq 0x774fe
leaq 0x30(%r14), %rsi
leaq 0x30(%rbx), %rdi
callq 0x774fe
leaq 0x48(%r14), %rsi
leaq 0x48(%rbx), %rdi
callq 0x774fe
movups 0x60(%r14), %xmm0
movups %xmm0, 0x60(%rbx)
movups 0x70(%r14), %xmm0
movups %xmm0, 0x70(%rbx)
movsd 0x80(%r14), %xmm0
movsd %xmm0, 0x80(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Load(int) const
void R3Camera::
Load(RNBoolean select_mode) const
{
    // Set the perspective projection
#if (RN_3D_GRFX == RN_IRISGL)
    perspective(20.0 * RN_RAD2DEG(yfov), tan(xfov) / tan(yfov), neardist, fardist);
#elif (RN_3D_GRFX == RN_OPENGL)
    if (!select_mode) {
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
    }
    gluPerspective(2.0 * RN_RAD2DEG(yfov), tan(xfov) / tan(yfov), neardist, fardist);
    glMatrixMode(GL_MODELVIEW);
#elif ((RN_3D_GRFX == RN_3DR) && (RN_MATH_PRECISION == RN_FLOAT_PRECISION))
    PointFW_t loc;
    PointF_t dir, up;
    loc.x = Origin().X();   loc.y = Origin().Y();   loc.z = Origin().Z();   loc.w = 1.0;
    dir.x = Towards().X();  dir.y = Towards().Y();  dir.z = Towards().Z();
    up.x = Up().X();        up.y = Up().Y();        up.z = Up().Z();
    G3dSetCameraPosition(R3dr_gc, &loc, &dir, &up);
#else
    RNAbort("Not Implemented");
#endif

    // Load the rotation matrix
    cs.InverseMatrix().Load();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
testl %esi, %esi
jne 0x4098c
movl $0x1701, %edi           # imm = 0x1701
callq 0x21cc0
callq 0x21c50
leaq 0x9f4b5(%rip), %rax     # 0xdfe48
movsd 0x9d28d(%rip), %xmm0    # 0xddc28
divsd (%rax), %xmm0
mulsd 0x68(%rbx), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x60(%rbx), %xmm0
callq 0x214c0
movsd %xmm0, 0x8(%rsp)
movsd 0x68(%rbx), %xmm0
callq 0x214c0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd 0x70(%rbx), %xmm2
movsd 0x78(%rbx), %xmm3
movsd 0x10(%rsp), %xmm0
callq 0x21af0
movl $0x1700, %edi           # imm = 0x1700
callq 0x21cc0
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7101a
movq %r14, %rdi
callq 0x45564
addq $0x98, %rsp
popq %rbx
popq %r14
retq