// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/gapsview/gapsview.cpp
// Function: DrawImageRay(ImageData*, gaps::R2Point const&)
static void
DrawImageRay(ImageData *data,
  const R2Point& image_position)
{               
  // Check image position
  R2Box b = data->ray_origin_images[0].GridBox();
  if (!R2Contains(b, image_position)) return;

  // Get ray parameter from images
  RNScalar ox = data->ray_origin_images[0].GridValue(image_position);
  RNScalar oy = data->ray_origin_images[1].GridValue(image_position);
  RNScalar oz = data->ray_origin_images[2].GridValue(image_position);
  RNScalar dx = data->ray_direction_images[0].GridValue(image_position);
  RNScalar dy = data->ray_direction_images[1].GridValue(image_position);
  RNScalar dz = data->ray_direction_images[2].GridValue(image_position);

  // Create ray
  R3Point ray_origin(ox, oy, oz);
  R3Vector ray_direction(dx, dy, dz);
  R3Ray ray(ray_origin, ray_direction);

  // Find projection of selected position onto ray
  RNScalar t = ray.T(selected_position);
  if (t <= 0) return;
  R3Point p = ray.Point(t);

  // Draw ray
  glDisable(GL_LIGHTING);
  RNLoadRgb(0, 1, 1);
  R3Span(ray_origin, p).Draw();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rsi, %r14
movq %rdi, %rbx
movl 0x348(%rdi), %eax
decl %eax
cvtsi2sd %eax, %xmm2
movl 0x34c(%rdi), %eax
decl %eax
cvtsi2sd %eax, %xmm3
leaq 0x78(%rsp), %r15
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq %r15, %rdi
callq 0xf05f4
movq %r15, %rdi
movq %r14, %rsi
callq 0xdfe7f
testl %eax, %eax
je 0x32339
leaq 0x288(%rbx), %rdi
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
callq 0xe2a7a
movsd %xmm0, 0x28(%rsp)
leaq 0x358(%rbx), %rdi
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
callq 0xe2a7a
movsd %xmm0, 0x20(%rsp)
leaq 0x428(%rbx), %rdi
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
callq 0xe2a7a
movsd %xmm0, 0x18(%rsp)
leaq 0x4f8(%rbx), %rdi
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
callq 0xe2a7a
movsd %xmm0, 0x10(%rsp)
leaq 0x5c8(%rbx), %rdi
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
callq 0xe2a7a
movsd %xmm0, 0x8(%rsp)
addq $0x698, %rbx            # imm = 0x698
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
movq %rbx, %rdi
callq 0xe2a7a
movsd %xmm0, (%rsp)
leaq 0x30(%rsp), %rdi
movsd 0x28(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0xd5e2e
leaq 0x60(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd (%rsp), %xmm2
callq 0xd68c6
leaq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x60(%rsp), %rdx
xorl %ecx, %ecx
callq 0xd5a1c
leaq 0x1aaa8b(%rip), %rsi    # 0x1dcd58
leaq 0xa0(%rsp), %rdi
callq 0xd5a6a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x32339
leaq 0x48(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xd5a2e
movl $0xb50, %edi            # imm = 0xB50
callq 0x27200
movss 0x11be2c(%rip), %xmm1   # 0x14e134
xorpd %xmm0, %xmm0
movapd %xmm1, %xmm2
callq 0x28390
leaq 0xd0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0xd52b2
leaq 0xd0(%rsp), %rdi
callq 0x90c2a
leaq 0x78(%rsp), %rdi
callq 0xf0e74
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
retq
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
jmp 0x32368
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xf0e74
movq %rbx, %rdi
callq 0x28160