LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: neguse[P]no/lang.cc
// Function: LangInterpreter::Frame::Get(char) const
std::shared_ptr<Value> Get(char c) const {
      auto it = m.find(c);
      if (it != m.end()) {
        return it->second;
      } else if (parent != nullptr) {
        return parent->Get(c);
      } else {
        return nullptr;
      }
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x8(%rsp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, 0x10(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movb %al, 0x37(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x18(%rsp)
addq $0x10, %rdi
leaq 0x37(%rsp), %rsi
callq 0x107b0
movq 0x18(%rsp), %rdi
movq %rax, 0x28(%rsp)
addq $0x10, %rdi
callq 0x10800
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x107e0
testb $0x1, %al
jne 0xf4e6
jmp 0xf503
leaq 0x28(%rsp), %rdi
callq 0x10830
movq 0x8(%rsp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x9d40
jmp 0xf543
movq 0x18(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10850
testb $0x1, %al
jne 0xf517
jmp 0xf535
movq 0x18(%rsp), %rdi
callq 0x9c00
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movsbl 0x37(%rsp), %edx
callq 0xf480
jmp 0xf543
movq 0x8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10870
movq 0x10(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)
// File: neguse[P]no/lang.cc
// Function: LangInterpreter::StringToList(char const*)
Value::Ref StringToList(const char *s) {
    if (*s == '\0') {
      Value::Ref v = std::make_shared<Value>();
      v->SetList(nullptr);
      return v;
    } else {
      Value::Ref v = std::make_shared<Value>();
      Cons::Ref c = std::make_shared<Cons>();
      Value::Ref vi = std::make_shared<Value>();
      vi->SetInteger(*s);
      c->car = vi;
      c->cdr = StringToList(s + 1);
      v->SetList(c);
      return v;
    }
  }

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa0(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xf71b
movq 0x18(%rsp), %rdi
movb $0x0, 0x9f(%rsp)
callq 0x9a70
movq 0x18(%rsp), %rdi
callq 0x9ae0
movq %rax, 0x10(%rsp)
leaq 0x88(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9db0
movq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x9d80
leaq 0x88(%rsp), %rdi
callq 0x9dd0
movb $0x1, 0x9f(%rsp)
testb $0x1, 0x9f(%rsp)
jne 0xf716
movq 0x18(%rsp), %rdi
callq 0x9d70
jmp 0xf877
movq 0x18(%rsp), %rdi
movb $0x0, 0x87(%rsp)
callq 0x9a70
leaq 0x70(%rsp), %rdi
callq 0xf890
jmp 0xf739
leaq 0x50(%rsp), %rdi
callq 0x9a70
jmp 0xf745
leaq 0x50(%rsp), %rdi
callq 0x9ae0
movq %rax, %rdi
movq 0xa0(%rsp), %rax
movsbl (%rax), %esi
callq 0xf240
jmp 0xf764
leaq 0x70(%rsp), %rdi
callq 0xf230
movq %rax, %rdi
leaq 0x50(%rsp), %rsi
callq 0xddb0
movq 0x28(%rsp), %rsi
movq 0xa0(%rsp), %rdx
incq %rdx
leaq 0x40(%rsp), %rdi
callq 0xf660
jmp 0xf797
leaq 0x70(%rsp), %rdi
callq 0xf230
movq %rax, %rdi
addq $0x10, %rdi
leaq 0x40(%rsp), %rsi
callq 0xf900
leaq 0x40(%rsp), %rdi
callq 0x9d70
movq 0x18(%rsp), %rdi
callq 0x9ae0
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xf3a0
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x9d80
leaq 0x30(%rsp), %rdi
callq 0x9dd0
movb $0x1, 0x87(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x9d70
leaq 0x70(%rsp), %rdi
callq 0x9dd0
testb $0x1, 0x87(%rsp)
jne 0xf869
jmp 0xf85f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0xf86b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0xf853
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x9d70
leaq 0x70(%rsp), %rdi
callq 0x9dd0
jmp 0xf86b
movq 0x18(%rsp), %rdi
callq 0x9d70
jmp 0xf877
movq 0x18(%rsp), %rdi
callq 0x9d70
jmp 0xf884
movq 0x20(%rsp), %rax
addq $0xb8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x21d0
nop
// File: superblocks[P]superblocks/set-dmd.cpp
// Function: Superblocks::init()
void Superblocks::init() {

	coin = "DMD"; 
	coin_name = "Diamondcoin";

	hash_length = 64;

	// normal (step 0)
	reward[0] = 1;

	// superblocks

	seed_type[1] = SEED_WITH_PREVIOUS_BLOCK_HASH;
	cutout_start[1] = 6;
	cutout_length[1] = 7;
	rnd_range_low[1] = 1;
	rnd_range_high[1] = 14400;
	luck_type[1] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[1] = 10000;
	luck_y[1] = 10011;
	reward[1] = 30;

	luck_type[2] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[2] = 2000;
	luck_y[2] = 2031;
	reward[2] = 8;

	luck_type[3] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[3] = 8000;
	luck_y[3] = 8101;
	reward[3] = 2;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
addq $0x18, %rdi
leaq 0x1801(%rip), %rsi      # 0x5e80
callq 0x21a0
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
leaq 0x17f1(%rip), %rsi      # 0x5e84
callq 0x21a0
movq -0x10(%rbp), %rax
movl $0x40, 0x58(%rax)
movl $0x1, 0x14c(%rax)
movl $0x2, 0x60(%rax)
movl $0x6, 0x70(%rax)
movl $0x7, 0x80(%rax)
movl $0x1, 0x90(%rax)
movl $0x3840, 0xa0(%rax)     # imm = 0x3840
movl $0x3, 0x120(%rax)
movl $0x2710, 0x130(%rax)    # imm = 0x2710
movl $0x271b, 0x140(%rax)    # imm = 0x271B
movl $0x1e, 0x150(%rax)
movl $0x3, 0x124(%rax)
movl $0x7d0, 0x134(%rax)     # imm = 0x7D0
movl $0x7ef, 0x144(%rax)     # imm = 0x7EF
movl $0x8, 0x154(%rax)
movl $0x3, 0x128(%rax)
movl $0x1f40, 0x138(%rax)    # imm = 0x1F40
movl $0x1fa5, 0x148(%rax)    # imm = 0x1FA5
movl $0x2, 0x158(%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: tomfunkhouser[P]gaps/apps/conf2sfl/conf2sfl.cpp
// Function: main
int main(int argc, char **argv)
{
  // Check number of arguments
  if (!ParseArgs(argc, argv)) exit(1);

  // Read configuration
  RGBDConfiguration *configuration = ReadConfiguration(input_configuration_name);
  if (!configuration) exit(-1);

  // Open surfel scene
  R3SurfelScene *scene = OpenSurfelScene(output_ssa_name, output_ssb_name);
  if (!scene) exit(-1);

  // Create surfels
  if (!LoadSurfels(scene, configuration)) exit(-1);

  // Process surfels
  if (create_multiresolution_hierarchy) {
    if (!CreateMultiresolutionHierarchy(scene)) exit(-1);
  }

  // Close surfel scene
  if (!CloseSurfelScene(scene)) exit(-1);

  // Delete scene
  delete scene;

  // Return success 
  return 0;
}

// Assembly:
subq $0x28, %rsp
movl $0x0, 0x24(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl 0x20(%rsp), %edi
movq 0x18(%rsp), %rsi
callq 0x19b20
cmpl $0x0, %eax
jne 0x19a52
movl $0x1, %edi
callq 0x168f0
movq 0x24eda7(%rip), %rdi    # 0x268800
callq 0x1a180
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x19a75
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x168f0
movq 0x24ed8c(%rip), %rdi    # 0x268808
movq 0x24ed8d(%rip), %rsi    # 0x268810
callq 0x1a300
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x19a9f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x168f0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1a5a0
cmpl $0x0, %eax
jne 0x19abd
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x168f0
cmpl $0x0, 0x24ed54(%rip)    # 0x268818
je 0x19ae1
movq 0x8(%rsp), %rdi
callq 0x1a850
cmpl $0x0, %eax
jne 0x19adf
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x168f0
jmp 0x19ae1
movq 0x8(%rsp), %rdi
callq 0x1aa30
cmpl $0x0, %eax
jne 0x19afa
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x168f0
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x19b13
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
xorl %eax, %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/conf2sfl/conf2sfl.cpp
// Function: ReadConfiguration(char const*)
static RGBDConfiguration *
ReadConfiguration(const char *filename) 
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  if (print_verbose) {
    printf("Reading configuration from %s ...\n", filename);
    fflush(stdout);
  }

  // Allocate configuration
  RGBDConfiguration *configuration = new RGBDConfiguration();
  if (!configuration) {
    RNFail("Unable to allocate configuration for %s\n", filename);
    return NULL;
  }

  // Read file
  if (!configuration->ReadFile(filename)) {
    RNFail("Unable to read configuration from %s\n", filename);
    return NULL;
  }

  // Print statistics
  if (print_verbose) {
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    printf("  # Surfaces = %d\n", configuration->NSurfaces());
    fflush(stdout);
  }

  // Return configuration
  return configuration;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x172a30
leaq 0x28(%rsp), %rdi
callq 0x1ec90
cmpl $0x0, 0x24e678(%rip)    # 0x26881c
je 0x1a1c8
movq 0x38(%rsp), %rsi
leaq 0x1e3037(%rip), %rdi    # 0x1fd1e9
movb $0x0, %al
callq 0x16090
movq 0x244dd0(%rip), %rax    # 0x25ef90
movq (%rax), %rdi
callq 0x168c0
movl $0x98, %edi
callq 0x16740
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x20950
jmp 0x1a1e4
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x1a239
movq 0x38(%rsp), %rsi
leaq 0x1e300a(%rip), %rdi    # 0x1fd20c
movb $0x0, %al
callq 0x1779b0
movq $0x0, 0x40(%rsp)
jmp 0x1a2df
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
movl $0x98, %esi
callq 0x16750
jmp 0x1a2e9
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq (%rdi), %rax
movl $0x1, %edx
callq *0x70(%rax)
cmpl $0x0, %eax
jne 0x1a271
movq 0x38(%rsp), %rsi
leaq 0x1e2fd6(%rip), %rdi    # 0x1fd235
movb $0x0, %al
callq 0x1779b0
movq $0x0, 0x40(%rsp)
jmp 0x1a2df
cmpl $0x0, 0x24e5a4(%rip)    # 0x26881c
je 0x1a2d5
leaq 0x28(%rsp), %rdi
callq 0x172af0
leaq 0x1e2fd0(%rip), %rdi    # 0x1fd25b
movb $0x1, %al
callq 0x16090
movq 0x20(%rsp), %rdi
callq 0x1ecb0
movl %eax, %esi
leaq 0x1e2fcd(%rip), %rdi    # 0x1fd272
movb $0x0, %al
callq 0x16090
movq 0x20(%rsp), %rdi
callq 0x1ecd0
movl %eax, %esi
leaq 0x1e2fc4(%rip), %rdi    # 0x1fd283
movb $0x0, %al
callq 0x16090
movq 0x244cc3(%rip), %rax    # 0x25ef90
movq (%rax), %rdi
callq 0x168c0
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x16ca0
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Distance(gaps::R3Point const&) const
RNLength R3SegmentationPrimitive::
Distance(const R3Point& position) const
{
  // Return distance from primitive to point
  if (primitive_type == R3_SEGMENTATION_POINT_PRIMITIVE_TYPE) return R3Distance(centroid, position);
  else if (primitive_type == R3_SEGMENTATION_LINE_PRIMITIVE_TYPE) return R3Distance(line, position);
  else if (primitive_type == R3_SEGMENTATION_PLANE_PRIMITIVE_TYPE) return R3Distance(plane, position);
#if 0
  else if (primitive_type == R3_SEGMENTATION_PLANAR_GRID_PRIMITIVE_TYPE) {
    R2R3SegmentationPoint grid_position = planar_grid.GridPosition(position);
    int ix = (int) (grid_position.X() + 0.5);
    if ((ix < 0) || (ix >= planar_grid.XResolution())) return RN_INFINITY;
    int iy = (int) (grid_position.Y() + 0.5);
    if ((iy < 0) || (iy >= planar_grid.YResolution())) return RN_INFINITY;
    RNScalar value = planar_grid.GridValue(ix, iy);
    if (value <= 0) return RN_INFINITY;
    return R3Distance(planar_grid.Plane(), position);
  }
#endif
  else {
    RNAbort("Unrecognized primitive type");
    return RN_INFINITY;
  }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x1, (%rax)
jne 0x3caf8
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movq 0x10(%rsp), %rsi
callq 0xc0550
movsd %xmm0, 0x20(%rsp)
jmp 0x3cb64
movq 0x8(%rsp), %rax
cmpl $0x2, (%rax)
jne 0x3cb1d
movq 0x8(%rsp), %rdi
addq $0x58, %rdi
movq 0x10(%rsp), %rsi
callq 0x47480
movsd %xmm0, 0x20(%rsp)
jmp 0x3cb64
movq 0x8(%rsp), %rax
cmpl $0x3, (%rax)
jne 0x3cb45
movq 0x8(%rsp), %rdi
addq $0x88, %rdi
movq 0x10(%rsp), %rsi
callq 0x474b0
movsd %xmm0, 0x20(%rsp)
jmp 0x3cb64
leaq 0x1c176c(%rip), %rdi    # 0x1fe2b8
movb $0x0, %al
callq 0x1778a0
leaq 0x22bbfe(%rip), %rax    # 0x268758
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Point const&)
void R3SegmentationPrimitive::
Update(const R3Point& point)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_POINT_PRIMITIVE_TYPE;
  this->centroid = point;
  line = R3null_line;
  plane = R3null_plane;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movl $0x1, (%rdi)
movq 0x8(%rsp), %rsi
addq $0x40, %rdi
callq 0x12b3e0
movq (%rsp), %rdi
addq $0x58, %rdi
leaq 0x62d736(%rip), %rsi    # 0x66a2e0
callq 0x474e0
movq (%rsp), %rdi
addq $0x88, %rdi
leaq 0x62d49f(%rip), %rsi    # 0x66a060
callq 0x47520
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Line const&)
void R3SegmentationPrimitive::
Update(const R3Line& line)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_LINE_PRIMITIVE_TYPE;
  centroid = R3zero_point;
  centroid.Project(line);
  this->line = line;
  plane = R3null_plane;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movl $0x2, (%rdi)
addq $0x40, %rdi
leaq 0x62d838(%rip), %rsi    # 0x66a430
callq 0x12b3e0
movq (%rsp), %rdi
addq $0x40, %rdi
movq 0x8(%rsp), %rsi
callq 0x12b120
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x58, %rdi
callq 0x474e0
movq (%rsp), %rdi
addq $0x88, %rdi
leaq 0x62d42d(%rip), %rsi    # 0x66a060
callq 0x47520
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Plane const&)
void R3SegmentationPrimitive::
Update(const R3Plane& plane)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_PLANE_PRIMITIVE_TYPE;
  centroid = R3zero_point;
  centroid.Project(plane);
  line = R3null_line;
  this->plane = plane;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movl $0x3, (%rdi)
addq $0x40, %rdi
leaq 0x62d7c8(%rip), %rsi    # 0x66a430
callq 0x12b3e0
movq (%rsp), %rdi
addq $0x40, %rdi
movq 0x8(%rsp), %rsi
callq 0x12b420
movq (%rsp), %rdi
addq $0x58, %rdi
leaq 0x62d652(%rip), %rsi    # 0x66a2e0
callq 0x474e0
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x88, %rdi
callq 0x47520
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::R3SegmentationCluster(gaps::R3SegmentationPoint*, gaps::R3SegmentationPrimitive const&)
R3SegmentationCluster::
R3SegmentationCluster(R3SegmentationPoint *seed_point, const R3SegmentationPrimitive& primitive)
  : seed_point(seed_point),
    points(),
    parent(NULL),
    children(),
    pairs(),
    primitive(primitive),
    area(0),
    color(0,0,0),
    timestamp(0),
    category_identifier(-1),
    category_confidence(0),
    possible_affinity(0),
    total_affinity(0),
    segmentation(NULL),
    segmentation_index(-1)
{
  // Update color and area
  if (seed_point) color = seed_point->color;
  if (seed_point) timestamp = seed_point->timestamp;
  if (seed_point) area = seed_point->area;
  if (seed_point) category_identifier = seed_point->category_identifier;
  if (seed_point) category_confidence = seed_point->category_confidence;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, 0x18(%rsp)
callq 0x20260
movq 0x20(%rsp), %rdi
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
movq %rdi, 0x28(%rsp)
callq 0x47650
jmp 0x3d470
movq 0x20(%rsp), %rdi
addq $0x30, %rdi
movq %rdi, 0x10(%rsp)
callq 0x47660
jmp 0x3d485
movq 0x20(%rsp), %rdi
addq $0x40, %rdi
movq %rdi, 0x8(%rsp)
movq 0x40(%rsp), %rsi
callq 0x3c070
jmp 0x3d49f
movq 0x20(%rsp), %rdi
movq $0x0, 0xe8(%rdi)
addq $0xf0, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x1731f0
jmp 0x3d4c6
movq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x108(%rax)
movl $0xffffffff, 0x110(%rax) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movsd %xmm0, 0x118(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x120(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x128(%rax)
movq $0x0, 0x130(%rax)
movl $0xffffffff, 0x138(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, 0x48(%rsp)
je 0x3d592
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rsi
addq $0x78, %rsi
addq $0xf0, %rdi
callq 0x173370
jmp 0x3d53a
jmp 0x3d592
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x3d629
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x3d61f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x3d615
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
callq 0x47670
jmp 0x3d615
cmpq $0x0, 0x48(%rsp)
je 0x3d5b1
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x108(%rax)
cmpq $0x0, 0x48(%rsp)
je 0x3d5d0
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movsd 0x70(%rcx), %xmm0
movsd %xmm0, 0xe8(%rax)
cmpq $0x0, 0x48(%rsp)
je 0x3d5ee
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movl 0x90(%rcx), %ecx
movl %ecx, 0x110(%rax)
cmpq $0x0, 0x48(%rsp)
je 0x3d610
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movsd 0x98(%rcx), %xmm0
movsd %xmm0, 0x118(%rax)
addq $0x58, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0x47690
movq 0x28(%rsp), %rdi
callq 0x476a0
movq 0x18(%rsp), %rdi
callq 0x1f730
movq 0x38(%rsp), %rdi
callq 0x16ca0
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::InsertPoint(gaps::R3SegmentationPoint*, double)
void R3SegmentationCluster::
InsertPoint(R3SegmentationPoint *point, RNScalar affinity)
{
  // Remove from previous cluster
  if (point->cluster ) {
    if (point->cluster == this) return;
    else point->cluster->RemovePoint(point);
  }

  // Update cluster
  total_affinity += affinity; // point->cluster_affinity;
  color = (point->color + points.NEntries()*color) / (points.NEntries()+1);
  timestamp = (point->timestamp + points.NEntries()*timestamp) / (points.NEntries()+1);
  area += point->area;

  // Update category
  if ((category_identifier < 0) && (point->category_identifier >= 0)) {
    category_identifier = point->category_identifier;
    category_confidence = point->category_confidence;
  }

  // Update point
  point->cluster = this;
  point->cluster_index = points.NEntries();
  point->cluster_affinity = affinity;

  // Insert point
  points.Insert(point);
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movsd %xmm0, 0x70(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x78(%rsp), %rax
cmpq $0x0, 0xc0(%rax)
je 0x3eca6
movq 0x20(%rsp), %rcx
movq 0x78(%rsp), %rax
cmpq %rcx, 0xc0(%rax)
jne 0x3ec8e
jmp 0x3ee55
movq 0x78(%rsp), %rax
movq 0xc0(%rax), %rdi
movq 0x78(%rsp), %rsi
callq 0x3e080
jmp 0x3eca6
movq 0x20(%rsp), %rdi
movsd 0x70(%rsp), %xmm0
addsd 0x128(%rdi), %xmm0
movsd %xmm0, 0x128(%rdi)
movq 0x78(%rsp), %rax
addq $0x78, %rax
movq %rax, 0x8(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movq 0x20(%rsp), %rsi
cvtsi2sd %eax, %xmm0
addq $0xf0, %rsi
leaq 0x28(%rsp), %rdi
callq 0x3b580
movq 0x8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x47790
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3b5c0
movq 0x20(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x58(%rsp), %rsi
callq 0x173370
movq 0x20(%rsp), %rdi
movq 0x78(%rsp), %rax
movsd 0x68(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movsd 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdi
cvtsi2sd %eax, %xmm0
movsd 0x108(%rdi), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movsd 0x18(%rsp), %xmm0
movl %eax, %ecx
movq 0x20(%rsp), %rax
addl $0x1, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%rax)
movq 0x78(%rsp), %rcx
movsd 0x70(%rcx), %xmm0
addsd 0xe8(%rax), %xmm0
movsd %xmm0, 0xe8(%rax)
cmpl $0x0, 0x110(%rax)
jge 0x3ee08
movq 0x78(%rsp), %rax
cmpl $0x0, 0x90(%rax)
jl 0x3ee08
movq 0x20(%rsp), %rax
movq 0x78(%rsp), %rcx
movl 0x90(%rcx), %ecx
movl %ecx, 0x110(%rax)
movq 0x78(%rsp), %rcx
movsd 0x98(%rcx), %xmm0
movsd %xmm0, 0x118(%rax)
movq 0x20(%rsp), %rdi
movq 0x78(%rsp), %rax
movq %rdi, 0xc0(%rax)
addq $0x8, %rdi
callq 0x1ecf0
movq 0x20(%rsp), %rdi
movl %eax, %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0xd0(%rax)
movsd 0x70(%rsp), %xmm0
movq 0x78(%rsp), %rax
movsd %xmm0, 0xc8(%rax)
addq $0x8, %rdi
movq 0x78(%rsp), %rsi
callq 0x1f3d0
addq $0x88, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::~R3SegmentationCluster()
R3SegmentationCluster::
~R3SegmentationCluster(void)
{
  // Delete children
  // for (int i = 0; i < children.NEntries(); i++) {
  //   delete children.Kth(i);
  // }

  // Remove from parent
  if (parent) parent->children.Remove(this);

  // Empty points
  EmptyPoints();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rax)
je 0x3ee90
movq 0x8(%rsp), %rsi
movq 0x18(%rsi), %rdi
addq $0x20, %rdi
callq 0x476f0
jmp 0x3ee8e
jmp 0x3ee90
movq 0x8(%rsp), %rdi
callq 0x3eef0
jmp 0x3ee9c
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x47670
movq 0x8(%rsp), %rdi
addq $0x30, %rdi
callq 0x47690
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
callq 0x476a0
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x1f730
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x27cf0
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::EmptyPoints()
void R3SegmentationCluster::
EmptyPoints(void)
{
  // Update points
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);
    point->cluster = NULL;
    point->cluster_affinity = 0;
    point->cluster_index = -1;
  }

  // Empty points
  points.Empty();

  // Update color and area
  color = RNblack_rgb;
  timestamp = 0;
  area = 0;

  // Update affinity
  total_affinity = 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x3ef7e
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movl 0x1c(%rsp), %esi
callq 0x1f6a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq $0x0, 0xc0(%rax)
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0xc8(%rax)
movq 0x10(%rsp), %rax
movl $0xffffffff, 0xd0(%rax) # imm = 0xFFFFFFFF
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x3ef0b
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x173a50
movq 0x8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x62c6af(%rip), %rsi    # 0x66b650
callq 0x173370
movq 0x8(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x108(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0xe8(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x128(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::AxisExtents()
R3Box R3SegmentationCluster::
AxisExtents(void)
{
  // Get centroid and axes
  R3Point center;
  R3Triad triad = PrincipleAxes(&center);
  
  // Find extent
  R3Box extent = R3null_box;
  for (int i = 0; i < points.NEntries(); i++) {
    R3Point position = points[i]->position;
    R3Vector vector = position - center;
    RNScalar x = triad.Axis(0).Dot(vector);
    RNScalar y = triad.Axis(1).Dot(vector);
    RNScalar z = triad.Axis(2).Dot(vector);
    extent.Union(R3Point(x, y, z));
  }

  // Return extent
  return extent;
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x58(%rsp)
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x12ad40
movq 0x50(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
leaq 0x120(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x3f030
movq 0x58(%rsp), %rdi
movb $0x0, 0xd7(%rsp)
leaq 0x22a1d8(%rip), %rsi    # 0x269688
callq 0xfc930
movl $0x0, 0xd0(%rsp)
movq 0x50(%rsp), %rdi
movl 0xd0(%rsp), %eax
movl %eax, 0x40(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, 0x44(%rsp)
jmp 0x3f4df
movl 0x40(%rsp), %eax
movl 0x44(%rsp), %ecx
cmpl %ecx, %eax
jge 0x3f672
movq 0x50(%rsp), %rdi
addq $0x8, %rdi
movl 0xd0(%rsp), %esi
callq 0x47770
movq %rax, 0x38(%rsp)
jmp 0x3f50b
movq 0x38(%rsp), %rax
movq (%rax), %rsi
addq $0x8, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x12ad90
jmp 0x3f526
leaq 0x90(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0x12b0b0
jmp 0x3f545
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x287a0
movq %rax, 0x30(%rsp)
jmp 0x3f55b
movq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x12c4c0
movsd %xmm0, 0x28(%rsp)
jmp 0x3f575
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
leaq 0xd8(%rsp), %rdi
movl $0x1, %esi
callq 0x287a0
movq %rax, 0x20(%rsp)
jmp 0x3f59d
movq 0x20(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x12c4c0
movsd %xmm0, 0x18(%rsp)
jmp 0x3f5b7
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
leaq 0xd8(%rsp), %rdi
movl $0x2, %esi
callq 0x287a0
movq %rax, 0x10(%rsp)
jmp 0x3f5df
movq 0x10(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x12c4c0
movsd %xmm0, 0x8(%rsp)
jmp 0x3f5f9
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x88(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x78(%rsp), %xmm2
leaq 0x60(%rsp), %rdi
callq 0x12ad50
jmp 0x3f629
movq 0x58(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xfe520
jmp 0x3f63a
jmp 0x3f63c
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x3f4c0
movq 0x58(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x1ec20
jmp 0x3f69b
movb $0x1, 0xd7(%rsp)
testb $0x1, 0xd7(%rsp)
jne 0x3f68e
movq 0x58(%rsp), %rdi
callq 0x1ec20
movq 0x48(%rsp), %rax
addq $0x148, %rsp            # imm = 0x148
retq
movq 0xc8(%rsp), %rdi
callq 0x16ca0
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::RemoveChild(gaps::R3SegmentationCluster*)
void R3SegmentationCluster::
RemoveChild(R3SegmentationCluster *child)
{
  // Update area
  area -= child->area;

  // Update color
  int n = points.NEntries() - child->points.NEntries();
  color *= points.NEntries();
  color -= child->points.NEntries() * child->color;
  color = (n > 0) ? color / n : RNblack_rgb;

  // Update timestamp
  timestamp *= points.NEntries();
  timestamp -= child->points.NEntries() * child->timestamp;
  timestamp = (n > 0) ? timestamp / n : 0;

  // Remove child
  this->children.Remove(child);
  child->parent = NULL;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x58(%rsp), %rax
movsd 0xe8(%rax), %xmm1
movsd 0xe8(%rdi), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rdi)
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, 0x14(%rsp)
movq 0x58(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
movq 0x18(%rsp), %rdi
movl %eax, %ecx
movl 0x14(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movq 0x18(%rsp), %rdi
cvtsi2sd %eax, %xmm0
addq $0xf0, %rdi
callq 0x1734b0
movq 0x58(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
cvtsi2sd %eax, %xmm0
movq 0x58(%rsp), %rsi
addq $0xf0, %rsi
leaq 0x38(%rsp), %rdi
callq 0x3b580
movq 0x18(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x38(%rsp), %rsi
callq 0x173400
cmpl $0x0, 0x54(%rsp)
jle 0x3ff16
movq 0x18(%rsp), %rsi
addq $0xf0, %rsi
cvtsi2sdl 0x54(%rsp), %xmm0
leaq 0x20(%rsp), %rdi
callq 0x3b5c0
jmp 0x3ff27
leaq 0x20(%rsp), %rdi
leaq 0x62b72e(%rip), %rsi    # 0x66b650
callq 0x1731b0
movq 0x18(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x20(%rsp), %rsi
callq 0x173370
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movq 0x18(%rsp), %rax
cvtsi2sd %ecx, %xmm0
mulsd 0x108(%rax), %xmm0
movsd %xmm0, 0x108(%rax)
movq 0x58(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movq 0x18(%rsp), %rax
cvtsi2sd %ecx, %xmm0
movq 0x58(%rsp), %rcx
movsd 0x108(%rcx), %xmm2
movsd 0x108(%rax), %xmm1
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x108(%rax)
cmpl $0x0, 0x54(%rsp)
jle 0x3ffe1
movq 0x18(%rsp), %rax
movsd 0x108(%rax), %xmm0
cvtsi2sdl 0x54(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x3ffec
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x3ffec
movq 0x18(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x108(%rdi)
addq $0x20, %rdi
movq 0x58(%rsp), %rsi
callq 0x476f0
movq 0x58(%rsp), %rax
movq $0x0, 0x18(%rax)
addq $0x68, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::UpdateColor()
int R3SegmentationCluster::
UpdateColor(void)
{
  // Update color
  color.Reset(0,0,0);
  if (points.NEntries() == 0) return 1;
  for (int i = 0; i < points.NEntries(); i++)
    color += points[i]->color;
  color /= points.NEntries();
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0xf0, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x47a60
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
cmpl $0x0, %eax
jne 0x407c8
movl $0x1, 0x24(%rsp)
jmp 0x40852
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x40827
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movl 0x14(%rsp), %esi
callq 0x47770
movq 0x8(%rsp), %rdi
movq (%rax), %rsi
addq $0x78, %rsi
addq $0xf0, %rdi
callq 0x1733b0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x407d0
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
movq 0x8(%rsp), %rdi
cvtsi2sd %eax, %xmm0
addq $0xf0, %rdi
callq 0x1734f0
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::UpdateTimestamp()
int R3SegmentationCluster::
UpdateTimestamp(void)
{
  // Update timestamp
  timestamp = 0;
  if (points.NEntries() == 0) return 1;
  for (int i = 0; i < points.NEntries(); i++)
    timestamp += points[i]->timestamp;
  timestamp /= points.NEntries();
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x108(%rdi)
addq $0x8, %rdi
callq 0x1ecf0
cmpl $0x0, %eax
jne 0x40899
movl $0x1, 0x24(%rsp)
jmp 0x40935
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x40900
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movl 0x14(%rsp), %esi
callq 0x47770
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq (%rcx), %rcx
movsd 0x68(%rcx), %xmm0
addsd 0x108(%rax), %xmm0
movsd %xmm0, 0x108(%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x408a1
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movq 0x8(%rsp), %rax
cvtsi2sd %ecx, %xmm1
movsd 0x108(%rax), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::UpdateArea()
int R3SegmentationCluster::
UpdateArea(void)
{
  // Update area
  area = 0;
  for (int i = 0; i < points.NEntries(); i++)
    area += points[i]->area;
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xe8(%rax)
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0x8, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x409c5
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movl 0x1c(%rsp), %esi
callq 0x47770
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq (%rcx), %rcx
movsd 0x70(%rcx), %xmm0
addsd 0xe8(%rax), %xmm0
movsd %xmm0, 0xe8(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x40966
movl $0x1, %eax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPair::R3SegmentationPair(gaps::R3SegmentationCluster*, gaps::R3SegmentationCluster*, double)
R3SegmentationPair::
R3SegmentationPair(R3SegmentationCluster *cluster1, R3SegmentationCluster *cluster2, RNScalar affinity)
  : affinity(affinity),
    heapentry(NULL)
{
  // Insert pair into clusters
  if (cluster1 && cluster2) {
    // Remember clusters
    clusters[0] = cluster1;
    clusters[1] = cluster2;

    // Remember position of pair in clusters
    cluster_index[0] = cluster1->pairs.NEntries();
    cluster_index[1] = cluster2->pairs.NEntries();

    // Update clusters
    cluster1->pairs.Insert(this);
    cluster2->pairs.Insert(this);
  }
  else {
    // Initialize clusters
    clusters[0] = NULL;
    clusters[1] = NULL;

    // Initialize cluster index
    cluster_index[0] = -1;
    cluster_index[1] = -1;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rax)
movq $0x0, 0x20(%rax)
cmpq $0x0, 0x18(%rsp)
je 0x42018
cmpq $0x0, 0x10(%rsp)
je 0x42018
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rdi
addq $0x30, %rdi
callq 0x1ecf0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x10(%rsp), %rdi
addq $0x30, %rdi
callq 0x1ecf0
movq (%rsp), %rsi
movl %eax, 0x14(%rsi)
movq 0x18(%rsp), %rdi
addq $0x30, %rdi
callq 0x47aa0
movq (%rsp), %rsi
movq 0x10(%rsp), %rdi
addq $0x30, %rdi
callq 0x47aa0
jmp 0x42039
movq (%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::~R3Segmentation()
R3Segmentation::
~R3Segmentation(void)
{
  // Delete clusters
  for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
  
  // Delete kdtree
  if (kdtree) delete kdtree;

  // Delete points
  if (point_buffer) delete [] point_buffer;
  else { for (int i = 0; i < points.NEntries(); i++) delete points[i]; }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x0, 0x6c(%rsp)
movq 0x60(%rsp), %rdi
movl 0x6c(%rsp), %eax
movl %eax, 0x58(%rsp)
addq $0x18, %rdi
callq 0x1ecf0
movl %eax, 0x5c(%rsp)
jmp 0x42687
movl 0x58(%rsp), %eax
movl 0x5c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x426e7
movq 0x60(%rsp), %rdi
addq $0x18, %rdi
movl 0x6c(%rsp), %esi
callq 0x47af0
movq %rax, 0x50(%rsp)
jmp 0x426ac
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x426d8
movq 0x48(%rsp), %rdi
callq 0x3ee60
movq 0x48(%rsp), %rdi
movl $0x140, %esi            # imm = 0x140
callq 0x16750
jmp 0x426da
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x4266b
movq 0x60(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x42722
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x42720
movq 0x40(%rsp), %rdi
callq 0x47b10
movq 0x40(%rsp), %rdi
movl $0x60, %esi
callq 0x16750
jmp 0x42722
movq 0x60(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x427bd
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x427bb
movq 0x38(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x20(%rsp)
movq -0x8(%rcx), %rax
movq %rax, 0x28(%rsp)
imulq $0xe0, %rax, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x30(%rsp)
je 0x427a1
movq 0x30(%rsp), %rdi
addq $-0xe0, %rdi
movq %rdi, 0x18(%rsp)
callq 0x1f2b0
movq 0x38(%rsp), %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x30(%rsp)
jne 0x42777
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rax
imulq $0xe0, %rax, %rsi
addq $0x8, %rsi
callq 0x16e20
jmp 0x42838
movl $0x0, 0x68(%rsp)
movq 0x60(%rsp), %rdi
movl 0x68(%rsp), %eax
movl %eax, 0x10(%rsp)
callq 0x1ecf0
movl %eax, 0x14(%rsp)
jmp 0x427dd
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %eax
jge 0x42836
movq 0x60(%rsp), %rdi
movl 0x68(%rsp), %esi
callq 0x47770
movq %rax, 0x8(%rsp)
jmp 0x427fe
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x42827
movq (%rsp), %rdi
callq 0x1f2b0
movq (%rsp), %rdi
movl $0xe0, %esi
callq 0x16750
jmp 0x42829
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0x427c5
jmp 0x42838
movq 0x60(%rsp), %rdi
addq $0x18, %rdi
callq 0x476a0
movq 0x60(%rsp), %rdi
callq 0x1f730
addq $0x78, %rsp
retq
movq %rax, %rdi
callq 0x27cf0
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::Affinity() const
RNScalar R3Segmentation::
Affinity(void) const
{
  RNScalar sum = 0;
  for (int i = 0; i < clusters.NEntries(); i++) {
    sum += clusters[i]->total_affinity;
  }
  return sum;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x18, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x428d7
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x14(%rsp), %esi
callq 0x47c30
movsd 0x128(%rax), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x42884
movsd 0x18(%rsp), %xmm0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::NUnclusteredPoints() const
int R3Segmentation::
NUnclusteredPoints(void) const
{
  // Count unclustered points
  int count = 0;
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);
    if (!point->cluster) count++;
  }

  // Return number of unclustered points
  return count;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x4296b
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x1f6a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0xc0(%rax)
jne 0x4295c
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x4295e
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x42913
movl 0x1c(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::AverageNeighborCount() const
RNScalar R3Segmentation::
AverageNeighborCount(void) const
{
  // Compute count
  int count = points.NEntries();
  if (count == 0) return 0;

  // Compute sum
  int sum = 0;
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);
    sum += point->neighbors.NEntries();
  }

  // Return mean
  return (double) sum / (double) count;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1ecf0
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x429ae
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0x42a29
movl $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x42a13
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x1f6a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq $0xb0, %rdi
callq 0x1ecf0
addl 0x20(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x429be
cvtsi2sdl 0x20(%rsp), %xmm0
cvtsi2sdl 0x24(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::CreateSingletonClusters(int)
int R3Segmentation::
CreateSingletonClusters(int primitive_type)
{
  // Create cluster for every point
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);

    // Create primitive
    R3SegmentationPrimitive primitive(primitive_type);
    primitive.Update(point);
    
    // Create cluster
    R3SegmentationCluster *cluster = new R3SegmentationCluster(point, primitive);

    // Insert point
    cluster->InsertPoint(point, 1.0);

    // Insert cluster
    cluster->segmentation = this;
    cluster->segmentation_index = clusters.NEntries();    
    clusters.Insert(cluster);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movl %esi, 0xfc(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0xf8(%rsp)
movq 0x28(%rsp), %rdi
movl 0xf8(%rsp), %eax
movl %eax, 0x24(%rsp)
callq 0x1ecf0
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jge 0x43db5
movq 0x28(%rsp), %rdi
movl 0xf8(%rsp), %esi
callq 0x1f6a0
movq %rax, 0xf0(%rsp)
movl 0xfc(%rsp), %esi
leaq 0x48(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x3bfc0
movq 0x18(%rsp), %rdi
movq 0xf0(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3c1e0
jmp 0x43cc8
movl $0x140, %edi            # imm = 0x140
callq 0x16740
movq %rax, 0x10(%rsp)
jmp 0x43cd9
movq 0x10(%rsp), %rdi
movq 0xf0(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x3d420
jmp 0x43cf2
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movsd 0x1b930f(%rip), %xmm0   # 0x1fd020
callq 0x3ec40
jmp 0x43d18
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rdi, 0x130(%rax)
addq $0x18, %rdi
callq 0x1ecf0
movl %eax, 0xc(%rsp)
jmp 0x43d38
movq 0x28(%rsp), %rdi
movl 0xc(%rsp), %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x138(%rax)
addq $0x18, %rdi
movq 0x30(%rsp), %rsi
callq 0x476c0
jmp 0x43d5c
leaq 0x48(%rsp), %rdi
callq 0x47670
movl 0xf8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf8(%rsp)
jmp 0x43c5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
jmp 0x43da9
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
movl $0x140, %esi            # imm = 0x140
callq 0x16750
leaq 0x48(%rsp), %rdi
callq 0x47670
jmp 0x43dc2
movl $0x1, %eax
addq $0x108, %rsp            # imm = 0x108
retq
movq 0x40(%rsp), %rdi
callq 0x16ca0
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::CompareClusters(void const*, void const*)
static int
CompareClusters(const void *data1, const void *data2)
{
  R3SegmentationCluster *cluster1 = *((R3SegmentationCluster **) data1);
  R3SegmentationCluster *cluster2 = *((R3SegmentationCluster **) data2);
  if (cluster2->total_affinity > cluster1->total_affinity) return 1;
  else if (cluster1->total_affinity > cluster2->total_affinity) return -1;
  else return 0;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movsd 0x128(%rax), %xmm0
movq -0x20(%rsp), %rax
ucomisd 0x128(%rax), %xmm0
jbe 0x4451a
movl $0x1, -0x4(%rsp)
jmp 0x44548
movq -0x20(%rsp), %rax
movsd 0x128(%rax), %xmm0
movq -0x28(%rsp), %rax
ucomisd 0x128(%rax), %xmm0
jbe 0x44540
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
jmp 0x44548
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::FindR3SegmentationPair(gaps::R3SegmentationCluster*, gaps::R3SegmentationCluster*)
static R3SegmentationPair *
FindR3SegmentationPair(R3SegmentationCluster *cluster1, R3SegmentationCluster *cluster2) 
{
  // Swap clusters so that cluster1 has fewer pairs
  if (cluster1->pairs.NEntries() > cluster2->pairs.NEntries()) {
    R3SegmentationCluster *swap = cluster1; 
    cluster1 = cluster2; 
    cluster2 = swap;
  }

  // Search for pair
  for (int i = 0; i < cluster1->pairs.NEntries(); i++) {
    R3SegmentationPair *pair = cluster1->pairs.Kth(i);
    if (pair->clusters[0] == cluster2) return pair;
    if (pair->clusters[1] == cluster2) return pair;
  }

  // R3SegmentationPair not found
  return NULL;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
addq $0x30, %rdi
callq 0x1ecf0
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rdi
addq $0x30, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jle 0x45816
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, (%rsp)
movq 0x28(%rsp), %rdi
addq $0x30, %rdi
callq 0x1ecf0
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jge 0x45899
movq 0x28(%rsp), %rdi
addq $0x30, %rdi
movl 0x14(%rsp), %esi
callq 0x47e60
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq 0x20(%rsp), %rax
jne 0x4586e
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x458a2
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
cmpq 0x20(%rsp), %rax
jne 0x4588a
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x458a2
jmp 0x4588c
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4581e
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<gaps::R3SegmentationPoint*>::FindAll(gaps::R3Point const&, double, double, gaps::RNArray<gaps::R3SegmentationPoint*>&) const
int R3Kdtree<PtrType>::
FindAll(const R3Point& query_position, RNScalar min_distance, RNScalar max_distance, RNArray<PtrType>& points) const
{
  // Check root
  if (!root) return 0;

  // Use squared distances for efficiency
  if (max_distance < 0) return 0;
  if (min_distance < 0) min_distance = 0;
  RNLength min_distance_squared = min_distance * min_distance;
  RNLength max_distance_squared = max_distance * max_distance;

  // Search nodes recursively
  FindAll(root, bbox, 
    NULL, query_position, 
    min_distance_squared, max_distance_squared, 
    NULL, NULL, 
    points);

  // Return number of points
  return points.NEntries();
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x50(%rax)
jne 0x478bd
movl $0x0, 0x54(%rsp)
jmp 0x47957
xorps %xmm0, %xmm0
ucomisd 0x30(%rsp), %xmm0
jbe 0x478d5
movl $0x0, 0x54(%rsp)
jmp 0x47957
xorps %xmm0, %xmm0
ucomisd 0x38(%rsp), %xmm0
jbe 0x478e9
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x10(%rsp), %rdx
movsd 0x38(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x30(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x50(%rdx), %rsi
movq 0x40(%rsp), %r8
movsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq 0x28(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %r9d
movq %rdx, %rdi
movq %r9, %rcx
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x48350
movq 0x28(%rsp), %rdi
callq 0x1ecf0
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Utils/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<gaps::R3SegmentationPoint*>::FindAll(gaps::R3Line const&, double, double, gaps::RNArray<gaps::R3SegmentationPoint*>&) const
int R3Kdtree<PtrType>::
FindAll(const R3Line& query_line, 
  RNScalar min_distance, RNScalar max_distance, 
  RNArray<PtrType>& points) const
{
  // Check root
  if (!root) return 0;

  // Search nodes recursively
  FindAll<R3Line>(root, bbox, 
    query_line,
    min_distance, max_distance, 
    points);

  // Return number of points
  return points.NEntries();
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x50(%rax)
jne 0x47999
movl $0x0, 0x34(%rsp)
jmp 0x479cd
movq (%rsp), %rdx
movq 0x50(%rdx), %rsi
movq 0x20(%rsp), %rcx
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movq 0x8(%rsp), %r8
movq %rdx, %rdi
callq 0x48d50
movq 0x8(%rsp), %rdi
callq 0x1ecf0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)