LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::RemoveParts(gaps::R3SurfelScene*, gaps::R3SurfelObject*)
int
RemoveParts(R3SurfelScene *scene, R3SurfelObject *object)
{
  // Copy array of parts
  RNArray<R3SurfelObject *> parts;
  for (int i = 0; i < object->NParts(); i++) {
    R3SurfelObject *part = object->Part(i);
    parts.Insert(part);
  }
  
  // Delete parts
  for (int i = 0; i < parts.NEntries(); i++) {
    R3SurfelObject *part = parts.Kth(i);
    RemoveParts(scene, part);
    scene->RemoveObject(part);
    delete part;
  }

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0xaaf34
cmpl $0x0, 0x2c(%r14)
jle 0x241b8
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rsi
movl 0x14(%rsp), %edx
movq %r15, %rdi
callq 0xaafca
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x24198
cmpl $0x0, 0x14(%rsp)
jle 0x241fd
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2416e
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x20(%rax)
testq %r14, %r14
je 0x241f0
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
incq %r15
movslq 0x14(%rsp), %rax
cmpq %rax, %r15
jl 0x241c2
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x2421a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::SplitObject(gaps::R3SurfelObject*, gaps::R3SurfelPointSet*, gaps::R3SurfelObject**, gaps::R3SurfelObject**)
int
SplitObject(R3SurfelObject *object, R3SurfelPointSet *pointset,
  R3SurfelObject **resultA, R3SurfelObject **resultB)
{
  // Read blocks
  object->ReadBlocks();

  // Set marks
  object->SetMarks(FALSE);
  pointset->SetMarks(TRUE);

  // Create constraint
  R3SurfelMultiConstraint constraint;
  R3SurfelMarkConstraint mark_constraint(TRUE, FALSE);
  R3SurfelObjectConstraint object_constraint(object);
  constraint.InsertConstraint(&mark_constraint);
  constraint.InsertConstraint(&object_constraint);

  // Split object
  int status = SplitObject(object, &constraint, resultA, resultB);

  // Release blocks
  object->ReleaseBlocks();

  // Return status
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
xorl %esi, %esi
callq 0x17f5e
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
callq *0x40(%rax)
movq (%r12), %rax
movq %r12, %rdi
movl $0x1, %esi
callq *0xa8(%rax)
movq %rsp, %rdi
callq 0x31f4c
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x31ef2
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x31c0a
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x31f60
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x31f60
movq %rsp, %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2435a
movl %eax, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x17f92
leaq 0x28(%rsp), %rdi
callq 0x321ae
leaq 0x18(%rsp), %rdi
callq 0x321ae
leaq 0x10b333(%rip), %rax    # 0x12f618
addq $0x10, %rax
leaq 0x8(%rsp), %rdi
movq %rax, -0x8(%rdi)
callq 0xaaf9e
movq %rsp, %rdi
callq 0x321ae
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x24327
movq %rax, %rbx
jmp 0x24331
jmp 0x2431a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x321ae
leaq 0x18(%rsp), %rdi
callq 0x321ae
leaq 0x10b2e0(%rip), %rax    # 0x12f618
addq $0x10, %rax
leaq 0x8(%rsp), %rdi
movq %rax, -0x8(%rdi)
callq 0xaaf9e
movq %rsp, %rdi
callq 0x321ae
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::GetObjectOBBProperty(gaps::R3SurfelObject*, gaps::R3OrientedBox*, double*, int*)
R3SurfelObjectProperty *
GetObjectOBBProperty(R3SurfelObject *object,
  R3OrientedBox *obb, RNScalar *confidence, int *originator)
{
  // Constants for OBB property
  static const int property_type = R3_SURFEL_OBJECT_AMODAL_OBB_PROPERTY;
  static const int noperands = 20;

  // Get object property
  R3SurfelObjectProperty *property = object->FindObjectProperty(property_type);
  if (!property) return NULL;

  // Check property operands
  if (property->NOperands() != noperands) return NULL;

  // Extract obb
  if (obb) {
    R3Point center(property->Operand(0), property->Operand(1), property->Operand(2));
    R3Vector axis0(property->Operand(3), property->Operand(4), property->Operand(5));
    R3Vector axis1(property->Operand(6), property->Operand(7), property->Operand(8));
    // R3Vector axis2(property->Operand(9), property->Operand(10), property->Operand(11));
    RNScalar radius0 = property->Operand(12);
    RNScalar radius1 = property->Operand(13);
    RNScalar radius2 = property->Operand(14);
    obb->Reset(center, axis0, axis1, radius0, radius1, radius2);
  }

  // Extract confidence and originator
  if (confidence) *confidence = property->Operand(15);
  if (originator) *originator = (int) (property->Operand(16) + 0.5);

  // Return property
  return property;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl $0x2, %esi
callq 0x174be
testq %rax, %rax
je 0x24846
movq %rax, %rbx
cmpl $0x14, 0x28(%rax)
jne 0x24846
testq %r12, %r12
je 0x24811
movq 0x20(%rbx), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
movq %rsp, %rdi
callq 0x84d7e
movq 0x20(%rbx), %rax
movsd 0x18(%rax), %xmm0
movsd 0x20(%rax), %xmm1
movsd 0x28(%rax), %xmm2
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x85816
movq 0x20(%rbx), %rax
movsd 0x30(%rax), %xmm0
movsd 0x38(%rax), %xmm1
movsd 0x40(%rax), %xmm2
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x85816
movq 0x20(%rbx), %rax
movsd 0x60(%rax), %xmm0
movsd 0x68(%rax), %xmm1
movsd 0x70(%rax), %xmm2
movq (%r12), %rax
movq %r12, %rdi
movq %rsp, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq *0x268(%rax)
testq %r15, %r15
je 0x24824
movq 0x20(%rbx), %rax
movsd 0x78(%rax), %xmm0
movsd %xmm0, (%r15)
testq %r14, %r14
je 0x24848
movq 0x20(%rbx), %rax
movsd 0x80(%rax), %xmm0
addsd 0xb9903(%rip), %xmm0    # 0xde140
cvttsd2si %xmm0, %eax
movl %eax, (%r14)
jmp 0x24848
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::SetObjectOBBProperty(gaps::R3SurfelObject*, gaps::R3OrientedBox const&, double, int)
int
SetObjectOBBProperty(R3SurfelObject *object,
  const R3OrientedBox& obb, double confidence, int originator)
{
  // Constants for OBB property
  static const int property_type = R3_SURFEL_OBJECT_AMODAL_OBB_PROPERTY;
  static const int noperands = 20;

  // Get/create object property
  R3SurfelObjectProperty *property = object->FindObjectProperty(property_type);
  if (!property) property = CreateObjectProperty(object, property_type);
  if (!property) return 0;

  // Check number of operands
  if (property->NOperands() != noperands) return 0;

  // Fill property operands
  double operands[noperands];
  operands[0] = obb.Center().X();
  operands[1] = obb.Center().Y();
  operands[2] = obb.Center().Z();
  operands[3] = obb.Axis(0).X();
  operands[4] = obb.Axis(0).Y();
  operands[5] = obb.Axis(0).Z();
  operands[6] = obb.Axis(1).X();
  operands[7] = obb.Axis(1).Y();
  operands[8] = obb.Axis(1).Z();
  operands[9] = obb.Axis(2).X();
  operands[10] = obb.Axis(2).Y();
  operands[11] = obb.Axis(2).Z();
  operands[12] = obb.Radius(0);
  operands[13] = obb.Radius(1);
  operands[14] = obb.Radius(2);
  operands[15] = confidence;
  operands[16] = originator;
  operands[17] = 0;
  operands[18] = 0;
  operands[19] = 0;

  // Set property operands
  property->ResetOperands(operands, noperands);
  
  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movl %edx, %ebx
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movl $0x2, %esi
callq 0x174be
testq %rax, %rax
jne 0x24890
movq %r15, %rdi
movl $0x2, %esi
callq 0x246a3
xorl %ecx, %ecx
testq %rax, %rax
je 0x24936
cmpl $0x14, 0x28(%rax)
jne 0x24936
movups 0x8(%r14), %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movups 0x18(%r14), %xmm0
movaps %xmm0, 0x10(%rsi)
movups 0x28(%r14), %xmm0
movaps %xmm0, 0x20(%rsi)
movups 0x38(%r14), %xmm0
movaps %xmm0, 0x30(%rsi)
movups 0x48(%r14), %xmm0
movaps %xmm0, 0x40(%rsi)
movups 0x58(%r14), %xmm0
movaps %xmm0, 0x50(%rsi)
movups 0x68(%r14), %xmm0
movaps %xmm0, 0x60(%rsi)
movsd 0x78(%r14), %xmm0
movsd %xmm0, 0x70(%rsi)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x78(%rsi)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x80(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x88(%rsi)
movq $0x0, 0x98(%rsi)
movq %rax, %rdi
movl $0x14, %edx
callq 0x3f93a
movl $0x1, %ecx
movl %ecx, %eax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::CreateLabel(gaps::R3SurfelScene*, gaps::R3SurfelLabel*, char const*, int, int, gaps::RNRgb const&)
R3SurfelLabel *
CreateLabel(R3SurfelScene *scene, R3SurfelLabel *parent_label,
  const char *label_name, int identifier, int key, const RNRgb& color)
{
  // Create label
  R3SurfelLabel *label = new R3SurfelLabel(label_name);
  if (!label) {
    RNFail("Unable to allocate label\n");
    return NULL;
  }

  // Set label properties
  if (identifier >= 0) label->SetIdentifier(identifier);
  if (key >= 0) label->SetAssignmentKeystroke(key);
  if ((color.R() >= 0) && (color.G() >= 0) && (color.B() >=0)) label->SetColor(color);
         
  // Find parent label
  if (!parent_label) parent_label = scene->RootLabel();

  // Insert label into scene
  scene->InsertLabel(label, parent_label);

  // Return label
  return label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, (%rsp)
movq %rdi, %r15
movl $0x98, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x40528
testl %r13d, %r13d
js 0x2498c
movq (%rbx), %rax
movq %rbx, %rdi
movl %r13d, %esi
callq *0x20(%rax)
testl %ebp, %ebp
js 0x2499b
movq (%rbx), %rax
movq %rbx, %rdi
movl %ebp, %esi
callq *0x28(%rax)
movsd (%r12), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x249d5
movsd 0x8(%r12), %xmm1
ucomisd %xmm0, %xmm1
jb 0x249d5
movsd 0x10(%r12), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x249d5
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x30(%rax)
movq (%rsp), %rdx
testq %rdx, %rdx
jne 0x249e5
movq 0x20(%r15), %rax
movq (%rax), %rdx
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x30(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x98, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::RemoveParts(gaps::R3SurfelScene*, gaps::R3SurfelLabel*)
int
RemoveParts(R3SurfelScene *scene, R3SurfelLabel *label)
{
  // Copy array of parts
  RNArray<R3SurfelLabel *> parts;
  for (int i = 0; i < label->NParts(); i++) {
    R3SurfelLabel *part = label->Part(i);
    parts.Insert(part);
  }
  
  // Delete parts
  for (int i = 0; i < parts.NEntries(); i++) {
    R3SurfelLabel *part = parts.Kth(i);
    RemoveParts(scene, part);
    scene->RemoveLabel(part);
    delete part;
  }

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0xaaf34
cmpl $0x0, 0x2c(%r14)
jle 0x24a79
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rsi
movl 0x14(%rsp), %edx
movq %r15, %rdi
callq 0xaafca
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x24a59
cmpl $0x0, 0x14(%rsp)
jle 0x24abe
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24a2f
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x38(%rax)
testq %r14, %r14
je 0x24ab1
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
incq %r15
movslq 0x14(%rsp), %rax
cmpq %rax, %r15
jl 0x24a83
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x24adb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::CreateConnectedPointSet(gaps::R3SurfelPointGraph*, int)
R3SurfelPointSet *
CreateConnectedPointSet(R3SurfelPointGraph *graph, int seed_index)
{
  // Initialize result
  R3SurfelPointSet *connected_pointset = new R3SurfelPointSet();
  if (graph->NPoints() == 0) return connected_pointset;

  // Find seed point 
  R3SurfelPoint *seed_point = graph->Point(seed_index);

  // Initialize marks
  for (int i = 0; i < graph->NPoints(); i++) {
    R3SurfelPoint *point = graph->Point(i);
    point->SetMark(FALSE);
  }

  // Flood fill from seed point
  RNArray<R3SurfelPoint *> stack;
  stack.Insert(seed_point);
  seed_point->SetMark(TRUE);
  while (!stack.IsEmpty()) {
    R3SurfelPoint *point = stack.Tail();
    stack.RemoveTail();
    connected_pointset->InsertPoint(*point);
    int point_index = graph->PointIndex(point);
    for (int i = 0; i < graph->NNeighbors(point_index); i++) {
      R3SurfelPoint *neighbor = graph->Neighbor(point_index, i);
      if (neighbor->IsMarked()) continue;
      stack.InsertTail(neighbor);
      neighbor->SetMark(TRUE);
    }
  }

  // Return connected pointset
  return connected_pointset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl $0x60, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
callq 0x329b8
cmpl $0x0, 0x18(%r14)
je 0x25b9e
movslq %ebp, %r15
shlq $0x4, %r15
addq 0x10(%r14), %r15
cmpl $0x0, 0x18(%r14)
jle 0x25acd
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%r14), %rdi
addq %r12, %rdi
xorl %esi, %esi
callq 0x32902
incq %r13
movslq 0x18(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x25aaf
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xaaf34
movl 0xc(%r12), %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0xaafca
movq %r15, %rdi
movl $0x1, %esi
callq 0x32902
movl 0x14(%rsp), %eax
testl %eax, %eax
je 0x25b94
leaq 0x8(%rsp), %r15
movq 0x8(%rsp), %rcx
movslq %eax, %rsi
movq -0x8(%rcx,%rsi,8), %r12
decl %esi
movq %r15, %rdi
callq 0xab13e
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x68(%rax)
subq 0x10(%r14), %r12
shrq $0x4, %r12
movslq %r12d, %r13
movq 0x68(%r14), %rax
shlq $0x4, %r13
cmpl $0x0, 0xc(%rax,%r13)
jle 0x25b88
xorl %ebp, %ebp
movq (%rax,%r13), %rax
movq (%rax,%rbp,8), %r12
movq 0x8(%r12), %rax
cmpb $0x0, 0x2f(%rax)
js 0x25b77
movl 0x14(%rsp), %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xaafca
movq %r12, %rdi
movl $0x1, %esi
callq 0x32902
incq %rbp
movq 0x68(%r14), %rax
movslq 0xc(%rax,%r13), %rcx
cmpq %rcx, %rbp
jl 0x25b48
movl 0x14(%rsp), %eax
testl %eax, %eax
jne 0x25b08
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x60, %esi
movq %rbx, %rdi
callq 0x134f0
jmp 0x25bd3
jmp 0x25bc6
jmp 0x25bc6
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::CreateConnectedPointSet(gaps::R3SurfelPointGraph*, gaps::R3Point const&)
R3SurfelPointSet *
CreateConnectedPointSet(R3SurfelPointGraph *graph, const R3Point& center)
{
  // Find seed point (closest to center)
  int seed_index = -1;
  RNLength seed_distance = FLT_MAX;
  for (int i = 0; i < graph->NPoints(); i++) {
    R3SurfelPoint *point = graph->Point(i);
    RNLength distance = R3SquaredDistance(point->Position(), center);
    if (distance < seed_distance) {
      seed_distance = distance;
      seed_index = i;
    }
  }     

  // Check seed index
  if (seed_index < 0) return NULL;

  // Return connected component
  return CreateConnectedPointSet(graph, seed_index);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x18(%rdi)
jle 0x25c98
movq %rsi, %r14
movsd 0xb855b(%rip), %xmm0    # 0xde170
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x8, %r12d
xorl %r13d, %r13d
leaq 0x10(%rsp), %r15
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rax
movq -0x8(%rax,%r12), %rcx
movq (%rax,%r12), %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 0x84d7e
movq %r15, %rdi
movq %r14, %rsi
callq 0x50893
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
minsd %xmm1, %xmm0
cmoval %r13d, %ebp
incq %r13
movslq 0x18(%rbx), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x25c28
jmp 0x25c9d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x25cad
movq %rbx, %rdi
movl %ebp, %esi
callq 0x25a64
jmp 0x25caf
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::CreateNormals(gaps::R3SurfelPointSet*, int, double)
R3Vector *
CreateNormals(R3SurfelPointSet *pointset, 
  int max_neighbors, RNLength max_neighbor_distance)
{
#if 0
  // Sorry
  RNAbort("CreateNormals has been deprecated.  Use UpdateNormals instead.");
  return NULL;
#else
  // Create graph
  R3SurfelPointGraph *graph = new R3SurfelPointGraph(*pointset, max_neighbors, max_neighbor_distance);
  if (!graph) {
    RNFail("Unable to create graph\n");
    return NULL;
  }

  // Compute normals
  R3Vector *normals = CreateNormals(graph);

  // Delete graph
  delete graph;

  // Return normals
  return normals;
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r14
movl $0x80, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
movsd 0x8(%rsp), %xmm0
callq 0x36764
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2713c
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movl $0x80, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::CreateObjectSet(gaps::R3SurfelScene*, gaps::R3SurfelConstraint const*)
R3SurfelObjectSet *
CreateObjectSet(R3SurfelScene *scene, 
  const R3SurfelConstraint *constraint)
{
  // Create object set
  R3SurfelObjectSet *objectset = new R3SurfelObjectSet();
  if (!objectset) {
    RNFail("Unable to allocate object set\n");
    return NULL;
  }

  // Construct object set
  for (int i = 0; i < scene->NObjects(); i++) {
    R3SurfelObject *object = scene->Object(i);
    if (constraint && !constraint->Check(object)) continue;
    objectset->InsertObject(object);
  }


  // Return object set
  return objectset;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x60, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
callq 0x3eeac
cmpl $0x0, 0x1c(%r15)
jle 0x2790d
xorl %r13d, %r13d
movq 0x10(%r15), %rax
movq (%rax,%r13,8), %r12
testq %r14, %r14
je 0x278f5
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x10(%rax)
testl %eax, %eax
je 0x27901
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x10(%rax)
incq %r13
movslq 0x1c(%r15), %rax
cmpq %rax, %r13
jl 0x278d8
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x60, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::FitPlane(gaps::R3SurfelPointSet*)
R3Plane
FitPlane(R3SurfelPointSet *pointset)
{
  // Allocate points
  int max_points = 1024;
  int npoints = pointset->NPoints();
  if (npoints > max_points) npoints = max_points;
  if (npoints == 0) return R3null_plane;
  R3Point *points = new R3Point [npoints];
  int step = pointset->NPoints() / npoints;
  if (step == 0) step = 1;
  for (int i = 0; i < npoints; i++) {
    const R3SurfelPoint *point = pointset->Point(i*step);
    points[i] = point->Position();
  }

  // Solve for plane
  R3Point centroid = R3Centroid(npoints, points);
  R3Triad triad = R3PrincipleAxes(centroid, npoints, points);
  R3Vector normal = triad[2];
  if (normal[2] < 0) normal.Flip();
  R3Plane plane(centroid, normal);

  // Delete points
  delete [] points;

  // Return plane
  return plane;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbp
movl 0x10(%rsi), %ebx
movl $0x400, %eax            # imm = 0x400
cmpl %eax, %ebx
cmovll %ebx, %eax
testl %ebx, %ebx
je 0x27ab7
movq %rsi, 0x10(%rsp)
movl %eax, 0xc(%rsp)
movslq %eax, %r13
movl $0x18, %ecx
movq %r13, %rax
mulq %rcx
movq $-0x1, %r12
cmovnoq %rax, %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r14
shlq $0x3, %r13
leaq (,%r13,2), %r15
addq %r13, %r15
xorl %r13d, %r13d
leaq (%r14,%r13), %rdi
callq 0x84d7c
addq $0x18, %r13
cmpq %r13, %r15
jne 0x2799a
movq %rbp, 0x18(%rsp)
testl %ebx, %ebx
movq 0x10(%rsp), %rsi
jle 0x27a38
movl 0x10(%rsi), %eax
cltd
movl 0xc(%rsp), %ecx
idivl %ecx
cmpl $0x1, %eax
adcl $0x0, %eax
movslq %eax, %rbx
movl %ecx, %ebp
shlq $0x4, %rbx
movl $0x8, %r15d
leaq 0x50(%rsp), %r12
movq %r14, %r13
movq 0x8(%rsi), %rax
movq -0x8(%rax,%r15), %rcx
movq (%rax,%r15), %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 %r12, %rdi
callq 0x84d7e
movq %r13, %rdi
movq %r12, %rsi
callq 0x850ec
movq 0x10(%rsp), %rsi
addq %rbx, %r15
addq $0x18, %r13
decq %rbp
jne 0x279e1
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movl 0xc(%rsp), %ebx
movl %ebx, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x5501d
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
movl %ebx, %edx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x550a7
leaq 0x80(%rsp), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x85826
xorpd %xmm0, %xmm0
ucomisd 0x10(%r15), %xmm0
jbe 0x27a93
leaq 0x20(%rsp), %rdi
callq 0x85ba4
leaq 0x38(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x838fe
movq %r14, %rdi
callq 0x13680
movq %rbx, %rax
jmp 0x27ac9
leaq 0x50e7e2(%rip), %rsi    # 0x5362a0
movq %rbp, %rdi
callq 0x83872
movq %rbp, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x139b0
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::EstimateSupportPlane(gaps::R3SurfelScene*, gaps::R3SurfelNode*, gaps::R3SurfelConstraint const*, double, double*)
R3Plane 
EstimateSupportPlane(R3SurfelScene *scene, 
  R3SurfelNode *source_node, const R3SurfelConstraint *constraint,
  RNLength accuracy, RNScalar *npoints)
{
  // Get points 
  R3SurfelPointSet *pointset = CreatePointSet(scene, source_node, constraint);
  if (!pointset) { 
    if (npoints) *npoints = 0;
    return R3null_plane; 
  }

  // Estimate support plane 
  R3Plane plane = EstimateSupportPlane(pointset, accuracy, npoints);

  // Delete points
  delete pointset;

  // Return plane
  return plane;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %r14
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x22183
testq %rax, %rax
je 0x27b3b
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movsd 0x8(%rsp), %xmm0
movq %r14, %rdx
callq 0x22526
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x27b56
testq %r14, %r14
je 0x27b47
movq $0x0, (%r14)
leaq 0x50e752(%rip), %rsi    # 0x5362a0
movq %rbx, %rdi
callq 0x83872
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::EstimateSupportZ(gaps::R3SurfelScene*, gaps::R3Point const&, double, double, double*)
RNCoord
EstimateSupportZ(R3SurfelScene *scene, 
  const R3Point& center, RNLength radius,
  RNLength accuracy, RNScalar *npoints)
{
 // Get points 
  R3SurfelCylinderConstraint cylinder_constraint(center, radius);
  R3SurfelPointSet *pointset = CreatePointSet(scene, NULL, &cylinder_constraint);
  if (!pointset) { 
    if (npoints) *npoints = 0;
    return -1; 
  }

  // Estimate support Z 
  R3Plane plane = EstimateSupportPlane(pointset, accuracy, npoints);
  RNScalar z = -(center[0]*plane[0] + center[1]*plane[1] + plane[3]) / plane[2];

  // Delete points
  delete pointset;

  // Return support z
  return z;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movsd %xmm1, (%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x30(%rsp), %r12
movsd 0xb656e(%rip), %xmm1    # 0xde178
movsd 0xb655e(%rip), %xmm2    # 0xde170
movq %r12, %rdi
callq 0x307da
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x22183
movq %rax, %r15
testq %rax, %rax
je 0x27c81
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
movq %r14, %rdx
callq 0x22526
movsd 0x8(%rbx), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd (%rbx), %xmm1
mulsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x28(%rsp), %xmm1
xorpd 0xb6735(%rip), %xmm1    # 0xde3a0
divsd 0x20(%rsp), %xmm1
movapd %xmm1, (%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x27c9a
movsd 0xb64df(%rip), %xmm0    # 0xde168
testq %r14, %r14
movapd %xmm0, (%rsp)
je 0x27c9a
movq $0x0, (%r14)
leaq 0x30(%rsp), %rdi
callq 0x321ae
movaps (%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x27cb6
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x321ae
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::FitSupportPlane(gaps::R3SurfelPointSet*, double, double*)
R3Plane
FitSupportPlane(R3SurfelPointSet *pointset,
  RNLength accuracy, RNScalar *npoints)
{
  // Estimate support plane
  R3Plane plane = EstimateSupportPlane(pointset, accuracy, npoints);

  // Create a set of points near plane
  R3SurfelPlaneConstraint constraint(plane, FALSE, TRUE, FALSE, 5 * accuracy);
  R3SurfelPointSet *plane_pointset = CreatePointSet(pointset, &constraint);

  // Fit plane to pointset
  if (plane_pointset->NPoints() > 3) {
    plane = FitPlane(plane_pointset);
    if (npoints) *npoints = plane_pointset->NPoints();
  }

  // Delete point set
  delete plane_pointset;

  // Return plane
  return plane;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movsd %xmm0, (%rsp)
movq %rsi, %r15
movq %rdi, %rbx
callq 0x22526
movsd (%rsp), %xmm0
mulsd 0xb6e0a(%rip), %xmm0    # 0xdeb00
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x30a4e
movq %r15, %rdi
movq %r12, %rsi
callq 0x22118
movq %rax, %r15
cmpl $0x4, 0x10(%rax)
jl 0x27d5c
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x27932
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x85fc2
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x18(%rbx)
testq %r14, %r14
je 0x27d5c
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%r15), %xmm0
movsd %xmm0, (%r14)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
leaq 0x28(%rsp), %rdi
callq 0x321ae
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x27d80
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x321ae
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::EstimateOrientedBBox(gaps::R3SurfelObject*)
R3OrientedBox 
EstimateOrientedBBox(R3SurfelObject *object)
{
  // Check object
  if (!object) return R3null_oriented_box;
  
  // Get pointset
  R3SurfelPointSet *pointset = object->PointSet(TRUE);
  if (!pointset) return R3null_oriented_box;

  // Compute oriented box
  R3OrientedBox obb = EstimateOrientedBBox(pointset);

  // Delete pointset
  delete pointset;
           
  // Return oriented box
  return obb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x283d4
xorps %xmm0, %xmm0
movq %rsi, %rdi
movl $0x1, %esi
callq 0x174e6
testq %rax, %rax
je 0x283d4
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x28151
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0x283e3
leaq 0x10d3b5(%rip), %rsi    # 0x135790
movq %rbx, %rdi
callq 0x6cb2e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::ClosestImage(gaps::R3SurfelScene*, gaps::R3Point const&)
R3SurfelImage *
ClosestImage(R3SurfelScene *scene, const R3Point& query_position)
{
  // Check scene
  if (!scene) return NULL;
  
  // Search for closest image
  RNScalar best_dd = FLT_MAX;
  R3SurfelImage *best_image = NULL;
  for (int i = 0; i < scene->NImages(); i++) {
    R3SurfelImage *image = scene->Image(i);
    RNScalar dd = R3SquaredDistance(image->Viewpoint(), query_position);
    if (dd < best_dd) {
      best_image = image;
      best_dd = dd;
    }
  }

  // Return closest image
  return best_image;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x2ac15
movq %rdi, %r14
cmpl $0x0, 0x9c(%rdi)
jle 0x2ac15
movq %rsi, %rbx
movsd 0xb35a1(%rip), %xmm0    # 0xde170
xorl %r12d, %r12d
xorl %r15d, %r15d
movsd %xmm0, 0x8(%rsp)
movq 0x90(%r14), %rax
movq (%rax,%r12,8), %r13
leaq 0x30(%r13), %rdi
movq %rbx, %rsi
callq 0x50893
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %r13, %r15
minsd %xmm1, %xmm0
incq %r12
movslq 0x9c(%r14), %rax
cmpq %rax, %r12
jl 0x2abd5
jmp 0x2ac18
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3Surfel.cpp
// Function: gaps::R3Surfel::R3Surfel(float, float, float, float, float, float, float, unsigned char, unsigned char, unsigned char, unsigned char)
R3Surfel::
R3Surfel(float x, float y, float z, float nx, float ny, float nz,
  float radius, unsigned char r, unsigned char g, unsigned char b, 
  unsigned char flags)
  : timestamp(0),
    identifier(0),
    attribute(0),
    depth(0),
    elevation(0),
    flags(flags)
{
  // Set everything
  SetPosition(x, y, z);
  SetNormal(nx, ny, nz);
  SetTangent(0, 0, 0);
  SetRadius(radius);
  SetColor(r, g, b);
}

// Assembly:
xorl %eax, %eax
movl %eax, 0xc(%rdi)
movl %eax, 0x28(%rdi)
movq $0x0, 0x20(%rdi)
movb %r8b, 0x2f(%rdi)
movss %xmm0, (%rdi)
movss %xmm1, 0x4(%rdi)
movss %xmm2, 0x8(%rdi)
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm3
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
cvtps2pd %xmm3, %xmm1
mulpd 0xb37c4(%rip), %xmm1    # 0xded90
addpd 0xb37cc(%rip), %xmm1    # 0xdeda0
cvttpd2dq %xmm1, %xmm1
pshuflw $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3,4,5,6,7]
xorps %xmm2, %xmm2
cvtss2sd %xmm5, %xmm2
mulsd 0xb37e4(%rip), %xmm2    # 0xdedd0
addsd 0xb2b4c(%rip), %xmm2    # 0xde140
movd %xmm1, 0x10(%rdi)
cvttsd2si %xmm2, %eax
movw %ax, 0x14(%rdi)
jne 0x2b613
jp 0x2b613
ucomiss %xmm0, %xmm4
jne 0x2b613
jp 0x2b613
ucomiss %xmm0, %xmm5
jne 0x2b613
jnp 0x2b61b
orb $0x40, %r8b
movb %r8b, 0x2f(%rdi)
movl $0x0, 0x16(%rdi)
xorps %xmm0, %xmm0
cvtss2sd %xmm6, %xmm0
mulsd 0xb37a7(%rip), %xmm0    # 0xdedd8
addsd 0xb2b07(%rip), %xmm0    # 0xde140
movw $0x0, 0x1a(%rdi)
cvtsd2ss %xmm0, %xmm0
movss 0xb379d(%rip), %xmm1    # 0xdede8
minss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movw %ax, 0x1c(%rdi)
movw %ax, 0x1e(%rdi)
movb %sil, 0x2c(%rdi)
movb %dl, 0x2d(%rdi)
movb %cl, 0x2e(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3Surfel.cpp
// Function: gaps::R3Surfel::R3Surfel(float, float, float, float, float, float, float, float, float, float, float, unsigned char, unsigned char, unsigned char, float, unsigned int, unsigned char)
R3Surfel::
R3Surfel(float x, float y, float z,
  float nx, float ny, float nz,
  float tx, float ty, float tz,
  float radius0, float radius1,
  unsigned char r, unsigned char g, unsigned char b, 
  float timestamp, unsigned int identifier,
  unsigned char flags)
  : timestamp(timestamp),
    identifier(identifier),
    attribute(0),
    depth(0),
    elevation(0),
    flags(flags)
{
  // Set everything
  SetPosition(x, y, z);
  SetNormal(nx, ny, nz);
  SetTangent(tx, ty, tz);
  SetRadius(0, radius0);
  SetRadius(1, radius1);
  SetColor(r, g, b);
}

// Assembly:
movss 0x8(%rsp), %xmm8
movss 0x20(%rsp), %xmm9
movss %xmm9, 0xc(%rdi)
movl %r8d, 0x20(%rdi)
movq $0x0, 0x24(%rdi)
movb %r9b, 0x2f(%rdi)
movss %xmm0, (%rdi)
movss %xmm1, 0x4(%rdi)
movss %xmm2, 0x8(%rdi)
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm3
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
cvtps2pd %xmm3, %xmm1
mulpd 0xb36e4(%rip), %xmm1    # 0xded90
addpd 0xb36ec(%rip), %xmm1    # 0xdeda0
cvttpd2dq %xmm1, %xmm1
pshuflw $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3,4,5,6,7]
xorps %xmm2, %xmm2
cvtss2sd %xmm5, %xmm2
mulsd 0xb3704(%rip), %xmm2    # 0xdedd0
addsd 0xb2a6c(%rip), %xmm2    # 0xde140
movd %xmm1, 0x10(%rdi)
cvttsd2si %xmm2, %eax
movw %ax, 0x14(%rdi)
jne 0x2b6f3
jp 0x2b6f3
ucomiss %xmm0, %xmm4
jne 0x2b6f3
jp 0x2b6f3
ucomiss %xmm0, %xmm5
jne 0x2b6f3
jnp 0x2b6fb
orb $0x40, %r9b
movb %r9b, 0x2f(%rdi)
movss 0x18(%rsp), %xmm0
movaps %xmm6, %xmm1
unpcklps %xmm7, %xmm1            # xmm1 = xmm1[0],xmm7[0],xmm1[1],xmm7[1]
cvtps2pd %xmm1, %xmm2
mulpd 0xb367e(%rip), %xmm2    # 0xded90
addpd 0xb3686(%rip), %xmm2    # 0xdeda0
movss 0x10(%rsp), %xmm1
cvttpd2dq %xmm2, %xmm2
pshuflw $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3,4,5,6,7]
movd %xmm2, 0x16(%rdi)
xorps %xmm2, %xmm2
cvtss2sd %xmm8, %xmm2
mulsd 0xb3692(%rip), %xmm2    # 0xdedd0
addsd 0xb29fa(%rip), %xmm2    # 0xde140
cvttsd2si %xmm2, %eax
movw %ax, 0x1a(%rdi)
xorpd %xmm2, %xmm2
ucomiss %xmm2, %xmm6
jne 0x2b768
jp 0x2b768
ucomiss %xmm2, %xmm7
jne 0x2b768
jp 0x2b768
ucomiss %xmm2, %xmm8
jne 0x2b768
jnp 0x2b76c
orb $0x1, 0x2f(%rdi)
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtps2pd %xmm1, %xmm0
mulpd 0xb3636(%rip), %xmm0    # 0xdedb0
addpd 0xb361e(%rip), %xmm0    # 0xdeda0
cvtpd2ps %xmm0, %xmm0
movaps 0xb3633(%rip), %xmm1    # 0xdedc0
minps %xmm0, %xmm1
cvttps2dq %xmm1, %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x1c(%rdi)
movb %sil, 0x2c(%rdi)
movb %dl, 0x2d(%rdi)
movb %cl, 0x2e(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::R3SurfelBlock(gaps::R3SurfelBlock const&)
R3SurfelBlock::
R3SurfelBlock(const R3SurfelBlock& block)
  : surfels(NULL),
    nsurfels(block.nsurfels),
    position_origin(block.position_origin),
    bbox(block.bbox),
    timestamp_origin(block.timestamp_origin),
    timestamp_range(block.timestamp_range),
    min_identifier(block.min_identifier),
    max_identifier(block.max_identifier),
    resolution(block.resolution),
    flags(block.flags & R3_SURFEL_BLOCK_PROPERTY_FLAGS),
    data(NULL),
    database(NULL),
    database_index(-1),
    file_surfels_offset(0),
    file_surfels_count(0),
    file_read_count(0),
    node(NULL),
    opengl_id(0)
{
  // Copy surfels
  if (nsurfels > 0) {
    surfels = new R3Surfel [ nsurfels ];
    for (int i = 0; i < nsurfels; i++) {
      surfels[i] = block.surfels[i];
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, (%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
addq $0x10, %rsi
callq 0x84d8e
leaq 0x28(%r14), %r15
leaq 0x28(%rbx), %rsi
movq %r15, %rdi
callq 0x6df88
movsd 0x60(%rbx), %xmm0
movsd %xmm0, 0x60(%r14)
leaq 0x68(%r14), %rdi
leaq 0x68(%rbx), %rsi
callq 0xacea8
movq 0x78(%rbx), %rax
movq %rax, 0x78(%r14)
movsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x80(%r14)
movzbl 0x88(%rbx), %eax
movq %rax, 0x88(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%r14)
movl $0xffffffff, 0xa0(%r14) # imm = 0xFFFFFFFF
movups %xmm0, 0xa8(%r14)
movups %xmm0, 0xb4(%r14)
movslq 0x8(%r14), %rax
testq %rax, %rax
jle 0x2bc44
shlq $0x4, %rax
leaq (%rax,%rax,2), %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r13
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x2b548
addq $0x30, %rbp
cmpq %rbp, %r12
jne 0x2bbf0
movq %r13, (%r14)
cmpl $0x0, 0x8(%r14)
jle 0x2bc44
xorl %eax, %eax
xorl %ecx, %ecx
movq (%rbx), %rdx
movq (%r14), %rsi
movups (%rdx,%rax), %xmm0
movups 0x10(%rdx,%rax), %xmm1
movups 0x20(%rdx,%rax), %xmm2
movups %xmm2, 0x20(%rsi,%rax)
movups %xmm1, 0x10(%rsi,%rax)
movups %xmm0, (%rsi,%rax)
incq %rcx
movslq 0x8(%r14), %rdx
addq $0x30, %rax
cmpq %rdx, %rcx
jl 0x2bc12
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2bc66
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x139b0
movq %r15, %rdi
callq 0x6ede0
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::R3SurfelBlock(gaps::R3Surfel const*, int, gaps::R3Point const&, double)
R3SurfelBlock::
R3SurfelBlock(const R3Surfel *surfels, int nsurfels,
  const R3Point& position_origin, RNScalar timestamp_origin)
  : surfels(NULL),
    nsurfels(nsurfels),
    position_origin(position_origin),
    bbox(FLT_MAX,FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX,-FLT_MAX),
    timestamp_origin(timestamp_origin),
    timestamp_range(FLT_MAX,-FLT_MAX),
    min_identifier(UINT_MAX),
    max_identifier(0),
    resolution(0),
    flags(0),
    data(NULL),
    database(NULL),
    database_index(-1),
    file_surfels_offset(0),
    file_surfels_count(0),
    file_read_count(0),
    node(NULL),
    opengl_id(0)
{
  // Copy surfels
  if (nsurfels > 0) {
    this->surfels = new R3Surfel [ nsurfels ];
    for (int i = 0; i < nsurfels; i++) {
      this->surfels[i] = surfels[i];
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, (%rdi)
movl %edx, 0x8(%rdi)
addq $0x10, %rdi
movq %rcx, %rsi
callq 0x84d8e
leaq 0x28(%r14), %r15
movsd 0xb1aac(%rip), %xmm0    # 0xde170
movsd 0xb1aac(%rip), %xmm3    # 0xde178
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
callq 0x6e028
movsd (%rsp), %xmm0
movsd %xmm0, 0x60(%r14)
leaq 0x68(%r14), %rdi
movsd 0xb1a79(%rip), %xmm0    # 0xde170
movsd 0xb1a79(%rip), %xmm1    # 0xde178
callq 0xace9e
movl $0xffffffff, 0x78(%r14) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x7c(%r14)
movups %xmm0, 0x8c(%r14)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x9c(%r14)
movups %xmm0, 0xa8(%r14)
movups %xmm0, 0xb4(%r14)
testl %ebp, %ebp
jle 0x2c7ae
movl %ebp, %ebp
movq %rbp, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r13
movq %r15, (%rsp)
xorl %r15d, %r15d
leaq (%r15,%r13), %rdi
callq 0x2b548
addq $0x30, %r15
cmpq %r15, %r12
jne 0x2c760
movq %r13, (%r14)
shlq $0x4, %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
xorl %ecx, %ecx
movq (%r14), %rdx
movups (%rbx,%rcx), %xmm0
movups 0x10(%rbx,%rcx), %xmm1
movups 0x20(%rbx,%rcx), %xmm2
movups %xmm2, 0x20(%rdx,%rcx)
movups %xmm1, 0x10(%rdx,%rcx)
movups %xmm0, (%rdx,%rcx)
addq $0x30, %rcx
cmpq %rcx, %rax
jne 0x2c786
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, (%rsp)
movq %rax, %rbx
jmp 0x2c7d4
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x139b0
movq (%rsp), %rdi
callq 0x6ede0
movq %rbx, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::R3SurfelBlock(gaps::RNArray<gaps::R3Surfel const*> const&, gaps::R3Point const&, double)
R3SurfelBlock::
R3SurfelBlock(const RNArray<const R3Surfel *>& array,
  const R3Point& position_origin, RNScalar timestamp_origin)
  : surfels(NULL),
    nsurfels(array.NEntries()),
    position_origin(position_origin),
    bbox(FLT_MAX,FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX,-FLT_MAX),
    timestamp_origin(timestamp_origin),
    timestamp_range(FLT_MAX,-FLT_MAX),
    min_identifier(UINT_MAX),
    max_identifier(0),
    resolution(0),
    flags(0),
    data(NULL),
    database(NULL),
    database_index(-1),
    file_surfels_offset(0),
    file_surfels_count(0),
    file_read_count(0),
    node(NULL),
    opengl_id(0)
{
  // Copy surfels
  if (nsurfels > 0) {
    surfels = new R3Surfel [ nsurfels ];
    for (int i = 0; i < nsurfels; i++) {
      this->surfels[i] = *(array[i]);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, (%rdi)
movl 0xc(%rsi), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
movq %rdx, %rsi
callq 0x84d8e
leaq 0x28(%r14), %r15
movsd 0xb194f(%rip), %xmm0    # 0xde170
movsd 0xb194f(%rip), %xmm3    # 0xde178
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
callq 0x6e028
movsd (%rsp), %xmm0
movsd %xmm0, 0x60(%r14)
leaq 0x68(%r14), %rdi
movsd 0xb191c(%rip), %xmm0    # 0xde170
movsd 0xb191c(%rip), %xmm1    # 0xde178
callq 0xace9e
movl $0xffffffff, 0x78(%r14) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x7c(%r14)
movups %xmm0, 0x8c(%r14)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x9c(%r14)
movups %xmm0, 0xa8(%r14)
movups %xmm0, 0xb4(%r14)
movslq 0x8(%r14), %rax
testq %rax, %rax
jle 0x2c90d
shlq $0x4, %rax
leaq (%rax,%rax,2), %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r13
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x2b548
addq $0x30, %rbp
cmpq %rbp, %r12
jne 0x2c8b8
movq %r13, (%r14)
cmpl $0x0, 0x8(%r14)
jle 0x2c90d
xorl %eax, %eax
xorl %ecx, %ecx
movq (%rbx), %rdx
movq (%rdx,%rcx,8), %rdx
movq (%r14), %rsi
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movups %xmm2, 0x20(%rsi,%rax)
movups %xmm1, 0x10(%rsi,%rax)
movups %xmm0, (%rsi,%rax)
incq %rcx
movslq 0x8(%r14), %rdx
addq $0x30, %rax
cmpq %rdx, %rcx
jl 0x2c8da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2c92f
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x139b0
movq %r15, %rdi
callq 0x6ede0
movq %rbx, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::~R3SurfelBlock()
R3SurfelBlock::
~R3SurfelBlock(void)
{
  // Safety check
  assert(file_read_count == 0);

  // Remove from node
  if (node) node->RemoveBlock(this);

  // Remove from database
  if (database) database->RemoveBlock(this);

  // Delete surfels
  if (surfels) delete [] surfels;

#if (R3_SURFEL_BLOCK_DRAW_METHOD == R3_SURFEL_BLOCK_DRAW_WITH_VBO)
  // Delete opengl VBO buffer
  if (opengl_id > 0) glDeleteBuffers(1, &opengl_id);
#elif (R3_SURFEL_BLOCK_DRAW_METHOD == R3_SURFEL_BLOCK_DRAW_WITH_DISPLAY_LIST)
  // Delete opengl display lists
  if (opengl_id > 0) glDeleteLists(opengl_id, 2);
#endif
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xb8(%rdi), %rdi
testq %rdi, %rdi
je 0x2ce47
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x30(%rax)
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x2ce5c
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x18(%rax)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2ce69
callq 0x13680
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x6ede0
movq %rax, %rdi
callq 0x1848f
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::operator=(gaps::R3SurfelBlock const&)
R3SurfelBlock& R3SurfelBlock::
operator=(const R3SurfelBlock& block)
{
  // Delete old surfels
  if (this->surfels) delete this->surfels;
  this->surfels = NULL;

  // Copy properties
  this->nsurfels = block.nsurfels;
  this->position_origin = block.position_origin;
  this->bbox = block.bbox;
  this->timestamp_origin = block.timestamp_origin;
  this->timestamp_range = block.timestamp_range;
  this->min_identifier = block.min_identifier;
  this->max_identifier = block.max_identifier;
  this->resolution = block.resolution;
  this->flags = block.flags & R3_SURFEL_BLOCK_PROPERTY_FLAGS;
  this->data = NULL;
  this->database = NULL;
  this->database_index = -1;
  this->file_surfels_offset = 0;
  this->file_surfels_count = 0;
  this->file_read_count = 0;
  this->node = NULL;
  this->opengl_id = 0;

  // Copy surfels
  if (this->nsurfels > 0) {
    this->surfels = new R3Surfel [ this->nsurfels ];
    for (int i = 0; i < this->nsurfels; i++) {
      this->surfels[i] = block.surfels[i];
    }
  }

  // Return this
  return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2ce9f
movl $0x30, %esi
callq 0x134f0
movq $0x0, (%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
leaq 0x10(%r14), %rsi
leaq 0x10(%rbx), %rdi
callq 0x850ec
leaq 0x30(%rbx), %rdi
leaq 0x30(%r14), %rsi
callq 0x850ec
leaq 0x48(%rbx), %rdi
leaq 0x48(%r14), %rsi
callq 0x850ec
movsd 0x60(%r14), %xmm0
movsd %xmm0, 0x60(%rbx)
movups 0x68(%r14), %xmm0
movups %xmm0, 0x68(%rbx)
movq 0x78(%r14), %rax
movq %rax, 0x78(%rbx)
movsd 0x80(%r14), %xmm0
movsd %xmm0, 0x80(%rbx)
movzbl 0x88(%r14), %eax
movq %rax, 0x88(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%rbx)
movl $0xffffffff, 0xa0(%rbx) # imm = 0xFFFFFFFF
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xb4(%rbx)
movslq 0x8(%rbx), %rax
testq %rax, %rax
jle 0x2cfa2
shlq $0x4, %rax
leaq (%rax,%rax,2), %r15
movq %r15, %rdi
callq 0x13030
movq %rax, %r12
xorl %r13d, %r13d
leaq (%r12,%r13), %rdi
callq 0x2b548
addq $0x30, %r13
cmpq %r13, %r15
jne 0x2cf51
movq %r12, (%rbx)
cmpl $0x0, 0x8(%rbx)
jle 0x2cfa2
xorl %eax, %eax
xorl %ecx, %ecx
movq (%r14), %rdx
movq (%rbx), %rsi
movups (%rdx,%rax), %xmm0
movups 0x10(%rdx,%rax), %xmm1
movups 0x20(%rdx,%rax), %xmm2
movups %xmm2, 0x20(%rsi,%rax)
movups %xmm1, 0x10(%rsi,%rax)
movups %xmm0, (%rsi,%rax)
incq %rcx
movslq 0x8(%rbx), %rdx
addq $0x30, %rax
cmpq %rdx, %rcx
jl 0x2cf70
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r12, %rdi
movq %r15, %rsi
callq 0x139b0
movq %rbx, %rdi
callq 0x138b0
nop