LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoints(gaps::R3SurfelPointSet const*, gaps::R3Box const&)
void R3SurfelPointSet::
InsertPoints(const R3SurfelPointSet *set, const R3Box& constraint_box)
{
  // Check set
  if (set->NPoints() == 0) return;

  // Check and update bounding box (conservatively)
  R3Box intersection_box = constraint_box;
  intersection_box.Intersect(set->BBox());
  if (intersection_box.IsEmpty()) return;
  bbox.Union(intersection_box);

  // Check and update timestamp range (conservatively)
  timestamp_range.Union(set->TimestampRange());

  // Allocate space for points
  AllocatePoints(npoints + set->NPoints());

  // Copy points
  for (int i = 0; i < set->NPoints(); i++) {
    const R3SurfelPoint *point = set->Point(i);
    if (!R3Intersects(constraint_box, point->Position())) continue;
    points[npoints] = *point;
    npoints++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpl $0x0, 0x10(%rsi)
je 0x308f6
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rdx, (%rsp)
movq %rdx, %rsi
callq 0x63ce6
leaq 0x18(%r14), %rsi
movq %r12, %rdi
callq 0x647fc
movsd 0x10(%rsp), %xmm0
ucomisd 0x28(%rsp), %xmm0
ja 0x308ec
movsd 0x18(%rsp), %xmm0
ucomisd 0x30(%rsp), %xmm0
ja 0x308ec
movsd 0x20(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
ja 0x308ec
leaq 0x18(%r15), %rdi
leaq 0x8(%rsp), %rsi
callq 0x646fe
leaq 0x50(%r15), %rdi
leaq 0x50(%r14), %rsi
callq 0x177ca
movl 0x10(%r14), %esi
addl 0x10(%r15), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0x80(%rax)
xorl %ebp, %ebp
leaq 0x40(%rsp), %r12
xorl %ebx, %ebx
movslq 0x10(%r14), %rax
cmpq %rax, %rbx
jge 0x308ec
movq 0x8(%r14), %r13
addq %rbp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x16310
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x4318d
testl %eax, %eax
je 0x308e3
movslq 0x10(%r15), %rdi
shlq $0x4, %rdi
addq 0x8(%r15), %rdi
movq %r13, %rsi
callq 0x2f252
incl 0x10(%r15)
incq %rbx
addq $0x10, %rbp
jmp 0x308a0
leaq 0x8(%rsp), %rdi
callq 0x649ae
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x30909
jmp 0x30909
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x649ae
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoints(gaps::R3SurfelPointSet const*, gaps::R3SurfelConstraint const&)
void R3SurfelPointSet::
InsertPoints(const R3SurfelPointSet *set, const R3SurfelConstraint& constraint)
{
  // Check set
  if (set->NPoints() == 0) return;
  if (!constraint.Check(set->BBox())) return;

  // Allocate space for points
  AllocatePoints(npoints + set->NPoints());

  // Insert surfels
  for (int i = 0; i < set->NPoints(); i++) {
    const R3SurfelPoint *point = set->Point(i);
    R3SurfelBlock *block = point->Block();
    const R3Surfel *surfel = point->Surfel();
    assert(block && surfel);
    if (!constraint.Check(block, surfel)) continue;
    bbox.Union(point->Position());
    timestamp_range.Union(point->Timestamp());
    points[npoints] = *point;
    npoints++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, (%rsp)
cmpl $0x0, 0x10(%rsi)
je 0x30c16
movq %rsi, %r14
movq %rdi, %r15
addq $0x18, %rsi
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
testl %eax, %eax
je 0x30c16
movl 0x10(%r14), %esi
addl 0x10(%r15), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0x80(%rax)
leaq 0x18(%r15), %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x30c16
movq 0x8(%r14), %rbp
movq (%rbp,%r12), %rsi
movq 0x8(%rbp,%r12), %rdx
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testl %eax, %eax
je 0x30c0a
addq %r12, %rbp
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x16310
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x6464c
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
cvtss2sd 0xc(%rcx), %xmm0
addsd 0x60(%rax), %xmm0
movsd 0x50(%r15), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x30be4
movsd %xmm0, 0x50(%r15)
ucomisd 0x58(%r15), %xmm0
jbe 0x30bf2
movsd %xmm0, 0x58(%r15)
movslq 0x10(%r15), %rdi
shlq $0x4, %rdi
addq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x2f252
incl 0x10(%r15)
incq %r13
addq $0x10, %r12
jmp 0x30b77
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoint(gaps::R3SurfelPoint const&)
void R3SurfelPointSet::
InsertPoint(const R3SurfelPoint& point)
{
  // AllocatePoints points
  if (npoints == nallocated) {
    if (npoints > 0) AllocatePoints(2 * npoints);
    else AllocatePoints(4);
  }

  // Insert point
  points[npoints++] = point;;

  // Update bounding box
  bbox.Union(point.Position());

  // Update timestamp range
  timestamp_range.Union(point.Timestamp());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rdi), %eax
cmpl 0x14(%rdi), %eax
jne 0x30c56
leal (%rax,%rax), %ecx
testl %eax, %eax
pushq $0x4
popq %rsi
cmovgl %ecx, %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x80(%rax)
movslq 0x10(%rbx), %rdi
leal 0x1(%rdi), %eax
movl %eax, 0x10(%rbx)
shlq $0x4, %rdi
addq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x2f252
leaq 0x18(%rbx), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x16310
movq %r15, %rdi
movq %r12, %rsi
callq 0x6464c
movq (%r14), %rax
movq 0x8(%r14), %rcx
cvtss2sd 0xc(%rcx), %xmm0
addsd 0x60(%rax), %xmm0
movsd 0x50(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x30cae
movsd %xmm0, 0x50(%rbx)
ucomisd 0x58(%rbx), %xmm0
jbe 0x30cba
movsd %xmm0, 0x58(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::AllocatePoints(int)
void R3SurfelPointSet::
AllocatePoints(int n)
{
  // Check if already big enough
  if (n <= nallocated) return;

  // To avoid little increments to nallocated
  if (n < 2*npoints) n = 2*npoints;

  // Allocate enough memory to store n points
  R3SurfelPoint *next_points = new R3SurfelPoint [ n ];

  // Copy and delete old points
  if (points) {
    for (int i = 0; i < npoints; i++) next_points[i] = points[i];
    delete [] points;
  }

  // Update set
  points = next_points;
  nallocated = n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl %esi, 0x14(%rdi)
jge 0x30dfa
movq %rdi, %rbx
movl 0x10(%rdi), %ebp
addl %ebp, %ebp
cmpl %esi, %ebp
cmovlel %esi, %ebp
movslq %ebp, %r15
movq %r15, %r14
shlq $0x4, %r14
leaq 0x8(%r14), %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movq %rdi, 0x10(%rsp)
callq 0x13030
leaq 0x8(%rax), %r13
movq %rax, 0x8(%rsp)
movq %r15, (%rax)
testl %r15d, %r15d
je 0x30d7b
negq %r14
xorl %r15d, %r15d
movq %r13, %r12
movq %r12, %rdi
callq 0x2f0ec
addq $-0x10, %r15
addq $0x10, %r12
cmpq %r15, %r14
jne 0x30d66
cmpq $0x0, 0x8(%rbx)
je 0x30df3
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x10(%rbx), %rax
movq 0x8(%rbx), %r14
cmpq %rax, %r12
jge 0x30dad
addq %r15, %r14
leaq (%r15,%r13), %rdi
movq %r14, %rsi
callq 0x2f252
incq %r12
addq $0x10, %r15
jmp 0x30d88
testq %r14, %r14
je 0x30df3
leaq -0x8(%r14), %rax
movq %rax, 0x8(%rsp)
movq -0x8(%r14), %r15
testq %r15, %r15
je 0x30dde
addq $-0x10, %r14
movq %r15, %r12
shlq $0x4, %r12
leaq (%r14,%r12), %rdi
callq 0x2f17a
addq $-0x10, %r12
jne 0x30dcf
shlq $0x4, %r15
orq $0x8, %r15
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x139f0
movq %r13, 0x8(%rbx)
movl %ebp, 0x14(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
testq %r15, %r15
je 0x30e2c
negq %r15
movq 0x8(%rsp), %r14
addq $-0x8, %r14
leaq (%r14,%r15), %rdi
callq 0x2f17a
addq $-0x10, %r15
jne 0x30e1d
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x139f0
movq %rbx, %rdi
callq 0x138f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Empty()
void R3SurfelPointSet::
Empty(void)
{
  // Delete points
  if (points) delete [] points;

  // Reset everything
  nallocated = 0;
  npoints = 0;
  points = NULL;
  bbox = R3null_box;
  timestamp_range = RNnull_interval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r12
movq 0x8(%rdi), %r13
testq %r13, %r13
je 0x30e9b
leaq -0x8(%r13), %r14
movq -0x8(%r13), %r15
testq %r15, %r15
je 0x30e88
addq $-0x10, %r13
movq %r15, %rbp
shlq $0x4, %rbp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x2f17a
addq $-0x10, %rbp
jne 0x30e77
shlq $0x4, %r15
orq $0x8, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x139f0
leaq 0x18(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
leaq 0xf4b3a(%rip), %rsi     # 0x1259e8
callq 0x177ee
leaq 0x4f6936(%rip), %rax    # 0x5277f0
movups (%rax), %xmm0
movups %xmm0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Subtract(gaps::R3SurfelPointSet const*)
void R3SurfelPointSet::
Subtract(const R3SurfelPointSet *set)
{
  // Clear marks in this point set
  for (int i = 0; i < npoints; i++) {
    points[i].SetMark(FALSE);
  }

  // Set marks in other point set
  for (int i = 0; i < set->npoints; i++) {
    set->points[i].SetMark(TRUE);
  }

  // Remove marked points from this point set
  for (int i = 0; i < npoints; i++) {
    if (!points[i].IsMarked()) continue;
    points[i] = points[npoints-1];
    npoints--;
    i--;
  }

  // Update bounding box (conservatively)
  // Do nothing
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x10(%rbx), %rax
cmpq %rax, %r12
jge 0x30f04
movq 0x8(%rbx), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x2f4bc
incq %r12
addq $0x10, %r15
jmp 0x30ee4
xorl %r15d, %r15d
pushq $0x1
popq %rbp
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x30f2d
movq 0x8(%r14), %rdi
addq %r15, %rdi
movl %ebp, %esi
callq 0x2f4bc
incq %r12
addq $0x10, %r15
jmp 0x30f0d
movl 0x10(%rbx), %eax
xorl %ebp, %ebp
cmpl %eax, %ebp
jge 0x30f70
movq 0x8(%rbx), %rcx
movslq %ebp, %rdi
shlq $0x4, %rdi
movq 0x8(%rcx,%rdi), %rdx
cmpb $0x0, 0x2f(%rdx)
jns 0x30f6c
addq %rcx, %rdi
cltq
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
callq 0x2f252
movl 0x10(%rbx), %eax
decl %eax
movl %eax, 0x10(%rbx)
decl %ebp
incl %ebp
jmp 0x30f32
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Intersect(gaps::R3SurfelPointSet const*)
void R3SurfelPointSet::
Intersect(const R3SurfelPointSet *set)
{
  // Set marks in this point set
  for (int i = 0; i < npoints; i++) {
    points[i].SetMark(TRUE);
  }

  // Clear marks in other point set
  for (int i = 0; i < set->npoints; i++) {
    set->points[i].SetMark(FALSE);
  }

  // Remove marked points from this point set
  for (int i = 0; i < npoints; i++) {
    if (!points[i].IsMarked()) continue;
    points[i] = points[npoints-1];
    npoints--;
    i--;
  }

  // Update bounding box (conservatively)
  // Do nothing
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
pushq $0x1
popq %rbp
xorl %r12d, %r12d
movslq 0x10(%rbx), %rax
cmpq %rax, %r12
jge 0x30fb1
movq 0x8(%rbx), %rdi
addq %r15, %rdi
movl %ebp, %esi
callq 0x2f4bc
incq %r12
addq $0x10, %r15
jmp 0x30f91
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x30fd7
movq 0x8(%r14), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x2f4bc
incq %r12
addq $0x10, %r15
jmp 0x30fb7
movl 0x10(%rbx), %eax
xorl %ebp, %ebp
cmpl %eax, %ebp
jge 0x3101a
movq 0x8(%rbx), %rcx
movslq %ebp, %rdi
shlq $0x4, %rdi
movq 0x8(%rcx,%rdi), %rdx
cmpb $0x0, 0x2f(%rdx)
jns 0x31016
addq %rcx, %rdi
cltq
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
callq 0x2f252
movl 0x10(%rbx), %eax
decl %eax
movl %eax, 0x10(%rbx)
decl %ebp
incl %ebp
jmp 0x30fdc
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Union(gaps::R3SurfelPointSet const*)
void R3SurfelPointSet::
Union(const R3SurfelPointSet *set)
{
  // Set marks in other point set
  for (int i = 0; i < set->npoints; i++) {
    set->points[i].SetMark(TRUE);
  }

  // Clear marks in this point set
  for (int i = 0; i < npoints; i++) {
    points[i].SetMark(FALSE);
  }

  // Count marked points from other point set
  int count = 0;
  for (int i = 0; i < set->npoints; i++) {
    if (!set->points[i].IsMarked()) continue;
    count++;
  }

  // Allocate space for points
  AllocatePoints(npoints + count);

  // Insert marked points from other point set
  for (int i = 0; i < set->npoints; i++) {
    if (!set->points[i].IsMarked()) continue;
    points[npoints] = set->points[i];
    npoints++;
  }

  // Update bounding box (conservatively)
  bbox.Union(set->BBox());

  // Update timestamp range (conservatively)
  timestamp_range.Union(set->TimestampRange());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x1
popq %rbp
xorl %r12d, %r12d
movslq 0x10(%rbx), %rax
cmpq %rax, %r12
jge 0x3105b
movq 0x8(%rbx), %rdi
addq %r15, %rdi
movl %ebp, %esi
callq 0x2f4bc
incq %r12
addq $0x10, %r15
jmp 0x3103b
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x31081
movq 0x8(%r14), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x2f4bc
incq %r12
addq $0x10, %r15
jmp 0x31061
movl 0x10(%rbx), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
shlq $0x4, %rcx
xorl %esi, %esi
cmpq %rdx, %rcx
je 0x310ae
movq 0x8(%rbx), %rdi
movq 0x8(%rdi,%rdx), %rdi
movzbl 0x2f(%rdi), %edi
shrl $0x7, %edi
addl %edi, %esi
addq $0x10, %rdx
jmp 0x31091
addl %eax, %esi
movq (%r14), %rax
movq %r14, %rdi
callq *0x80(%rax)
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x10(%rbx), %rax
cmpq %rax, %r12
jge 0x310fb
movq 0x8(%rbx), %rsi
movq 0x8(%rsi,%r15), %rax
cmpb $0x0, 0x2f(%rax)
jns 0x310f2
addq %r15, %rsi
movslq 0x10(%r14), %rdi
shlq $0x4, %rdi
addq 0x8(%r14), %rdi
callq 0x2f252
incl 0x10(%r14)
incq %r12
addq $0x10, %r15
jmp 0x310c2
leaq 0x18(%r14), %rdi
leaq 0x18(%rbx), %rsi
callq 0x646fe
addq $0x50, %r14
addq $0x50, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x177ca
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Blocks() const
RNArray<R3SurfelBlock *> *R3SurfelPointSet::
Blocks(void) const
{
  // Check pointset 
  if (npoints == 0) return NULL;

  // Create array of blocks
  RNArray<R3SurfelBlock *> *blocks = new RNArray<R3SurfelBlock *>();
  if (!blocks) {
    RNFail("Unable to allocate array of blocks\n");
    return NULL;
  }

  // Fill array of blocks
  R3SurfelBlock *last_block = NULL;
  for (int i = 0; i < npoints; i++) {
    R3SurfelPoint *point = &points[i];
    R3SurfelBlock *block = point->Block();
    if (!block) continue;
    if (block == last_block) continue;
    if (blocks->FindEntry(block)) continue;
    blocks->Insert(block);
    last_block = block;
  }

  // Check array of blocks
  if (blocks->IsEmpty()) {
    delete blocks;
    return NULL;
  }

  // Return array of blocks
  return blocks;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
je 0x3121e
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x134f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x9a7ae
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x31205
movq 0x8(%r14), %rax
movq (%rax,%r12), %r15
testq %r15, %r15
sete %al
cmpq %rbp, %r15
sete %cl
orb %al, %cl
jne 0x311fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9a824
testq %rax, %rax
jne 0x311fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1784c
movq %r15, %rbp
incq %r13
addq $0x10, %r12
jmp 0x311bd
cmpl $0x0, 0xc(%rbx)
jne 0x31220
movq %rbx, %rdi
callq 0x9a81c
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x13500
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x13500
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Nodes() const
RNArray<R3SurfelNode *> *R3SurfelPointSet::
Nodes(void) const
{
  // Check pointset 
  if (npoints == 0) return NULL;

  // Create array of nodes
  RNArray<R3SurfelNode *> *nodes = new RNArray<R3SurfelNode *>();
  if (!nodes) {
    RNFail("Unable to allocate array of nodes\n");
    return NULL;
  }

  // Fill array of nodes
  R3SurfelNode *last_node = NULL;
  for (int i = 0; i < npoints; i++) {
    R3SurfelPoint *point = &points[i];
    R3SurfelBlock *block = point->Block();
    if (!block) continue;
    R3SurfelNode *node = block->Node();
    if (!node) continue;
    if (node == last_node) continue;
    if (nodes->FindEntry(node)) continue;
    nodes->Insert(node);
    last_node = node;
  }    

  // Check array of nodes
  if (nodes->IsEmpty()) {
    delete nodes;
    return NULL;
  }

  // Return array of nodes
  return nodes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
je 0x312e8
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x134f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x9a7ae
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x312cf
movq 0x8(%r14), %rax
movq (%rax,%r12), %rax
testq %rax, %rax
je 0x312c6
movq 0xb8(%rax), %r15
testq %r15, %r15
sete %al
cmpq %rbp, %r15
sete %cl
orb %al, %cl
jne 0x312c6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9a824
testq %rax, %rax
jne 0x312c6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1784c
movq %r15, %rbp
incq %r13
addq $0x10, %r12
jmp 0x3127b
cmpl $0x0, 0xc(%rbx)
jne 0x312ea
movq %rbx, %rdi
callq 0x9a81c
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x13500
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x13500
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Objects() const
RNArray<R3SurfelObject *> *R3SurfelPointSet::
Objects(void) const
{
  // Check pointset 
  if (npoints == 0) return NULL;

  // Create array of objects
  RNArray<R3SurfelObject *> *objects = new RNArray<R3SurfelObject *>();
  if (!objects) {
    RNFail("Unable to allocate array of objects\n");
    return NULL;
  }

  // Fill array of objects
  R3SurfelObject *last_object = NULL;
  for (int i = 0; i < npoints; i++) {
    R3SurfelPoint *point = &points[i];
    R3SurfelBlock *block = point->Block();
    if (!block) continue;
    R3SurfelNode *node = block->Node();
    if (!node) continue;
    R3SurfelObject *object = node->Object();
    if (!object) continue;
    if (object == last_object) continue;
    if (objects->FindEntry(object)) continue;
    objects->Insert(object);
    last_object = object;
  }    

  // Check array of objects
  if (objects->IsEmpty()) {
    delete objects;
    return NULL;
  }

  // Return array of objects
  return objects;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
je 0x313c3
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x134f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x9a7ae
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x313aa
movq 0x8(%r14), %rax
movq (%rax,%r12), %rax
testq %rax, %rax
je 0x313a1
movq 0xb8(%rax), %rdi
testq %rdi, %rdi
je 0x313a1
xorl %esi, %esi
xorl %edx, %edx
callq 0x338b4
movq %rax, %r15
testq %rax, %rax
sete %al
cmpq %rbp, %r15
sete %cl
orb %al, %cl
jne 0x313a1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9a824
testq %rax, %rax
jne 0x313a1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1784c
movq %r15, %rbp
incq %r13
addq $0x10, %r12
jmp 0x31345
cmpl $0x0, 0xc(%rbx)
jne 0x313c5
movq %rbx, %rdi
callq 0x9a81c
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x13500
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x13500
movq %r14, %rdi
callq 0x138f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::ReadFile(char const*)
int R3SurfelPointSet::
ReadFile(const char *filename)
{
  // Create block
  R3SurfelBlock *block = new R3SurfelBlock();
  if (!block) {
    RNFail("Unable to allocate block for %s\n", filename);
    return 0;
  }

  // Read block
  if (!block->ReadFile(filename)) return 0;

  // Insert points from block
  InsertPoints(block);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0xc8, %edi
callq 0x134f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x294bc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2bab8
testl %eax, %eax
je 0x3172e
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
pushq $0x1
popq %rax
jmp 0x31730
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x13500
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::WriteFile(char const*) const
int R3SurfelPointSet::
WriteFile(const char *filename) const
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .ply)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strncmp(extension, ".xyz", 4)) {
    return WriteXYZFile(filename);
  }
  else { 
    RNFail("Unable to write file %s (unrecognized extension: %s)\n", filename, extension); 
    return 0; 
  }

  // Should never get here
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x13580
testq %rax, %rax
je 0x31798
movq %rax, %r15
leaq 0x9774e(%rip), %rsi     # 0xc8ec1
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x13250
testl %eax, %eax
je 0x317b1
leaq 0x96d13(%rip), %rdi     # 0xc849c
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9ce26
jmp 0x317a9
leaq 0x976ed(%rip), %rdi     # 0xc8e8c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x13070
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rax
movq 0xc8(%rax), %rax
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::WriteXYZFile(char const*) const
int R3SurfelPointSet::
WriteXYZFile(const char *filename) const
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "w"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Write points
  for (int i = 0; i < NPoints(); i++) {
    const R3SurfelPoint *point = Point(i);
    R3Point position = point->Position();
    fprintf(fp, "%g %g %g\n", position.X(), position.Y(), position.Z());
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x9daa1(%rip), %rsi     # 0xcf284
movq %r15, %rdi
callq 0x135f0
testq %rax, %rax
je 0x3184e
movq %rax, %r14
xorl %r13d, %r13d
movq %rsp, %r15
leaq 0x98b86(%rip), %r12     # 0xca386
xorl %ebp, %ebp
movslq 0x10(%rbx), %rax
cmpq %rax, %rbp
jge 0x31841
movq 0x8(%rbx), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x16310
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %r14, %rdi
movq %r12, %rsi
movb $0x3, %al
callq 0x13780
incq %rbp
addq $0x10, %r13
jmp 0x31802
movq %r14, %rdi
callq 0x134e0
pushq $0x1
popq %rbx
jmp 0x31861
leaq 0x96c7d(%rip), %rdi     # 0xc84d2
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x9ce26
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<gaps::R3SurfelPoint*>::R3Kdtree(gaps::RNArray<gaps::R3SurfelPoint*> const&, gaps::R3Point (*)(gaps::R3SurfelPoint*, void*), void*)
R3Kdtree<PtrType>::
R3Kdtree(const RNArray<PtrType>& points, R3Point (*position_callback)(PtrType, void *), void *position_callback_data)
  : position_offset(-1),
    position_callback(position_callback),
    position_callback_data(position_callback_data),
    npoints(points.NEntries()),
    nnodes(1)
{
  // Create root node
  root = new R3KdtreeNode<PtrType>(NULL);
  assert(root);

  // Determine bounding box 
  bbox = R3null_box;
  for (int i = 0; i < points.NEntries(); i++) {
    bbox.Union(Position(points[i]));
  }

  // Allocate copy of points array (so that it can be sorted)
  PtrType *copy = new PtrType [ points.NEntries() ];
  assert(copy);

  // Copy points
  for (int i = 0; i < points.NEntries(); i++) 
    copy[i] = points[i];

  // Insert points into root
  InsertPoints(root, bbox, copy, points.NEntries());

  // Delete copy of points array
  delete [] copy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0x63ca2
orl $-0x1, 0x38(%rbx)
movq %r12, 0x40(%rbx)
movq %r15, 0x48(%rbx)
movl 0xc(%r14), %eax
movl %eax, 0x58(%rbx)
movl $0x1, 0x5c(%rbx)
movl $0x130, %edi            # imm = 0x130
callq 0x134f0
andl $0x0, 0x128(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
andl $0x0, 0x20(%rax)
movq %rax, 0x50(%rbx)
leaq 0xf3c50(%rip), %rsi     # 0x1259e8
movq %rbx, %rdi
callq 0x177ee
xorl %r13d, %r13d
leaq 0x8(%rsp), %r12
movslq 0xc(%r14), %r15
cmpq %r15, %r13
jge 0x31dd3
movq (%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31f00
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6464c
incq %r13
jmp 0x31da8
leaq (,%r15,8), %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x13030
movq %rax, %r12
movq (%r14), %rax
xorl %ecx, %ecx
testl %r15d, %r15d
movl $0x0, %edx
cmovgl %r15d, %edx
cmpq %rcx, %rdx
je 0x31e10
movq (%rax,%rcx,8), %rsi
movq %rsi, (%r12,%rcx,8)
incq %rcx
jmp 0x31dfe
movq 0x50(%rbx), %rsi
movq %rbx, %rdi
movq %rbx, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x31f54
movq %r12, %rdi
callq 0x136a0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x31e3f
jmp 0x31e3f
movq %rax, %r14
movq %rbx, %rdi
callq 0x649ae
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<gaps::R3SurfelPoint*>::FindClosest(gaps::R3SurfelPoint*, double, double, int, int (*)(gaps::R3SurfelPoint*, gaps::R3SurfelPoint*, void*), void*, gaps::RNArray<gaps::R3SurfelPoint*>&, double*) const
int R3Kdtree<PtrType>::
FindClosest(PtrType query_point, 
  RNScalar min_distance, RNScalar max_distance, int max_points, 
  int (*IsCompatible)(PtrType, PtrType, void *), void *compatible_data, 
  RNArray<PtrType>& points, RNLength *distances) 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;

  // Allocate temporary array of squared distances to max_points closest points
  RNLength *distances_squared = new RNLength [ max_points ];

  // Search nodes recursively
  FindClosest(root, bbox, 
    query_point, Position(query_point),
    min_distance_squared, max_distance_squared, max_points, 
    IsCompatible, compatible_data,
    points, distances_squared);

  // Update return distances
  if (distances) {
    for (int i = 0; i < points.NEntries(); i++) {
      distances[i] = sqrt(distances_squared[i]);
    }
  }

  // Delete temporary array of squared distances
  delete [] distances_squared;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbx
movq %rdi, %r15
movq 0x50(%rdi), %r12
testq %r12, %r12
sete %dil
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
seta %r9b
xorl %eax, %eax
orb %dil, %r9b
jne 0x323d3
movq 0x80(%rsp), %r13
maxsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
movsd %xmm2, 0x10(%rsp)
mulsd %xmm1, %xmm1
movsd %xmm1, 0x18(%rsp)
movl %edx, %eax
shlq $0x3, %rax
testl %edx, %edx
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rsi, %rbp
movl %edx, 0xc(%rsp)
callq 0x13030
movq %rax, %r14
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x31f00
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
leaq 0x30(%rsp), %r8
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl 0xc(%rsp), %r9d
pushq %r14
pushq %rbx
pushq 0x30(%rsp)
pushq 0x40(%rsp)
callq 0x323e2
addq $0x20, %rsp
testq %r13, %r13
je 0x323c8
xorl %r15d, %r15d
xorpd %xmm1, %xmm1
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jge 0x323c8
movsd (%r14,%r15,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0x323b3
sqrtsd %xmm0, %xmm0
jmp 0x323bc
callq 0x133d0
xorpd %xmm1, %xmm1
movsd %xmm0, (%r13,%r15,8)
incq %r15
jmp 0x32398
movq %r14, %rdi
callq 0x136a0
movl 0xc(%rbx), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointGraph.cpp
// Function: gaps::R3SurfelPointGraph::R3SurfelPointGraph(gaps::R3SurfelPointGraph const&)
R3SurfelPointGraph::
R3SurfelPointGraph(const R3SurfelPointGraph& graph)
  : set(graph.set),
    neighbors(NULL),
    max_neighbors(graph.max_neighbors),
    max_distance(graph.max_distance)
{
  // Copy neighbors
  neighbors = new RNArray<R3SurfelPoint *> [ NPoints() ];
  for (int i = 0; i < NPoints(); i++) {
    neighbors[i].Resize(graph.neighbors[i].NEntries());
    for (int j = 0; j < graph.neighbors[i].NEntries(); j++) {
      neighbors[i].Insert(graph.neighbors[i][j]);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0xed0c5(%rip), %rax     # 0x11f998
movq %rax, (%rdi)
addq $0x8, %rdi
addq $0x8, %rsi
movq %rdi, 0x10(%rsp)
callq 0x2f5a4
andq $0x0, 0x68(%r15)
movl 0x70(%r14), %eax
movl %eax, 0x70(%r15)
movsd 0x78(%r14), %xmm0
movsd %xmm0, 0x78(%r15)
movslq 0x18(%r15), %r13
movq %r13, %rbx
shlq $0x4, %rbx
leaq 0x8(%rbx), %rax
testq %r13, %r13
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movq %rdi, 0x8(%rsp)
callq 0x13030
movq %r13, (%rax)
movq %rax, (%rsp)
leaq 0x8(%rax), %r12
testl %r13d, %r13d
je 0x32952
negq %rbx
xorl %r13d, %r13d
movq %r12, %rbp
movq %rbp, %rdi
callq 0x9a7ae
addq $-0x10, %r13
addq $0x10, %rbp
cmpq %r13, %rbx
jne 0x3293d
movq %r12, 0x68(%r15)
xorl %r12d, %r12d
movslq 0x18(%r15), %rax
cmpq %rax, %r12
jge 0x329ae
movq %r12, %rbx
shlq $0x4, %rbx
movq 0x68(%r15), %rdi
addq %rbx, %rdi
movq 0x68(%r14), %rax
movl 0xc(%rax,%rbx), %esi
callq 0x9a894
xorl %r13d, %r13d
movq 0x68(%r14), %rax
movslq 0xc(%rax,%rbx), %rcx
cmpq %rcx, %r13
jge 0x329a9
addq %rbx, %rax
movq (%rax), %rax
movq 0x68(%r15), %rdi
addq %rbx, %rdi
movq (%rax,%r13,8), %rsi
callq 0x1784c
incq %r13
jmp 0x32980
incq %r12
jmp 0x32959
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x329f3
movq %rax, %r14
testq %r13, %r13
je 0x329e1
negq %r13
movq (%rsp), %rbx
addq $-0x8, %rbx
leaq (%rbx,%r13), %rdi
callq 0x9a81c
addq $-0x10, %r13
jne 0x329d2
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x139f0
jmp 0x329f6
jmp 0x329f3
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x2f6a8
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointGraph.cpp
// Function: gaps::R3SurfelPointGraph::R3SurfelPointGraph(gaps::R3SurfelPointSet const&, int, double)
R3SurfelPointGraph::
R3SurfelPointGraph(const R3SurfelPointSet& set, int max_neighbors, RNLength max_distance)
  : set(set),
    neighbors(NULL),
    max_neighbors(max_neighbors),
    max_distance(max_distance)
{
  // Allocate neighbors
  neighbors = new RNArray<R3SurfelPoint *> [ NPoints() ];

  // Find neighbors with kdtree
  RNArray<R3SurfelPoint *> points;
  for (int i = 0; i < NPoints(); i++) points.Insert(Point(i));
  R3Kdtree<R3SurfelPoint *> kdtree(points, SurfelPointPosition, NULL);
  for (int i = 0; i < NPoints(); i++) {
    kdtree.FindClosest(Point(i), 0, max_distance, max_neighbors, neighbors[i]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movsd %xmm0, 0x10(%rsp)
movl %edx, %ebp
movq %rdi, %r14
leaq 0xecf6d(%rip), %rax     # 0x11f998
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, 0x30(%rsp)
callq 0x2f5a4
andq $0x0, 0x68(%r14)
movl %ebp, 0x70(%r14)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x78(%r14)
movslq 0x18(%r14), %r12
movq %r12, %rbx
shlq $0x4, %rbx
leaq 0x8(%rbx), %rax
testq %r12, %r12
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movq %rdi, 0x28(%rsp)
callq 0x13030
movq %r12, (%rax)
movq %rax, 0x8(%rsp)
leaq 0x8(%rax), %r15
testl %r12d, %r12d
je 0x32aa3
negq %rbx
xorl %r12d, %r12d
movq %r15, %r13
movq %r13, %rdi
callq 0x9a7ae
addq $-0x10, %r12
addq $0x10, %r13
cmpq %r12, %rbx
jne 0x32a8e
movq %r15, 0x68(%r14)
leaq 0x18(%rsp), %rdi
callq 0x9a7ae
xorl %ebx, %ebx
leaq 0x18(%rsp), %r15
xorl %r12d, %r12d
movslq 0x18(%r14), %rax
cmpq %rax, %r12
jge 0x32adc
movq 0x10(%r14), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x1784c
incq %r12
addq $0x10, %rbx
jmp 0x32abb
leaq -0x35c5(%rip), %rdx     # 0x2f51e
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
xorl %ecx, %ecx
callq 0x31d36
xorl %ebx, %ebx
leaq 0x38(%rsp), %r15
xorl %r12d, %r12d
movslq 0x18(%r14), %rax
cmpq %rax, %r12
jge 0x32b34
movq 0x10(%r14), %rsi
addq %rbx, %rsi
movq 0x68(%r14), %rcx
addq %rbx, %rcx
xorps %xmm0, %xmm0
movq %r15, %rdi
movsd 0x10(%rsp), %xmm1
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x31e52
incq %r12
addq $0x10, %rbx
jmp 0x32afe
leaq 0x38(%rsp), %rdi
callq 0x31e66
leaq 0x18(%rsp), %rdi
callq 0x9a81c
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32ba6
jmp 0x32b5e
movq %rax, %r14
jmp 0x32bb3
movq %rax, %r14
testq %r12, %r12
je 0x32b86
negq %r12
movq 0x8(%rsp), %rbx
addq $-0x8, %rbx
leaq (%rbx,%r12), %rdi
callq 0x9a81c
addq $-0x10, %r12
jne 0x32b77
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x139f0
jmp 0x32bb3
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x31e66
jmp 0x32ba9
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x9a81c
movq 0x30(%rsp), %rdi
callq 0x2f6a8
movq %r14, %rdi
callq 0x138f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointGraph.cpp
// Function: gaps::R3SurfelPointGraph::Draw(gaps::RNFlags) const
void R3SurfelPointGraph::
Draw(RNFlags flags) const
{
  // Draw surfels
  set.Draw(flags);

  // Draw lines between neighbors
  RNGrfxBegin(RN_GRFX_LINES);
  for (int i = 0; i < NPoints(); i++) {
    R3SurfelPoint *point0 = Point(i);
    for (int j = 0; j < NNeighbors(i); j++) {
      R3SurfelPoint *point1 = Neighbor(i,j);
      R3LoadPoint(point0->Position());
      R3LoadPoint(point1->Position());
    }
  }
  RNGrfxEnd();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x313ee
pushq $0x1
popq %rdi
callq 0x13130
xorl %ebp, %ebp
leaq 0x10(%rsp), %r14
movslq 0x18(%rbx), %rax
cmpq %rax, %rbp
jge 0x32f8c
movq %rbp, 0x8(%rsp)
shlq $0x4, %rbp
movq 0x10(%rbx), %r15
addq %rbp, %r15
xorl %r13d, %r13d
movq 0x68(%rbx), %rax
movslq 0xc(%rax,%rbp), %rcx
cmpq %rcx, %r13
jge 0x32f82
movq (%rax,%rbp), %rax
movq (%rax,%r13,8), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x16310
movq %r14, %rdi
callq 0x13150
movq %r14, %rdi
movq %r12, %rsi
callq 0x16310
movq %r14, %rdi
callq 0x13150
incq %r13
jmp 0x32f41
movq 0x8(%rsp), %rbp
incq %rbp
jmp 0x32f25
callq 0x136d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointGraph.cpp
// Function: gaps::R3SurfelPointGraph::UpdateNormals() const
void R3SurfelPointGraph::
UpdateNormals(void) const
{
  // Declare variables (fill it only if needed)
  R3Point *positions = NULL;

  // Compute normals for all points that don't already have them
  for (int i = 0; i < NPoints(); i++) {
    R3SurfelPoint *point = Point(i);
    if (point->HasNormal()) continue;

    // Allocate array of positions
    if (!positions) {
      positions = new R3Point [MaxNeighbors() + 1];
      if (!positions) RNAbort("Unable to allocate positions to update normals");
    }

    // Create array of positions for neighborhood
    int npositions = 0;
    positions[npositions++] = point->Position();
    for (int j = 0; j < NNeighbors(i); j++) {
      R3SurfelPoint *neighbor = Neighbor(i, j);
      positions[npositions++] = neighbor->Position();
    }

    // Compute normal with PCA of neighborhood
    R3Point centroid = R3Centroid(npositions, positions);
    R3Triad triad = R3PrincipleAxes(centroid, npositions, positions);
    R3Vector normal = triad[2];

    // Assign normal
    point->SetNormal(normal);
  }

  // Delete data
  if (positions) delete [] positions;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
xorl %ecx, %ecx
leaq 0x50(%rsp), %r15
xorl %ebp, %ebp
movslq 0x18(%rbx), %rax
cmpq %rax, %rcx
jge 0x330f4
movq 0x10(%rbx), %rsi
movq %rcx, %r14
shlq $0x4, %r14
movq 0x8(%rsi,%r14), %rax
testb $0x40, 0x2f(%rax)
jne 0x330ec
movq %rcx, 0x18(%rsp)
testq %rbp, %rbp
jne 0x33042
movq %rsi, 0x8(%rsp)
movl 0x70(%rbx), %r12d
leal 0x1(%r12), %eax
movslq %eax, %r13
movq %r13, %rax
pushq $0x18
popq %rcx
mulq %rcx
movq %rax, %rdi
pushq $-0x1
popq %rax
cmovoq %rax, %rdi
movq %rdi, 0x10(%rsp)
callq 0x13030
movq %rax, %rbp
incl %r12d
je 0x3303d
imulq $0x18, %r13, %r13
xorl %r12d, %r12d
leaq (%r12,%rbp), %rdi
callq 0x781ba
addq $0x18, %r12
cmpq %r12, %r13
jne 0x3302b
movq 0x8(%rsp), %rsi
addq %r14, %rsi
movq %r15, %rdi
movq %rsi, 0x8(%rsp)
callq 0x16310
movq %rbp, %rdi
movq %r15, %rsi
callq 0x784a6
leaq 0x18(%rbp), %r13
xorl %r12d, %r12d
movq 0x68(%rbx), %rax
movslq 0xc(%rax,%r14), %rcx
cmpq %rcx, %r12
jge 0x33096
movq (%rax,%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x16310
movq %r13, %rdi
movq %r15, %rsi
callq 0x784a6
incq %r12
addq $0x18, %r13
jmp 0x33064
incl %r12d
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x4d640
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movq %rbp, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4d6c9
leaq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x80(%rsp), %rsi
callq 0x7898c
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2f290
movq 0x18(%rsp), %rcx
incq %rcx
jmp 0x32fbd
testq %rbp, %rbp
je 0x33101
movq %rbp, %rdi
callq 0x136a0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x139f0
movq %rbx, %rdi
callq 0x138f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::~R3SurfelNode()
R3SurfelNode::
~R3SurfelNode(void)
{
  // Remove blocks from node
  while (NBlocks() > 0) RemoveBlock(Block(NBlocks()-1));

  // Remove node from object
  if (object) object->RemoveNode(this);

  // Remove node from scan
  if (scan) scan->SetNode(NULL);

  // Delete parts
  while (NParts() > 0) delete (Part(NParts()-1));
  
  // Remove node from tree
  if (tree) tree->RemoveNode(this);

  // Delete name
  if (name) free(name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xec43d(%rip), %rax     # 0x11f9d0
movq %rax, (%rdi)
leaq 0x40(%rdi), %rbx
movslq 0x4c(%r14), %rax
testq %rax, %rax
jle 0x335b7
movq (%r14), %rcx
movq 0x40(%r14), %rdx
movq -0x8(%rdx,%rax,8), %rsi
movq %r14, %rdi
callq *0x30(%rcx)
jmp 0x3359a
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x335c8
movq %r14, %rsi
callq 0x1677a
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x335d9
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
leaq 0x30(%r14), %r15
movslq 0x3c(%r14), %rax
testq %rax, %rax
jle 0x335fb
movq (%r15), %rcx
movq -0x8(%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x335dd
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x335dd
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x3360c
movq %r14, %rsi
callq 0x34fc0
movq 0xb8(%r14), %rdi
callq 0x13600
addq $0x60, %r14
movq %r14, %rdi
callq 0x649ae
movq %rbx, %rdi
callq 0x9a81c
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x9a81c
jmp 0x3363b
movq %rax, %rdi
callq 0x177bf
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::AverageRadius() const
RNLength R3SurfelNode::
AverageRadius(void) const
{
  // Sum average radius of surfels 
  RNLength total_radius = 0;
  RNLength total_weight = 0;
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    RNScalar weight = block->NSurfels();
    total_radius += weight * block->AverageRadius();
    total_weight += weight;
  }

  // Return weighted average
  return (total_weight > 0) ? total_radius / total_weight : 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorpd %xmm1, %xmm1
xorl %r14d, %r14d
xorpd %xmm2, %xmm2
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jge 0x33707
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
cvtsi2sdl 0x8(%rdi), %xmm0
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
movapd %xmm2, 0x10(%rsp)
callq 0x34688
movapd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
movsd (%rsp), %xmm3
mulsd %xmm3, %xmm0
addsd %xmm0, %xmm2
addsd %xmm3, %xmm1
incq %r14
jmp 0x336b9
divsd %xmm1, %xmm2
xorpd %xmm0, %xmm0
cmpltsd %xmm1, %xmm0
andpd %xmm2, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::BBox() const
const R3Box& R3SurfelNode::
BBox(void) const
{
  // Return bounding box of node
  if (bbox[0][0] == FLT_MAX) 
    ((R3SurfelNode *) this)->UpdateBBox();
  return bbox;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd 0x68(%rdi), %xmm0
ucomisd 0x94a37(%rip), %xmm0    # 0xc8168
jne 0x3373e
jp 0x3373e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
addq $0x60, %rbx
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::ElevationRange() const
const RNInterval& R3SurfelNode::
ElevationRange(void) const
{
  // Return elevation interval of node
  if (elevation_range.Min() == FLT_MAX) 
    ((R3SurfelNode *) this)->UpdateElevationRange();
  return elevation_range;
}

// Assembly:
pushq %rbx
leaq 0x98(%rdi), %rbx
movsd 0x98(%rdi), %xmm0
ucomisd 0x94a08(%rip), %xmm0    # 0xc8168
jne 0x3376a
jp 0x3376a
movq (%rdi), %rax
callq *0x70(%rax)
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::TimestampRange() const
const RNInterval& R3SurfelNode::
TimestampRange(void) const
{
  // Return timestamp interval of node
  if (timestamp_range.Min() == FLT_MAX) 
    ((R3SurfelNode *) this)->UpdateTimestampRange();
  return timestamp_range;
}

// Assembly:
pushq %rbx
leaq 0xa8(%rdi), %rbx
movsd 0xa8(%rdi), %xmm0
ucomisd 0x949e0(%rip), %xmm0    # 0xc8168
jne 0x33792
jp 0x33792
movq (%rdi), %rax
callq *0x78(%rax)
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::HasSurfels(int) const
RNBoolean R3SurfelNode::
HasSurfels(RNBoolean leaf_level) const
{
  // Check blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    if (block->NSurfels() > 0) return TRUE;
  }

  // Check parts
  if (leaf_level) {
    for (int i = 0; i < NParts(); i++) {
      R3SurfelNode *part = Part(i);
      if (part->HasSurfels(leaf_level)) return TRUE;
    }
  }

  // Did not find anything
  return FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movl 0x4c(%rdi), %eax
movq 0x40(%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
pushq $0x1
popq %rbx
cmpq %rdx, %rax
je 0x337c7
movq (%rcx,%rdx,8), %rsi
incq %rdx
cmpl $0x0, 0x8(%rsi)
jle 0x337b3
jmp 0x337f8
testl %ebp, %ebp
je 0x337f6
movl 0x3c(%rdi), %r14d
movq 0x30(%rdi), %r15
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
cmpq %r12, %r14
je 0x337f6
movq (%r15,%r12,8), %rdi
movl %ebp, %esi
callq 0x33798
incq %r12
testl %eax, %eax
je 0x337dd
jmp 0x337f8
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::Object(int, int) const
R3SurfelObject *R3SurfelNode::
Object(RNBoolean search_ancestors, RNBoolean search_descendants) const
{
  // Return object, if there is one associated with this node
  if (object) return object;

  // Search descendants for object
  if (search_descendants) {
    RNScalar best_complexity = 0;
    R3SurfelObject *best_object = NULL;
    for (int i = 0; i < NParts(); i++) {
      R3SurfelNode *part = Part(i);
      R3SurfelObject *object = part->Object(FALSE, TRUE);
      if (object) {
        RNScalar complexity = object->Complexity();
        if (complexity > best_complexity) {
          best_complexity = complexity;
          best_object = object;
        }
      }
    }
    if (best_object) return best_object;
  }

  // Search ancestors for object
  if (search_ancestors) {
    const R3SurfelNode *node = this;
    while (node) {
      R3SurfelObject *object = node->Object(FALSE, FALSE);
      if (object) return object;
      node = node->Parent();
    }
  }

  // Object not found
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x338dd
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
testl %edx, %edx
je 0x33956
movl %esi, 0xc(%rsp)
movl 0x3c(%rbx), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
movq 0x30(%rbx), %rbp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
pushq $0x1
popq %r15
xorl %r14d, %r14d
cmpq %r13, %r12
je 0x33949
movq (%rbp,%r13,8), %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x338b4
testq %rax, %rax
je 0x33944
movsd 0x98(%rax), %xmm0
movsd 0x10(%rsp), %xmm1
ucomisd %xmm1, %xmm0
cmovaq %rax, %r14
maxsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
incq %r13
jmp 0x3390b
testq %r14, %r14
movl 0xc(%rsp), %esi
jne 0x338cb
xorl %r14d, %r14d
testl %esi, %esi
je 0x338cb
testq %rbx, %rbx
je 0x338cb
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x338b4
testq %rax, %rax
jne 0x33981
movq 0x28(%rbx), %rbx
jmp 0x33961
movq %rax, %r14
jmp 0x338cb
nop