LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelConstraint.cpp
// Function: gaps::R3SurfelMultiConstraint::Check(gaps::R3SurfelBlock const*, gaps::R3Surfel const*) const
int R3SurfelMultiConstraint::
Check(const R3SurfelBlock *block, const R3Surfel *surfel) const
{
  // Check whether all constraints are met
  for (int i = 0; i < constraints.NEntries(); i++) {
    const R3SurfelConstraint *constraint = constraints.Kth(i);
    if (!constraint->Check(block, surfel)) return R3_SURFEL_CONSTRAINT_FAIL;
  }

  // Return how all constraints are met
  return R3_SURFEL_CONSTRAINT_PASS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0x2, %ebx
cmpl $0x0, 0x14(%rdi)
jle 0x31d02
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq 0x8(%r12), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movq %r14, %rdx
callq *0x28(%rax)
testl %eax, %eax
je 0x31d00
incq %r13
movslq 0x14(%r12), %rax
cmpq %rax, %r13
jl 0x31cd8
jmp 0x31d02
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelConstraint.cpp
// Function: gaps::R3SurfelMultiConstraint::Check(gaps::R3Box const&) const
int R3SurfelMultiConstraint::
Check(const R3Box& box) const
{
  // Initialize return status 
  int status = R3_SURFEL_CONSTRAINT_PASS;

  // Check whether all constraints are met
  for (int i = 0; i < constraints.NEntries(); i++) {
    const R3SurfelConstraint *constraint = constraints.Kth(i);
    int s = constraint->Check(box);
    if (s == R3_SURFEL_CONSTRAINT_FAIL) return R3_SURFEL_CONSTRAINT_FAIL;
    else if (s == R3_SURFEL_CONSTRAINT_MAYBE) status = R3_SURFEL_CONSTRAINT_MAYBE;
  }

  // Return how all constraints are met
  return status;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x14(%rdi)
jle 0x31d53
movq %rsi, %r14
movq %rdi, %r15
movl $0x2, %ebx
xorl %r12d, %r12d
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x30(%rax)
testl %eax, %eax
je 0x31d5a
cmpl $0x1, %eax
cmovel %eax, %ebx
incq %r12
movslq 0x14(%r15), %rax
cmpq %rax, %r12
jl 0x31d2a
jmp 0x31d5c
movl $0x2, %ebx
jmp 0x31d5c
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelConstraint.cpp
// Function: gaps::R3SurfelMultiConstraint::Check(gaps::R3Point const&) const
int R3SurfelMultiConstraint::
Check(const R3Point& point) const
{
  // Check whether all constraints are met
  for (int i = 0; i < constraints.NEntries(); i++) {
    const R3SurfelConstraint *constraint = constraints.Kth(i);
    if (!constraint->Check(point)) return R3_SURFEL_CONSTRAINT_FAIL;
  }

  // All constraints are met
  return R3_SURFEL_CONSTRAINT_PASS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x2, %ebx
cmpl $0x0, 0x14(%rdi)
jle 0x31dab
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x38(%rax)
testl %eax, %eax
je 0x31da9
incq %r12
movslq 0x14(%r15), %rax
cmpq %rax, %r12
jl 0x31d86
jmp 0x31dab
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPoint.cpp
// Function: gaps::R3SurfelPoint::R3SurfelPoint(gaps::R3SurfelBlock*, int)
R3SurfelPoint::
R3SurfelPoint(R3SurfelBlock *block, int surfel_index)
  : block(block),
    surfel(NULL)
{
  // Update block reference count
  if (block && block->Database()) block->Database()->ReadBlock(block);

  // Find surfel
  surfel = block->Surfel(surfel_index);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, (%rdi)
movq $0x0, 0x8(%rdi)
testq %rsi, %rsi
je 0x32082
movq 0x98(%r14), %rdi
testq %rdi, %rdi
je 0x32082
movl 0xb4(%r14), %eax
testl %eax, %eax
jne 0x32079
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %r14, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x32082
movl 0xb4(%r14), %eax
incl %eax
movl %eax, 0xb4(%r14)
movslq %ebp, %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq (%r14), %rax
movq %rax, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPoint.cpp
// Function: gaps::R3SurfelPoint::Copy(gaps::R3SurfelPoint const*)
void R3SurfelPoint::
Copy(const R3SurfelPoint *point)
{
  // Update block reference counts
  if (this->block != point->block) {
    if (this->block && this->block->Database()) this->block->Database()->ReleaseBlock(this->block);
    if (point->block && point->block->Database()) point->block->Database()->ReadBlock(point->block);
  }

  // Copy block and surfel
  this->block = point->block;
  this->surfel = point->surfel;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r15
movq (%rsi), %r12
cmpq %r12, %r15
je 0x3220a
testq %r15, %r15
je 0x321c3
movq 0x98(%r15), %r12
testq %r12, %r12
je 0x321c0
movl 0xb4(%r15), %eax
cmpl $0x1, %eax
jne 0x32189
movq (%r12), %rax
movq 0x8(%r12), %rdx
movl 0x28(%r12), %ecx
movq %r12, %rdi
movq %r15, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x321c0
movl 0xb4(%r15), %eax
decl %eax
movl %eax, 0xb4(%r15)
jne 0x321c0
testb $0x2, 0x89(%r15)
je 0x321c0
movq (%r12), %rax
movq %r12, %rdi
movq %r15, %rsi
callq *0x18(%rax)
movq %r15, %rdi
callq 0x2ca06
movl $0xc8, %esi
movq %r15, %rdi
callq 0x134f0
movq (%r14), %r12
testq %r12, %r12
je 0x3220a
movq 0x98(%r12), %rdi
testq %rdi, %rdi
je 0x3220a
movl 0xb4(%r12), %eax
testl %eax, %eax
jne 0x32200
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %r12, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x3220a
movl 0xb4(%r12), %eax
incl %eax
movl %eax, 0xb4(%r12)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPoint.cpp
// Function: gaps::R3SurfelPoint::Reset(gaps::R3SurfelBlock*, gaps::R3Surfel const*)
void R3SurfelPoint::
Reset(R3SurfelBlock *block, const R3Surfel *surfel)
{
  // Update block reference counts
  if (this->block != block) {
    if (this->block && this->block->Database()) this->block->Database()->ReleaseBlock(this->block);
    if (block && block->Database()) block->Database()->ReadBlock(block);
  }

  // Copy block and surfel
  this->block = block;
  this->surfel = surfel;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %r12
cmpq %rsi, %r12
je 0x322fb
testq %r12, %r12
je 0x322b8
movq 0x98(%r12), %r13
testq %r13, %r13
je 0x322b8
movl 0xb4(%r12), %eax
cmpl $0x1, %eax
jne 0x3227f
movq (%r13), %rax
movq 0x8(%r13), %rdx
movl 0x28(%r13), %ecx
movq %r13, %rdi
movq %r12, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x322b8
movl 0xb4(%r12), %eax
decl %eax
movl %eax, 0xb4(%r12)
jne 0x322b8
testb $0x2, 0x89(%r12)
je 0x322b8
movq (%r13), %rax
movq %r13, %rdi
movq %r12, %rsi
callq *0x18(%rax)
movq %r12, %rdi
callq 0x2ca06
movl $0xc8, %esi
movq %r12, %rdi
callq 0x134f0
testq %r15, %r15
je 0x322fb
movq 0x98(%r15), %rdi
testq %rdi, %rdi
je 0x322fb
movl 0xb4(%r15), %eax
testl %eax, %eax
jne 0x322f2
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %r15, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x322fb
movl 0xb4(%r15), %eax
incl %eax
movl %eax, 0xb4(%r15)
movq %r15, (%r14)
movq %rbx, 0x8(%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPoint.cpp
// Function: gaps::R3SurfelPoint::Draw(gaps::RNFlags) const
void R3SurfelPoint::
Draw(RNFlags flags) const
{
  // Draw surfel
  RNGrfxBegin(RN_GRFX_POINTS);
  if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(Color());
  R3LoadPoint(Position().Coords());
  RNGrfxEnd();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %edi, %edi
callq 0x13130
testb $0x1, %r14b
je 0x325a7
movq 0x8(%rbx), %rdi
addq $0x2c, %rdi
callq 0x13660
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cvtss2sd (%rcx), %xmm0
addsd 0x10(%rax), %xmm0
cvtss2sd 0x4(%rcx), %xmm1
addsd 0x18(%rax), %xmm1
cvtss2sd 0x8(%rcx), %xmm2
addsd 0x20(%rax), %xmm2
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x83dc2
movq %rbx, %rdi
callq 0x13150
callq 0x136a0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::Centroid() const
R3Point R3SurfelPointSet::
Centroid(void) const
{
  // Return centroid of set
  R3Point sum(0, 0, 0);
  if (npoints == 0) return sum;
  for (int i = 0; i < npoints; i++) {
    R3SurfelPoint& point = points[i];
    sum[0] += point.X();
    sum[1] += point.Y();
    sum[2] += point.Z();
  }
  return R3Point(sum[0]/npoints, sum[1]/npoints, sum[2]/npoints); 
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x83dc2
movl 0x10(%r14), %eax
testq %rax, %rax
je 0x3286a
movsd (%rsp), %xmm0
testl %eax, %eax
jle 0x32877
movq 0x8(%r14), %rcx
movupd 0x8(%rsp), %xmm2
movq %rax, %rdx
shlq $0x4, %rdx
xorl %esi, %esi
movq 0x8(%rcx,%rsi), %rdi
xorps %xmm1, %xmm1
cvtss2sd (%rdi), %xmm1
movq (%rcx,%rsi), %r8
addsd 0x10(%r8), %xmm1
addsd %xmm1, %xmm0
cvtps2pd 0x4(%rdi), %xmm1
movupd 0x18(%r8), %xmm3
addpd %xmm1, %xmm3
addpd %xmm3, %xmm2
movhpd %xmm2, 0x10(%rsp)
addq $0x10, %rsi
cmpq %rsi, %rdx
jne 0x32822
movsd %xmm0, (%rsp)
movlpd %xmm2, 0x8(%rsp)
jmp 0x3287d
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x83dd2
jmp 0x328a0
movupd 0x8(%rsp), %xmm2
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
divsd %xmm3, %xmm0
movapd %xmm2, %xmm1
divsd %xmm3, %xmm1
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
divsd %xmm3, %xmm2
movq %rbx, %rdi
callq 0x83dc2
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoints(gaps::R3SurfelBlock*)
void R3SurfelPointSet::
InsertPoints(R3SurfelBlock *block)
{
  // Check block
  if (block->NSurfels() == 0) return;

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

  // Update timestamp range
  timestamp_range.Union(block->TimestampRange());

  // Allocate space for points
  AllocatePoints(npoints + block->NSurfels());

  // Read block
  if (block->database) block->database->ReadBlock(block);

  // Copy surfels
  for (int i = 0; i < block->NSurfels(); i++) {
    const R3Surfel *surfel = block->Surfel(i);
    points[npoints].Reset(block, surfel);
    npoints++;
  }

  // Release block
  if (block->database) block->database->ReleaseBlock(block);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x8(%rsi)
je 0x32dcc
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rdi), %r15
movq %rsi, %rdi
callq 0x2cb9e
movq %r15, %rdi
movq %rax, %rsi
callq 0x6de0c
movq %rbx, %rdi
callq 0x2ce62
movsd (%rax), %xmm0
movsd 0x50(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x32cdd
movsd %xmm0, 0x50(%r14)
movsd 0x8(%rax), %xmm0
ucomisd 0x58(%r14), %xmm0
jbe 0x32cf0
movsd %xmm0, 0x58(%r14)
movl 0x8(%rbx), %esi
addl 0x10(%r14), %esi
movq (%r14), %rax
movq %r14, %rdi
callq *0x80(%rax)
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x32d3e
movl 0xb4(%rbx), %eax
testl %eax, %eax
jne 0x32d36
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x32d3e
movl 0xb4(%rbx), %eax
incl %eax
movl %eax, 0xb4(%rbx)
cmpl $0x0, 0x8(%rbx)
jle 0x32d81
movl 0x10(%r14), %eax
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rbx), %rdx
addq %r15, %rdx
movslq %eax, %rdi
shlq $0x4, %rdi
addq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0x3221e
movl 0x10(%r14), %eax
incl %eax
movl %eax, 0x10(%r14)
incq %r12
movslq 0x8(%rbx), %rcx
addq $0x30, %r15
cmpq %rcx, %r12
jl 0x32d4e
movq 0x98(%rbx), %r14
testq %r14, %r14
je 0x32dcc
movl 0xb4(%rbx), %eax
cmpl $0x1, %eax
jne 0x32db9
movq (%r14), %rax
movq 0x8(%r14), %rdx
movl 0x28(%r14), %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x32dcc
movl 0xb4(%rbx), %eax
decl %eax
movl %eax, 0xb4(%rbx)
jne 0x32dcc
testb $0x2, 0x89(%rbx)
jne 0x32dd8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ca06
movl $0xc8, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x134f0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoints(gaps::R3SurfelPointSet const*)
void R3SurfelPointSet::
InsertPoints(const R3SurfelPointSet *set)
{
  // Check set
  if (set->NPoints() == 0) return;

  // Check and update bounding box (conservatively)
  bbox.Union(set->BBox());

  // 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++) {
    points[npoints] = set->points[i];
    npoints++;
  }
}

// Assembly:
cmpl $0x0, 0x10(%rsi)
je 0x33c1e
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rdi
addq $0x18, %rsi
callq 0x6de0c
movsd 0x50(%rbx), %xmm0
movsd 0x50(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x33bac
movsd %xmm0, 0x50(%r14)
movsd 0x58(%rbx), %xmm0
ucomisd 0x58(%r14), %xmm0
jbe 0x33bbf
movsd %xmm0, 0x58(%r14)
movl 0x10(%rbx), %esi
addl 0x10(%r14), %esi
movq (%r14), %rax
movq %r14, %rdi
callq *0x80(%rax)
cmpl $0x0, 0x10(%rbx)
jle 0x33c13
movl 0x10(%r14), %eax
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rsi
addq %r15, %rsi
movslq %eax, %rdi
shlq $0x4, %rdi
addq 0x8(%r14), %rdi
callq 0x3230c
movl 0x10(%r14), %eax
incl %eax
movl %eax, 0x10(%r14)
incq %r12
movslq 0x10(%rbx), %rcx
addq $0x10, %r15
cmpq %rcx, %r12
jl 0x33be2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoints(gaps::R3SurfelPointSet const*, gaps::R2Box const&)
void R3SurfelPointSet::
InsertPoints(const R3SurfelPointSet *set, const R2Box& constraint_box)
{
  // Check set
  if (set->NPoints() == 0) return;

  // Check and update bounding box (conservatively)
  R3Box intersection_box(constraint_box[0][0], constraint_box[0][1], -FLT_MAX, constraint_box[1][0], constraint_box[1][1], FLT_MAX);
  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);
    R3Point position = point->Position();
    if (!R2Intersects(constraint_box, R2Point(position.X(), position.Y()))) continue;
    points[npoints] = *point;
    npoints++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0x0, 0x10(%rsi)
je 0x33dae
movq %rsi, %r14
movq %rdi, %rbx
movsd 0x8(%rdx), %xmm0
movsd 0x10(%rdx), %xmm1
movsd 0x18(%rdx), %xmm3
movq %rdx, (%rsp)
movsd 0x20(%rdx), %xmm4
leaq 0x8(%rsp), %r12
movsd 0xa950d(%rip), %xmm2    # 0xdd170
movsd 0xa94fd(%rip), %xmm5    # 0xdd168
movq %r12, %rdi
callq 0x6d3f4
leaq 0x18(%r14), %rsi
movq %r12, %rdi
callq 0x6df4e
movsd 0x10(%rsp), %xmm0
ucomisd 0x28(%rsp), %xmm0
ja 0x33da4
movsd 0x18(%rsp), %xmm0
ucomisd 0x30(%rsp), %xmm0
ja 0x33da4
movsd 0x20(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
ja 0x33da4
leaq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6de0c
movsd 0x50(%r14), %xmm0
movsd 0x50(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x33cd9
movsd %xmm0, 0x50(%rbx)
movsd 0x58(%r14), %xmm0
ucomisd 0x58(%rbx), %xmm0
jbe 0x33ceb
movsd %xmm0, 0x58(%rbx)
movl 0x10(%r14), %esi
addl 0x10(%rbx), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x80(%rax)
cmpl $0x0, 0x10(%r14)
jle 0x33da4
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x8(%r14), %rbp
movq (%rbp,%r12), %rax
movq 0x8(%rbp,%r12), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx), %xmm0
addsd 0x10(%rax), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx), %xmm1
addsd 0x18(%rax), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rcx), %xmm2
addsd 0x20(%rax), %xmm2
leaq 0x40(%rsp), %rdi
callq 0x83dc2
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0xa2542
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x8fd0f
testl %eax, %eax
je 0x33d90
addq %r12, %rbp
movslq 0x10(%rbx), %rdi
shlq $0x4, %rdi
addq 0x8(%rbx), %rdi
movq %rbp, %rsi
callq 0x3230c
incl 0x10(%rbx)
incq %r13
movslq 0x10(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x33d0f
leaq 0x8(%rsp), %rdi
callq 0x6e174
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x33dc1
jmp 0x33dc1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6e174
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x33f2e
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rdx, (%rsp)
movq %rdx, %rsi
callq 0x6d354
leaq 0x18(%r14), %rsi
movq %r12, %rdi
callq 0x6df4e
movsd 0x10(%rsp), %xmm0
ucomisd 0x28(%rsp), %xmm0
ja 0x33f24
movsd 0x18(%rsp), %xmm0
ucomisd 0x30(%rsp), %xmm0
ja 0x33f24
movsd 0x20(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
ja 0x33f24
leaq 0x18(%r15), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6de0c
movsd 0x50(%r14), %xmm0
movsd 0x50(%r15), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x33e70
movsd %xmm0, 0x50(%r15)
movsd 0x58(%r14), %xmm0
ucomisd 0x58(%r15), %xmm0
jbe 0x33e84
movsd %xmm0, 0x58(%r15)
movl 0x10(%r14), %esi
addl 0x10(%r15), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0x80(%rax)
cmpl $0x0, 0x10(%r14)
jle 0x33f24
xorl %ebp, %ebp
leaq 0x40(%rsp), %rbx
xorl %r12d, %r12d
movq 0x8(%r14), %r13
movq (%r13,%rbp), %rax
movq 0x8(%r13,%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx), %xmm0
addsd 0x10(%rax), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx), %xmm1
addsd 0x18(%rax), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rcx), %xmm2
addsd 0x20(%rax), %xmm2
movq %rbx, %rdi
callq 0x83dc2
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x48d4d
testl %eax, %eax
je 0x33f14
addq %rbp, %r13
movslq 0x10(%r15), %rdi
shlq $0x4, %rdi
addq 0x8(%r15), %rdi
movq %r13, %rsi
callq 0x3230c
incl 0x10(%r15)
incq %r12
movslq 0x10(%r14), %rax
addq $0x10, %rbp
cmpq %rax, %r12
jl 0x33ead
leaq 0x8(%rsp), %rdi
callq 0x6e174
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x33f41
jmp 0x33f41
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6e174
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x342d2
movq %rsi, %r14
movq %rdi, %r15
addq $0x18, %rsi
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
testl %eax, %eax
je 0x342d2
movl 0x10(%r14), %esi
addl 0x10(%r15), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0x80(%rax)
cmpl $0x0, 0x10(%r14)
jle 0x342d2
leaq 0x18(%r15), %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
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 0x342be
addq %r12, %rbp
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx), %xmm0
addsd 0x10(%rax), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx), %xmm1
addsd 0x18(%rax), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rcx), %xmm2
addsd 0x20(%rax), %xmm2
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x83dc2
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x6dd46
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rcx), %xmm0
addsd 0x60(%rax), %xmm0
movsd 0x50(%r15), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x34298
movsd %xmm0, 0x50(%r15)
ucomisd 0x58(%r15), %xmm0
jbe 0x342a6
movsd %xmm0, 0x58(%r15)
movslq 0x10(%r15), %rdi
shlq $0x4, %rdi
addq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x3230c
incl 0x10(%r15)
incq %r13
movslq 0x10(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x34206
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x34314
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x4, %esi
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 0x3230c
leaq 0x18(%rbx), %r15
movq (%r14), %rax
movq 0x8(%r14), %rcx
cvtss2sd (%rcx), %xmm0
addsd 0x10(%rax), %xmm0
cvtss2sd 0x4(%rcx), %xmm1
addsd 0x18(%rax), %xmm1
cvtss2sd 0x8(%rcx), %xmm2
addsd 0x20(%rax), %xmm2
movq %rsp, %r12
movq %r12, %rdi
callq 0x83dc2
movq %r15, %rdi
movq %r12, %rsi
callq 0x6dd46
movq (%r14), %rax
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rcx), %xmm0
addsd 0x60(%rax), %xmm0
movsd 0x50(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x34390
movsd %xmm0, 0x50(%rbx)
ucomisd 0x58(%rbx), %xmm0
jbe 0x3439c
movsd %xmm0, 0x58(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x344e9
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
movq $-0x1, %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 0x34461
negq %r14
xorl %r15d, %r15d
movq %r13, %r12
movq %r12, %rdi
callq 0x31f80
addq $-0x10, %r15
addq $0x10, %r12
cmpq %r15, %r14
jne 0x3444c
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x344e2
cmpl $0x0, 0x10(%rbx)
jle 0x3449f
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rsi
addq %r14, %rsi
leaq (%r14,%r13), %rdi
callq 0x3230c
incq %r15
movslq 0x10(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0x34476
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x344e2
leaq -0x8(%r12), %rax
movq %rax, 0x8(%rsp)
movq -0x8(%r12), %r14
testq %r14, %r14
je 0x344cd
addq $-0x10, %r12
movq %r14, %r15
shlq $0x4, %r15
leaq (%r12,%r15), %rdi
callq 0x3209a
addq $-0x10, %r15
jne 0x344be
shlq $0x4, %r14
orq $0x8, %r14
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x139b0
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 0x3451b
negq %r15
movq 0x8(%rsp), %r14
addq $-0x8, %r14
leaq (%r14,%r15), %rdi
callq 0x3209a
addq $-0x10, %r15
jne 0x3450c
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x139b0
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x34589
leaq -0x8(%r13), %r14
movq -0x8(%r13), %r15
testq %r15, %r15
je 0x34576
addq $-0x10, %r13
movq %r15, %rbp
shlq $0x4, %rbp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x3209a
addq $-0x10, %rbp
jne 0x34565
shlq $0x4, %r15
orq $0x8, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x139b0
leaq 0x20(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
leaq 0x10042c(%rip), %r14    # 0x1349c8
leaq 0x8(%r14), %rsi
callq 0x8412a
leaq 0x38(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0x8412a
leaq 0x502214(%rip), %rax    # 0x5367d0
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_O3/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
movl 0x10(%rdi), %eax
testl %eax, %eax
jle 0x3460b
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x32568
incq %r12
movslq 0x10(%rbx), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x345ed
cmpl $0x0, 0x10(%r14)
jle 0x3463c
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rdi
addq %r15, %rdi
movl $0x1, %esi
callq 0x32568
incq %r12
movslq 0x10(%r14), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x34618
movl 0x10(%rbx), %eax
testl %eax, %eax
jle 0x3467e
xorl %ebp, %ebp
movq 0x8(%rbx), %rcx
movslq %ebp, %rdi
shlq $0x4, %rdi
movq 0x8(%rcx,%rdi), %rdx
cmpb $0x0, 0x2f(%rdx)
jns 0x34678
addq %rcx, %rdi
cltq
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
callq 0x3230c
movl 0x10(%rbx), %eax
decl %eax
movl %eax, 0x10(%rbx)
decl %ebp
incl %ebp
cmpl %eax, %ebp
jl 0x34642
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x10(%rdi), %eax
testl %eax, %eax
jle 0x346c4
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
addq %r15, %rdi
movl $0x1, %esi
callq 0x32568
incq %r12
movslq 0x10(%rbx), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x346a3
cmpl $0x0, 0x10(%r14)
jle 0x346f2
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x32568
incq %r12
movslq 0x10(%r14), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x346d1
movl 0x10(%rbx), %eax
testl %eax, %eax
jle 0x34734
xorl %ebp, %ebp
movq 0x8(%rbx), %rcx
movslq %ebp, %rdi
shlq $0x4, %rdi
movq 0x8(%rcx,%rdi), %rdx
cmpb $0x0, 0x2f(%rdx)
jns 0x3472e
addq %rcx, %rdi
cltq
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
callq 0x3230c
movl 0x10(%rbx), %eax
decl %eax
movl %eax, 0x10(%rbx)
decl %ebp
incl %ebp
cmpl %eax, %ebp
jl 0x346f8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rsi), %ecx
testl %ecx, %ecx
jle 0x3477a
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rdi
addq %r15, %rdi
movl $0x1, %esi
callq 0x32568
incq %r12
movslq 0x10(%r14), %rcx
addq $0x10, %r15
cmpq %rcx, %r12
jl 0x34759
movl 0x10(%rbx), %eax
testl %eax, %eax
jle 0x347a9
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x32568
incq %r12
movslq 0x10(%rbx), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x34787
movl 0x10(%r14), %ecx
testl %ecx, %ecx
jle 0x347d7
movq 0x8(%r14), %rdx
movl %ecx, %ecx
shlq $0x4, %rcx
xorl %edi, %edi
xorl %esi, %esi
movq 0x8(%rdx,%rdi), %r8
movzbl 0x2f(%r8), %r8d
shrl $0x7, %r8d
addl %r8d, %esi
addq $0x10, %rdi
cmpq %rdi, %rcx
jne 0x347bb
jmp 0x347d9
xorl %esi, %esi
addl %eax, %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x80(%rax)
movl 0x10(%r14), %eax
testl %eax, %eax
jle 0x3482e
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rsi
movq 0x8(%rsi,%r15), %rcx
cmpb $0x0, 0x2f(%rcx)
jns 0x3481f
addq %r15, %rsi
movslq 0x10(%rbx), %rdi
shlq $0x4, %rdi
addq 0x8(%rbx), %rdi
callq 0x3230c
incl 0x10(%rbx)
movl 0x10(%r14), %eax
incq %r12
movslq %eax, %rcx
addq $0x10, %r15
cmpq %rcx, %r12
jl 0x347f5
leaq 0x18(%rbx), %rdi
leaq 0x18(%r14), %rsi
callq 0x6de0c
movsd 0x50(%r14), %xmm0
movsd 0x50(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x34851
movsd %xmm0, 0x50(%rbx)
movsd 0x58(%r14), %xmm0
ucomisd 0x58(%rbx), %xmm0
jbe 0x34863
movsd %xmm0, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3497e
movq %rdi, %r14
movl $0x10, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
callq 0xa9ca8
cmpl $0x0, 0x10(%r14)
jle 0x34963
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%r14), %rax
movq (%rax,%r12), %r15
testq %r15, %r15
sete %al
cmpq %rbp, %r15
sete %cl
orb %al, %cl
jne 0x34953
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d20
testq %rax, %rax
jne 0x34953
movl 0xc(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d3e
movq %r15, %rbp
incq %r13
movslq 0x10(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x3491a
cmpl $0x0, 0xc(%rbx)
jne 0x34980
movq %rbx, %rdi
callq 0xa9d12
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
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
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x34a56
movq %rdi, %r14
movl $0x10, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
callq 0xa9ca8
cmpl $0x0, 0x10(%r14)
jle 0x34a3b
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%r14), %rax
movq (%rax,%r12), %rax
testq %rax, %rax
je 0x34a2b
movq 0xb8(%rax), %r15
testq %r15, %r15
sete %al
cmpq %rbp, %r15
sete %cl
orb %al, %cl
jne 0x34a2b
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d20
testq %rax, %rax
jne 0x34a2b
movl 0xc(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d3e
movq %r15, %rbp
incq %r13
movslq 0x10(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x349e6
cmpl $0x0, 0xc(%rbx)
jne 0x34a58
movq %rbx, %rdi
callq 0xa9d12
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
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
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x34b3f
movq %rdi, %r14
movl $0x10, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
callq 0xa9ca8
cmpl $0x0, 0x10(%r14)
jle 0x34b24
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%r14), %rax
movq (%rax,%r12), %rax
testq %rax, %rax
je 0x34b14
movq 0xb8(%rax), %rdi
testq %rdi, %rdi
je 0x34b14
xorl %esi, %esi
xorl %edx, %edx
callq 0x376f4
movq %rax, %r15
testq %rax, %rax
sete %al
cmpq %rbp, %r15
sete %cl
orb %al, %cl
jne 0x34b14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d20
testq %rax, %rax
jne 0x34b14
movl 0xc(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d3e
movq %r15, %rbp
incq %r13
movslq 0x10(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x34abe
cmpl $0x0, 0xc(%rbx)
jne 0x34b41
movq %rbx, %rdi
callq 0xa9d12
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
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
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x134e0
movq %rax, %rbx
movq %rax, %rdi
callq 0x2b544
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2e666
testl %eax, %eax
je 0x34fe8
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movl $0x1, %eax
jmp 0x34fea
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x13560
testq %rax, %rax
je 0x35056
movq %rax, %r15
leaq 0xa8ea2(%rip), %rsi     # 0xdded1
movl $0x4, %edx
movq %rax, %rdi
callq 0x13240
testl %eax, %eax
je 0x3506f
leaq 0xa8455(%rip), %rdi     # 0xdd49c
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xac81a
jmp 0x35067
leaq 0xa8e3f(%rip), %rdi     # 0xdde9c
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_O3/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 0xaf243(%rip), %rsi     # 0xe42e4
movq %r15, %rdi
callq 0x135d0
testq %rax, %rax
je 0x35145
movq %rax, %r14
cmpl $0x0, 0x10(%rbx)
jle 0x35136
movl $0x8, %r13d
xorl %ebp, %ebp
movq %rsp, %r15
leaq 0xaa319(%rip), %r12     # 0xdf3e6
movq 0x8(%rbx), %rax
movq -0x8(%rax,%r13), %rcx
movq (%rax,%r13), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
addsd 0x10(%rcx), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rax), %xmm1
addsd 0x18(%rcx), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rax), %xmm2
addsd 0x20(%rcx), %xmm2
movq %r15, %rdi
callq 0x83dc2
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %r14, %rdi
movq %r12, %rsi
movb $0x3, %al
callq 0x13740
incq %rbp
movslq 0x10(%rbx), %rax
addq $0x10, %r13
cmpq %rax, %rbp
jl 0x350cd
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebx
jmp 0x35158
leaq 0xa8386(%rip), %rdi     # 0xdd4d2
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xac81a
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0x6d310
movl $0xffffffff, 0x38(%rbx) # imm = 0xFFFFFFFF
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 0x134e0
xorl %ecx, %ecx
movl %ecx, 0x128(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movl %ecx, 0x20(%rax)
movq %rax, 0x50(%rbx)
leaq 0x8(%rbx), %rdi
leaq 0xff246(%rip), %r15     # 0x1349c8
leaq 0x8(%r15), %rsi
callq 0x8412a
leaq 0x20(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x8412a
movslq 0xc(%r14), %rax
testq %rax, %rax
jle 0x357da
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movq (%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x35900
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6dd46
incq %r12
movl 0xc(%r14), %ebp
movslq %ebp, %rax
cmpq %rax, %r12
jl 0x357ac
jmp 0x357dc
movl %eax, %ebp
shlq $0x3, %rax
testl %ebp, %ebp
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x13030
movq %rax, %r15
testl %ebp, %ebp
jle 0x35810
movq (%r14), %rax
movl %ebp, %ecx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rsi, (%r15,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x35800
movq 0x50(%rbx), %rsi
movq %rbx, %rdi
movq %rbx, %rdx
movq %r15, %rcx
movl %ebp, %r8d
callq 0x35954
movq %r15, %rdi
callq 0x13680
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3583e
jmp 0x3583e
movq %rax, %r14
movq %rbx, %rdi
callq 0x6e174
movq %r14, %rdi
callq 0x138b0
nop