LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::InsertIntoPointSet(gaps::R3SurfelPointSet*, int, double) const
void R3SurfelNode::
InsertIntoPointSet(R3SurfelPointSet *pointset, RNBoolean leaf_level, RNScalar max_resolution) const
{
  // Insert points
  if (leaf_level && (NParts() > 0)) {
    // Insert points from all decendent parts at leaf level
    for (int i = 0; i < NParts(); i++) {
      R3SurfelNode *part = Part(i);
      part->InsertIntoPointSet(pointset, leaf_level, max_resolution);
    }
  }
  else {
    // Insert points from all blocks in this node
    for (int i = 0; i < NBlocks(); i++) {
      R3SurfelBlock *block = Block(i);
      pointset->InsertPoints(block, max_resolution);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
je 0x33a50
movl 0x3c(%r14), %eax
testl %eax, %eax
jle 0x33a50
movl %edx, %ebp
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x33a77
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movsd (%rsp), %xmm0
callq 0x33a06
incq %r15
movl 0x3c(%r14), %eax
jmp 0x33a29
xorl %r15d, %r15d
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jge 0x33a77
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq *0x38(%rax)
incq %r15
jmp 0x33a53
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::SetName(char const*)
void R3SurfelNode::
SetName(const char *name)
{
  // Delete previous name
  if (this->name) free(this->name);
  this->name = (name) ? RNStrdup(name) : NULL;

  // Mark scene as dirty
  if (Tree() && Tree()->Scene()) Tree()->Scene()->SetDirty();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0xb8(%rdi), %rdi
callq 0x13600
testq %r14, %r14
je 0x33aa7
movq %r14, %rdi
callq 0x9cc91
jmp 0x33aa9
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x33ac9
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x33ac9
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::SetParent(gaps::R3SurfelNode*)
void R3SurfelNode::
SetParent(R3SurfelNode *parent)
{
  // Just checking
  assert(parent);
  assert(this->parent);
  assert(tree);
  assert(tree == this->parent->tree);
  assert(tree == parent->tree);
  if (parent == this->parent) return;

  // Find least common ancestor
  R3SurfelNode *least_common_ancestor = NULL;

  // Invalidate properties starting at current parent
  R3SurfelNode *ancestor = this->parent;
  while (ancestor && (ancestor != least_common_ancestor)) {
    if (ancestor->complexity == -1) break;
    ancestor->complexity = -1;
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    ancestor = ancestor->parent;
  }

  // Invalidate properties starting at new parent
  ancestor = parent;
  while (ancestor && (ancestor != least_common_ancestor)) {
    if (ancestor->complexity == -1) break;
    ancestor->complexity = -1;
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    ancestor = ancestor->parent;
  }

  // Update hierarchy
  this->parent->parts.Remove(this);
  parent->parts.Insert(this);
  this->parent = parent;

  // Mark scene as dirty
  if (Tree() && Tree()->Scene()) Tree()->Scene()->SetDirty();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
cmpq %rsi, %rdi
je 0x33b9a
movq %rsi, %r14
movsd 0x94667(%rip), %xmm0    # 0xc8160
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movabsq $0x47efffffe0000000, %rcx # imm = 0x47EFFFFFE0000000
movq %rdi, %rdx
testq %rdx, %rdx
je 0x33b37
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x33b22
jnp 0x33b37
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
jmp 0x33b10
movq %r14, %rdx
testq %rdx, %rdx
je 0x33b65
movsd 0x50(%rdx), %xmm0
ucomisd 0x94614(%rip), %xmm0    # 0xc8160
jne 0x33b50
jnp 0x33b65
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
jmp 0x33b3a
addq $0x30, %rdi
movq %rbx, %rsi
callq 0x1782a
leaq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0x1784c
movq %r14, 0x28(%rbx)
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x33b9a
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x33b9a
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::InsertBlock(gaps::R3SurfelBlock*)
void R3SurfelNode::
InsertBlock(R3SurfelBlock *block)
{
  // Just checking
  assert(block->node == NULL);
  assert(!blocks.FindEntry(block));

  // Insert block
  blocks.Insert(block);

  // Update properties
  R3SurfelNode *ancestor = this;
  while (ancestor) {
    if (ancestor->complexity == -1) break;
    ancestor->complexity = -1;
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    ancestor = ancestor->parent;
  }

  // Mark resolution out of date
  resolution = -1;

  // Update block
  block->UpdateAfterInsert(this);

  // Update object
  if (object) object->UpdateAfterInsertBlock(this, block);

  // Mark scene as dirty
  if (Tree() && Tree()->Scene()) Tree()->Scene()->SetDirty();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x40, %rdi
callq 0x1784c
movsd 0x945a3(%rip), %xmm0    # 0xc8160
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movabsq $0x47efffffe0000000, %rcx # imm = 0x47EFFFFFE0000000
movq %rbx, %rdx
testq %rdx, %rdx
je 0x33bfb
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x33be6
jnp 0x33bfb
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
jmp 0x33bd4
movq %rax, 0x58(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d0a0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x33c1e
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1763c
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x33c37
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x33c37
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::RemoveBlock(gaps::R3SurfelBlock*)
void R3SurfelNode::
RemoveBlock(R3SurfelBlock *block)
{
  // Just checking
  assert(block->node == this);
  assert(blocks.FindEntry(block));

  // Update object
  if (object) object->UpdateBeforeRemoveBlock(this, block);

  // Update block
  block->UpdateBeforeRemove(this);

  // Remove block
  blocks.Remove(block);

  // Mark resolution out of date
  resolution = -1;

  // Invalidate properties
  R3SurfelNode *ancestor = this;
  while (ancestor) {
    if (ancestor->complexity == -1) break;
    ancestor->complexity = -1;
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    ancestor = ancestor->parent;
  }

  // Mark scene as dirty
  if (Tree() && Tree()->Scene()) Tree()->Scene()->SetDirty();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x33c5e
movq %rbx, %rsi
movq %r14, %rdx
callq 0x176ae
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d0a8
leaq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0x1782a
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x58(%rbx)
movsd 0x944d5(%rip), %xmm0    # 0xc8160
movabsq $0x47efffffe0000000, %rcx # imm = 0x47EFFFFFE0000000
movq %rbx, %rdx
testq %rdx, %rdx
je 0x33cbf
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x33caa
jnp 0x33cbf
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
jmp 0x33c98
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x33cd8
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x33cd8
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::Transform(gaps::R3Affine const&)
void R3SurfelNode::
Transform(const R3Affine& transformation) 
{
  // Transform all blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    block->Transform(transformation);
  }

  // Update resolution
  RNScalar scale = transformation.ScaleFactor();
  if ((resolution > 0) && (RNIsNotEqual(scale, 1.0))) resolution /= scale * scale;

  // Invalidate bounding boxes starting at this node
  R3SurfelNode *ancestor = this;
  while (ancestor) {
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    ancestor = ancestor->parent;
  }

  // Update object
  if (object) object->UpdateAfterTransform(this);

  // Mark scene as dirty
  if (Tree() && Tree()->Scene()) Tree()->Scene()->SetDirty();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jge 0x33d0c
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq %r14, %rsi
callq 0x2b1fc
incq %r15
jmp 0x33cee
movq (%r14), %rax
movq %r14, %rdi
callq *0xc0(%rax)
movsd 0x58(%rbx), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jbe 0x33d5f
leaq 0xf0efa(%rip), %rax     # 0x124c28
movsd (%rax), %xmm2
movsd 0x94426(%rip), %xmm3    # 0xc8160
addsd %xmm0, %xmm3
ucomisd %xmm2, %xmm3
ja 0x33d52
xorpd 0x94654(%rip), %xmm2    # 0xc83a0
ucomisd %xmm3, %xmm2
jbe 0x33d5f
mulsd %xmm0, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x58(%rbx)
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rbx, %rcx
testq %rcx, %rcx
je 0x33d82
movq %rax, 0x68(%rcx)
movq %rax, 0xa8(%rcx)
movq 0x28(%rcx), %rcx
jmp 0x33d6c
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x33d93
movq %rbx, %rsi
callq 0x17724
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x33dac
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x33dac
orb $0x1, 0x1e8(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::SetMarks(int)
void R3SurfelNode::
SetMarks(RNBoolean mark)
{
  // Set mark for all blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    block->SetMarks(mark);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jge 0x33ddc
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x2b1b6
incq %r15
jmp 0x33dbf
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::ReadBlocks(int)
void R3SurfelNode::
ReadBlocks(RNBoolean entire_subtree)
{
  // Read blocks in node
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    R3SurfelDatabase *database = block->Database();
    if (database) database->ReadBlock(block);
  }

  // Read blocks in parts
  if (entire_subtree) {
    for (int i = 0; i < NParts(); i++) {
      R3SurfelNode *part = Part(i);
      part->ReadBlocks(entire_subtree);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jge 0x33e16
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rsi
movq 0x98(%rsi), %rdi
testq %rdi, %rdi
je 0x33e11
callq 0x20a64
incq %r15
jmp 0x33def
testl %ebx, %ebx
je 0x33e3a
xorl %r15d, %r15d
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jge 0x33e3a
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x33de2
incq %r15
jmp 0x33e1d
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::ReleaseBlocks(int)
void R3SurfelNode::
ReleaseBlocks(RNBoolean entire_subtree)
{
  // Release blocks in node
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    R3SurfelDatabase *database = block->Database();
    if (database) database->ReleaseBlock(block);
  }

  // Release blocks in parts
  if (entire_subtree) {
    for (int i = 0; i < NParts(); i++) {
      R3SurfelNode *part = Part(i);
      part->ReleaseBlocks(entire_subtree);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jge 0x33e74
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rsi
movq 0x98(%rsi), %rdi
testq %rdi, %rdi
je 0x33e6f
callq 0x20aa0
incq %r15
jmp 0x33e4d
testl %ebx, %ebx
je 0x33e98
xorl %r15d, %r15d
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jge 0x33e98
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x33e40
incq %r15
jmp 0x33e7b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::AreBlocksResident() const
RNBoolean R3SurfelNode::
AreBlocksResident(void) const
{
  // Return whether blocks are in memory
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    R3SurfelDatabase *database = block->Database();
    if (!database->IsBlockResident(block)) return FALSE;
  }

  // All blocks are resident
  return TRUE;
}

// Assembly:
movslq 0x4c(%rdi), %rcx
movq 0x40(%rdi), %rax
xorl %edi, %edi
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
movq %rdi, %rsi
cmpq %rdi, %rdx
je 0x33ec8
movq (%rax,%rsi,8), %r8
leaq 0x1(%rsi), %rdi
cmpq $0x0, (%r8)
jne 0x33eb2
xorl %eax, %eax
cmpq %rcx, %rsi
setge %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelNode::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print node
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%d %s", TreeIndex(), (Name()) ? Name() : "-");
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

  // Print all surfel blocks
  if (prefix) fprintf(fp, "%s", prefix);
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    fprintf(fp, "%d ", block->DatabaseIndex());
  }
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
jne 0x33ef6
movq 0xf008d(%rip), %rax     # 0x123f80
movq (%rax), %rbx
testq %r12, %r12
je 0x33f06
movq %r12, %rdi
movq %rbx, %rsi
callq 0x135d0
movl 0x20(%r15), %edx
movq 0xb8(%r15), %rax
testq %rax, %rax
leaq 0x9442b(%rip), %rcx     # 0xc8346
cmovneq %rax, %rcx
leaq 0x9441a(%rip), %rsi     # 0xc8340
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13780
testq %r14, %r14
je 0x33f40
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135d0
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x13690
testq %r12, %r12
je 0x33f5b
movq %r12, %rdi
movq %rbx, %rsi
callq 0x135d0
leaq 0x94941(%rip), %r12     # 0xc88a3
xorl %r13d, %r13d
movslq 0x4c(%r15), %rax
cmpq %rax, %r13
jge 0x33f8e
movq 0x40(%r15), %rax
movq (%rax,%r13,8), %rax
movl 0xa0(%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x13780
incq %r13
jmp 0x33f65
testq %r14, %r14
je 0x33f9e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135d0
pushq $0xa
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x13690
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::Draw(gaps::RNFlags) const
void R3SurfelNode::
Draw(RNFlags flags) const
{
  // Draw all blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    block->Draw(flags);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jge 0x33fe5
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x2b676
incq %r15
jmp 0x33fc5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::DrawResidentDescendents(gaps::RNFlags) const
int R3SurfelNode::
DrawResidentDescendents(RNFlags draw_flags) const
{
  // Initialize return status
  int status = 0;

  // Draw parts
  if (NParts() > 0) {
    // Draw resident descendents of all parts
    status = 1;
    for (int i = 0; i < NParts(); i++) {
      R3SurfelNode *part = Part(i);
      status &= part->DrawResidentDescendents(draw_flags);
    }
  }

  // Draw node if resident
  if (status == 0) {
    if (AreBlocksResident()) {
      Draw(draw_flags);
      status = 1;
    }
  }

  // Return whether drew everything
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x3c(%rdi), %eax
testl %eax, %eax
jle 0x34036
pushq $0x1
popq %rbp
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x3402d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x58(%rax)
andl %eax, %ebp
incq %r15
movl 0x3c(%r14), %eax
jmp 0x3400a
testl %ebp, %ebp
je 0x34036
pushq $0x1
popq %rbp
jmp 0x34055
movq %r14, %rdi
callq 0x33e9e
testl %eax, %eax
je 0x34053
pushq $0x1
popq %rbp
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x48(%rax)
jmp 0x34055
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateProperties()
void R3SurfelNode::
UpdateProperties(void)
{
  // Update surfels
  UpdateSurfelNormals();

  // Update properties
  double dummy = 0;
  dummy += Complexity();
  dummy += Resolution();
  dummy += BBox().Min().X();
  dummy += ElevationRange().Min();
  dummy += TimestampRange().Min();
  if (dummy == 927612.21242) {
    printf("Amazing!\n");
  }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x98(%rax)
movq %rbx, %rdi
callq 0x3365c
xorpd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %rbx, %rdi
callq 0x33680
addsd 0x8(%rsp), %xmm0
movsd 0x68(%rbx), %xmm1
ucomisd 0x93edc(%rip), %xmm1    # 0xc8168
jne 0x342aa
jp 0x342aa
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
callq *0x68(%rax)
movsd 0x8(%rsp), %xmm0
movsd 0x68(%rbx), %xmm1
addsd %xmm1, %xmm0
movsd 0x98(%rbx), %xmm1
ucomisd 0x93eaa(%rip), %xmm1    # 0xc8168
jne 0x342df
jp 0x342df
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
callq *0x70(%rax)
movsd 0x8(%rsp), %xmm0
movsd 0x98(%rbx), %xmm1
addsd %xmm1, %xmm0
movsd 0xa8(%rbx), %xmm1
ucomisd 0x93e75(%rip), %xmm1    # 0xc8168
jne 0x34314
jp 0x34314
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
callq *0x78(%rax)
movsd 0x8(%rsp), %xmm0
movsd 0xa8(%rbx), %xmm1
addsd %xmm1, %xmm0
ucomisd 0x94000(%rip), %xmm0    # 0xc8320
jne 0x34335
jp 0x34335
leaq 0x9401d(%rip), %rdi     # 0xc8348
addq $0x10, %rsp
popq %rbx
jmp 0x13800
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateBBox()
void R3SurfelNode::
UpdateBBox(void)
{
  // Check if bounding box is uptodate
  if (bbox[0][0] != FLT_MAX) return;

  // Initialize bounding box
  bbox = R3null_box;

  // Union bounding boxes of blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    bbox.Union(block->BBox());
  }

  // Union bounding boxes of parts
  for (int i = 0; i < NParts(); i++) {
    R3SurfelNode *part = Part(i);
    bbox.Union(part->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movsd 0x68(%rdi), %xmm0
ucomisd 0x93e17(%rip), %xmm0    # 0xc8168
jne 0x34355
jnp 0x34361
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdi, %rbx
leaq 0x60(%rdi), %r14
leaq 0xf1679(%rip), %rsi     # 0x1259e8
movq %r14, %rdi
callq 0x177ee
xorl %r15d, %r15d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jge 0x343a0
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x2a720
movq %r14, %rdi
movq %rax, %rsi
callq 0x646fe
incq %r15
jmp 0x3437a
xorl %r12d, %r12d
movslq 0x3c(%rbx), %rax
cmpq %rax, %r12
jge 0x34355
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x68(%r15), %xmm0
ucomisd 0x93da6(%rip), %xmm0    # 0xc8168
jne 0x343cf
jp 0x343cf
movq (%r15), %rax
movq %r15, %rdi
callq *0x68(%rax)
addq $0x60, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x646fe
incq %r12
jmp 0x343a3
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateElevationRange()
void R3SurfelNode::
UpdateElevationRange(void)
{
  // Check if range is uptodate
  if (elevation_range[0] != FLT_MAX) return;

  // Initialize elevation range
  elevation_range.Reset(FLT_MAX,-FLT_MAX);

  // Compute elevation range
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    RNInterval block_range = block->ElevationRange();
    elevation_range.Union(block_range);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd 0x98(%rdi), %xmm0
ucomisd 0x93d6b(%rip), %xmm0    # 0xc8168
jne 0x34401
jnp 0x3440b
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rdi, %rbx
movapd 0x93f1a(%rip), %xmm0    # 0xc8330
movupd %xmm0, 0x98(%rdi)
xorl %r15d, %r15d
movq %rsp, %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jge 0x34401
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x2a802
movsd (%rsp), %xmm0
movsd 0x98(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x34458
movsd %xmm0, 0x98(%rbx)
movsd 0x8(%rsp), %xmm0
ucomisd 0xa0(%rbx), %xmm0
jbe 0x34470
movsd %xmm0, 0xa0(%rbx)
incq %r15
jmp 0x34424
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateTimestampRange()
void R3SurfelNode::
UpdateTimestampRange(void)
{
  // Check if range is uptodate
  if (timestamp_range[0] != FLT_MAX) return;

  // Initialize timestamp range
  timestamp_range.Reset(FLT_MAX,-FLT_MAX);

  // Union timestamp ranges of blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    timestamp_range.Union(block->TimestampRange());
  }

  // Union timestamp ranges of parts
  for (int i = 0; i < NParts(); i++) {
    R3SurfelNode *part = Part(i);
    timestamp_range.Union(part->TimestampRange());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movsd 0xa8(%rdi), %xmm0
ucomisd 0x93cda(%rip), %xmm0    # 0xc8168
jne 0x34492
jnp 0x3449e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdi, %rbx
leaq 0xa8(%rdi), %r14
movapd 0x93e80(%rip), %xmm0    # 0xc8330
movupd %xmm0, 0xa8(%rdi)
xorl %r15d, %r15d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jge 0x344e1
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x2a8a8
movq %r14, %rdi
movq %rax, %rsi
callq 0x177ca
incq %r15
jmp 0x344bb
xorl %r12d, %r12d
movslq 0x3c(%rbx), %rax
cmpq %rax, %r12
jge 0x34492
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0xa8(%r15), %xmm0
ucomisd 0x93c62(%rip), %xmm0    # 0xc8168
jne 0x34513
jp 0x34513
movq (%r15), %rax
movq %r15, %rdi
callq *0x78(%rax)
addq $0xa8, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x177ca
incq %r12
jmp 0x344e4
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateComplexity()
void R3SurfelNode::
UpdateComplexity(void)
{
  // Check if complexity is uptodate
  if (complexity >= 0) return;

  // Sum complexity of blocks
  complexity = 0;
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    complexity += block->NSurfels();
  }
}

// Assembly:
movsd 0x50(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jae 0x34568
andq $0x0, 0x50(%rdi)
movl 0x4c(%rdi), %eax
movq 0x40(%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x34568
movq (%rcx,%rdx,8), %rsi
cvtsi2sdl 0x8(%rsi), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rdi)
incq %rdx
jmp 0x3454c
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateResolution()
void R3SurfelNode::
UpdateResolution(void)
{
  // Check if resolution is uptodate
  if (resolution >= 0) return;

  // Initialize resolution
  resolution = 0;

  // Compute minimum of block resolutions
  if (Complexity() > 0) {
    resolution = FLT_MAX;
    assert(NBlocks() > 0);
    for (int i = 0; i < NBlocks(); i++) {
      R3SurfelBlock *block = Block(i);
      RNScalar block_resolution = block->Resolution();
      if (block_resolution < resolution) {
        resolution = block_resolution;
      }
    }
  }
}

// Assembly:
movsd 0x58(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0x345d7
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, 0x58(%rdi)
callq 0x3365c
ucomisd 0x93dee(%rip), %xmm0    # 0xc8380
jbe 0x345d0
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x58(%rbx)
xorl %r14d, %r14d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jge 0x345d0
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2aa12
movsd 0x58(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x345cb
movsd %xmm0, 0x58(%rbx)
incq %r14
jmp 0x345a5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateFlags()
void R3SurfelNode::
UpdateFlags(void)
{
  // Reset flags
  flags.Remove(R3_SURFEL_NODE_HAS_ACTIVE_FLAG);
  flags.Remove(R3_SURFEL_NODE_HAS_NORMALS_FLAG);
  flags.Remove(R3_SURFEL_NODE_HAS_AERIAL_FLAG);
  flags.Remove(R3_SURFEL_NODE_HAS_TERRESTRIAL_FLAG);

  // Update flags
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    if (block->HasActive()) flags.Add(R3_SURFEL_NODE_HAS_ACTIVE_FLAG);
    if (block->HasNormals()) flags.Add(R3_SURFEL_NODE_HAS_NORMALS_FLAG);
    if (block->HasAerial()) flags.Add(R3_SURFEL_NODE_HAS_AERIAL_FLAG);
    if (block->HasTerrestrial()) flags.Add(R3_SURFEL_NODE_HAS_TERRESTRIAL_FLAG);
  }

  // Mark flags uptodate
  flags.Add(R3_SURFEL_NODE_FLAGS_UPTODATE_FLAG);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
andb $0xf, 0xc0(%rdi)
xorl %r15d, %r15d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jge 0x3464c
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0x2aaee
testl %eax, %eax
je 0x3460e
orb $0x40, 0xc0(%rbx)
movq %r14, %rdi
callq 0x2abd2
testl %eax, %eax
je 0x34621
orb $-0x80, 0xc0(%rbx)
movq %r14, %rdi
callq 0x2ac1a
testl %eax, %eax
je 0x34634
orb $0x10, 0xc0(%rbx)
movq %r14, %rdi
callq 0x2ac3e
testl %eax, %eax
je 0x34647
orb $0x20, 0xc0(%rbx)
incq %r15
jmp 0x345ea
orb $0x4, 0xc0(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/./R3SurfelBlock.h
// Function: gaps::R3SurfelBlock::AverageRadius() const
inline RNLength R3SurfelBlock::
AverageRadius(void) const
{
  // Return average radius of surfels
  RNScalar res = Resolution();
  if (res == 0) return 0;
  return sqrt(1.0 / (res * RN_PI));
}

// Assembly:
pushq %rax
callq 0x2aa12
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3469a
jnp 0x346bf
leaq 0x9d0b7(%rip), %rax     # 0xd1758
mulsd (%rax), %xmm0
movsd 0x93a9b(%rip), %xmm1    # 0xc8148
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x346c5
sqrtsd %xmm1, %xmm1
movapd %xmm1, %xmm0
popq %rax
retq
movapd %xmm1, %xmm0
popq %rax
jmp 0x133d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNodes(gaps::R3SurfelObject*, double)
void R3SurfelNodeSet::
InsertNodes(R3SurfelObject *object, RNScalar max_resolution)
{
  // Insert cut at nodes rooted at object
  for (int i = 0; i < object->NNodes(); i++) {
    R3SurfelNode *node = object->Node(i);
    InsertNodes(node, max_resolution);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x6c(%rbx), %rax
cmpq %rax, %r15
jge 0x34859
movq 0x60(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq (%r14), %rax
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq *0x18(%rax)
incq %r15
jmp 0x34834
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNodes(gaps::R3SurfelTree*)
void R3SurfelNodeSet::
InsertNodes(R3SurfelTree *tree)
{
  // Insert all leaf nodes 
  for (int i = 0; i < tree->NNodes(); i++) {
    R3SurfelNode *node = tree->Node(i);
    if (node->NParts() > 0) continue;
    InsertNode(node);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jge 0x34b6f
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
cmpl $0x0, 0x3c(%rsi)
jg 0x34b6a
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
incq %r15
jmp 0x34b4a
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNode(gaps::R3SurfelNode*)
void R3SurfelNodeSet::
InsertNode(R3SurfelNode *node)
{
  // Insert node
  nodes.Insert(node);

  // Update complexity
  complexity += node->Complexity();

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x1784c
movq %r14, %rdi
callq 0x3365c
addsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%rbx)
leaq 0x20(%rbx), %r15
movq %r14, %rdi
callq 0x33720
movq %r15, %rdi
movq %rax, %rsi
callq 0x646fe
addq $0x58, %rbx
movq %r14, %rdi
callq 0x33770
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x177ca
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::RemoveNode(int)
void R3SurfelNodeSet::
RemoveNode(int k)
{
  // Update complexity
  complexity -= nodes[k]->Complexity();

  // Copy last node over node
  RNArrayEntry *entry = nodes.KthEntry(k);
  assert(entry);
  R3SurfelNode *tail = nodes.Tail();
  nodes.EntryContents(entry) = tail;
  nodes.RemoveTail();

  // Update bounding box
  // XXX

  // Update timestamp range
  // XXX
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %rax
movslq %esi, %r15
movq (%rax,%r15,8), %rdi
callq 0x3365c
movsd 0x18(%rbx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rbx)
movq 0x8(%rbx), %rax
movslq 0x14(%rbx), %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%r15,8)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x17820
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::Empty()
void R3SurfelNodeSet::
Empty(void)
{
  // Remove nodes
  nodes.Empty();

  // Update complexity
  complexity = 0;

  // Update bounding box
  bbox = R3null_box;

  // Update timestamp range
  timestamp_range.Reset(FLT_MAX,-FLT_MAX);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
xorl %esi, %esi
callq 0x9a9cc
andq $0x0, 0x18(%rbx)
leaq 0x20(%rbx), %rdi
leaq 0xf0d85(%rip), %rsi     # 0x1259e8
callq 0x177ee
movaps 0x936c1(%rip), %xmm0    # 0xc8330
movups %xmm0, 0x58(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::ReadBlocks()
void R3SurfelNodeSet::
ReadBlocks(void)
{
  // Read nodes in set
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->ReadBlocks();
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jge 0x34c9d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x33de2
incq %r14
jmp 0x34c80
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::ReleaseBlocks()
void R3SurfelNodeSet::
ReleaseBlocks(void)
{
  // Release nodes in set
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->ReleaseBlocks();
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jge 0x34ccd
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x33e40
incq %r14
jmp 0x34cb0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::AreBlocksResident() const
RNBoolean R3SurfelNodeSet::
AreBlocksResident(void) const
{
  // Return whether nodes are in memory
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    if (!node->AreBlocksResident()) return FALSE;
  }

  // All nodes are resident
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ecx, %ecx
movq %rcx, %r14
movslq 0x14(%rbx), %r15
cmpq %r15, %rcx
jge 0x34d01
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x33e9e
leaq 0x1(%r14), %rcx
testl %eax, %eax
jne 0x34ce0
xorl %eax, %eax
cmpq %r15, %r14
setge %al
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::Draw(gaps::RNFlags) const
void R3SurfelNodeSet::
Draw(RNFlags flags) const
{
  // Draw nodes
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->Draw(flags);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x14(%r14), %rax
cmpq %rax, %r15
jge 0x34d3d
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x48(%rax)
incq %r15
jmp 0x34d1e
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelNodeSet::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print nodes
  // Print all surfel nodes
  if (prefix) fprintf(fp, "%s", prefix);
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    fprintf(fp, "%d ", node->TreeIndex());
  }
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
jne 0x34d65
movq 0xef21e(%rip), %rax     # 0x123f80
movq (%rax), %rbx
testq %rdx, %rdx
je 0x34d75
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x135d0
leaq 0x93b27(%rip), %r12     # 0xc88a3
xorl %r13d, %r13d
movslq 0x14(%r15), %rax
cmpq %rax, %r13
jge 0x34da5
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rax
movl 0x20(%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x13780
incq %r13
jmp 0x34d7f
testq %r14, %r14
je 0x34db5
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135d0
pushq $0xa
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x13690
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::R3SurfelTree()
R3SurfelTree::
R3SurfelTree(void)
  : scene(NULL),
    database(NULL),
    nodes()
{
  // Create database
  database = new R3SurfelDatabase();
  database->tree = this;

  // Create root node
  R3SurfelNode *node = new R3SurfelNode("Root");
  InsertNode(node, NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xead3d(%rip), %rax     # 0x11fb18
movq %rax, (%rdi)
leaq 0x18(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq %rbx, %rdi
callq 0x9a7ae
movl $0xc0, %edi
callq 0x134f0
movq %rax, %r15
movq %rax, %rdi
callq 0x3be68
movq %r15, 0x10(%r14)
movq %r14, 0xb0(%r15)
movl $0xd0, %edi
callq 0x134f0
movq %rax, %r15
leaq 0x935df(%rip), %rsi     # 0xc8404
movq %rax, %rdi
callq 0x33394
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x34e72
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0xd0, %esi
jmp 0x34e52
movq %rax, %r14
movl $0xc0, %esi
movq %r15, %rdi
callq 0x13500
jmp 0x34e61
jmp 0x34e5e
movq %rax, %r14
movq %rbx, %rdi
callq 0x9a81c
movq %r14, %rdi
callq 0x138f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::InsertNode(gaps::R3SurfelNode*, gaps::R3SurfelNode*)
void R3SurfelTree::
InsertNode(R3SurfelNode *node, R3SurfelNode *parent)
{
  // Just checking
  assert(node);
  assert(node->tree == NULL);
  assert(node->tree_index == -1);

  // Insert node into tree
  node->tree = this;
  node->tree_index = nodes.NEntries();
  nodes.Insert(node);

  // Update parent
  node->parent = parent;
  if (parent) parent->parts.Insert(node);

  // Update nodes
  node->UpdateAfterInsert(this);

  // Mark scene as dirty
  if (scene) scene->SetDirty();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdi, 0x18(%rsi)
addq $0x18, %rdi
movl 0x24(%rbx), %eax
movl %eax, 0x20(%rsi)
callq 0x1784c
movq %r15, 0x28(%r14)
testq %r15, %r15
je 0x34eab
addq $0x30, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1784c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x341c2
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x34ec6
orb $0x1, 0x1e8(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::~R3SurfelTree()
R3SurfelTree::
~R3SurfelTree(void)
{
  // Delete nodes
  // If uncomment this, need to comment recursive delete in R3SurfelNode
  // while (NNodes() > 0) delete Node(NNodes()-1);
  if (RootNode()) delete RootNode();
  
  // Remove from scene
  if (scene) scene->tree = NULL;

  // Delete database
  if (database) delete database;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xeabfb(%rip), %rax     # 0x11fb18
movq %rax, (%rdi)
movq 0x18(%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x34f32
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x34f40
andq $0x0, 0x8(%rax)
movq 0x10(%rbx), %rdi
addq $0x18, %rbx
testq %rdi, %rdi
je 0x34f53
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x9a81c
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::FindNodeByName(char const*) const
R3SurfelNode *R3SurfelTree::
FindNodeByName(const char *node_name) const
{
  // Search for node
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    if (!node->Name()) continue;
    if (strcmp(node->Name(), node_name)) continue;
    return node;
  }

  // Not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x24(%rdi), %r15
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x34faf
movq (%r12,%r13,8), %r14
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x34faa
movq %rbx, %rsi
callq 0x13750
testl %eax, %eax
je 0x34fb2
incq %r13
jmp 0x34f89
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::RemoveNode(gaps::R3SurfelNode*)
void R3SurfelTree::
RemoveNode(R3SurfelNode *node)
{
  // Just checking
  assert(node);
  assert(node->tree == this);
  assert(node->tree_index >= 0);
  assert(nodes.Kth(node->tree_index) == node);

  // Update node
  node->UpdateBeforeRemove(this);

  // Update parent
  if (node->parent) node->parent->parts.Remove(node);

  // Update node
  node->parent = NULL;

  // Remove node from tree
  RNArrayEntry *entry = nodes.KthEntry(node->tree_index);
  R3SurfelNode *tail = nodes.Tail();
  tail->tree_index = node->tree_index;
  nodes.EntryContents(entry) = tail;
  nodes.RemoveTail();
  node->tree_index = -1;
  node->tree = NULL;

  // Mark scene as dirty
  if (scene) scene->SetDirty();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x34206
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x34fea
addq $0x30, %rdi
movq %r14, %rsi
callq 0x1782a
andq $0x0, 0x28(%r14)
leaq 0x18(%rbx), %rdi
movslq 0x20(%r14), %rax
movq 0x18(%rbx), %rcx
movslq 0x24(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rdx
movl %eax, 0x20(%rdx)
movq %rdx, (%rcx,%rax,8)
callq 0x17820
orl $-0x1, 0x20(%r14)
andq $0x0, 0x18(%r14)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3502a
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::CreateMultiresolutionBlocks(double, double)
int R3SurfelTree::
CreateMultiresolutionBlocks(RNScalar multiresolution_factor, RNScalar max_complexity)
{
  // Create multiresolution blocks recursively
  CreateMultiresolutionBlocks(RootNode(), multiresolution_factor, max_complexity);
  
  // Return success
  return 1;
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x18(%rdi), %rcx
movq (%rcx), %rsi
xorps %xmm2, %xmm2
callq *0x60(%rax)
pushq $0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::SplitNodes(gaps::R3SurfelNode*, int, int, double, double, double, double, int)
int R3SurfelTree::
SplitNodes(R3SurfelNode *start_node,
    int max_parts_per_node, int max_blocks_per_node, 
    RNScalar max_leaf_complexity, RNScalar max_block_complexity,
    RNLength max_leaf_extent, RNLength max_block_extent,
    int max_levels)
{
  // Initialize stack for depth first traversal from root node
  RNArray<R3SurfelNode *> stack;
  stack.Insert(start_node);
  int status = 0;

  // Split nodes into manageable sized chunks
  while (!stack.IsEmpty()) {
    // Pop node from stack
    R3SurfelNode *node = stack.Tail();
    stack.RemoveTail();

    // Split node
    status |= SplitNode(node, 
      max_parts_per_node, max_blocks_per_node, 
      max_leaf_complexity, max_block_complexity, 
      max_leaf_extent, max_block_extent, 
      max_levels);

    // Push parts onto stack
    for (int i = 0; i < node->NParts(); i++) {
      stack.Insert(node->Part(i));
    }
  }

  // Return whether any nodes were split
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, 0x4(%rsp)
movsd %xmm3, 0x30(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movl %ecx, (%rsp)
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x9a7ae
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1784c
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
movslq 0x14(%rsp), %rax
testq %rax, %rax
je 0x35fdf
movq 0x8(%rsp), %rcx
movq -0x8(%rcx,%rax,8), %rbx
movq %r13, %rdi
callq 0x17820
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl (%rsp), %ecx
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
movl 0x4(%rsp), %r8d
callq *0x10(%rax)
orl %eax, %r12d
xorl %ebp, %ebp
movslq 0x3c(%rbx), %rax
cmpq %rax, %rbp
jge 0x35f71
movq 0x30(%rbx), %rax
movq (%rax,%rbp,8), %rsi
movq %r13, %rdi
callq 0x1784c
incq %rbp
jmp 0x35fc1
leaq 0x8(%rsp), %rdi
callq 0x9a81c
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x35fff
jmp 0x35fff
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/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::SplitBlocks(gaps::R3SurfelNode*, gaps::R3SurfelPointSet&, gaps::RNArray<gaps::R3SurfelBlock*>*, gaps::RNArray<gaps::R3SurfelBlock*>*)
int R3SurfelTree::
SplitBlocks(R3SurfelNode *node, R3SurfelPointSet& pointset,
  RNArray<R3SurfelBlock *> *blocksA, RNArray<R3SurfelBlock *> *blocksB)
{
  // Just checking
  assert(node);
  assert(node->Tree() == this);
  assert(node->tree_index >= 0);
  assert(nodes.Kth(node->tree_index) == node);
  int status = 0;
  
  // Create array of blocks containing points in point set
  RNArray<R3SurfelBlock *> *pointset_blocks = pointset.Blocks();;
  if (!pointset_blocks) return 0;

  // Create constraint to include only marked points
  const R3SurfelMarkConstraint constraint(TRUE, FALSE);

  // Split blocks 
  for (int i = 0; i < pointset_blocks->NEntries(); i++) {
    R3SurfelBlock *block = pointset_blocks->Kth(i);
    if (block->Node() != node) continue;
    block->SetMarks(FALSE);
    pointset.SetMarks(TRUE);
    R3SurfelBlock *blockA, *blockB;
    if (SplitBlock(node, block, constraint, &blockA, &blockB)) status = 1;
    if (blocksA && blockA) blocksA->Insert(blockA);
    if (blocksB && blockB) blocksB->Insert(blockB);
  }

  // Delete array of blocks containing points in point set
  delete pointset_blocks;

  // Return whether any blocks were split
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, (%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, 0x10(%rsp)
movq %rdx, %rdi
callq 0x3118e
testq %rax, %rax
je 0x36664
movq %rax, %r15
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rsi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x2ea32
xorl %ebx, %ebx
movslq 0xc(%r15), %rax
cmpq %rax, %rbp
jge 0x36645
movq (%r15), %rax
movq (%rax,%rbp,8), %r14
cmpq %r13, 0xb8(%r14)
jne 0x3663d
movq %r14, %rdi
xorl %esi, %esi
callq 0x2b1b6
movq (%r12), %rax
movq %r12, %rdi
pushq $0x1
popq %rsi
callq *0xa8(%rax)
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
movq %r14, %rdx
leaq 0x28(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x18(%rsp), %r9
callq *0x50(%rax)
cmpq $0x0, 0x8(%rsp)
setne %cl
testl %eax, %eax
pushq $0x1
popq %rax
cmovnel %eax, %ebx
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
setne %al
testb %al, %cl
je 0x3661a
movq 0x8(%rsp), %rdi
callq 0x1784c
cmpq $0x0, (%rsp)
setne %al
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3663d
movq (%rsp), %rdi
callq 0x1784c
incq %rbp
jmp 0x36595
movq %r15, %rdi
callq 0x9a81c
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x13500
leaq 0x28(%rsp), %rdi
callq 0x2ec74
jmp 0x36666
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x36679
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2ec74
movq %rbx, %rdi
callq 0x138f0