LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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), %edx
movl %edx, 0x20(%rsi)
callq 0xaafca
movq %r15, 0x28(%r14)
testq %r15, %r15
je 0x392af
movl 0x3c(%r15), %edx
addq $0x30, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xaafca
movq %r14, %rdi
movq %rbx, %rsi
callq 0x38456
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x392ca
orb $0x1, 0x1e8(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf67e7(%rip), %rax     # 0x12fb08
movq %rax, (%rdi)
movq 0x18(%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x39336
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x39347
movq $0x0, 0x8(%rax)
movq 0x10(%rbx), %rdi
addq $0x18, %rbx
testq %rdi, %rdi
je 0x3935a
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0xaaf9e
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x24(%rdi), %r15
testq %r15, %r15
jle 0x393cb
movq %rsi, %rbx
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %rbp
movq 0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x393bd
movq %rbx, %rsi
callq 0x13710
testl %eax, %eax
setne %al
cmoveq %rbp, %r14
jmp 0x393bf
movb $0x1, %al
testb %al, %al
je 0x393ce
incq %r13
cmpq %r13, %r15
jne 0x3939a
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x384a2
movq 0x28(%r14), %r12
testq %r12, %r12
je 0x39425
leaq 0x30(%r12), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xaafac
subq 0x30(%r12), %rax
shrq $0x3, %rax
movq %r15, %rdi
movl %eax, %esi
callq 0xab13e
xorl %r15d, %r15d
movq %r15, 0x28(%r14)
leaq 0x18(%rbx), %rdi
movslq 0x20(%r14), %rax
movq 0x18(%rbx), %rcx
movslq 0x24(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x20(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xab13e
movl $0xffffffff, 0x20(%r14) # imm = 0xFFFFFFFF
movq %r15, 0x18(%r14)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3946c
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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)
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movl %r8d, 0x24(%rsp)
movsd %xmm3, 0x40(%rsp)
movsd %xmm2, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movl %ecx, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xaaf34
movl 0xc(%r12), %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xaafca
movl 0x14(%rsp), %eax
xorl %r12d, %r12d
testl %eax, %eax
je 0x3a64e
leaq 0x8(%rsp), %r13
movq 0x8(%rsp), %rcx
movslq %eax, %rsi
movq -0x8(%rcx,%rsi,8), %rbx
decl %esi
movq %r13, %rdi
callq 0xab13e
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
movl 0x1c(%rsp), %edx
movl 0x20(%rsp), %ecx
movsd 0x28(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x40(%rsp), %xmm3
movl 0x24(%rsp), %r8d
callq *0x10(%rax)
movl %eax, %ebp
cmpl $0x0, 0x3c(%rbx)
jle 0x3a643
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rsi
movl 0x14(%rsp), %edx
movq %r13, %rdi
callq 0xaafca
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3a623
orl %ebp, %r12d
movl 0x14(%rsp), %eax
testl %eax, %eax
jne 0x3a5d0
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a66e
jmp 0x3a66e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xaaf9e
movq %rbx, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x34bc2
testq %rax, %rax
je 0x3ad6a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
xorl %ebp, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x31ef2
cmpl $0x0, 0xc(%rbx)
jle 0x3ad49
xorl %r14d, %r14d
xorl %ebp, %ebp
movq (%rbx), %rax
movq (%rax,%r14,8), %r15
cmpq %r13, 0xb8(%r15)
jne 0x3ad39
movq %r15, %rdi
xorl %esi, %esi
callq 0x2de7e
movq (%r12), %rax
movq %r12, %rdi
movl $0x1, %esi
callq *0xa8(%rax)
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
movq %r15, %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
movl $0x1, %eax
cmovnel %eax, %ebp
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
setne %al
testb %al, %cl
je 0x3ad13
movq 0x8(%rsp), %rdi
movl 0xc(%rdi), %edx
callq 0xaafca
cmpq $0x0, (%rsp)
setne %al
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3ad39
movq (%rsp), %rdi
movl 0xc(%rdi), %edx
callq 0xaafca
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x3ac94
movq %rbx, %rdi
callq 0xaaf9e
movl $0x10, %esi
movq %rbx, %rdi
callq 0x134f0
leaq 0x28(%rsp), %rdi
callq 0x321ae
jmp 0x3ad6c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3ad7f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x321ae
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::SplitBlocks(gaps::R3SurfelNode*, gaps::R3SurfelConstraint const&, gaps::RNArray<gaps::R3SurfelBlock*>*, gaps::RNArray<gaps::R3SurfelBlock*>*)
int R3SurfelTree::
SplitBlocks(R3SurfelNode *node, const R3SurfelConstraint& constraint, 
  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;

  // Make a temporary array of blocks
  RNArray<R3SurfelBlock *> splittable_blocks;
  for (int i = 0; i < node->NBlocks(); i++) {
    R3SurfelBlock *block = node->Block(i);
    splittable_blocks.Insert(block);
  }

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movq %rsp, %rdi
callq 0xaaf34
cmpl $0x0, 0x4c(%r12)
jle 0x3b0df
xorl %r15d, %r15d
movq %rsp, %rbp
movq 0x40(%r12), %rax
movq (%rax,%r15,8), %rsi
movl 0xc(%rsp), %edx
movq %rbp, %rdi
callq 0xaafca
incq %r15
movslq 0x4c(%r12), %rax
cmpq %rax, %r15
jl 0x3b0bd
cmpl $0x0, 0xc(%rsp)
jle 0x3b170
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%rsp), %rax
movq (%rax,%r15,8), %rdx
movq (%r13), %rax
movq %r13, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x18(%rsp), %r9
callq *0x50(%rax)
testq %r14, %r14
setne %cl
testl %eax, %eax
movl $0x1, %eax
cmovnel %eax, %ebp
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
setne %al
testb %al, %cl
je 0x3b13e
movl 0xc(%r14), %edx
movq %r14, %rdi
callq 0xaafca
testq %rbx, %rbx
setne %al
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3b161
movl 0xc(%rbx), %edx
movq %rbx, %rdi
callq 0xaafca
incq %r15
movslq 0xc(%rsp), %rax
cmpq %rax, %r15
jl 0x3b0ef
jmp 0x3b172
xorl %ebp, %ebp
movq %rsp, %rdi
callq 0xaaf9e
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b18d
movq %rax, %rbx
movq %rsp, %rdi
callq 0xaaf9e
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelTree::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print tree header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%s", "Tree");
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

  // Add indentation to prefix
  char indented_prefix[1024];
  sprintf(indented_prefix, "%s  ", prefix);

  // Print all nodes
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->Print(fp, indented_prefix, suffix);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
testq %rsi, %rsi
jne 0x3b405
movq 0xf8b6e(%rip), %rax     # 0x133f70
movq (%rax), %r15
testq %r12, %r12
je 0x3b415
movq %r12, %rdi
movq %r15, %rsi
callq 0x135b0
leaq 0xa428b(%rip), %rdi     # 0xdf6a7
movq %r15, %rsi
callq 0x135b0
testq %rbx, %rbx
je 0x3b434
movq %rbx, %rdi
movq %r15, %rsi
callq 0x135b0
movl $0xa, %edi
movq %r15, %rsi
callq 0x13670
leaq 0xa2fd7(%rip), %rsi     # 0xde41f
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x130e0
cmpl $0x0, 0x24(%r14)
jle 0x3b485
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq *0x60(%rax)
incq %r13
movslq 0x24(%r14), %rax
cmpq %rax, %r13
jl 0x3b462
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::~R3SurfelScan()
R3SurfelScan::
~R3SurfelScan(void)
{
  // Remove node
  if (node) SetNode(NULL);

  // Remove image
  if (image) SetImage(NULL);

  // Remove scan from scene
  if (scene) scene->RemoveScan(this);

  // Delete name
  if (name) free(name);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xf4569(%rip), %rax     # 0x12fba8
movq %rax, (%rdi)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x3b665
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movq %rcx, 0x18(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3b665
orb $0x1, 0x1e8(%rax)
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x3b688
xorl %ecx, %ecx
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3b688
orb $0x1, 0x1e8(%rax)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3b69d
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x98(%rax)
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x3b6af
popq %rbx
jmp 0x135e0
popq %rbx
retq
movq %rax, %rdi
callq 0x1848f
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::operator=(gaps::R3SurfelScan const&)
R3SurfelScan& R3SurfelScan::
operator=(const R3SurfelScan& scan)
{
  // Copy properties
  this->pose = scan.pose;
  this->timestamp = scan.timestamp;
  this->image_width = scan.image_width; 
  this->image_height = scan.image_height;
  this->image_center = scan.image_center;
  this->xfocal = scan.xfocal;
  this->yfocal = scan.yfocal;
  this->name = (scan.name) ? RNStrdup(scan.name) : NULL;
  this->flags = 0;

  // Return this
  return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x28, %rsi
addq $0x28, %rdi
callq 0x850ec
leaq 0x40(%rbx), %rdi
leaq 0x40(%r14), %rsi
callq 0x85fc2
leaq 0x58(%r14), %rsi
leaq 0x58(%rbx), %rdi
callq 0x85fc2
leaq 0x70(%r14), %rsi
leaq 0x70(%rbx), %rdi
callq 0x85fc2
movsd 0x88(%r14), %xmm0
movsd %xmm0, 0x88(%rbx)
movq 0x90(%r14), %rax
movq %rax, 0x90(%rbx)
movl $0x98, %edi
leaq (%r14,%rdi), %rsi
addq %rbx, %rdi
callq 0xa38ae
movups 0xa8(%r14), %xmm0
movups %xmm0, 0xa8(%rbx)
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x3b776
callq 0xadc0f
jmp 0x3b778
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
movq $0x0, 0xc0(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::SetName(char const*)
void R3SurfelScan::
SetName(const char *name)
{
  // Delete previous name
  if (this->name) free(this->name);
  this->name = (name) ? RNStrdup(name) : NULL;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0xb8(%rdi), %rdi
testq %rdi, %rdi
je 0x3b85f
callq 0x135e0
testq %r14, %r14
je 0x3b86e
movq %r14, %rdi
callq 0xadc0f
jmp 0x3b870
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3b887
orb $0x1, 0x1e8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelScan::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print scan
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%d %s %d %d",
          SceneIndex(), (Name()) ? Name() : "-",
          (Node()) ? node->TreeIndex() : -1,
          (Image()) ? image->SceneIndex() : -1);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
jne 0x3b949
movq 0xf862a(%rip), %rax     # 0x133f70
movq (%rax), %rbx
testq %rdx, %rdx
je 0x3b959
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x135b0
movq 0xb8(%r15), %rax
testq %rax, %rax
leaq 0xa29dc(%rip), %rcx     # 0xde346
cmovneq %rax, %rcx
movq 0x18(%r15), %rax
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3b987
movl 0x20(%rax), %r8d
movl 0x10(%r15), %edx
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x3b998
movl 0x10(%rax), %r9d
leaq 0xa3d23(%rip), %rsi     # 0xdf6c2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13740
testq %r14, %r14
je 0x3b9b9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x13670
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::ImagePosition(gaps::R3Point const&) const
R2Point R3SurfelScan::
ImagePosition(const R3Point& world_position) const
{
  // Transform 3D point into canonical coordinate system
  R3Point p = Pose().InverseMatrix() * world_position;
  if (RNIsPositiveOrZero(p.Z())) return R2infinite_point;

  // Compute 2D point projected onto viewport
  const R2Point c = ImageCenter();
  RNCoord x = c.X() + xfocal * p.X() / -p.Z();
  RNCoord y = c.Y() + yfocal * p.Y() / -p.Z();

  // Return point projected onto viewport
  return R2Point(x, y);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
addq $0x28, %rsi
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x714b6
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7514e
movsd 0x10(%r13), %xmm0
leaq 0xf91de(%rip), %rax     # 0x134c08
movsd (%rax), %xmm1
xorpd 0xa296a(%rip), %xmm1    # 0xde3a0
ucomisd %xmm1, %xmm0
jae 0x3ba99
leaq 0x98(%r14), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xa3780
movsd 0xa8(%r14), %xmm1
movsd 0xb0(%r14), %xmm2
mulsd 0x8(%rsp), %xmm1
movsd 0x18(%rsp), %xmm3
divsd %xmm3, %xmm1
movsd (%r15), %xmm0
subsd %xmm1, %xmm0
movsd 0x8(%r15), %xmm1
mulsd 0x10(%rsp), %xmm2
divsd %xmm3, %xmm2
subsd %xmm2, %xmm1
movq %rbx, %rdi
callq 0xa3776
jmp 0x3baa8
leaq 0x4fb8d0(%rip), %rsi    # 0x537370
movq %rbx, %rdi
callq 0xa3780
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::R3SurfelImage(char const*)
R3SurfelImage::
R3SurfelImage(const char *name)
  : scene(NULL),
    scene_index(-1),
    scan(NULL),
    channels(),
    pose(R3Point(0,0,0), R3Triad(R3Vector(0,0,0), R3Vector(0,0,0))),
    timestamp(0),
    image_width(0), 
    image_height(0),
    image_center(0,0),
    xfocal(0),
    yfocal(0),
    distortion_type(R3_SURFEL_NO_DISTORTION),
    name((name) ? RNStrdup(name) : NULL),
    flags(0),
    data(NULL)
{
  // Intialize distortion parameters
  radial_distortion[0] = 0;
  radial_distortion[1] = 0;
  radial_distortion[2] = 0;
  tangential_distortion[0] = 0;
  tangential_distortion[1] = 0;

  // Initialize rolling shutter pose parameters
  rolling_shutter_poses[0] = pose;
  rolling_shutter_poses[1] = pose;
  rolling_shutter_timestamps[0] = timestamp;
  rolling_shutter_timestamps[1] = timestamp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0xf4186(%rip), %rax     # 0x12fc60
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movq %rax, 0x18(%rdi)
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0xaaf34
leaq 0x38(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x84d7e
leaq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x85816
leaq 0x8(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x85816
leaq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x71906
leaq 0x30(%r14), %r12
leaq 0x38(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x71408
leaq 0xa0(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%r14)
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0xa3776
leaq 0xf0(%r14), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xb0(%r14)
movl $0x0, 0xc0(%r14)
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
callq 0x713c8
addq $0x60, %rbp
cmpq $0xc0, %rbp
jne 0x3bb99
testq %r15, %r15
je 0x3bbc0
movq %r15, %rdi
callq 0xadc0f
jmp 0x3bbc2
xorl %eax, %eax
movq %rax, 0x1c0(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%r14)
movups %xmm0, 0xd8(%r14)
movq $0x0, 0xe8(%r14)
movups %xmm0, 0x1c8(%r14)
movq %r13, %rdi
movq %r12, %rsi
callq 0x850ec
leaq 0x108(%r14), %rdi
leaq 0x48(%r14), %r15
movq %r15, %rsi
callq 0x85fc2
leaq 0x60(%r14), %r13
leaq 0x120(%r14), %rdi
movq %r13, %rsi
callq 0x85fc2
leaq 0x78(%r14), %rbp
leaq 0x138(%r14), %rdi
movq %rbp, %rsi
callq 0x85fc2
leaq 0x150(%r14), %rdi
movq %r12, %rsi
callq 0x850ec
leaq 0x168(%r14), %rdi
movq %r15, %rsi
callq 0x85fc2
leaq 0x180(%r14), %rdi
movq %r13, %rsi
callq 0x85fc2
leaq 0x198(%r14), %rdi
movq %rbp, %rsi
callq 0x85fc2
movsd 0x90(%r14), %xmm0
movsd %xmm0, 0x1b0(%r14)
movsd %xmm0, 0x1b8(%r14)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3bca4
jmp 0x3bca4
jmp 0x3bca4
jmp 0x3bca4
movq %rax, %r14
movq %rbx, %rdi
callq 0xaaf9e
movq %r14, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::~R3SurfelImage()
R3SurfelImage::
~R3SurfelImage(void)
{
  // Remove image from scan
  if (scan) SetScan(NULL);
  
  // Remove image from scene
  if (scene) scene->RemoveImage(this);

  // Delete all channels
  for (int i = 0; i < channels.NEntries(); i++) {
    R2Grid *channel = channels.Kth(i);
    if (channel) delete channel;
  }
  
  // Delete name
  if (name) free(name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf3d28(%rip), %rax     # 0x12fc60
movq %rax, (%rdi)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x3bf5e
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movq %rcx, 0x18(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3bf5e
orb $0x1, 0x1e8(%rax)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3bf73
movq (%rdi), %rax
movq %rbx, %rsi
callq *0xa8(%rax)
leaq 0x20(%rbx), %r14
cmpl $0x0, 0x2c(%rbx)
jle 0x3bfad
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x3bfa1
movq %r15, %rdi
callq 0x92a48
movl $0xd0, %esi
movq %r15, %rdi
callq 0x134f0
incq %r12
movslq 0x2c(%rbx), %rax
cmpq %rax, %r12
jl 0x3bf80
movq 0x1c0(%rbx), %rdi
testq %rdi, %rdi
je 0x3bfbe
callq 0x135e0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xaaf9e
movq %rax, %rdi
callq 0x1848f
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::ColorChannels() const
R2Image R3SurfelImage::
ColorChannels(void) const
{
  // Allocate color image for result
  R2Image color_image;

  // Get RGB channels
  const R2Grid *red_channel = RedChannel();
  const R2Grid *green_channel = GreenChannel();
  const R2Grid *blue_channel = BlueChannel();
  if (red_channel && green_channel && blue_channel) {
    // Fill in RGB for each pixel
    color_image = R2Image(ImageWidth(), ImageHeight(), 3);
    for (int iy = 0; iy < ImageHeight(); iy++) {
      for (int ix = 0; ix < ImageWidth(); ix++) {
        RNScalar red = red_channel->GridValue(ix, iy);
        RNScalar green = green_channel->GridValue(ix, iy);
        RNScalar blue = blue_channel->GridValue(ix, iy);
        RNRgb color(red, green, blue);
        color_image.SetPixelRGB(ix, iy, color);
      }
    }
  }

  // Return color image
  return color_image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
callq 0xa406c
movl 0x2c(%r12), %eax
testl %eax, %eax
jle 0x3c025
movq 0x20(%r12), %rcx
movq (%rcx), %rcx
movq %rcx, 0x18(%rsp)
jmp 0x3c02e
movq $0x0, 0x18(%rsp)
cmpl $0x2, %eax
jl 0x3c043
movq 0x20(%r12), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rsp)
jmp 0x3c04c
movq $0x0, 0x10(%rsp)
cmpl $0x3, %eax
jl 0x3c05c
movq 0x20(%r12), %rax
movq 0x10(%rax), %r14
jmp 0x3c05f
xorl %r14d, %r14d
cmpq $0x0, 0x18(%rsp)
je 0x3c179
cmpq $0x0, 0x10(%rsp)
je 0x3c179
testq %r14, %r14
je 0x3c179
movl 0x98(%r12), %esi
movl 0x9c(%r12), %edx
leaq 0x20(%rsp), %rdi
movl $0x3, %ecx
callq 0xa438e
leaq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0xa4694
leaq 0x20(%rsp), %rdi
callq 0xa45f6
cmpl $0x0, 0x9c(%r12)
jle 0x3c179
xorl %r15d, %r15d
leaq 0x20(%rsp), %rbx
movq %r12, %rbp
cmpl $0x0, 0x98(%r12)
jle 0x3c166
movslq %r15d, %r12
xorl %r13d, %r13d
movq 0x18(%rsp), %rcx
movq 0xb8(%rcx), %rax
movslq 0xc8(%rcx), %rcx
imulq %r12, %rcx
addq %r13, %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x10(%rsp), %rcx
movq 0xb8(%rcx), %rax
movslq 0xc8(%rcx), %rcx
imulq %r12, %rcx
addq %r13, %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0xb8(%r14), %rax
movslq 0xc8(%r14), %rcx
imulq %r12, %rcx
addq %r13, %rcx
movsd (%rax,%rcx,8), %xmm2
movq %rbx, %rdi
callq 0xaada8
movq 0x8(%rsp), %rdi
movl %r13d, %esi
movl %r15d, %edx
movq %rbx, %rcx
callq 0xa473e
incq %r13
cmpl 0x98(%rbp), %r13d
jl 0x3c0e7
incl %r15d
movq %rbp, %r12
cmpl 0x9c(%rbp), %r15d
jl 0x3c0cf
movq 0x8(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0xa45f6
jmp 0x3c1a1
jmp 0x3c19e
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0xa45f6
movq %r14, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::ProjectionMatrix(double, double) const
R4Matrix R3SurfelImage::
ProjectionMatrix(RNScalar neardist, RNScalar fardist) const
{
  // Return projection transformation from camera coordinates to normalized image coordinates
  RNScalar fx = XFocal();
  RNScalar fy = YFocal();
  RNScalar cx = ImageCenter().X();
  RNScalar cy = ImageCenter().Y();
  RNScalar W = ImageWidth();
  RNScalar H = ImageHeight();
  return R4Matrix(
    2*fx/W, 0, -2*(cx/W)+1, 0,
    0, 2*fy/H, -2*(cy/H)+1, 0,
    0, 0, -(fardist + neardist) / (fardist - neardist),  -2.0 * neardist * fardist / (fardist - neardist),
    0, 0, -1, 0 );
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movapd %xmm0, %xmm3
movq %rdi, %rbx
movsd 0xb0(%rsi), %xmm0
movsd 0xb8(%rsi), %xmm5
movsd 0xa0(%rsi), %xmm4
cvtsi2sdl 0x98(%rsi), %xmm2
cvtsi2sdl 0x9c(%rsi), %xmm7
movsd 0xa8(%rsi), %xmm8
addsd %xmm0, %xmm0
divsd %xmm2, %xmm0
divsd %xmm2, %xmm4
addsd %xmm4, %xmm4
movsd 0xa1f47(%rip), %xmm6    # 0xde150
movapd %xmm6, %xmm2
subsd %xmm4, %xmm2
addsd %xmm5, %xmm5
divsd %xmm7, %xmm5
divsd %xmm7, %xmm8
addsd %xmm8, %xmm8
movapd %xmm3, %xmm4
addsd %xmm1, %xmm4
xorpd 0xa216d(%rip), %xmm4    # 0xde3a0
subsd %xmm8, %xmm6
movapd %xmm1, %xmm7
subsd %xmm3, %xmm7
divsd %xmm7, %xmm4
mulsd 0xa28c4(%rip), %xmm3    # 0xdeb10
mulsd %xmm1, %xmm3
divsd %xmm7, %xmm3
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x30(%rsp)
xorpd %xmm1, %xmm1
movupd %xmm1, 0x20(%rsp)
movsd %xmm3, 0x18(%rsp)
movupd %xmm1, (%rsp)
movsd %xmm4, 0x10(%rsp)
movq $0x0, 0x38(%rsp)
xorpd %xmm1, %xmm1
xorpd %xmm3, %xmm3
xorpd %xmm4, %xmm4
xorpd %xmm7, %xmm7
callq 0x730f2
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::PixelWorldRay(gaps::R2Point const&) const
R3Ray R3SurfelImage::
PixelWorldRay(const R2Point& image_position) const
{
  // Get/check intrinsics matrix
  if (RNIsZero(xfocal)) return R3null_ray;
  if (RNIsZero(yfocal)) return R3null_ray;

  // Get point at depth 1.0 along ray in camera coordinates
  R3Point camera_position;
  camera_position[0] = (image_position[0] - image_center.X()) / xfocal;
  camera_position[1] = (image_position[1] - image_center.Y()) / yfocal;
  camera_position[2] = -1.0;

  // Create ray and transform into world coordinates
  R3Ray ray(R3zero_point, camera_position);
  ray.Transform(R3Affine(CameraToWorld(), 0));

  // Return ray through pixel in world coordinates
  return ray;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movsd 0xb0(%rsi), %xmm2
leaq 0xf893c(%rip), %rax     # 0x134c08
movsd (%rax), %xmm0
movapd 0xa20c8(%rip), %xmm1    # 0xde3a0
xorpd %xmm0, %xmm1
ucomisd %xmm1, %xmm2
jb 0x3c2e8
ucomisd %xmm2, %xmm0
jae 0x3c2fd
movsd 0xb8(%r14), %xmm2
ucomisd %xmm1, %xmm2
jb 0x3c311
ucomisd %xmm2, %xmm0
jb 0x3c311
leaq 0x4fa0cc(%rip), %rsi    # 0x5363d0
movq %rbx, %rdi
callq 0x84966
jmp 0x3c3a0
movq %rsp, %r12
movq %r12, %rdi
callq 0x84d7c
movupd (%r15), %xmm0
movupd 0xa0(%r14), %xmm1
subpd %xmm1, %xmm0
movupd 0xb0(%r14), %xmm1
divpd %xmm1, %xmm0
movapd %xmm0, (%r12)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x10(%r12)
leaq 0x4fa319(%rip), %rsi    # 0x536670
movq %rbx, %rdi
movq %r12, %rdx
callq 0x84972
addq $0x30, %r14
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7142e
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x70cc6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x84a40
leaq 0x18(%rsp), %rdi
callq 0x70d14
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x70d14
movq %rbx, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::TrajectoryDirection() const
R3Vector R3SurfelImage::
TrajectoryDirection(void) const
{
  // Check scene
  if (!scene) return R3zero_vector;
  if (scene_index < 0) return R3zero_vector;
  
  // Find images before/after this image
  int delta = 7;
  int index = scene_index;
  int indexA = index - delta;
  int indexB = index + delta;
  if (indexA < 0) indexA = 0;
  if (indexB > scene->NImages()-1) indexB = scene->NImages()-1;
  R3SurfelImage *imageA = scene->Image(indexA);
  R3SurfelImage *imageB = scene->Image(indexB);

  // Compute trajector direction
  R3Point viewpointA = imageA->Viewpoint();
  R3Point viewpointB = imageB->Viewpoint();
  R3Vector trajectory_direction = viewpointB - viewpointA;
  trajectory_direction.Normalize();

  // Return trajectory direction
  return trajectory_direction;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3c452
movl 0x10(%rsi), %ecx
testl %ecx, %ecx
js 0x3c452
leal 0x7(%rcx), %edx
cmpl $0x8, %ecx
movl $0x7, %esi
cmovgel %ecx, %esi
movl 0x9c(%rax), %ecx
leal -0x1(%rcx), %edi
cmpl %ecx, %edx
cmovll %edx, %edi
movq 0x90(%rax), %rax
movq -0x38(%rax,%rsi,8), %rsi
movslq %edi, %rcx
movq (%rax,%rcx,8), %r14
addq $0x30, %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x84d8e
addq $0x30, %r14
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x84d8e
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x84fe0
movq %rbx, %rdi
callq 0x85b38
jmp 0x3c461
leaq 0xa9d77(%rip), %rsi     # 0xe61d0
movq %rbx, %rdi
callq 0x85826
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetChannel(int, gaps::R2Grid const&)
void R3SurfelImage::
SetChannel(int channel_index, const R2Grid& channel)
{
  // Check channel index
  assert(channel_index >= 0);

  // Insert channels up to channel index
  for (int i = channels.NEntries(); i <= channel_index; i++) {
    channels.Insert(NULL);
  }

  // Delete previous channel
  if (channels[channel_index]) delete channels[channel_index];

  // Update image width and height
  if (image_width <= 0) image_width = channel.XResolution();
  if (image_height <= 0) image_height = channel.YResolution();
  
  // Copy image into channel
  channels[channel_index] = new R2Grid(channel);

  // Resample if necessary
  if ((image_width != channel.XResolution()) || (image_height != channel.YResolution())) {
    channels[channel_index]->Resample(image_width, image_height, TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x20(%rdi), %r15
movl 0x2c(%rdi), %eax
cmpl %esi, %eax
jg 0x3c6de
movl %ebp, %r12d
subl %eax, %r12d
incl %r12d
movl 0x2c(%rbx), %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0xaafca
decl %r12d
jne 0x3c6cc
movq (%r15), %rax
movslq %ebp, %r12
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x3c702
movq %r15, %rdi
callq 0x92a48
movl $0xd0, %esi
movq %r15, %rdi
callq 0x134f0
cmpl $0x0, 0x98(%rbx)
jg 0x3c718
movl 0xc0(%r14), %eax
movl %eax, 0x98(%rbx)
cmpl $0x0, 0x9c(%rbx)
jg 0x3c72e
movl 0xc4(%r14), %eax
movl %eax, 0x9c(%rbx)
movl $0xd0, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x92870
movq 0x20(%rbx), %rax
movq %r15, (%rax,%r12,8)
movl 0x98(%rbx), %esi
cmpl 0xc0(%r14), %esi
jne 0x3c775
movl 0x9c(%rbx), %eax
cmpl 0xc4(%r14), %eax
jne 0x3c775
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
movl 0x9c(%rbx), %edx
movl $0x1, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x977b2
movq %rax, %rbx
movl $0xd0, %esi
movq %r15, %rdi
callq 0x134f0
movq %rbx, %rdi
callq 0x138b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetColorChannels(gaps::R2Image const&)
void R3SurfelImage::
SetColorChannels(const R2Image& color_image)
{
  // Initialize channels
  R2Grid red_channel(color_image.Width(), color_image.Height());
  R2Grid green_channel(color_image.Width(), color_image.Height());
  R2Grid blue_channel(color_image.Width(), color_image.Height());

  // Fill channels
  for (int iy = 0; iy < color_image.Height(); iy++) {
    for (int ix = 0; ix < color_image.Width(); ix++) {
      RNRgb rgb = color_image.PixelRGB(ix, iy);
      red_channel.SetGridValue(ix, iy, rgb.R());
      green_channel.SetGridValue(ix, iy, rgb.G());
      blue_channel.SetGridValue(ix, iy, rgb.B());
    }
  }

  // Set channels
  SetRedChannel(red_channel);
  SetGreenChannel(green_channel);
  SetBlueChannel(blue_channel);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %esi
movl 0x4(%r14), %edx
leaq 0x1b8(%rsp), %rdi
callq 0x91e28
movl (%r14), %esi
movl 0x4(%r14), %edx
leaq 0xe8(%rsp), %rdi
callq 0x91e28
movl (%r14), %esi
movl 0x4(%r14), %edx
leaq 0x18(%rsp), %rdi
callq 0x91e28
cmpl $0x0, 0x4(%r14)
jle 0x3c911
xorl %r15d, %r15d
movq %rsp, %r12
cmpl $0x0, (%r14)
jle 0x3c904
movslq %r15d, %rbp
xorl %r13d, %r13d
movq %r12, %rdi
movq %r14, %rsi
movl %r13d, %edx
movl %r15d, %ecx
callq 0xa4604
movsd (%rsp), %xmm0
movq 0x270(%rsp), %rax
movslq 0x280(%rsp), %rcx
imulq %rbp, %rcx
addq %r13, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x8(%rsp), %xmm0
movq 0x1a0(%rsp), %rax
movslq 0x1b0(%rsp), %rcx
imulq %rbp, %rcx
addq %r13, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x10(%rsp), %xmm0
movq 0xd0(%rsp), %rax
movslq 0xe0(%rsp), %rcx
imulq %rbp, %rcx
addq %r13, %rcx
movsd %xmm0, (%rax,%rcx,8)
incq %r13
cmpl (%r14), %r13d
jl 0x3c886
incl %r15d
cmpl 0x4(%r14), %r15d
jl 0x3c876
movq (%rbx), %rax
leaq 0x1b8(%rsp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rbx), %rax
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdi
callq *0x20(%rax)
movq (%rbx), %rax
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq *0x28(%rax)
leaq 0x18(%rsp), %rdi
callq 0x92a48
leaq 0xe8(%rsp), %rdi
callq 0x92a48
leaq 0x1b8(%rsp), %rdi
callq 0x92a48
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3c990
movq %rax, %rbx
jmp 0x3c99d
jmp 0x3c983
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x92a48
leaq 0xe8(%rsp), %rdi
callq 0x92a48
leaq 0x1b8(%rsp), %rdi
callq 0x92a48
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::RemoveChannel(int)
void R3SurfelImage::
RemoveChannel(int channel_index)
{
  // Check channel index
  if (channel_index < 0) return;
  if (channel_index >= channels.NEntries()) return;
  if (!channels[channel_index]) return;

  // Remove channel
  delete channels[channel_index];
  channels[channel_index] = NULL;
}

// Assembly:
testl %esi, %esi
js 0x3c9f9
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x2c(%rdi)
jle 0x3c9f4
movq 0x20(%rbx), %rax
movl %esi, %r15d
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x3c9f4
movq %r14, %rdi
callq 0x92a48
movl $0xd0, %esi
movq %r14, %rdi
callq 0x134f0
movq 0x20(%rbx), %rax
movq $0x0, (%rax,%r15,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetPose(gaps::R3CoordSystem const&)
void R3SurfelImage::
SetPose(const R3CoordSystem& pose) 
{
  // Set pose
  this->pose = pose;

  // Update rollling shutter poses
  this->rolling_shutter_poses[0] = this->pose;
  this->rolling_shutter_poses[1] = this->pose;
  flags.Remove(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x850ec
leaq 0x48(%rbx), %r15
leaq 0x18(%rbp), %rsi
movq %r15, %rdi
callq 0x85fc2
leaq 0x30(%rbp), %rsi
leaq 0x60(%rbx), %r12
movq %r12, %rdi
callq 0x85fc2
addq $0x48, %rbp
leaq 0x78(%rbx), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x85fc2
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x108(%rbx), %rdi
movq %r15, %rsi
callq 0x85fc2
leaq 0x120(%rbx), %rdi
movq %r12, %rsi
callq 0x85fc2
leaq 0x138(%rbx), %rdi
movq %r13, %rsi
callq 0x85fc2
leaq 0x150(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x168(%rbx), %rdi
movq %r15, %rsi
callq 0x85fc2
leaq 0x180(%rbx), %rdi
movq %r12, %rsi
callq 0x85fc2
leaq 0x198(%rbx), %rdi
movq %r13, %rsi
callq 0x85fc2
andb $-0x2, 0x1c8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetViewpoint(gaps::R3Point const&)
void R3SurfelImage::
SetViewpoint(const R3Point& viewpoint) 
{
  // Set viewpoint
  this->pose.SetOrigin(viewpoint);

  // Update rollling shutter poses
  this->rolling_shutter_poses[0] = this->pose;
  this->rolling_shutter_poses[1] = this->pose;
  flags.Remove(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x71510
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x108(%rbx), %rdi
leaq 0x48(%rbx), %r15
movq %r15, %rsi
callq 0x85fc2
leaq 0x60(%rbx), %r12
leaq 0x120(%rbx), %rdi
movq %r12, %rsi
callq 0x85fc2
leaq 0x78(%rbx), %r13
leaq 0x138(%rbx), %rdi
movq %r13, %rsi
callq 0x85fc2
leaq 0x150(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x168(%rbx), %rdi
movq %r15, %rsi
callq 0x85fc2
leaq 0x180(%rbx), %rdi
movq %r12, %rsi
callq 0x85fc2
leaq 0x198(%rbx), %rdi
movq %r13, %rsi
callq 0x85fc2
andb $-0x2, 0x1c8(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetOrientation(gaps::R3Vector const&, gaps::R3Vector const&)
void R3SurfelImage::
SetOrientation(const R3Vector& towards, const R3Vector& up) 
{
  // Set orientation
  this->pose.SetAxes(R3Triad(towards, up));

  // Update rollling shutter poses
  this->rolling_shutter_poses[0] = this->pose;
  this->rolling_shutter_poses[1] = this->pose;
  flags.Remove(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x71906
movq %r14, %rdi
movq %r15, %rsi
callq 0x71516
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x108(%rbx), %rdi
leaq 0x48(%rbx), %r15
movq %r15, %rsi
callq 0x85fc2
leaq 0x60(%rbx), %r12
leaq 0x120(%rbx), %rdi
movq %r12, %rsi
callq 0x85fc2
leaq 0x78(%rbx), %r13
leaq 0x138(%rbx), %rdi
movq %r13, %rsi
callq 0x85fc2
leaq 0x150(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x168(%rbx), %rdi
movq %r15, %rsi
callq 0x85fc2
leaq 0x180(%rbx), %rdi
movq %r12, %rsi
callq 0x85fc2
leaq 0x198(%rbx), %rdi
movq %r13, %rsi
callq 0x85fc2
andb $-0x2, 0x1c8(%rbx)
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::SetRollingShutterPoses(gaps::R3CoordSystem const&, gaps::R3CoordSystem const&)
void R3SurfelImage::
SetRollingShutterPoses(const R3CoordSystem& pose0, const R3CoordSystem& pose1) 
{
  // Check if poses are different
  if (pose0 == pose1) {
    SetPose(pose0);
  }
  else {    
    // Set rollling shutter poses
    this->rolling_shutter_poses[0] = pose0;
    this->rolling_shutter_poses[1] = pose1;

    // Update center pose
    this->pose = R3CoordSystemSlerp(pose0, pose1, 0.5);

    // Update flags
    flags.Add(R3_SURFEL_IMAGE_HAS_ROLLING_SHUTTER);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x84e44
testl %eax, %eax
je 0x3cdc9
leaq 0x18(%r14), %rdi
leaq 0x18(%r15), %rsi
callq 0x85ad4
testl %eax, %eax
je 0x3cdc9
leaq 0x30(%r14), %rdi
leaq 0x30(%r15), %rsi
callq 0x85ad4
testl %eax, %eax
je 0x3cdc9
movq (%rbx), %rax
movq 0x58(%rax), %rax
movq %rbx, %rdi
movq %r14, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
leaq 0xf0(%rbx), %rdi
movq %r14, %rsi
callq 0x850ec
leaq 0x108(%rbx), %rdi
leaq 0x18(%r14), %rsi
callq 0x85fc2
leaq 0x30(%r14), %rsi
leaq 0x120(%rbx), %rdi
callq 0x85fc2
leaq 0x48(%r14), %rsi
leaq 0x138(%rbx), %rdi
callq 0x85fc2
leaq 0x150(%rbx), %rdi
movq %r15, %rsi
callq 0x850ec
leaq 0x168(%rbx), %rdi
leaq 0x18(%r15), %rsi
callq 0x85fc2
leaq 0x30(%r15), %rsi
leaq 0x180(%rbx), %rdi
callq 0x85fc2
leaq 0x48(%r15), %rsi
leaq 0x198(%rbx), %rdi
callq 0x85fc2
leaq 0x8(%rsp), %r12
movsd 0xa12ec(%rip), %xmm0    # 0xde140
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x71667
leaq 0x30(%rbx), %rdi
movq %r12, %rsi
callq 0x850ec
leaq 0x48(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x85fc2
leaq 0x38(%rsp), %rsi
leaq 0x60(%rbx), %rdi
callq 0x85fc2
leaq 0x50(%rsp), %rsi
leaq 0x78(%rbx), %rdi
callq 0x85fc2
orb $0x1, 0x1c8(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop