LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::HasSurfels(int) const
RNBoolean R3SurfelNode::
HasSurfels(RNBoolean leaf_level) const
{
  // Check blocks
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    if (block->NSurfels() > 0) return TRUE;
  }

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

  // Did not find anything
  return FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movslq 0x4c(%rdi), %rax
testq %rax, %rax
setg %dl
jle 0x378ff
movq 0x40(%rdi), %rcx
movq (%rcx), %rsi
cmpl $0x0, 0x8(%rsi)
jg 0x378f6
leaq -0x1(%rax), %rsi
xorl %edx, %edx
cmpq %rdx, %rsi
je 0x378ff
movq 0x8(%rcx,%rdx,8), %r8
incq %rdx
cmpl $0x0, 0x8(%r8)
jle 0x378dc
cmpq %rax, %rdx
setb %dl
movl $0x1, %eax
testb %dl, %dl
jne 0x37954
testl %ebx, %ebx
je 0x37952
movslq 0x3c(%rdi), %r14
testq %r14, %r14
setg %bpl
jle 0x37952
movq 0x30(%rdi), %r15
movq (%r15), %rdi
movl %ebx, %esi
callq 0x378b0
testl %eax, %eax
jne 0x37948
leaq -0x1(%r14), %r13
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x37952
movq 0x8(%r15,%r12,8), %rdi
movl %ebx, %esi
callq 0x378b0
incq %r12
testl %eax, %eax
je 0x37929
cmpq %r14, %r12
setb %bpl
movl $0x1, %eax
testb %bpl, %bpl
jne 0x37954
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::HasActive() const
RNBoolean R3SurfelNode::
HasActive(void) const
{
  // Return whether node has active surfels 
  if (!flags[R3_SURFEL_NODE_FLAGS_UPTODATE_FLAG])
    ((R3SurfelNode *) this)->UpdateFlags();
  return flags[R3_SURFEL_NODE_HAS_ACTIVE_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0xc0(%rdi)
jne 0x3797d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl 0xc0(%rbx), %eax
shrl $0x6, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::HasNormals() const
RNBoolean R3SurfelNode::
HasNormals(void) const
{
  // Return whether node has surfels with normals
  if (!flags[R3_SURFEL_NODE_FLAGS_UPTODATE_FLAG])
    ((R3SurfelNode *) this)->UpdateFlags();
  return flags[R3_SURFEL_NODE_HAS_NORMALS_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0xc0(%rdi)
jne 0x379a5
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl 0xc0(%rbx), %eax
shrl $0x7, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::HasAerial() const
RNBoolean R3SurfelNode::
HasAerial(void) const
{
  // Return whether node has surfels collected with aerial scanner
  if (!flags[R3_SURFEL_NODE_FLAGS_UPTODATE_FLAG])
    ((R3SurfelNode *) this)->UpdateFlags();
  return flags[R3_SURFEL_NODE_HAS_AERIAL_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0xc0(%rdi)
jne 0x379cd
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl 0xc0(%rbx), %eax
shrl $0x4, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::HasTerrestrial() const
RNBoolean R3SurfelNode::
HasTerrestrial(void) const
{
  // Return whether node has surfels collected with terrestrial scanner
  if (!flags[R3_SURFEL_NODE_FLAGS_UPTODATE_FLAG]) 
    ((R3SurfelNode *) this)->UpdateFlags();
  return flags[R3_SURFEL_NODE_HAS_TERRESTRIAL_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0xc0(%rdi)
jne 0x379f5
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl 0xc0(%rbx), %eax
shrl $0x5, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::Object(int, int) const
R3SurfelObject *R3SurfelNode::
Object(RNBoolean search_ancestors, RNBoolean search_descendants) const
{
  // Return object, if there is one associated with this node
  if (object) return object;

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

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

  // Object not found
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x37a3c
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %ebp
movq %rdi, %rbx
testl %edx, %edx
je 0x37a9e
movslq 0x3c(%rbx), %r15
testq %r15, %r15
jle 0x37aa0
movq 0x30(%rbx), %r12
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movq (%r12,%r13,8), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x37a16
testq %rax, %rax
je 0x37a94
movsd 0x98(%rax), %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm1, %xmm0
cmovaq %rax, %r14
maxsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
incq %r13
cmpq %r13, %r15
jne 0x37a61
jmp 0x37aa3
jmp 0x37aa8
xorl %r14d, %r14d
testq %r14, %r14
jne 0x37a2a
testl %ebp, %ebp
je 0x37ae3
movq %rbx, %rax
testq %rbx, %rbx
je 0x37ad4
movq 0x8(%rax), %rdx
movq %rax, %rbx
movq %rdx, %rcx
testq %rdx, %rdx
jne 0x37aca
movq 0x28(%rax), %rbx
movq %r14, %rcx
movq %rcx, %r14
testq %rdx, %rdx
je 0x37aac
jmp 0x37ad7
movq %r14, %rcx
movq %rcx, %r14
testq %rax, %rax
jne 0x37a2a
xorl %r14d, %r14d
jmp 0x37a2a
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::Scan(int) const
R3SurfelScan *R3SurfelNode::
Scan(RNBoolean search_ancestors) const
{
  // Check if should search ancestors
  if (!search_ancestors) return scan;

  // Search ancestors for scan
  const R3SurfelNode *node = this;
  while (node) {
    R3SurfelScan *scan = node->Scan(FALSE);
    if (scan) return scan;
    node = node->Parent();
  }

  // Scan not found
  return NULL;
}

// Assembly:
testl %esi, %esi
je 0x37b0d
testq %rdi, %rdi
je 0x37b12
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x37b03
movq %rcx, %rax
jmp 0x37b07
movq 0x28(%rdi), %rdi
testq %rcx, %rcx
je 0x37af0
retq
movq 0x10(%rdi), %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37bc4
cmpl $0x0, 0x3c(%r14)
jle 0x37bc4
cmpl $0x0, 0x3c(%r14)
jle 0x37bf0
movl %edx, %ebp
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movsd (%rsp), %xmm0
callq 0x37b76
incq %r15
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jl 0x37b9f
jmp 0x37bf0
cmpl $0x0, 0x4c(%r14)
jle 0x37bf0
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq *0x38(%rax)
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x37bce
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
testq %rdi, %rdi
je 0x37c17
callq 0x135e0
testq %r14, %r14
je 0x37c26
movq %r14, %rdi
callq 0xadc0f
jmp 0x37c28
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x37c48
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x37c48
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r12
cmpq %rsi, %r12
je 0x37d41
movq %rsi, %r14
movq %rdi, %rbx
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movabsq $0x47efffffe0000000, %rcx # imm = 0x47EFFFFFE0000000
testq %r12, %r12
je 0x37cbc
movsd 0xa64d4(%rip), %xmm0    # 0xde168
movq %r12, %rdx
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x37ca4
jnp 0x37cbc
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
testq %rdx, %rdx
jne 0x37c97
testq %r14, %r14
je 0x37cf1
movsd 0xa649f(%rip), %xmm0    # 0xde168
movq %r14, %rdx
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x37cd9
jnp 0x37cf1
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
testq %rdx, %rdx
jne 0x37ccc
leaq 0x30(%r12), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xaafac
subq 0x30(%r12), %rax
shrq $0x3, %rax
movq %r15, %rdi
movl %eax, %esi
callq 0xab13e
leaq 0x30(%r14), %rdi
movl 0x3c(%r14), %edx
movq %rbx, %rsi
callq 0xaafca
movq %r14, 0x28(%rbx)
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x37d41
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x37d41
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x4c(%rbx), %edx
callq 0xaafca
movsd 0xa63fc(%rip), %xmm0    # 0xde168
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movabsq $0x47efffffe0000000, %rcx # imm = 0x47EFFFFFE0000000
movq %rbx, %rdx
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x37d90
jnp 0x37da8
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
testq %rdx, %rdx
jne 0x37d83
movq %rax, 0x58(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x302d8
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x37dcb
movq %rbx, %rsi
movq %r14, %rdx
callq 0x182dc
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x37de4
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x37de4
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x37e0b
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1834e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x302e0
leaq 0x40(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xaafac
subq 0x40(%rbx), %rax
shrq $0x3, %rax
movq %r15, %rdi
movl %eax, %esi
callq 0xab13e
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x58(%rbx)
movsd 0xa631b(%rip), %xmm0    # 0xde168
movabsq $0x47efffffe0000000, %rcx # imm = 0x47EFFFFFE0000000
movq %rbx, %rdx
movsd 0x50(%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x37e67
jnp 0x37e7f
movq %rax, 0x50(%rdx)
movq %rcx, 0x68(%rdx)
movq %rcx, 0xa8(%rdx)
movq 0x28(%rdx), %rdx
testq %rdx, %rdx
jne 0x37e5a
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x37e98
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x37e98
orb $0x1, 0x1e8(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpl $0x0, 0x4c(%rdi)
jle 0x37ece
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq %r14, %rsi
callq 0x2dec6
incq %r15
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jl 0x37eb2
movq (%r14), %rax
movq %r14, %rdi
callq *0xc0(%rax)
movsd 0x58(%rbx), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jbe 0x37f21
leaq 0xfcd18(%rip), %rax     # 0x134c08
movsd (%rax), %xmm2
movsd 0xa626c(%rip), %xmm3    # 0xde168
addsd %xmm0, %xmm3
ucomisd %xmm2, %xmm3
ja 0x37f14
xorpd 0xa6492(%rip), %xmm2    # 0xde3a0
ucomisd %xmm3, %xmm2
jbe 0x37f21
mulsd %xmm0, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x58(%rbx)
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rbx, %rcx
movq %rax, 0x68(%rcx)
movq %rax, 0xa8(%rcx)
movq 0x28(%rcx), %rcx
testq %rcx, %rcx
jne 0x37f2e
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x37f53
movq %rbx, %rsi
callq 0x183c4
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x37f6c
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x37f6c
orb $0x1, 0x1e8(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x4c(%rdi)
jle 0x37fa5
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x2de7e
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x37f85
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x0, 0x4c(%rdi)
jle 0x38004
xorl %r12d, %r12d
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %r15
movq 0x98(%r15), %rdi
testq %rdi, %rdi
je 0x37ff8
cmpl $0x0, 0xb4(%r15)
jne 0x37ff1
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %r15, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x37ff8
incl 0xb4(%r15)
incq %r12
movslq 0x4c(%r14), %rax
cmpq %rax, %r12
jl 0x37fbc
testl %ebx, %ebx
je 0x3802d
cmpl $0x0, 0x3c(%r14)
jle 0x3802d
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x37fa6
incq %r15
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jl 0x38012
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x0, 0x4c(%rdi)
jle 0x380db
xorl %r13d, %r13d
movq 0x40(%r14), %rax
movq (%rax,%r13,8), %r15
movq 0x98(%r15), %r12
testq %r12, %r12
je 0x380cb
cmpl $0x1, 0xb4(%r15)
jne 0x38091
movq (%r12), %rax
movq 0x8(%r12), %rdx
movl 0x28(%r12), %ecx
movq %r12, %rdi
movq %r15, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x380cb
decl 0xb4(%r15)
jne 0x380cb
testb $0x2, 0x89(%r15)
je 0x380cb
movq (%r12), %rax
movq %r12, %rdi
movq %r15, %rsi
callq *0x18(%rax)
testq %r15, %r15
je 0x380cb
movq %r15, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %r15, %rdi
callq 0x134f0
incq %r13
movslq 0x4c(%r14), %rax
cmpq %rax, %r13
jl 0x38055
testl %ebx, %ebx
je 0x38104
cmpl $0x0, 0x3c(%r14)
jle 0x38104
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x3803a
incq %r15
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jl 0x380e9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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), %rax
testq %rax, %rax
setle %dl
jle 0x38148
movq 0x40(%rdi), %rcx
movq (%rcx), %rsi
cmpq $0x0, (%rsi)
je 0x38148
movl $0x1, %esi
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x38142
movq (%rcx,%rdx,8), %rdi
leaq 0x1(%rdx), %rsi
cmpq $0x0, (%rdi)
jne 0x3812c
cmpq %rax, %rdx
setae %dl
movzbl %dl, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x38170
movq 0xfbe03(%rip), %rax     # 0x133f70
movq (%rax), %rbx
testq %r12, %r12
je 0x38180
movq %r12, %rdi
movq %rbx, %rsi
callq 0x135b0
movl 0x20(%r15), %edx
movq 0xb8(%r15), %rax
testq %rax, %rax
leaq 0xa61b1(%rip), %rcx     # 0xde346
cmovneq %rax, %rcx
leaq 0xa61a0(%rip), %rsi     # 0xde340
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13740
testq %r14, %r14
je 0x381ba
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x13670
testq %r12, %r12
je 0x381d7
movq %r12, %rdi
movq %rbx, %rsi
callq 0x135b0
cmpl $0x0, 0x4c(%r15)
jle 0x3820f
leaq 0xa66be(%rip), %r12     # 0xde8a3
xorl %r13d, %r13d
movq 0x40(%r15), %rax
movq (%rax,%r13,8), %rax
movl 0xa0(%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x13740
incq %r13
movslq 0x4c(%r15), %rax
cmpq %rax, %r13
jl 0x381e8
testq %r14, %r14
je 0x3821f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x13670
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x4c(%rdi)
jle 0x38270
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x2e55a
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x3824a
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpl $0x0, 0x3c(%rdi)
jle 0x382bc
cmpl $0x0, 0x3c(%r14)
jle 0x38306
movl $0x1, %ebp
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x58(%rax)
andl %eax, %ebp
incq %r15
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jl 0x38294
movl $0x1, %eax
testl %ebp, %ebp
jne 0x3830f
movslq 0x4c(%r14), %rax
testq %rax, %rax
setle %cl
jle 0x382f6
movq 0x40(%r14), %rcx
movq (%rcx), %rdx
cmpq $0x0, (%rdx)
je 0x3830d
movl $0x1, %esi
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x382f0
movq (%rcx,%rdx,8), %rdi
leaq 0x1(%rdx), %rsi
cmpq $0x0, (%rdi)
jne 0x382da
cmpq %rax, %rdx
setae %cl
testb %cl, %cl
je 0x3830d
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x48(%rax)
movl $0x1, %eax
jmp 0x3830f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateAfterInsert(gaps::R3SurfelTree*)
void R3SurfelNode::
UpdateAfterInsert(R3SurfelTree *tree)
{
  // Invalidate properties
  R3SurfelNode *ancestor = parent;
  while (ancestor) {
    if (ancestor->complexity == -1) break;
    ancestor->complexity = -1;
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    // while (ancestor->NBlocks()) { 
    //   R3SurfelBlock *block = ancestor->Block(0);
    //   ancestor->RemoveBlock(block);
    //   database->RemoveBlock(block);
    //   delete block;
    // }
    ancestor = ancestor->parent;
  }
}

// Assembly:
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x384a0
movsd 0xa5d01(%rip), %xmm0    # 0xde168
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movabsq $0x47efffffe0000000, %rdx # imm = 0x47EFFFFFE0000000
movsd 0x50(%rax), %xmm1
ucomisd %xmm0, %xmm1
jne 0x38488
jnp 0x384a0
movq %rcx, 0x50(%rax)
movq %rdx, 0x68(%rax)
movq %rdx, 0xa8(%rax)
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x3847b
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateBeforeRemove(gaps::R3SurfelTree*)
void R3SurfelNode::
UpdateBeforeRemove(R3SurfelTree *tree)
{
  // Invalidate properties
  R3SurfelNode *ancestor = parent;
  while (ancestor) {
    if (ancestor->complexity == -1) break;
    ancestor->complexity = -1;
    ancestor->bbox[0][0] = FLT_MAX;
    ancestor->timestamp_range[0] = FLT_MAX;
    // while (ancestor->NBlocks()) { 
    //   R3SurfelBlock *block = ancestor->Block(0);
    //   ancestor->RemoveBlock(block);
    //   database->RemoveBlock(block);
    //   delete block;
    // }
    ancestor = ancestor->parent;
  }
}

// Assembly:
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x384ec
movsd 0xa5cb5(%rip), %xmm0    # 0xde168
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movabsq $0x47efffffe0000000, %rdx # imm = 0x47EFFFFFE0000000
movsd 0x50(%rax), %xmm1
ucomisd %xmm0, %xmm1
jne 0x384d4
jnp 0x384ec
movq %rcx, 0x50(%rax)
movq %rdx, 0x68(%rax)
movq %rdx, 0xa8(%rax)
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x384c7
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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)
xorpd %xmm0, %xmm0
ucomisd 0x50(%rbx), %xmm0
jbe 0x3851a
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x80(%rax)
xorpd %xmm0, %xmm0
movsd 0x50(%rbx), %xmm1
addsd %xmm0, %xmm1
ucomisd 0x58(%rbx), %xmm0
jbe 0x38542
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm1, 0x8(%rsp)
callq *0x88(%rax)
movsd 0x8(%rsp), %xmm1
addsd 0x58(%rbx), %xmm1
movsd 0x68(%rbx), %xmm0
ucomisd 0xa5c1c(%rip), %xmm0    # 0xde170
jne 0x3856d
jp 0x3856d
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm1, 0x8(%rsp)
callq *0x68(%rax)
movsd 0x8(%rsp), %xmm1
addsd 0x68(%rbx), %xmm1
movsd 0x98(%rbx), %xmm0
ucomisd 0xa5bee(%rip), %xmm0    # 0xde170
jne 0x3859b
jp 0x3859b
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm1, 0x8(%rsp)
callq *0x70(%rax)
movsd 0x8(%rsp), %xmm1
addsd 0x98(%rbx), %xmm1
movsd 0xa8(%rbx), %xmm0
ucomisd 0xa5bbd(%rip), %xmm0    # 0xde170
jne 0x385cc
jp 0x385cc
movq (%rbx), %rax
movq %rbx, %rdi
movsd %xmm1, 0x8(%rsp)
callq *0x78(%rax)
movsd 0x8(%rsp), %xmm1
addsd 0xa8(%rbx), %xmm1
ucomisd 0xa5d4c(%rip), %xmm1    # 0xde328
jne 0x385f1
jp 0x385f1
leaq 0xa5d61(%rip), %rdi     # 0xde348
addq $0x10, %rsp
popq %rbx
jmp 0x137c0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa5b63(%rip), %xmm0    # 0xde170
jne 0x386bb
jp 0x386bb
movq %rdi, %rbx
leaq 0x60(%rdi), %r14
addq $0x68, %rdi
leaq 0xfd39d(%rip), %r15     # 0x1359c8
leaq 0x8(%r15), %rsi
callq 0x850ec
leaq 0x80(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x850ec
cmpl $0x0, 0x4c(%rbx)
jle 0x38674
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x2cfc6
movq %r14, %rdi
movq %rax, %rsi
callq 0x6ea70
incq %r15
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jl 0x38650
cmpl $0x0, 0x3c(%rbx)
jle 0x386bb
xorl %r12d, %r12d
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x68(%r15), %xmm0
ucomisd 0xa5add(%rip), %xmm0    # 0xde170
jne 0x386a0
jp 0x386a0
movq (%r15), %rax
movq %r15, %rdi
callq *0x68(%rax)
addq $0x60, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x6ea70
incq %r12
movslq 0x3c(%rbx), %rax
cmpq %rax, %r12
jl 0x3867d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa5a8f(%rip), %xmm0    # 0xde170
jne 0x38753
jp 0x38753
movq %rdi, %rbx
movapd 0xa5c40(%rip), %xmm0    # 0xde330
movupd %xmm0, 0x98(%rdi)
cmpl $0x0, 0x4c(%rdi)
jle 0x38753
xorl %r15d, %r15d
movq %rsp, %r14
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x2d144
movsd (%rsp), %xmm0
movsd 0x98(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3872f
movsd %xmm0, 0x98(%rbx)
movsd 0x8(%rsp), %xmm0
ucomisd 0xa0(%rbx), %xmm0
jbe 0x38747
movsd %xmm0, 0xa0(%rbx)
incq %r15
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jl 0x38704
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movsd 0xa8(%rdi), %xmm0
ucomisd 0xa59fd(%rip), %xmm0    # 0xde170
jne 0x3885a
jp 0x3885a
movq %rdi, %rbx
movapd 0xa5ba6(%rip), %xmm0    # 0xde330
movupd %xmm0, 0xa8(%rdi)
cmpl $0x0, 0x4c(%rdi)
jle 0x387e5
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2d262
movsd (%rax), %xmm0
movsd 0xa8(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x387c2
movsd %xmm0, 0xa8(%rbx)
movsd 0x8(%rax), %xmm0
ucomisd 0xb0(%rbx), %xmm0
jbe 0x387d9
movsd %xmm0, 0xb0(%rbx)
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x3879b
cmpl $0x0, 0x3c(%rbx)
jle 0x3885a
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %r14
movsd 0xa8(%r14), %xmm0
ucomisd 0xa5969(%rip), %xmm0    # 0xde170
jne 0x38814
jp 0x38814
movq (%r14), %rax
movq %r14, %rdi
callq *0x78(%rax)
movsd 0xa8(%r14), %xmm0
movsd 0xa8(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x38833
movsd %xmm0, 0xa8(%rbx)
movsd 0xb0(%r14), %xmm0
ucomisd 0xb0(%rbx), %xmm0
jbe 0x3884e
movsd %xmm0, 0xb0(%rbx)
incq %r15
movslq 0x3c(%rbx), %rax
cmpq %rax, %r15
jl 0x387ee
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0x388a8
movq $0x0, 0x50(%rdi)
movslq 0x4c(%rdi), %rax
testq %rax, %rax
jle 0x388a8
movsd 0x50(%rdi), %xmm0
movq 0x40(%rdi), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
xorps %xmm1, %xmm1
cvtsi2sdl 0x8(%rsi), %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x3888b
movsd %xmm0, 0x50(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jae 0x38931
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, 0x58(%rdi)
ucomisd 0x50(%rdi), %xmm0
jbe 0x388db
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x80(%rax)
movsd 0x50(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3892a
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x58(%rbx)
cmpl $0x0, 0x4c(%rbx)
jle 0x3892a
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2d4ca
movsd 0x58(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3891e
movsd %xmm0, 0x58(%rbx)
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x38901
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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)
cmpl $0x0, 0x4c(%rdi)
jle 0x389aa
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0x2d5ee
testl %eax, %eax
je 0x38965
orb $0x40, 0xc0(%rbx)
movq %r14, %rdi
callq 0x2d730
testl %eax, %eax
je 0x38978
orb $-0x80, 0xc0(%rbx)
movq %r14, %rdi
callq 0x2d778
testl %eax, %eax
je 0x3898b
orb $0x10, 0xc0(%rbx)
movq %r14, %rdi
callq 0x2d79c
testl %eax, %eax
je 0x3899e
orb $0x20, 0xc0(%rbx)
incq %r15
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jl 0x3894a
orb $0x4, 0xc0(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x6c(%rsi)
jle 0x38b9c
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movsd %xmm0, 0x8(%rsp)
movq 0x60(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq (%r14), %rax
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq *0x18(%rax)
incq %r15
movslq 0x6c(%rbx), %rax
cmpq %rax, %r15
jl 0x38b70
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x24(%rsi)
jle 0x38f0c
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
cmpl $0x0, 0x3c(%rsi)
jg 0x38efb
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x38ee4
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x14(%rbx), %edx
callq 0xaafca
movq %r14, %rdi
callq 0x3770e
addsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%rbx)
leaq 0x20(%rbx), %r15
movq %r14, %rdi
callq 0x37838
movq %r15, %rdi
movq %rax, %rsi
callq 0x6ea70
movq %r14, %rdi
callq 0x37888
movsd (%rax), %xmm0
movsd 0x58(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x38f6a
movsd %xmm0, 0x58(%rbx)
movsd 0x8(%rax), %xmm0
ucomisd 0x60(%rbx), %xmm0
jbe 0x38f7b
movsd %xmm0, 0x60(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3770e
movsd 0x18(%rbx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rbx)
movq 0x8(%rbx), %rax
movslq 0x14(%rbx), %rcx
movq -0x8(%rax,%rcx,8), %rdx
movq %rdx, (%rax,%r15,8)
leal -0x1(%rcx), %esi
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xab13e
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rdi
xorl %esi, %esi
callq 0xab174
movq $0x0, 0x18(%rbx)
leaq 0x28(%rbx), %rdi
leaq 0xfc9a9(%rip), %r14     # 0x1359c8
leaq 0x8(%r14), %rsi
callq 0x850ec
leaq 0x40(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0x850ec
movaps 0xa52f1(%rip), %xmm0    # 0xde330
movups %xmm0, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x14(%rdi)
jle 0x3907e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x37fa6
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x3905c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x14(%rdi)
jle 0x390b2
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x3803a
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x39090
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
setle %bpl
jle 0x390fc
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %rdi
callq 0x3810e
testl %eax, %eax
je 0x390fc
movl $0x1, %r14d
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
setge %bpl
jge 0x390fc
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3810e
incq %r14
testl %eax, %eax
jne 0x390db
movzbl %bpl, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x14(%rdi)
jle 0x3913c
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x48(%rax)
incq %r15
movslq 0x14(%r14), %rax
cmpq %rax, %r15
jl 0x3911a
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3915f
movq 0xfae14(%rip), %rax     # 0x133f70
movq (%rax), %rbx
testq %rdx, %rdx
je 0x3916f
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x135b0
cmpl $0x0, 0x14(%r15)
jle 0x391a4
leaq 0xa5726(%rip), %r12     # 0xde8a3
xorl %r13d, %r13d
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rax
movl 0x20(%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x13740
incq %r13
movslq 0x14(%r15), %rax
cmpq %rax, %r13
jl 0x39180
testq %r14, %r14
je 0x391b4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x13670
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf692d(%rip), %rax     # 0x12fb08
movq %rax, (%rdi)
leaq 0x18(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq %rbx, %rdi
callq 0xaaf34
movl $0xc0, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
callq 0x411dc
movq %r15, 0x10(%r14)
movq %r14, 0xb0(%r15)
movl $0xd0, %edi
callq 0x134e0
movq %rax, %r15
leaq 0xa51df(%rip), %rsi     # 0xde404
movq %rax, %rdi
callq 0x37448
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x39272
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0xd0, %esi
jmp 0x39252
movq %rax, %r14
movl $0xc0, %esi
movq %r15, %rdi
callq 0x134f0
jmp 0x39261
jmp 0x3925e
movq %rax, %r14
movq %rbx, %rdi
callq 0xaaf9e
movq %r14, %rdi
callq 0x138b0
nop