LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::RemoveChannel(int)
void R3SurfelImage::
RemoveChannel(int channel_index)
{
  // Check channel index
  if (channel_index < 0) return;
  if (channel_index >= channels.NEntries()) return;
  if (!channels[channel_index]) return;

  // Remove channel
  delete channels[channel_index];
  channels[channel_index] = NULL;
}

// Assembly:
testl %esi, %esi
js 0x3c669
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x2c(%rdi)
jle 0x3c664
movq 0x20(%rbx), %rax
movl %esi, %r15d
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x3c664
movq %r14, %rdi
callq 0x918ec
movl $0xd0, %esi
movq %r14, %rdi
callq 0x134f0
movq 0x20(%rbx), %rax
movq $0x0, (%rax,%r15,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetPose(gaps::R3CoordSystem const&)
void R3SurfelImage::
SetPose(const R3CoordSystem& pose) 
{
  // Set pose
  this->pose = pose;

  // Update rollling shutter poses
  this->rolling_shutter_poses[0] = this->pose;
  this->rolling_shutter_poses[1] = this->pose;
  flags.Remove(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x8412a
leaq 0x48(%rbx), %r15
leaq 0x18(%rbp), %rsi
movq %r15, %rdi
callq 0x84fe2
leaq 0x30(%rbp), %rsi
leaq 0x60(%rbx), %r12
movq %r12, %rdi
callq 0x84fe2
addq $0x48, %rbp
leaq 0x78(%rbx), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x84fe2
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x108(%rbx), %rdi
movq %r15, %rsi
callq 0x84fe2
leaq 0x120(%rbx), %rdi
movq %r12, %rsi
callq 0x84fe2
leaq 0x138(%rbx), %rdi
movq %r13, %rsi
callq 0x84fe2
leaq 0x150(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x168(%rbx), %rdi
movq %r15, %rsi
callq 0x84fe2
leaq 0x180(%rbx), %rdi
movq %r12, %rsi
callq 0x84fe2
leaq 0x198(%rbx), %rdi
movq %r13, %rsi
callq 0x84fe2
andb $-0x2, 0x1c8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetViewpoint(gaps::R3Point const&)
void R3SurfelImage::
SetViewpoint(const R3Point& viewpoint) 
{
  // Set viewpoint
  this->pose.SetOrigin(viewpoint);

  // Update rollling shutter poses
  this->rolling_shutter_poses[0] = this->pose;
  this->rolling_shutter_poses[1] = this->pose;
  flags.Remove(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x708b0
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x108(%rbx), %rdi
leaq 0x48(%rbx), %r15
movq %r15, %rsi
callq 0x84fe2
leaq 0x60(%rbx), %r12
leaq 0x120(%rbx), %rdi
movq %r12, %rsi
callq 0x84fe2
leaq 0x78(%rbx), %r13
leaq 0x138(%rbx), %rdi
movq %r13, %rsi
callq 0x84fe2
leaq 0x150(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x168(%rbx), %rdi
movq %r15, %rsi
callq 0x84fe2
leaq 0x180(%rbx), %rdi
movq %r12, %rsi
callq 0x84fe2
leaq 0x198(%rbx), %rdi
movq %r13, %rsi
callq 0x84fe2
andb $-0x2, 0x1c8(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetOrientation(gaps::R3Vector const&, gaps::R3Vector const&)
void R3SurfelImage::
SetOrientation(const R3Vector& towards, const R3Vector& up) 
{
  // Set orientation
  this->pose.SetAxes(R3Triad(towards, up));

  // Update rollling shutter poses
  this->rolling_shutter_poses[0] = this->pose;
  this->rolling_shutter_poses[1] = this->pose;
  flags.Remove(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x70ca6
movq %r14, %rdi
movq %r15, %rsi
callq 0x708b6
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x108(%rbx), %rdi
leaq 0x48(%rbx), %r15
movq %r15, %rsi
callq 0x84fe2
leaq 0x60(%rbx), %r12
leaq 0x120(%rbx), %rdi
movq %r12, %rsi
callq 0x84fe2
leaq 0x78(%rbx), %r13
leaq 0x138(%rbx), %rdi
movq %r13, %rsi
callq 0x84fe2
leaq 0x150(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x168(%rbx), %rdi
movq %r15, %rsi
callq 0x84fe2
leaq 0x180(%rbx), %rdi
movq %r12, %rsi
callq 0x84fe2
leaq 0x198(%rbx), %rdi
movq %r13, %rsi
callq 0x84fe2
andb $-0x2, 0x1c8(%rbx)
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetRollingShutterPoses(gaps::R3CoordSystem const&, gaps::R3CoordSystem const&)
void R3SurfelImage::
SetRollingShutterPoses(const R3CoordSystem& pose0, const R3CoordSystem& pose1) 
{
  // Check if poses are different
  if (pose0 == pose1) {
    SetPose(pose0);
  }
  else {    
    // Set rollling shutter poses
    this->rolling_shutter_poses[0] = pose0;
    this->rolling_shutter_poses[1] = pose1;

    // Update center pose
    this->pose = R3CoordSystemSlerp(pose0, pose1, 0.5);

    // Update flags
    flags.Add(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x83e88
testl %eax, %eax
je 0x3ca39
leaq 0x18(%r14), %rdi
leaq 0x18(%r15), %rsi
callq 0x84b08
testl %eax, %eax
je 0x3ca39
leaq 0x30(%r14), %rdi
leaq 0x30(%r15), %rsi
callq 0x84b08
testl %eax, %eax
je 0x3ca39
movq (%rbx), %rax
movq 0x58(%rax), %rax
movq %rbx, %rdi
movq %r14, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x8412a
leaq 0x108(%rbx), %rdi
leaq 0x18(%r14), %rsi
callq 0x84fe2
leaq 0x30(%r14), %rsi
leaq 0x120(%rbx), %rdi
callq 0x84fe2
leaq 0x48(%r14), %rsi
leaq 0x138(%rbx), %rdi
callq 0x84fe2
leaq 0x150(%rbx), %rdi
movq %r15, %rsi
callq 0x8412a
leaq 0x168(%rbx), %rdi
leaq 0x18(%r15), %rsi
callq 0x84fe2
leaq 0x30(%r15), %rsi
leaq 0x180(%rbx), %rdi
callq 0x84fe2
leaq 0x48(%r15), %rsi
leaq 0x198(%rbx), %rdi
callq 0x84fe2
leaq 0x8(%rsp), %r12
movsd 0xa0674(%rip), %xmm0    # 0xdd138
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x70a07
leaq 0x30(%rbx), %rdi
movq %r12, %rsi
callq 0x8412a
leaq 0x48(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x84fe2
leaq 0x38(%rsp), %rsi
leaq 0x60(%rbx), %rdi
callq 0x84fe2
leaq 0x50(%rsp), %rsi
leaq 0x78(%rbx), %rdi
callq 0x84fe2
orb $0x1, 0x1c8(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TransformFromWorldToCamera(gaps::R3Point const&) const
R3Point R3SurfelImage::
TransformFromWorldToCamera(const R3Point& world_position) const
{
  // Initialize result
  R3Point camera_position = pose.InverseMatrix() * world_position;

  // Check if has rolling shutter
  if (HasRollingShutter()) {
    // Search for x coordinate (there is a different camera pose for every column)
    int column_index = ImageWidth() / 2;
    int last_column_index = column_index;
    for (int i = 0; i < ImageWidth()/2; i++) {
      // Transform world point into column's camera coordinate system
      R3CoordSystem cs = RollingShutterPoseAtImagePosition(R2Point(column_index, 0));
      R3Point camera_p = cs.InverseMatrix() * world_position;
      if (RNIsPositiveOrZero(camera_p.Z())) return camera_position;
      camera_position = camera_p;
      
      // Get/check column index
      R2Point distorted_position = TransformFromCameraToImage(camera_position);
      column_index = (int) (distorted_position.X() + 0.5);
      if (column_index < 0) column_index = 0;
      if (column_index >= ImageWidth()-1) column_index = ImageWidth()-1;
      if (column_index == last_column_index) break;
      last_column_index = column_index;
    }
  }

  // Return camera position
  return camera_position;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq $0x30, %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x70856
movq %rbx, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, 0x8(%rsp)
movq %r14, %rdx
callq 0x7443a
testb $0x1, 0x1c8(%r15)
je 0x3ccee
movl 0x98(%r15), %ebp
cmpl $0x2, %ebp
jl 0x3ccee
shrl %ebp
leaq 0x28(%rsp), %r12
leaq 0x10(%rsp), %r14
xorl %r13d, %r13d
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
xorps %xmm1, %xmm1
movq %r12, %rdi
callq 0xa2542
movq %r14, %rbx
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3cd04
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %r14
callq 0x70856
movq %rbx, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
callq 0x7443a
movsd 0x20(%rsp), %xmm0
leaq 0xf6f8f(%rip), %rax     # 0x133c08
movsd (%rax), %xmm1
xorpd 0xa071b(%rip), %xmm1    # 0xdd3a0
ucomisd %xmm1, %xmm0
jae 0x3ccee
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8412a
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3cd80
movsd 0x28(%rsp), %xmm0
addsd 0xa0482(%rip), %xmm0    # 0xdd138
cvttsd2si %xmm0, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl 0x98(%r15), %ecx
leal -0x1(%rcx), %edx
cmpl %edx, %eax
cmovgel %edx, %eax
cmpl %ebp, %eax
je 0x3ccee
incl %r13d
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movl %eax, %ebp
cmpl %edx, %r13d
jl 0x3cc23
movq (%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::RollingShutterPoseAtImagePosition(gaps::R2Point const&) const
R3CoordSystem R3SurfelImage::
RollingShutterPoseAtImagePosition(const R2Point& image_position) const
{
  // Check rolling shutter parameters
  if (!HasRollingShutter()) return pose;
  if (image_width <= 1) return rolling_shutter_poses[0];

  // Get interpolation parameter
  double u = (double) image_position.X() / (double) (image_width-1);
  if (u <= 0) return rolling_shutter_poses[0];
  if (u >= 1) return rolling_shutter_poses[1];

  // Return slerped pose
  return R3CoordSystemSlerp(rolling_shutter_poses[0], rolling_shutter_poses[1], u);
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
testb $0x1, 0x1c8(%rsi)
jne 0x3cd1a
addq $0x30, %rax
jmp 0x3cd67
movl 0x98(%rax), %ecx
cmpl $0x1, %ecx
jle 0x3cd61
movsd (%rdx), %xmm0
decl %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x3cd61
ucomisd 0xa0403(%rip), %xmm0    # 0xdd148
jae 0x3cd77
leaq 0xf0(%rax), %rsi
addq $0x150, %rax            # imm = 0x150
movq %rbx, %rdi
movq %rax, %rdx
callq 0x70a07
jmp 0x3cd72
addq $0xf0, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7077e
movq %rbx, %rax
popq %rbx
retq
addq $0x150, %rax            # imm = 0x150
jmp 0x3cd67
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TransformFromCameraToImage(gaps::R3Point const&) const
R2Point R3SurfelImage::
TransformFromCameraToImage(const R3Point& camera_position) const
{
  // Project 3D point in camera coordinates into pixels
  const R2Point c = ImageCenter();
  RNCoord x = c.X() + xfocal * camera_position.X() / -camera_position.Z();
  RNCoord y = c.Y() + yfocal * camera_position.Y() / -camera_position.Z();
  R2Point undistorted_image_position(x, y);
  
  // Distort image position
  return DistortImagePosition(undistorted_image_position);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
addq $0xa0, %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0xa254c
movsd 0xb0(%r14), %xmm1
movsd 0xb8(%r14), %xmm2
mulsd (%r15), %xmm1
movsd 0x10(%r15), %xmm3
divsd %xmm3, %xmm1
movsd (%r12), %xmm0
subsd %xmm1, %xmm0
movsd 0x8(%r12), %xmm1
mulsd 0x8(%r15), %xmm2
divsd %xmm3, %xmm2
subsd %xmm2, %xmm1
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa2542
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3ce7c
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TransformFromWorldToImage(gaps::R3Point const&) const
R2Point R3SurfelImage::
TransformFromWorldToImage(const R3Point& world_position) const
{
  // Transform into camera coordinates
  R3Point camera_position = TransformFromWorldToCamera(world_position);
  if (RNIsPositiveOrZero(camera_position.Z())) return R2unknown_point;

  // Transform into image coordinates
  return TransformFromCameraToImage(camera_position);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3cbb4
movsd 0x10(%r15), %xmm0
leaq 0xf6dcd(%rip), %rax     # 0x133c08
movsd (%rax), %xmm1
xorpd 0xa0559(%rip), %xmm1    # 0xdd3a0
ucomisd %xmm1, %xmm0
jae 0x3ce5f
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cd80
jmp 0x3ce6e
leaq 0x4f951a(%rip), %rsi    # 0x536380
movq %rbx, %rdi
callq 0xa254c
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TransformFromCameraToWorld(gaps::R3Point const&) const
R3Point R3SurfelImage::
TransformFromCameraToWorld(const R3Point& camera_position) const
{
  // Check if rolling shutter
  if (HasRollingShutter()) {
    // Get projected image position
    R2Point image_position = TransformFromCameraToImage(camera_position);

    // Get rolling shutter pose
    R3CoordSystem rs_pose = RollingShutterPoseAtImagePosition(image_position);

    // Transform 3D point from camera into world coordinate system
    return rs_pose.Matrix() * camera_position;
  }
  else {
    // Transform 3D point from camera into world coordinate system
    return CameraToWorld() * camera_position;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf0, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testb $0x1, 0x1c8(%rsi)
jne 0x3d152
addq $0x30, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x707ce
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x3d18f
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3cd80
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3cd04
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x707ce
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x7443a
movq %rbx, %rax
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TransformFromImageToWorld(gaps::R2Point const&, double) const
R3Point R3SurfelImage::
TransformFromImageToWorld(const R2Point& image_position, RNLength depth) const
{
  // Transform from image to camera coordinates
  R3Point camera_position = TransformFromImageToCamera(image_position, depth);

  // Transform from camera to world coordinates
  if (HasRollingShutter()) {
    // Get rolling shutter pose
    R3CoordSystem rs_pose = RollingShutterPoseAtImagePosition(image_position);

    // Return position in world coordinates
    return rs_pose.Matrix() * camera_position;
  }
  else {
    // Return position in world coordinates
    return TransformFromCameraToWorld(camera_position);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x3d228
testb $0x1, 0x1c8(%r14)
jne 0x3d1e5
movq %rsp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d114
jmp 0x3d216
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3cd04
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x707ce
movq %rsp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7443a
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TransformFromImageToCamera(gaps::R2Point const&, double) const
R3Point R3SurfelImage::
TransformFromImageToCamera(const R2Point& image_position, RNLength depth) const
{
  // Check camera parameters
  if ((xfocal <= 0) || (yfocal <= 0)) return R3unknown_point;

  // Undistort image position
  R2Point undistorted_image_position = UndistortImagePosition(image_position);
  if (undistorted_image_position == R2unknown_point) return R3unknown_point;

  // Get depth
  if (depth < 0) {
    if (channels.NEntries() <= R3_SURFEL_DEPTH_CHANNEL) return R3unknown_point;
    if (!channels[R3_SURFEL_DEPTH_CHANNEL]) return R3unknown_point;
    int ix = image_position.X() + 0.5;
    int iy = image_position.Y() + 0.5;
    depth = channels[R3_SURFEL_DEPTH_CHANNEL]->GridValue(ix, iy);
  }

  // Backproject from pixels into camera coordinate system
  const R2Point c = ImageCenter();
  RNCoord x = (undistorted_image_position.X() - c.X()) * depth / xfocal;
  RNCoord y = (undistorted_image_position.Y() - c.Y()) * depth / yfocal;
  return R3Point(x, y, -depth);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd 0xb0(%rsi), %xmm1
jae 0x3d27c
movq %rsi, %r14
ucomisd 0xb8(%rsi), %xmm1
jae 0x3d27c
movq %rdx, %r15
movapd %xmm0, (%rsp)
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3d358
leaq 0x4f9110(%rip), %rsi    # 0x536380
movq %r12, %rdi
callq 0xa2812
testl %eax, %eax
je 0x3d29a
leaq 0x4f84dd(%rip), %rsi    # 0x535760
movq %rbx, %rdi
callq 0x83dd2
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorpd %xmm0, %xmm0
movapd (%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3d2f4
cmpl $0x3, 0x2c(%r14)
jle 0x3d27c
movq 0x20(%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3d27c
movsd 0x9fe73(%rip), %xmm0    # 0xdd138
movsd (%r15), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
addsd 0x8(%r15), %xmm0
cvttsd2si %xmm0, %edx
imull 0xc8(%rax), %edx
movq 0xb8(%rax), %rax
addl %ecx, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm1
movapd %xmm1, (%rsp)
leaq 0xa0(%r14), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xa254c
movsd 0x18(%rsp), %xmm0
subsd (%r15), %xmm0
movapd (%rsp), %xmm2
mulsd %xmm2, %xmm0
divsd 0xb0(%r14), %xmm0
movsd 0x20(%rsp), %xmm1
subsd 0x8(%r15), %xmm1
mulsd %xmm2, %xmm1
divsd 0xb8(%r14), %xmm1
xorpd 0xa0055(%rip), %xmm2    # 0xdd3a0
movq %rbx, %rdi
callq 0x83dc2
jmp 0x3d28b
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::UndistortImagePosition(gaps::R2Point const&) const
R2Point R3SurfelImage::
UndistortImagePosition(const R2Point& distorted_image_position) const
{
  // Check distortion type
  if (distortion_type == R3_SURFEL_NO_DISTORTION)
    return distorted_image_position;

  // Check distortion parameters
  if ((radial_distortion[0] == 0) && (radial_distortion[1] == 0) && (radial_distortion[2] == 0) &&
      (tangential_distortion[0] == 0) && (tangential_distortion[1] == 0))
    return distorted_image_position;

  // Check focal lengths
  if ((xfocal <= 0) || (yfocal <= 0))
    return distorted_image_position;
  
  // Not implemented yet
  RNWarning("R3SurfelImage::UndistortImagePosition not implemented");
  return distorted_image_position;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x0, 0xc0(%rsi)
je 0x3d3cd
movupd 0xc8(%rsi), %xmm0
movupd 0xd8(%rsi), %xmm1
xorpd %xmm2, %xmm2
cmpneqpd %xmm2, %xmm1
cmpneqpd %xmm2, %xmm0
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
movmskps %xmm0, %eax
testl %eax, %eax
jne 0x3d3a8
movsd 0xe8(%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3d3a8
jnp 0x3d3cd
xorps %xmm0, %xmm0
ucomisd 0xb0(%rsi), %xmm0
jae 0x3d3cd
ucomisd 0xb8(%rsi), %xmm0
jae 0x3d3cd
leaq 0xa1332(%rip), %rdi     # 0xde6f8
xorl %eax, %eax
callq 0xac8d5
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa254c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::RollingShutterPoseAtTimestamp(double) const
R3CoordSystem R3SurfelImage::
RollingShutterPoseAtTimestamp(RNScalar t) const
{
  // Check rolling shutter parameters
  if (!HasRollingShutter()) return pose;
  double dt = rolling_shutter_timestamps[1] - rolling_shutter_timestamps[0];
  if (RNIsZero(dt)) return rolling_shutter_poses[0];

  // Get interpolation parameter
  double u = (t - rolling_shutter_timestamps[0]) / dt;
  if (u <= 0) return rolling_shutter_poses[0];
  if (u >= 1) return rolling_shutter_poses[1];
  
  // Return slerped pose
  return R3CoordSystemSlerp(rolling_shutter_poses[0], rolling_shutter_poses[1], u);
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rbx
testb $0x1, 0x1c8(%rsi)
jne 0x3d450
addq $0x30, %rdx
jmp 0x3d4c2
movsd 0x1b0(%rdx), %xmm2
movsd 0x1b8(%rdx), %xmm1
subsd %xmm2, %xmm1
leaq 0xf679d(%rip), %rax     # 0x133c08
movsd (%rax), %xmm3
movapd 0x9ff29(%rip), %xmm4    # 0xdd3a0
xorpd %xmm3, %xmm4
ucomisd %xmm4, %xmm1
jb 0x3d487
ucomisd %xmm1, %xmm3
jae 0x3d4bb
subsd %xmm2, %xmm0
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x3d4bb
ucomisd 0x9fca7(%rip), %xmm0    # 0xdd148
jae 0x3d4d2
leaq 0xf0(%rdx), %rsi
addq $0x150, %rdx            # imm = 0x150
movq %rbx, %rdi
callq 0x70a07
jmp 0x3d4cd
addq $0xf0, %rdx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x7077e
movq %rbx, %rax
popq %rbx
retq
addq $0x150, %rdx            # imm = 0x150
jmp 0x3d4c2
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::RollingShutterTimestampAtImagePosition(gaps::R2Point const&) const
RNScalar R3SurfelImage::
RollingShutterTimestampAtImagePosition(const R2Point& image_position) const
{
  // Check rolling shutter parameters
  if (!HasRollingShutter()) return timestamp;
  if (image_width <= 1) return rolling_shutter_timestamps[0];

  // Get interpolation parameter
  double u = (double) image_position.X() / (double) (image_width-1);
  if (u <= 0) return rolling_shutter_timestamps[0];
  if (u >= 1) return rolling_shutter_timestamps[1];

  // Return interpolated timestamp
  return (1-u)*rolling_shutter_timestamps[0] + u*rolling_shutter_timestamps[1];
}

// Assembly:
testb $0x1, 0x1c8(%rdi)
jne 0x3d4ee
movsd 0x90(%rdi), %xmm0
retq
movl 0x98(%rdi), %eax
cmpl $0x1, %eax
jle 0x3d53c
movsd (%rsi), %xmm1
decl %eax
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x3d53c
ucomisd 0x9fc2f(%rip), %xmm1    # 0xdd148
jae 0x3d545
movsd 0x9fc25(%rip), %xmm0    # 0xdd148
subsd %xmm1, %xmm0
mulsd 0x1b8(%rdi), %xmm1
mulsd 0x1b0(%rdi), %xmm0
addsd %xmm1, %xmm0
retq
movsd 0x1b0(%rdi), %xmm0
retq
movsd 0x1b8(%rdi), %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelImage::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print image
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%d %s", SceneIndex(), (Name()) ? Name() : "-");
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
jne 0x3d56b
movq 0xf5a08(%rip), %rax     # 0x132f70
movq (%rax), %rbx
testq %rdx, %rdx
je 0x3d57b
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x135b0
movl 0x10(%r15), %edx
movq 0x1c0(%r15), %rax
testq %rax, %rax
leaq 0x9fdb6(%rip), %rcx     # 0xdd346
cmovneq %rax, %rcx
leaq 0x9fda5(%rip), %rsi     # 0xdd340
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13740
testq %r14, %r14
je 0x3d5b5
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x13670
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::Draw(gaps::RNFlags, double) const
void R3SurfelImage::
Draw(RNFlags flags, RNScalar scale) const
{
#if 1
  // Draw towards and up
  RNGrfxBegin(RN_GRFX_LINES);
  const R3Point& viewpoint = Viewpoint();
  const R3Vector towards = Towards();
  const R3Vector up = Up();
  R3LoadPoint(viewpoint);
  R3LoadPoint(viewpoint + scale * towards);
  R3LoadPoint(viewpoint);
  R3LoadPoint(viewpoint + 0.5 * scale * up);
  RNGrfxEnd();
#else
  // Draw R3Camera approximation
  Camera().Draw(scale);
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movsd %xmm0, (%rsp)
movq %rdi, %r15
movl $0x1, %edi
callq 0x13130
leaq 0x30(%r15), %rbx
leaq 0x78(%r15), %rsi
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x85490
addq $0x60, %r15
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x84866
movq %rbx, %rdi
callq 0x13150
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movsd (%rsp), %xmm0
callq 0x851f2
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x84107
movq %r12, %rdi
callq 0x13150
movq %rbx, %rdi
callq 0x13150
movsd (%rsp), %xmm0
mulsd 0x9fadd(%rip), %xmm0    # 0xdd138
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x851f2
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x84107
movq %r14, %rdi
callq 0x13150
callq 0x136a0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeature.cpp
// Function: gaps::R3SurfelFeature::operator=(gaps::R3SurfelFeature const&)
R3SurfelFeature& R3SurfelFeature::
operator=(const R3SurfelFeature& feature)
{
  // Assign properties
  this->name = (feature.name) ? RNStrdup(feature.name) : NULL;
  this->range = feature.range;
  this->weight = feature.weight;

  // Return this
  return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rdi
testq %rdi, %rdi
je 0x3e0c6
callq 0xac67b
jmp 0x3e0c8
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movups 0x20(%r14), %xmm0
movups %xmm0, 0x20(%rbx)
movsd 0x30(%r14), %xmm0
movsd %xmm0, 0x30(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeature.cpp
// Function: gaps::R3SurfelFeature::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelFeature::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print feature name
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%s ", Name());
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
jne 0x3e17b
movq 0xf4df8(%rip), %rax     # 0x132f70
movq (%rax), %rbx
testq %rdx, %rdx
je 0x3e18b
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x135b0
movq 0x18(%r15), %rdx
leaq 0x9f7d6(%rip), %rsi     # 0xdd96c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13740
testq %r14, %r14
je 0x3e1b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x13670
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::R3SurfelFeatureVector(int)
R3SurfelFeatureVector::
R3SurfelFeatureVector(int nvalues)
  : values(NULL),
    nvalues(nvalues)
{
  // Allocate values
  if (nvalues > 0) {
    values = new RNScalar [ nvalues ];
    for (int i = 0; i < nvalues; i++) {
      values[i] = RN_UNKNOWN;
    }
  }
}

// Assembly:
leaq 0xf0c2d(%rip), %rax     # 0x12edf8
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl %esi, 0x10(%rdi)
testl %esi, %esi
jle 0x3e29c
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
leaq (,%r15,8), %rdi
callq 0x13030
movq %rax, 0x8(%r14)
incl %ebx
decq %r15
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %ebx
shlq $0x4, %rbx
movdqa 0xa0574(%rip), %xmm1    # 0xde790
xorl %ecx, %ecx
movdqa 0xa057a(%rip), %xmm2    # 0xde7a0
pxor %xmm2, %xmm0
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
pcmpeqd %xmm3, %xmm3
movdqa 0xa0570(%rip), %xmm4    # 0xde7b0
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x3e276
movq %rdx, (%rax,%rcx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x3e28a
movq %rdx, 0x8(%rax,%rcx)
paddq %xmm4, %xmm1
addq $0x10, %rcx
cmpq %rcx, %rbx
jne 0x3e240
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::R3SurfelFeatureVector(gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector::
R3SurfelFeatureVector(const R3SurfelFeatureVector& vector)
  : values(NULL),
    nvalues(vector.nvalues)
{
  // Allocate values
  if (nvalues > 0) {
    values = new RNScalar [ nvalues ];
    for (int i = 0; i < nvalues; i++) {
      values[i] = vector.values[i];
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xf0b4e(%rip), %rax     # 0x12edf8
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movslq 0x10(%rsi), %r15
movl %r15d, 0x10(%rdi)
testq %r15, %r15
jle 0x3e2f1
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%r15,8), %rdi
callq 0x13030
movq %rax, 0x8(%r14)
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %r15
jne 0x3e2df
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator=(gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator=(const R3SurfelFeatureVector& vector)
{
  // Reallocate values
  if (nvalues != vector.nvalues) {
    nvalues = vector.nvalues;
    if (values) delete [] values;
    if (nvalues > 0) values = new RNScalar [ nvalues ];
    else values = NULL;
  }

  // Copy values
  for (int i = 0; i < nvalues; i++) {
    values[i] = vector.values[i];
  }

  // Return this
  return *this;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rdi), %edx
movl 0x10(%rsi), %ebp
cmpl %ebp, %edx
jne 0x3e354
testl %edx, %edx
jg 0x3e37d
jmp 0x3e3a5
movl %ebp, 0x10(%rbx)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3e368
callq 0x13680
movl 0x10(%rbx), %ebp
testl %ebp, %ebp
jle 0x3e39d
movl %ebp, %edi
shlq $0x3, %rdi
callq 0x13030
movq %rax, 0x8(%rbx)
movl %ebp, %edx
movq 0x8(%r14), %rax
movq 0x8(%rbx), %rcx
movl %edx, %edx
xorl %esi, %esi
movsd (%rax,%rsi,8), %xmm0
movsd %xmm0, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x3e389
jmp 0x3e3a5
movq $0x0, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator+=(gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator+=(const R3SurfelFeatureVector& vector)
{
  // Check number of values
  assert(nvalues == vector.nvalues);

  // Add values
  for (int i = 0; i < nvalues; i++) {
    values[i] += vector.values[i];
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e3db
movq 0x8(%rsi), %rdx
movq 0x8(%rax), %rsi
xorl %edi, %edi
movsd (%rdx,%rdi,8), %xmm0
addsd (%rsi,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x3e3c4
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator-=(gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator-=(const R3SurfelFeatureVector& vector)
{
  // Check number of values
  assert(nvalues == vector.nvalues);

  // Subtract values
  for (int i = 0; i < nvalues; i++) {
    values[i] -= vector.values[i];
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e409
movq 0x8(%rsi), %rdx
movq 0x8(%rax), %rsi
xorl %edi, %edi
movsd (%rsi,%rdi,8), %xmm0
subsd (%rdx,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x3e3f2
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator*=(gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator*=(const R3SurfelFeatureVector& vector)
{
  // Check number of values
  assert(nvalues == vector.nvalues);

  // Multiply values
  for (int i = 0; i < nvalues; i++) {
    values[i] *= vector.values[i];
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e437
movq 0x8(%rsi), %rdx
movq 0x8(%rax), %rsi
xorl %edi, %edi
movsd (%rdx,%rdi,8), %xmm0
mulsd (%rsi,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x3e420
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator/=(gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator/=(const R3SurfelFeatureVector& vector)
{
  // Check number of values
  assert(nvalues == vector.nvalues);

  // Divide values
  for (int i = 0; i < nvalues; i++) {
    if (RNIsNotZero(vector.values[i])) values[i] /= vector.values[i];
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e498
movq 0x8(%rsi), %rdx
movq 0x8(%rax), %rsi
leaq 0xf57b5(%rip), %rdi     # 0x133c08
movsd (%rdi), %xmm1
xorl %r8d, %r8d
movapd 0x9ef3e(%rip), %xmm0    # 0xdd3a0
movsd (%rdx,%r8,8), %xmm2
ucomisd %xmm1, %xmm2
ja 0x3e47c
movapd %xmm1, %xmm3
xorpd %xmm0, %xmm3
ucomisd %xmm2, %xmm3
jbe 0x3e490
movsd (%rsi,%r8,8), %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, (%rsi,%r8,8)
movsd (%rdi), %xmm1
incq %r8
cmpq %r8, %rcx
jne 0x3e462
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator+=(double)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator+=(RNScalar a)
{
  // Add values
  for (int i = 0; i < nvalues; i++) {
    values[i] += a;
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e4c2
movq 0x8(%rax), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x3e4ac
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator-=(double)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator-=(RNScalar a)
{
  // Subtract values
  for (int i = 0; i < nvalues; i++) {
    values[i] -= a;
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e4ec
movq 0x8(%rax), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x3e4d6
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator*=(double)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator*=(RNScalar a)
{
  // Multiply values
  for (int i = 0; i < nvalues; i++) {
    values[i] *= a;
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e516
movq 0x8(%rax), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x3e500
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::operator/=(double)
R3SurfelFeatureVector& R3SurfelFeatureVector::
operator/=(RNScalar a)
{
  // Check a
  if (RNIsZero(a)) return *this;

  // Divide values
  for (int i = 0; i < nvalues; i++) {
    values[i] /= a;
  }

  // Return this
  return *this;
}

// Assembly:
movq %rdi, %rax
leaq 0xf56e6(%rip), %rcx     # 0x133c08
movsd (%rcx), %xmm1
movapd 0x9ee72(%rip), %xmm2    # 0xdd3a0
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x3e53e
ucomisd %xmm0, %xmm1
jae 0x3e563
movslq 0x10(%rax), %rcx
testq %rcx, %rcx
jle 0x3e563
movq 0x8(%rax), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x3e54d
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator+(gaps::R3SurfelFeatureVector const&, gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector 
operator+(const R3SurfelFeatureVector& vector1, const R3SurfelFeatureVector& vector2)
{
  // Add feature vectors
  R3SurfelFeatureVector vector = vector1;
  vector += vector2;
  return vector;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
callq 0x3e29e
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e59d
movq 0x8(%r14), %rcx
movq 0x8(%rbx), %rdx
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm0
addsd (%rdx,%rsi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x3e586
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator-(gaps::R3SurfelFeatureVector const&, gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector 
operator-(const R3SurfelFeatureVector& vector1, const R3SurfelFeatureVector& vector2)
{
  // Subtract feature vectors
  R3SurfelFeatureVector vector = vector1;
  vector -= vector2;
  return vector;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
callq 0x3e29e
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e5e1
movq 0x8(%r14), %rcx
movq 0x8(%rbx), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm0
subsd (%rcx,%rsi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x3e5ca
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator*(gaps::R3SurfelFeatureVector const&, gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector 
operator*(const R3SurfelFeatureVector& vector1, const R3SurfelFeatureVector& vector2)
{
  // Multiply feature vectors
  R3SurfelFeatureVector vector = vector1;
  vector *= vector2;
  return vector;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
callq 0x3e29e
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e625
movq 0x8(%r14), %rcx
movq 0x8(%rbx), %rdx
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm0
mulsd (%rdx,%rsi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x3e60e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator+(gaps::R3SurfelFeatureVector const&, double)
R3SurfelFeatureVector 
operator+(const R3SurfelFeatureVector& vector1, const RNScalar a)
{
  // Add scalar
  R3SurfelFeatureVector vector = vector1;
  vector += a;
  return vector;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x3e29e
movsd 0x8(%rsp), %xmm1
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e693
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3e67d
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator+(double, gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector 
operator+(const RNScalar a, const R3SurfelFeatureVector& vector1)
{
  // Add scalar
  R3SurfelFeatureVector vector = vector1;
  vector += a;
  return vector;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x3e29e
movsd 0x8(%rsp), %xmm1
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e6da
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3e6c4
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator-(gaps::R3SurfelFeatureVector const&, double)
R3SurfelFeatureVector 
operator-(const R3SurfelFeatureVector& vector1, const RNScalar a)
{
  // Subtract scalar
  R3SurfelFeatureVector vector = vector1;
  vector -= a;
  return vector;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x3e29e
movsd 0x8(%rsp), %xmm1
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e721
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3e70b
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator*(gaps::R3SurfelFeatureVector const&, double)
R3SurfelFeatureVector 
operator*(const R3SurfelFeatureVector& vector1, const RNScalar a)
{
  // Multiply by scalar
  R3SurfelFeatureVector vector = vector1;
  vector *= a;
  return vector;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x3e29e
movsd 0x8(%rsp), %xmm1
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e785
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3e76f
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator*(double, gaps::R3SurfelFeatureVector const&)
R3SurfelFeatureVector 
operator*(const RNScalar a, const R3SurfelFeatureVector& vector1)
{
  // Multiply by scalar
  R3SurfelFeatureVector vector = vector1;
  vector *= a;
  return vector;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x3e29e
movsd 0x8(%rsp), %xmm1
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e7cc
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3e7b6
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::operator/(gaps::R3SurfelFeatureVector const&, double)
R3SurfelFeatureVector 
operator/(const R3SurfelFeatureVector& vector1, const RNScalar a)
{
  // Divide by scalar
  R3SurfelFeatureVector vector = vector1;
  vector /= a;
  return vector;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x3e29e
leaq 0xf5419(%rip), %rax     # 0x133c08
movsd (%rax), %xmm0
movapd 0x9eba5(%rip), %xmm1    # 0xdd3a0
xorpd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm2
ucomisd %xmm1, %xmm2
movapd %xmm2, %xmm1
jb 0x3e815
ucomisd %xmm1, %xmm0
jae 0x3e83a
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x3e83a
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3e824
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::Resize(int)
void R3SurfelFeatureVector::
Resize(int size)
{
  // Save old stuff
  RNScalar *old_values = values;
  int old_nvalues = nvalues;

  // Set new stuff
  nvalues = size;
  values = NULL;

  // Copy values
  if (nvalues > 0) {
    values = new RNScalar [ nvalues ];
    int overlap = (nvalues > old_nvalues) ? old_nvalues : nvalues;
    for (int i = 0; i < overlap; i++) values[i] = old_values[i];
    for (int i = overlap; i < nvalues; i++) values[i] = RN_UNKNOWN;
  }

  // Delete old values
  if (old_values) delete [] old_values;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rbx
movslq 0x10(%rdi), %r15
movl %esi, 0x10(%rdi)
movq $0x0, 0x8(%rdi)
testl %esi, %esi
jle 0x3e947
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %edi
shlq $0x3, %rdi
callq 0x13030
movq %rax, 0x8(%r14)
testl %r15d, %r15d
jle 0x3e89c
cmpl %ebp, %r15d
movl %ebp, %ecx
cmovbl %r15d, %ecx
xorl %edx, %edx
movq (%rbx,%rdx,8), %xmm0
movq %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x3e88a
cmpl %ebp, %r15d
jge 0x3e947
movl %r15d, %edx
notl %edx
addl %ebp, %edx
leaq 0x2(%rdx), %rcx
andq $-0x2, %rcx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rax,%r15,8), %rax
addq $0x8, %rax
xorl %edx, %edx
movdqa 0x9fec0(%rip), %xmm1    # 0xde790
movdqa 0x9fec8(%rip), %xmm2    # 0xde7a0
pxor %xmm2, %xmm0
movabsq $-0x4010000000000000, %rsi # imm = 0xBFF0000000000000
pcmpeqd %xmm3, %xmm3
movq %rdx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %edi
notl %edi
testb $0x1, %dil
je 0x3e92b
movq %rsi, -0x8(%rax,%rdx,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %edi
testb $0x1, %dil
je 0x3e93e
movq %rsi, (%rax,%rdx,8)
addq $0x2, %rdx
cmpq %rdx, %rcx
jne 0x3e8ea
testq %rbx, %rbx
je 0x3e95e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13680
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::EuclideanDistanceSquared(gaps::R3SurfelFeatureVector const&) const
RNLength R3SurfelFeatureVector::
EuclideanDistanceSquared(const R3SurfelFeatureVector& vector) const
{
  // Compute sum of squared differences
  RNLength sum = 0;
  assert(NValues() == vector.NValues());
  for (int i = 0; i < NValues(); i++) {
    RNScalar delta = Value(i) - vector.Value(i);
    sum += delta * delta;
  }

  // Return squared Euclidean distance
  return sum;
}

// Assembly:
movslq 0x10(%rdi), %rax
testq %rax, %rax
jle 0x3ea50
movq 0x8(%rdi), %rcx
movq 0x8(%rsi), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm1
subsd (%rdx,%rsi,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x3ea35
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureVector.cpp
// Function: gaps::R3SurfelFeatureVector::Correlation(gaps::R3SurfelFeatureVector const&) const
RNScalar R3SurfelFeatureVector::
Correlation(const R3SurfelFeatureVector& vector) const
{
  // Compute sum of products (dot product)
  RNLength sum = 0;
  assert(NValues() == vector.NValues());
  for (int i = 0; i < NValues(); i++) {
    sum += Value(i) * vector.Value(i);
  }

  // Return correlation
  return sum;
}

// Assembly:
movslq 0x10(%rdi), %rax
testq %rax, %rax
jle 0x3ea82
movq 0x8(%rdi), %rcx
movq 0x8(%rsi), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm1
mulsd (%rdx,%rsi,8), %xmm1
addsd %xmm1, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x3ea6b
retq
xorps %xmm0, %xmm0
retq