LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x2
popq %rsi
callq 0x16b78
testq %rax, %rax
jne 0x22fd6
pushq $0x2
popq %rsi
movq %r15, %rdi
callq 0x22dec
testq %rax, %rax
je 0x23069
cmpl $0x14, 0x28(%rax)
jne 0x23069
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)
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x80(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x88(%rsi)
andq $0x0, 0x98(%rsi)
pushq $0x14
popq %rdx
movq %rax, %rdi
callq 0x3a74e
pushq $0x1
popq %rax
jmp 0x2306b
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x134f0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3b2a4
testl %r13d, %r13d
js 0x230bf
movq (%rbx), %rax
movq %rbx, %rdi
movl %r13d, %esi
callq *0x20(%rax)
testl %ebp, %ebp
js 0x230ce
movq (%rbx), %rax
movq %rbx, %rdi
movl %ebp, %esi
callq *0x28(%rax)
movsd (%r12), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x23108
movsd 0x8(%r12), %xmm1
ucomisd %xmm0, %xmm1
jb 0x23108
movsd 0x10(%r12), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x23108
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x30(%rax)
movq (%rsp), %rdx
testq %rdx, %rdx
jne 0x23118
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 0x13500
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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), %r15
movq %r15, %rdi
callq 0x9a7ae
xorl %r12d, %r12d
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jge 0x2319f
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x1784c
incq %r12
jmp 0x23181
xorl %r15d, %r15d
movslq 0x14(%rsp), %rax
cmpq %rax, %r15
jge 0x231df
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23160
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x38(%rax)
testq %r14, %r14
je 0x231da
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
incq %r15
jmp 0x231a2
leaq 0x8(%rsp), %rdi
callq 0x9a81c
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x231fa
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x9a81c
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::EstimateSurfelColors(gaps::R3SurfelScene*)
int
EstimateSurfelColors(R3SurfelScene *scene)
{
  // Get surfel tree
  R3SurfelTree *tree = scene->Tree();
  if (!tree) {
    RNFail("Scene has no surfel tree\n");
    return 0;
  }    

  // Get surfel database
  R3SurfelDatabase *database = tree->Database();
  if (!database) {
    RNFail("Scene has no surfel database\n");
    return 0;
  }

  // Estimate color very every surfel
  for (int i = 0; i < tree->NNodes(); i++) {
    R3SurfelNode *node = tree->Node(i);
    for (int j = 0; j < node->NBlocks(); j++) {
      R3SurfelBlock *block = node->Block(j);

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

      // Estimate color
      for (int k = 0; k < block->NSurfels(); k++) {
        R3Point position = block->SurfelPosition(k);
        R3Vector normal = block->SurfelNormal(k);
        RNScalar timestamp = block->SurfelTimestamp(k);
        RNRgb color = EstimateColor(scene, position, normal, timestamp);
        block->SetSurfelColor(k, color);
      }

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

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x28(%rsp)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x23e9f
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x23ea8
xorl %edx, %edx
leaq 0x60(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x30(%rsp), %rbp
movq %rax, (%rsp)
movq %r14, 0x10(%rsp)
movq %rax, %rcx
movslq 0x24(%rax), %rax
cmpq %rax, %rdx
jge 0x23e9a
movq 0x18(%rcx), %rax
movq %rdx, 0x8(%rsp)
movq (%rax,%rdx,8), %r15
xorl %ecx, %ecx
movq %r15, 0x18(%rsp)
movslq 0x4c(%r15), %rax
cmpq %rax, %rcx
jge 0x23e89
movq 0x40(%r15), %rax
movq %rcx, 0x20(%rsp)
movq (%rax,%rcx,8), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20a64
testl %eax, %eax
je 0x23e7c
pushq $0xc
popq %r14
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x23e67
movq %r12, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x20b18
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x20b6c
movq (%rbx), %rax
cvtss2sd (%rax,%r14), %xmm0
addsd 0x60(%rbx), %xmm0
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x23a00
movq %rbx, %rdi
movl %r15d, %esi
movq %rbp, %rdx
callq 0x2aefe
incq %r15
addq $0x30, %r14
jmp 0x23e0a
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20aa0
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0x23dda
movq 0x8(%rsp), %rdx
incq %rdx
movq (%rsp), %rax
jmp 0x23db6
pushq $0x1
popq %rbx
jmp 0x23eb8
leaq 0xa4c92(%rip), %rdi     # 0xc8b38
jmp 0x23eaf
leaq 0xa4da6(%rip), %rdi     # 0xc8c55
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x9ce26
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/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
pushq $0x60
popq %rdi
callq 0x134f0
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x2f52c
movl 0x18(%r14), %eax
testl %eax, %eax
je 0x23fdc
movq 0x10(%r14), %r15
movslq %ebp, %rbx
xorl %r12d, %r12d
xorl %r13d, %r13d
cltq
cmpq %rax, %r13
jge 0x23f2b
movq 0x10(%r14), %rdi
addq %r12, %rdi
xorl %esi, %esi
callq 0x2f4bc
incq %r13
movl 0x18(%r14), %eax
addq $0x10, %r12
jmp 0x23f09
shlq $0x4, %rbx
addq %rbx, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x9a7ae
movq %r12, %rdi
movq %r15, %rsi
callq 0x1784c
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x2f4bc
leaq 0x8(%rsp), %r15
pushq $0x1
popq %rbp
movslq 0x14(%rsp), %rax
testq %rax, %rax
je 0x23fd2
movq 0x8(%rsp), %rcx
movq -0x8(%rcx,%rax,8), %r12
movq %r15, %rdi
callq 0x17820
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x68(%rax)
subq 0x10(%r14), %r12
shrq $0x4, %r12
movslq %r12d, %r13
shlq $0x4, %r13
xorl %ebx, %ebx
movq 0x68(%r14), %rax
movslq 0xc(%rax,%r13), %rcx
cmpq %rcx, %rbx
jge 0x23f5d
movq (%rax,%r13), %rax
movq (%rax,%rbx,8), %r12
movq 0x8(%r12), %rax
cmpb $0x0, 0x2f(%rax)
js 0x23fcd
movq %r15, %rdi
movq %r12, %rsi
callq 0x1784c
movq %r12, %rdi
movl %ebp, %esi
callq 0x2f4bc
incq %rbx
jmp 0x23f97
leaq 0x8(%rsp), %rdi
callq 0x9a81c
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x60
popq %rsi
movq (%rsp), %rdi
callq 0x13500
jmp 0x24011
jmp 0x24004
jmp 0x24004
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x9a81c
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %r15
movq %rdi, %r14
pushq $-0x1
popq %rbx
movsd 0xa411c(%rip), %xmm0    # 0xc8168
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
xorl %ebp, %ebp
movslq 0x18(%r14), %rax
cmpq %rax, %rbp
jge 0x24099
movq 0x10(%r14), %rsi
addq %r13, %rsi
movq %r12, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x16310
movq %r12, %rdi
movq %r15, %rsi
callq 0x495a1
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %ebp, %ebx
minsd %xmm1, %xmm0
incq %rbp
addq $0x10, %r13
jmp 0x24056
testl %ebx, %ebx
js 0x240a9
movq %r14, %rdi
movl %ebx, %esi
callq 0x23ec9
jmp 0x240ab
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_O2/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 0x134f0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
movsd 0x8(%rsp), %xmm0
callq 0x32a08
movq %rbx, %rdi
xorl %esi, %esi
callq 0x251da
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 0x13500
movq %r14, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rdi, %r15
pushq $0x60
popq %rdi
callq 0x134f0
movq %rax, %r14
movq %rax, %rdi
callq 0x39d70
xorl %r13d, %r13d
movslq 0x1c(%r15), %rax
cmpq %rax, %r13
jge 0x25808
movq 0x10(%r15), %rax
movq (%rax,%r13,8), %r12
testq %rbx, %rbx
je 0x257f7
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x10(%rax)
testl %eax, %eax
je 0x25803
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x10(%rax)
incq %r13
jmp 0x257d1
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x60
popq %rsi
movq %r14, %rdi
callq 0x13500
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, 0x10(%rsp)
movl 0x10(%rsi), %eax
movl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
cmovll %eax, %ecx
testl %eax, %eax
je 0x2597b
movl %ecx, 0xc(%rsp)
movslq %ecx, %r13
pushq $0x18
popq %rcx
movq %r13, %rax
mulq %rcx
pushq $-0x1
popq %r12
cmovnoq %rax, %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r14
imulq $0x18, %r13, %rbx
xorl %r15d, %r15d
leaq (%r14,%r15), %rdi
callq 0x781ba
addq $0x18, %r15
cmpq %r15, %rbx
jne 0x25883
movq %rbp, 0x18(%rsp)
movq 0x10(%rsp), %rax
movl 0x10(%rax), %eax
cltd
movl 0xc(%rsp), %ecx
idivl %ecx
cmpl $0x1, %eax
adcl $0x0, %eax
movslq %eax, %r13
xorl %ebx, %ebx
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
imulq $0x18, %rax, %rbp
shlq $0x4, %r13
leaq 0x50(%rsp), %r12
xorl %r15d, %r15d
cmpq %r15, %rbp
je 0x258fc
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
addq %rbx, %rsi
movq %r12, %rdi
callq 0x16310
leaq (%r14,%r15), %rdi
movq %r12, %rsi
callq 0x784a6
addq $0x18, %r15
addq %r13, %rbx
jmp 0x258ce
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movl 0xc(%rsp), %ebx
movl %ebx, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x4d640
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
movl %ebx, %edx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4d6c9
leaq 0x80(%rsp), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x7898c
xorpd %xmm0, %xmm0
ucomisd 0x10(%r15), %xmm0
jbe 0x25957
leaq 0x20(%rsp), %rdi
callq 0x78cd2
leaq 0x38(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x76e1c
movq %r14, %rdi
callq 0x136a0
movq %rbx, %rax
jmp 0x2598d
leaq 0x50093e(%rip), %rsi    # 0x5262c0
movq %rbp, %rdi
callq 0x76d90
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 0x139f0
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x20cb7
testq %rax, %rax
je 0x259ff
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movsd 0x8(%rsp), %xmm0
movq %r14, %rdx
callq 0x21047
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x25a17
testq %r14, %r14
je 0x25a08
andq $0x0, (%r14)
leaq 0x5008b1(%rip), %rsi    # 0x5262c0
movq %rbx, %rdi
callq 0x76d90
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xa26a5(%rip), %xmm1    # 0xc8170
movsd 0xa2695(%rip), %xmm2    # 0xc8168
movq %r12, %rdi
callq 0x2d69a
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20cb7
movq %rax, %r15
testq %rax, %rax
je 0x25b42
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
movq %r14, %rdx
callq 0x21047
movsd 0x8(%rbx), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd (%rbx), %xmm1
mulsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x28(%rsp), %xmm1
xorpd 0xa2874(%rip), %xmm1    # 0xc83a0
divsd 0x20(%rsp), %xmm1
movapd %xmm1, (%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x25b58
movsd 0xa2616(%rip), %xmm0    # 0xc8160
testq %r14, %r14
movapd %xmm0, (%rsp)
je 0x25b58
andq $0x0, (%r14)
leaq 0x30(%rsp), %rdi
callq 0x2ec74
movaps (%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x25b74
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2ec74
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x21047
movsd (%rsp), %xmm0
mulsd 0xa2f4c(%rip), %xmm0    # 0xc8b00
leaq 0x28(%rsp), %r12
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x2d90a
movq %r15, %rdi
movq %r12, %rsi
callq 0x20c50
movq %rax, %r15
cmpl $0x4, 0x10(%rax)
jl 0x25c0a
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x2582b
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2865e
testq %r14, %r14
je 0x25c0a
cvtsi2sdl 0x10(%r15), %xmm0
movsd %xmm0, (%r14)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
leaq 0x28(%rsp), %rdi
callq 0x2ec74
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x25c2e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2ec74
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x261b6
pushq $0x1
popq %rax
xorps %xmm0, %xmm0
movq %rsi, %rdi
movl %eax, %esi
callq 0x16b9c
testq %rax, %rax
je 0x261b6
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x25fa3
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0x261c5
leaq 0xff5f3(%rip), %rsi     # 0x1257b0
movq %rbx, %rdi
callq 0x629ec
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2831a
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x9fe94(%rip), %xmm0    # 0xc8168
xorl %r12d, %r12d
xorl %r15d, %r15d
movslq 0x9c(%r14), %rax
cmpq %rax, %r12
jge 0x2831d
movq 0x90(%r14), %rax
movq (%rax,%r12,8), %r13
leaq 0x30(%r13), %rdi
movq %rbx, %rsi
movsd %xmm0, 0x8(%rsp)
callq 0x495a1
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %r13, %r15
minsd %xmm1, %xmm0
incq %r12
jmp 0x282da
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_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/./R3SurfelImage.h
// Function: gaps::R3SurfelImage::PixelDepth(int, int) const
inline RNScalar R3SurfelImage::
PixelDepth(int ix, int iy) const
{
  // Return the depth of the pixel
  const R2Grid *depth_channel = DepthChannel();
  if (!depth_channel) return -1;
  return depth_channel->GridValue(ix, iy);
}

// Assembly:
movsd 0x9fbfa(%rip), %xmm0    # 0xc8160
cmpl $0x4, 0x2c(%rdi)
jl 0x28591
movq 0x20(%rdi), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x28591
imull 0xc8(%rax), %edx
movq 0xb8(%rax), %rax
addl %esi, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/../../pkgs/R3Shapes/R3PlanarGrid.h
// Function: gaps::R3PlanarGrid::RasterizeWorldPoint(gaps::R3Point const&, double, int)
inline void R3PlanarGrid::
RasterizeWorldPoint(const R3Point& point, RNScalar value, int operation) 
{ 
  // Rasterize point at position on the plane closest to point given in 3D world coordinates
  R3Point p(point);
  p.Transform(transformation);
  return grid.RasterizeWorldPoint(p.X(), p.Y(), value, operation); 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movsd %xmm0, (%rsp)
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x781cc
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x78802
addq $0x130, %r14            # imm = 0x130
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movq %r14, %rdi
movsd (%rsp), %xmm2
movl %ebx, %esi
callq 0x28a94
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movss %xmm6, 0x4(%rsp)
movq %rdi, %r15
andl $0x0, 0xc(%rdi)
andq $0x0, 0x20(%rdi)
andl $0x0, 0x28(%rdi)
movb %r8b, 0x2f(%rdi)
movss %xmm0, (%rdi)
movss %xmm1, 0x4(%rdi)
movss %xmm2, 0x8(%rdi)
movaps %xmm3, %xmm0
movaps %xmm4, %xmm1
movaps %xmm5, %xmm2
callq 0x293b6
andl $0x0, 0x16(%r15)
andw $0x0, 0x1a(%r15)
cvtss2sd 0x4(%rsp), %xmm0
mulsd 0x9fc0b(%rip), %xmm0    # 0xc8dc8
addsd 0x9ef73(%rip), %xmm0    # 0xc8138
cvtsd2ss %xmm0, %xmm0
movss 0x9fc07(%rip), %xmm1    # 0xc8dd8
minss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movw %ax, 0x1c(%r15)
movw %ax, 0x1e(%r15)
movb %r14b, 0x2c(%r15)
movb %bpl, 0x2d(%r15)
movb %bl, 0x2e(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movss %xmm7, 0x4(%rsp)
movss %xmm6, (%rsp)
movq %rdi, %r15
movss 0x48(%rsp), %xmm6
movss %xmm6, 0xc(%rdi)
movl %r8d, 0x20(%rdi)
andq $0x0, 0x24(%rdi)
movb %r9b, 0x2f(%rdi)
movss %xmm0, (%rdi)
movss %xmm1, 0x4(%rdi)
movss %xmm2, 0x8(%rdi)
movaps %xmm3, %xmm0
movaps %xmm4, %xmm1
movaps %xmm5, %xmm2
callq 0x293b6
movq %r15, %rdi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
movss 0x30(%rsp), %xmm2
callq 0x29418
movss 0x40(%rsp), %xmm0
movss 0x38(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtps2pd %xmm1, %xmm0
mulpd 0x9fb23(%rip), %xmm0    # 0xc8da0
addpd 0x9fb0b(%rip), %xmm0    # 0xc8d90
cvtpd2ps %xmm0, %xmm0
movaps 0x9fb20(%rip), %xmm1    # 0xc8db0
minps %xmm0, %xmm1
cvttps2dq %xmm1, %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x1c(%r15)
movb %r14b, 0x2c(%r15)
movb %bpl, 0x2d(%r15)
movb %bl, 0x2e(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3Surfel.cpp
// Function: gaps::R3Surfel::R3Surfel(float, float, 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,
  float depth, float elevation,
  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);
  SetDepth(depth);
  SetElevation(elevation);
  SetColor(r, g, b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movss %xmm7, 0x4(%rsp)
movss %xmm6, (%rsp)
movq %rdi, %r15
movss 0x58(%rsp), %xmm6
movss %xmm6, 0xc(%rdi)
movl %r8d, 0x20(%rdi)
andq $0x0, 0x24(%rdi)
movb %r9b, 0x2f(%rdi)
movss %xmm0, (%rdi)
movss %xmm1, 0x4(%rdi)
movss %xmm2, 0x8(%rdi)
movaps %xmm3, %xmm0
movaps %xmm4, %xmm1
movaps %xmm5, %xmm2
callq 0x293b6
movq %r15, %rdi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
movss 0x30(%rsp), %xmm2
callq 0x29418
movss 0x40(%rsp), %xmm0
movss 0x38(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtps2pd %xmm1, %xmm0
mulpd 0x9fa63(%rip), %xmm0    # 0xc8da0
addpd 0x9fa4b(%rip), %xmm0    # 0xc8d90
cvtpd2ps %xmm0, %xmm0
movaps 0x9fa60(%rip), %xmm1    # 0xc8db0
minps %xmm0, %xmm1
cvttps2dq %xmm1, %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
cvtss2sd 0x48(%rsp), %xmm1
mulsd 0x9fa66(%rip), %xmm1    # 0xc8dd0
addsd 0x9edc6(%rip), %xmm1    # 0xc8138
movd %xmm0, 0x1c(%r15)
cvtsd2ss %xmm1, %xmm0
movss 0x9fa54(%rip), %xmm1    # 0xc8dd8
minss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movw %ax, 0x28(%r15)
movq %r15, %rdi
movss 0x50(%rsp), %xmm0
callq 0x2947a
movb %r14b, 0x2c(%r15)
movb %bpl, 0x2d(%r15)
movb %bl, 0x2e(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/./R3Surfel.h
// Function: gaps::R3Surfel::SetNormal(float, float, float)
inline void R3Surfel::
SetNormal(float x, float y, float z)
{
  // Set normal
  normal[0] = (RNInt16) (32767.0 * x + 0.5);
  normal[1] = (RNInt16) (32767.0 * y + 0.5);
  normal[2] = (RNInt16) (32767.0 * z + 0.5);

  // Update flags
  if ((x != 0) || (y != 0) || (z != 0)) flags |= R3_SURFEL_NORMAL_FLAG;
}

// Assembly:
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
mulpd 0x9f9b6(%rip), %xmm0    # 0xc8d80
addpd 0x9f9be(%rip), %xmm0    # 0xc8d90
cvttpd2dq %xmm0, %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
cvtss2sd %xmm2, %xmm4
mulsd 0x9f9d9(%rip), %xmm4    # 0xc8dc0
addsd 0x9ed49(%rip), %xmm4    # 0xc8138
movd %xmm0, 0x10(%rdi)
cvttsd2si %xmm4, %eax
movw %ax, 0x14(%rdi)
jne 0x29413
jp 0x29413
ucomiss %xmm3, %xmm1
jne 0x29413
jp 0x29413
pxor %xmm0, %xmm0
ucomiss %xmm0, %xmm2
jne 0x29413
jp 0x29413
retq
orb $0x40, 0x2f(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/./R3Surfel.h
// Function: gaps::R3Surfel::SetTangent(float, float, float)
inline void R3Surfel::
SetTangent(float x, float y, float z)
{
  // Set tangent
  tangent[0] = (RNInt16) (32767.0 * x + 0.5);
  tangent[1] = (RNInt16) (32767.0 * y + 0.5);
  tangent[2] = (RNInt16) (32767.0 * z + 0.5);

  // Update flags
  if ((x != 0) || (y != 0) || (z != 0)) flags |= R3_SURFEL_TANGENT_FLAG;
}

// Assembly:
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
mulpd 0x9f954(%rip), %xmm0    # 0xc8d80
addpd 0x9f95c(%rip), %xmm0    # 0xc8d90
cvttpd2dq %xmm0, %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
cvtss2sd %xmm2, %xmm4
mulsd 0x9f977(%rip), %xmm4    # 0xc8dc0
addsd 0x9ece7(%rip), %xmm4    # 0xc8138
movd %xmm0, 0x16(%rdi)
cvttsd2si %xmm4, %eax
movw %ax, 0x1a(%rdi)
jne 0x29475
jp 0x29475
ucomiss %xmm3, %xmm1
jne 0x29475
jp 0x29475
pxor %xmm0, %xmm0
ucomiss %xmm0, %xmm2
jne 0x29475
jp 0x29475
retq
orb $0x1, 0x2f(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/./R3Surfel.h
// Function: gaps::R3Surfel::SetElevation(float)
inline void R3Surfel::
SetElevation(float elevation)
{
  // Set elevation
  float d = 400.0 * elevation + 0.5;
  if (d < -32767) d = -32767;
  else if (d > 32767) d = 32767;
  this->elevation = (RNInt16) d;
}

// Assembly:
cvtss2sd %xmm0, %xmm0
mulsd 0x9f94a(%rip), %xmm0    # 0xc8dd0
addsd 0x9ecaa(%rip), %xmm0    # 0xc8138
cvtsd2ss %xmm0, %xmm1
movss 0x9f942(%rip), %xmm0    # 0xc8ddc
ucomiss %xmm1, %xmm0
ja 0x294b3
ucomiss 0x9f93a(%rip), %xmm1    # 0xc8de0
movaps %xmm1, %xmm0
jbe 0x294b3
movss 0x9f92d(%rip), %xmm0    # 0xc8de0
cvttss2si %xmm0, %eax
movw %ax, 0x2a(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
addq $0x10, %rsi
callq 0x781cc
leaq 0x28(%r14), %r15
leaq 0x28(%rbx), %rsi
movq %r15, %rdi
callq 0x63ce6
movsd 0x60(%rbx), %xmm0
movsd %xmm0, 0x60(%r14)
leaq 0x68(%r14), %rdi
leaq 0x68(%rbx), %rsi
callq 0x9c1ea
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)
orl $-0x1, 0xa0(%r14)
movups %xmm0, 0xa8(%r14)
movups %xmm0, 0xb4(%r14)
movslq 0x8(%r14), %rax
testq %rax, %rax
jle 0x29777
imulq $0x30, %rax, %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r13
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x29118
addq $0x30, %rbp
cmpq %rbp, %r12
jne 0x29728
movq %r13, (%r14)
xorl %eax, %eax
xorl %ecx, %ecx
movslq 0x8(%r14), %rdx
cmpq %rdx, %rcx
jge 0x29777
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
addq $0x30, %rax
jmp 0x29743
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x29799
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x139f0
movq %r15, %rdi
callq 0x649ae
movq %rbx, %rdi
callq 0x138f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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)
movq %rdi, %rbx
andq $0x0, (%rdi)
movl %edx, %ebp
movq %rsi, %r14
movl %edx, 0x8(%rdi)
addq $0x10, %rdi
movq %rcx, %rsi
callq 0x781cc
leaq 0x28(%rbx), %r15
movsd 0x9e2b3(%rip), %xmm0    # 0xc8168
movsd 0x9e2b3(%rip), %xmm3    # 0xc8170
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
callq 0x63d86
movsd (%rsp), %xmm0
movsd %xmm0, 0x60(%rbx)
leaq 0x68(%rbx), %rdi
movsd 0x9e281(%rip), %xmm0    # 0xc8168
movsd 0x9e281(%rip), %xmm1    # 0xc8170
callq 0x9c1e0
orl $-0x1, 0x78(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7c(%rbx)
movups %xmm0, 0x8c(%rbx)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x9c(%rbx)
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xb4(%rbx)
testl %ebp, %ebp
jle 0x29f82
movl %ebp, %eax
imulq $0x30, %rax, %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r13
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x29118
addq $0x30, %rbp
cmpq %rbp, %r12
jne 0x29f3c
movq %r13, (%rbx)
xorl %eax, %eax
cmpq %rax, %r12
je 0x29f82
movq (%rbx), %rcx
movups (%r14,%rax), %xmm0
movups 0x10(%r14,%rax), %xmm1
movups 0x20(%r14,%rax), %xmm2
movups %xmm2, 0x20(%rcx,%rax)
movups %xmm1, 0x10(%rcx,%rax)
movups %xmm0, (%rcx,%rax)
addq $0x30, %rax
jmp 0x29f55
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x29fa4
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x139f0
movq %r15, %rdi
callq 0x649ae
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %rbx
andq $0x0, (%rdi)
movq %rsi, %r14
movl 0xc(%rsi), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
movq %rdx, %rsi
callq 0x781cc
leaq 0x28(%rbx), %r15
movsd 0x9e17c(%rip), %xmm0    # 0xc8168
movsd 0x9e17c(%rip), %xmm3    # 0xc8170
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
callq 0x63d86
movsd (%rsp), %xmm0
movsd %xmm0, 0x60(%rbx)
leaq 0x68(%rbx), %rdi
movsd 0x9e14a(%rip), %xmm0    # 0xc8168
movsd 0x9e14a(%rip), %xmm1    # 0xc8170
callq 0x9c1e0
orl $-0x1, 0x78(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7c(%rbx)
movups %xmm0, 0x8c(%rbx)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x9c(%rbx)
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xb4(%rbx)
movslq 0x8(%rbx), %rax
testq %rax, %rax
jle 0x2a0c6
imulq $0x30, %rax, %r12
movq %r12, %rdi
callq 0x13030
movq %rax, %r13
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x29118
addq $0x30, %rbp
cmpq %rbp, %r12
jne 0x2a076
movq %r13, (%rbx)
xorl %eax, %eax
xorl %ecx, %ecx
movslq 0x8(%rbx), %rdx
cmpq %rdx, %rcx
jge 0x2a0c6
movq (%r14), %rdx
movq (%rdx,%rcx,8), %rdx
movq (%rbx), %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
addq $0x30, %rax
jmp 0x2a091
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2a0e8
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x139f0
movq %r15, %rdi
callq 0x649ae
movq %rbx, %rdi
callq 0x138f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2a5bf
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x30(%rax)
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x2a5d4
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x18(%rax)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2a5e1
callq 0x136a0
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x649ae
movq %rax, %rdi
callq 0x177bf
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2a615
pushq $0x30
popq %rsi
callq 0x13500
andq $0x0, (%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
leaq 0x10(%r14), %rsi
leaq 0x10(%rbx), %rdi
callq 0x784a6
leaq 0x28(%r14), %rsi
leaq 0x28(%rbx), %rdi
callq 0x177ee
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)
orl $-0x1, 0xa0(%rbx)
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xb4(%rbx)
movslq 0x8(%rbx), %rax
testq %rax, %rax
jle 0x2a6fd
imulq $0x30, %rax, %r15
movq %r15, %rdi
callq 0x13030
movq %rax, %r12
xorl %r13d, %r13d
leaq (%r12,%r13), %rdi
callq 0x29118
addq $0x30, %r13
cmpq %r13, %r15
jne 0x2a6b0
movq %r12, (%rbx)
xorl %eax, %eax
xorl %ecx, %ecx
movslq 0x8(%rbx), %rdx
cmpq %rdx, %rcx
jge 0x2a6fd
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
addq $0x30, %rax
jmp 0x2a6c9
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r12, %rdi
movq %r15, %rsi
callq 0x139f0
movq %rbx, %rdi
callq 0x138f0