LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertObjectProperty(gaps::R3SurfelObjectProperty*)
void R3SurfelScene::
InsertObjectProperty(R3SurfelObjectProperty *property)
{
  // Just checking
  assert(property);
  assert(property->scene == NULL);
  assert(property->scene_index == -1);

  // Insert property into scene
  property->scene = this;
  property->scene_index = object_properties.NEntries();
  object_properties.Insert(property);

  // Update object
  R3SurfelObject *object = property->Object();
  object->UpdateAfterInsertObjectProperty(property);

  // Update object property
  property->UpdateAfterInsert(this);

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x30, %rdi
callq 0x16d50
movq 0x8(%rsp), %rdi
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x30, %rdi
movq 0x28(%rsp), %rsi
callq 0x1bf90
movq 0x28(%rsp), %rdi
callq 0x30cc0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x1b3e0
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x30cd0
movq 0x8(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1c2d0
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveObjectProperty(gaps::R3SurfelObjectProperty*)
void R3SurfelScene::
RemoveObjectProperty(R3SurfelObjectProperty *property)
{
  // Just checking
  assert(property);
  assert(property->scene == this);
  assert(property->scene_index >= 0);
  assert(object_properties.Kth(property->scene_index) == property);

  // Update object property
  property->UpdateBeforeRemove(this);

  // Update object
  R3SurfelObject *object = property->Object();
  object->UpdateBeforeRemoveObjectProperty(property);

  // Remove property from scene
  RNArrayEntry *entry = object_properties.KthEntry(property->scene_index);
  R3SurfelObjectProperty *tail = object_properties.Tail();
  tail->scene_index = property->scene_index;
  object_properties.EntryContents(entry) = tail;
  object_properties.RemoveTail();
  property->scene_index = -1;
  property->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x30ce0
movq 0x38(%rsp), %rdi
callq 0x30cc0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x1b410
movq 0x8(%rsp), %rdi
addq $0x30, %rdi
movq 0x38(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x8(%rsp), %rdi
movq %rax, 0x28(%rsp)
addq $0x30, %rdi
callq 0x30cf0
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
addq $0x30, %rdi
movq 0x28(%rsp), %rsi
callq 0x30d00
movq (%rsp), %rcx
movq 0x8(%rsp), %rdi
movq %rcx, (%rax)
addq $0x30, %rdi
callq 0x1c0c0
movq 0x8(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertLabelProperty(gaps::R3SurfelLabelProperty*)
void R3SurfelScene::
InsertLabelProperty(R3SurfelLabelProperty *property)
{
  // Just checking
  assert(property);
  assert(property->scene == this);
  assert(property->scene_index == -1);

  // Insert property into scene
  property->scene = this;
  property->scene_index = label_properties.NEntries();
  label_properties.Insert(property);

  // Update label
  R3SurfelLabel *label = property->Label();
  label->UpdateAfterInsertLabelProperty(property);

  // Update label property
  property->UpdateAfterInsert(this);

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x40, %rdi
callq 0x16d50
movq 0x8(%rsp), %rdi
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x40, %rdi
movq 0x28(%rsp), %rsi
callq 0x30d10
movq 0x28(%rsp), %rdi
callq 0x30d40
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x70c80
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x30d50
movq 0x8(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1c2d0
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveLabelProperty(gaps::R3SurfelLabelProperty*)
void R3SurfelScene::
RemoveLabelProperty(R3SurfelLabelProperty *property)
{
  // Just checking
  assert(property);
  assert(property->scene == this);
  assert(property->scene_index >= 0);
  assert(label_properties.Kth(property->scene_index) == property);

  // Update label property
  property->UpdateAfterInsert(this);

  // Update label
  R3SurfelLabel *label = property->Label();
  label->UpdateBeforeRemoveLabelProperty(property);

  // Remove property from scene
  RNArrayEntry *entry = label_properties.KthEntry(property->scene_index);
  R3SurfelLabelProperty *tail = label_properties.Tail();
  tail->scene_index = property->scene_index;
  label_properties.EntryContents(entry) = tail;
  label_properties.RemoveTail();
  property->scene_index = -1;
  property->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x30d50
movq 0x38(%rsp), %rdi
callq 0x30d40
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x70cb0
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movq 0x38(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x8(%rsp), %rdi
movq %rax, 0x28(%rsp)
addq $0x40, %rdi
callq 0x30d60
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
addq $0x40, %rdi
movq 0x28(%rsp), %rsi
callq 0x30d70
movq (%rsp), %rcx
movq 0x8(%rsp), %rdi
movq %rcx, (%rax)
addq $0x40, %rdi
callq 0x1c0c0
movq 0x8(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertObjectRelationship(gaps::R3SurfelObjectRelationship*)
void R3SurfelScene::
InsertObjectRelationship(R3SurfelObjectRelationship *relationship)
{
  // Just checking
  assert(relationship);
  assert(relationship->scene == NULL);
  assert(relationship->scene_index == -1);

  // Insert relationship into scene
  relationship->scene = this;
  relationship->scene_index = object_relationships.NEntries();
  object_relationships.Insert(relationship);

  // Update objects
  for (int i = 0; i < relationship->NObjects(); i++) {
    R3SurfelObject *object = relationship->Object(i);
    object->UpdateAfterInsertObjectRelationship(relationship);
  }

  // Update object relationship
  relationship->UpdateAfterInsert(this);

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x50, %rdi
callq 0x16d50
movq 0x18(%rsp), %rdi
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x50, %rdi
movq 0x38(%rsp), %rsi
callq 0x1bff0
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rdi
callq 0x30d80
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x1eeda
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x30da0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x1b440
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1ee8f
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x30dd0
movq 0x18(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveObjectRelationship(gaps::R3SurfelObjectRelationship*)
void R3SurfelScene::
RemoveObjectRelationship(R3SurfelObjectRelationship *relationship)
{
  // Just checking
  assert(relationship);
  assert(relationship->scene == this);
  assert(relationship->scene_index >= 0);
  assert(object_relationships.Kth(relationship->scene_index) == relationship);

  // Update object relationship
  relationship->UpdateBeforeRemove(this);

  // Update objects
  for (int i = 0; i < relationship->NObjects(); i++) {
    R3SurfelObject *object = relationship->Object(i);
    object->UpdateBeforeRemoveObjectRelationship(relationship);
  }

  // Remove relationship from scene
  RNArrayEntry *entry = object_relationships.KthEntry(relationship->scene_index);
  R3SurfelObjectRelationship *tail = object_relationships.Tail();
  tail->scene_index = relationship->scene_index;
  object_relationships.EntryContents(entry) = tail;
  object_relationships.RemoveTail();
  relationship->scene_index = -1;
  relationship->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movq 0x48(%rsp), %rdi
callq 0x30de0
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x48(%rsp), %rdi
callq 0x30d80
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x1ef95
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x30da0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x1b470
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x1ef4a
movq 0x18(%rsp), %rdi
addq $0x50, %rdi
movq 0x48(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x18(%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x50, %rdi
callq 0x30df0
movq 0x18(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
addq $0x50, %rdi
movq 0x30(%rsp), %rsi
callq 0x30e00
movq (%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rcx, (%rax)
addq $0x50, %rdi
callq 0x1c0c0
movq 0x18(%rsp), %rax
movq 0x48(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x58, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertLabelRelationship(gaps::R3SurfelLabelRelationship*)
void R3SurfelScene::
InsertLabelRelationship(R3SurfelLabelRelationship *relationship)
{
  // Just checking
  assert(relationship);
  assert(relationship->scene == this);
  assert(relationship->scene_index == -1);

  // Insert relationship into scene
  relationship->scene = this;
  relationship->scene_index = label_relationships.NEntries();
  label_relationships.Insert(relationship);

  // Update labels
  for (int i = 0; i < relationship->NLabels(); i++) {
    R3SurfelLabel *label = relationship->Label(i);
    label->UpdateAfterInsertLabelRelationship(relationship);
  }

  // Update label relationship
  relationship->UpdateAfterInsert(this);

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x60, %rdi
callq 0x16d50
movq 0x18(%rsp), %rdi
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x60, %rdi
movq 0x38(%rsp), %rsi
callq 0x30e10
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rdi
callq 0x30e40
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x1f0ea
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x30e60
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x70ce0
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1f09f
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x30e90
movq 0x18(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveLabelRelationship(gaps::R3SurfelLabelRelationship*)
void R3SurfelScene::
RemoveLabelRelationship(R3SurfelLabelRelationship *relationship)
{
  // Just checking
  assert(relationship);
  assert(relationship->scene == this);
  assert(relationship->scene_index >= 0);
  assert(label_relationships.Kth(relationship->scene_index) == relationship);

  // Update label relationship
  relationship->UpdateAfterInsert(this);

  // Update labels
  for (int i = 0; i < relationship->NLabels(); i++) {
    R3SurfelLabel *label = relationship->Label(i);
    label->UpdateBeforeRemoveLabelRelationship(relationship);
  }

  // Remove relationship from scene
  RNArrayEntry *entry = label_relationships.KthEntry(relationship->scene_index);
  R3SurfelLabelRelationship *tail = label_relationships.Tail();
  tail->scene_index = relationship->scene_index;
  label_relationships.EntryContents(entry) = tail;
  label_relationships.RemoveTail();
  relationship->scene_index = -1;
  relationship->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movq 0x48(%rsp), %rdi
callq 0x30e90
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x48(%rsp), %rdi
callq 0x30e40
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x1f1a5
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x30e60
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x70d10
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x1f15a
movq 0x18(%rsp), %rdi
addq $0x60, %rdi
movq 0x48(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x18(%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x60, %rdi
callq 0x30ea0
movq 0x18(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
addq $0x60, %rdi
movq 0x30(%rsp), %rsi
callq 0x30eb0
movq (%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rcx, (%rax)
addq $0x60, %rdi
callq 0x1c0c0
movq 0x18(%rsp), %rax
movq 0x48(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x58, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertLabelAssignment(gaps::R3SurfelLabelAssignment*)
void R3SurfelScene::
InsertLabelAssignment(R3SurfelLabelAssignment *assignment)
{
  // Just checking
  assert(assignment);
  assert(assignment->scene == NULL);
  assert(assignment->scene_index == -1);
  assert(assignment->Object());
  assert(assignment->Object()->Scene() == this);
  assert(assignment->Label());
  assert(assignment->Label()->Scene() == this);

  // Insert assignment into scene
  assignment->scene = this;
  assignment->scene_index = assignments.NEntries();
  assignments.Insert(assignment);

  // Update object and label
  assignment->Object()->UpdateAfterInsertLabelAssignment(assignment);
  assignment->Label()->UpdateAfterInsertLabelAssignment(assignment);

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

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x18(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x70, %rdi
callq 0x16d50
movq (%rsp), %rdi
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x70, %rdi
movq 0x18(%rsp), %rsi
callq 0x1c050
movq 0x18(%rsp), %rdi
callq 0x30ec0
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x1b4a0
movq 0x18(%rsp), %rdi
callq 0x1bca0
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x70d40
movq (%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x30ed0
movq (%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1c2d0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveLabelAssignment(gaps::R3SurfelLabelAssignment*)
void R3SurfelScene::
RemoveLabelAssignment(R3SurfelLabelAssignment *assignment)
{
  // Just checking
  assert(assignment);
  assert(assignment->scene == this);
  assert(assignment->scene_index >= 0);
  assert(assignment->Object());
  assert(assignment->Object()->Scene() == this);
  assert(assignment->Label());
  assert(assignment->Label()->Scene() == this);

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

  // Update object and label
  assignment->Object()->UpdateBeforeRemoveLabelAssignment(assignment);
  assignment->Label()->UpdateBeforeRemoveLabelAssignment(assignment);

  // Remove assignment from scene
  assert(assignment->scene == this);
  RNArrayEntry *entry = assignments.KthEntry(assignment->scene_index);
  R3SurfelLabelAssignment *tail = assignments.Tail();
  tail->scene_index = assignment->scene_index;
  assignments.EntryContents(entry) = tail;
  assignments.RemoveTail();
  assignment->scene_index = -1;
  assignment->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq 0x38(%rsp), %rdi
callq 0x30ee0
movq 0x38(%rsp), %rdi
callq 0x30ec0
movq %rax, %rdi
movq 0x38(%rsp), %rsi
callq 0x1b4f0
movq 0x38(%rsp), %rdi
callq 0x1bca0
movq %rax, %rdi
movq 0x38(%rsp), %rsi
callq 0x70d90
movq 0x10(%rsp), %rdi
addq $0x70, %rdi
movq 0x38(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x70, %rdi
callq 0x1c0a0
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x70, %rdi
movq 0x30(%rsp), %rsi
callq 0x1c0b0
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
addq $0x70, %rdi
callq 0x1c0c0
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertScan(gaps::R3SurfelScan*)
void R3SurfelScene::
InsertScan(R3SurfelScan *scan)
{
  // Just checking
  assert(scan);

  // Insert label 
  scan->scene = this;
  scan->scene_index = scans.NEntries();
  scans.Insert(scan);

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x18(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x80, %rdi
callq 0x16d50
movq (%rsp), %rdi
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x80, %rdi
movq 0x18(%rsp), %rsi
callq 0x30ef0
movq (%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1c2d0
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveScan(gaps::R3SurfelScan*)
void R3SurfelScene::
RemoveScan(R3SurfelScan *scan)
{
  // Just checking
  assert(scan);

  // Remove scan from scene
  RNArrayEntry *entry = scans.KthEntry(scan->scene_index);
  R3SurfelScan *tail = scans.Tail();
  tail->scene_index = scan->scene_index;
  scans.EntryContents(entry) = tail;
  scans.RemoveTail();
  scan->scene_index = -1;
  scan->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x80, %rdi
movq 0x38(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x80, %rdi
callq 0x30f20
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x80, %rdi
movq 0x30(%rsp), %rsi
callq 0x30f30
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
addq $0x80, %rdi
callq 0x1c0c0
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertImage(gaps::R3SurfelImage*)
void R3SurfelScene::
InsertImage(R3SurfelImage *image)
{
  // Just checking
  assert(image);

  // Insert label 
  image->scene = this;
  image->scene_index = images.NEntries();
  images.Insert(image);

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x18(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x90, %rdi
callq 0x16d50
movq (%rsp), %rdi
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x90, %rdi
movq 0x18(%rsp), %rsi
callq 0x30f40
movq (%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1c2d0
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveImage(gaps::R3SurfelImage*)
void R3SurfelScene::
RemoveImage(R3SurfelImage *image)
{
  // Just checking
  assert(image);

  // Remove image from scene
  RNArrayEntry *entry = images.KthEntry(image->scene_index);
  R3SurfelImage *tail = images.Tail();
  tail->scene_index = image->scene_index;
  images.EntryContents(entry) = tail;
  images.RemoveTail();
  image->scene_index = -1;
  image->scene = NULL;

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x90, %rdi
movq 0x38(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x90, %rdi
callq 0x30f70
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x90, %rdi
movq 0x30(%rsp), %rsi
callq 0x30f80
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
addq $0x90, %rdi
callq 0x1c0c0
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0xffffffff, 0x10(%rcx) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rcx
movq $0x0, 0x8(%rcx)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertFeature(gaps::R3SurfelFeature*)
void R3SurfelScene::
InsertFeature(R3SurfelFeature *feature)
{
  // Just checking
  assert(feature);

  // Insert label 
  feature->scene = this;
  feature->scene_index = features.NEntries();
  features.Insert(feature);

  // Update all object feature vectors
  for (int i = 0; i < NObjects(); i++) {
    R3SurfelObject *object = Object(i);
    if (object->feature_vector.NValues() > 0) {
      object->feature_vector.Resize(NFeatures());
      feature->UpdateFeatureVector(object, object->feature_vector);
    }
  }

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0xa0, %rdi
callq 0x16d50
movq 0x18(%rsp), %rdi
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0xa0, %rdi
movq 0x38(%rsp), %rsi
callq 0x30f90
movl $0x0, 0x34(%rsp)
movq 0x18(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x14(%rsp)
callq 0x16c20
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x1f7d6
movq 0x18(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x185f0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
addq $0x70, %rdi
callq 0x1bc40
cmpl $0x0, %eax
jle 0x1f7c4
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
addq $0x70, %rax
movq %rax, 0x8(%rsp)
callq 0x16c80
movq 0x8(%rsp), %rdi
movl %eax, %esi
callq 0x6cc20
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq $0x70, %rdx
movq (%rdi), %rax
callq *0x48(%rax)
jmp 0x1f7c6
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1f745
movq 0x18(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, (%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq (%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveFeature(gaps::R3SurfelFeature*)
void R3SurfelScene::
RemoveFeature(R3SurfelFeature *feature)
{
  // Just checking
  assert(feature);
  assert(feature->scene == this);
  assert(feature->scene_index >= 0);
  assert(feature->scene_index < NFeatures());

  // Remove feature from scene
  RNArrayEntry *entry = features.KthEntry(feature->scene_index);
  R3SurfelFeature *tail = features.Tail();
  tail->scene_index = feature->scene_index;
  features.EntryContents(entry) = tail;
  features.RemoveTail();
  feature->scene_index = -1;
  feature->scene = NULL;

  // Update all object feature vectors
  if (feature != tail) {
    for (int i = 0; i < NObjects(); i++) {
      R3SurfelObject *object = Object(i);
      R3SurfelFeatureVector& vector = object->feature_vector;
      if (vector.NValues() == 0) continue;
      assert(vector.NValues() == NFeatures()+1);
      RNScalar tail_value = vector.Value(vector.NValues()-1);
      object->feature_vector.SetValue(tail->scene_index, tail_value);
      object->feature_vector.Resize(NFeatures());
    }
  }

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, 0x28(%rsp)
addq $0xa0, %rdi
movq 0x68(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x1c080
movq 0x28(%rsp), %rdi
movq %rax, 0x60(%rsp)
addq $0xa0, %rdi
callq 0x30fc0
movq 0x28(%rsp), %rdi
movq %rax, 0x58(%rsp)
movq 0x68(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x58(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0xa0, %rdi
movq 0x60(%rsp), %rsi
callq 0x30fd0
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdi
movq %rcx, (%rax)
addq $0xa0, %rdi
callq 0x1c0c0
movq 0x68(%rsp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x68(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x68(%rsp), %rax
cmpq 0x58(%rsp), %rax
je 0x1f99e
movl $0x0, 0x54(%rsp)
movq 0x28(%rsp), %rdi
movl 0x54(%rsp), %eax
movl %eax, 0x1c(%rsp)
callq 0x16c20
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x1f99c
movq 0x28(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x185f0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
addq $0x70, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x1bc40
cmpl $0x0, %eax
jne 0x1f923
jmp 0x1f98c
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x1bc40
movq 0x8(%rsp), %rdi
movl %eax, %esi
subl $0x1, %esi
callq 0x18640
movsd %xmm0, 0x38(%rsp)
movq 0x48(%rsp), %rdi
addq $0x70, %rdi
movq 0x58(%rsp), %rax
movl 0x10(%rax), %esi
movsd 0x38(%rsp), %xmm0
callq 0x6cd70
movq 0x28(%rsp), %rdi
movq 0x48(%rsp), %rax
addq $0x70, %rax
movq %rax, 0x10(%rsp)
callq 0x16c80
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x6cc20
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x1f8d1
jmp 0x1f99e
movq 0x28(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, (%rsp)
leaq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq (%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1c2d0
addq $0x78, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertComment(char const*)
void R3SurfelScene::
InsertComment(const char *comment)
{
  // Check if already have same comment
  for (int i = 0; i < comments.NEntries(); i++) {
    if (!strcmp(comment, comments[i])) return;
  }
  
  // Insert comment
  comments.Insert(strdup(comment));

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, 0x34(%rsp)
movq 0x20(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x1c(%rsp)
addq $0x1d8, %rdi            # imm = 0x1D8
callq 0x16d50
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x1fa55
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x1d8, %rdi            # imm = 0x1D8
movl 0x34(%rsp), %esi
callq 0x30830
movq 0x10(%rsp), %rdi
movq (%rax), %rsi
callq 0x137e0
cmpl $0x0, %eax
jne 0x1fa46
jmp 0x1faa8
jmp 0x1fa48
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1f9f0
movq 0x20(%rsp), %rax
addq $0x1d8, %rax            # imm = 0x1D8
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
callq 0x139f0
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x30fe0
movq 0x20(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::RemoveComment(char const*)
void R3SurfelScene::
RemoveComment(const char *comment)
{
  // Remove comment
  for (int i = 0; i < comments.NEntries(); i++) {
    if (!strcmp(comment, comments[i])) {
      free(comments[i]);
      comments.RemoveKth(i);
      break;
    }
  }

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, 0x34(%rsp)
movq 0x20(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x1c(%rsp)
addq $0x1d8, %rdi            # imm = 0x1D8
callq 0x16d50
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x1fb6a
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x1d8, %rdi            # imm = 0x1D8
movl 0x34(%rsp), %esi
callq 0x30830
movq 0x10(%rsp), %rdi
movq (%rax), %rsi
callq 0x137e0
cmpl $0x0, %eax
jne 0x1fb58
movq 0x20(%rsp), %rdi
addq $0x1d8, %rdi            # imm = 0x1D8
movl 0x34(%rsp), %esi
callq 0x30830
movq (%rax), %rdi
callq 0x136a0
movq 0x20(%rsp), %rdi
addq $0x1d8, %rdi            # imm = 0x1D8
movl 0x34(%rsp), %esi
callq 0x31010
jmp 0x1fb6a
jmp 0x1fb5a
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1fad0
movq 0x20(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x1c2d0
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::Draw(gaps::RNFlags) const
void R3SurfelScene::
Draw(RNFlags flags) const
{
  // Draw all objects
  for (int i = 0; i < NObjects(); i++) {
    R3SurfelObject *object = Object(i);
    object->Draw(flags);
  } 
}

// Assembly:
subq $0x38, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x24(%rsp)
movq 0x8(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x16c20
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x22bc6
movq 0x8(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x185f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x48(%rax)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x22b70
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelScene::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print scene header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%s", (name) ? name : "Scene");
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

  // Print all objects
  for (int i = 0; i < NObjects(); i++) {
    R3SurfelObject *object = Object(i);
    object->Print(fp, indented_prefix, suffix);
  }
}

// Assembly:
subq $0x458, %rsp            # imm = 0x458
movq %rdi, 0x450(%rsp)
movq %rsi, 0x448(%rsp)
movq %rdx, 0x440(%rsp)
movq %rcx, 0x438(%rsp)
movq 0x450(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x448(%rsp)
jne 0x22c21
movq 0x1d037a(%rip), %rax    # 0x1f2f90
movq (%rax), %rax
movq %rax, 0x448(%rsp)
cmpq $0x0, 0x440(%rsp)
je 0x22c4a
movq 0x448(%rsp), %rdi
movq 0x440(%rsp), %rdx
leaq 0x184980(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x18(%rsp), %rax
movq 0x448(%rsp), %rcx
movq %rcx, 0x10(%rsp)
cmpq $0x0, 0x1d0(%rax)
je 0x22c79
movq 0x18(%rsp), %rax
movq 0x1d0(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x22c87
leaq 0x18176d(%rip), %rax    # 0x1a43ed
movq %rax, 0x8(%rsp)
jmp 0x22c87
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
leaq 0x18492b(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
cmpq $0x0, 0x438(%rsp)
je 0x22cc8
movq 0x448(%rsp), %rdi
movq 0x438(%rsp), %rdx
leaq 0x184902(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x448(%rsp), %rdi
leaq 0x188a1b(%rip), %rsi    # 0x1ab6f2
movb $0x0, %al
callq 0x13810
leaq 0x30(%rsp), %rdi
movq 0x440(%rsp), %rdx
leaq 0x181701(%rip), %rsi    # 0x1a43f3
movb $0x0, %al
callq 0x130f0
movl $0x0, 0x2c(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x16c20
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x22d5d
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x185f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x448(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq 0x438(%rsp), %rcx
movq (%rdi), %rax
callq *0x58(%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x22d01
addq $0x458, %rsp            # imm = 0x458
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::OpenFile(char const*, char const*, char const*, char const*)
int R3SurfelScene::
OpenFile(const char *scene_filename, 
  const char *database_filename, 
  const char *scene_rwaccess,
  const char *database_rwaccess)
{
  // Remember scene file name
  if (this->filename) free(this->filename);
  this->filename = RNStrdup(scene_filename);

  // Remember scene file access mode
  if (this->rwaccess) free(this->rwaccess);
  if (!scene_rwaccess) this->rwaccess = RNStrdup("r");
  else if (!strcmp(scene_rwaccess, "w")) this->rwaccess = RNStrdup("w");
  else if (strstr(scene_rwaccess, "+")) this->rwaccess = RNStrdup("r+");
  else this->rwaccess = RNStrdup("r"); 

  // Open database file
  if (database_filename) {
    if (tree) {
      R3SurfelDatabase *database = tree->Database();
      if (!database->OpenFile(database_filename, database_rwaccess)) {
        return 0;
      }
    }
  }

  // Read scene file
  if (strcmp(this->rwaccess, "w")) {
    if (!ReadFile(scene_filename)) {
      return 0;
    }
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x1c0(%rax)
je 0x22db2
movq 0x8(%rsp), %rax
movq 0x1c0(%rax), %rdi
callq 0x136a0
movq 0x30(%rsp), %rdi
callq 0x1461b0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x1c0(%rax)
cmpq $0x0, 0x1c8(%rax)
je 0x22de6
movq 0x8(%rsp), %rax
movq 0x1c8(%rax), %rdi
callq 0x136a0
cmpq $0x0, 0x20(%rsp)
jne 0x22e0e
leaq 0x18855e(%rip), %rdi    # 0x1ab353
callq 0x1461b0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x1c8(%rax)
jmp 0x22e94
movq 0x20(%rsp), %rdi
leaq 0x1840e4(%rip), %rsi    # 0x1a6efe
callq 0x137e0
cmpl $0x0, %eax
jne 0x22e41
leaq 0x1840d3(%rip), %rdi    # 0x1a6efe
callq 0x1461b0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x1c8(%rax)
jmp 0x22e92
movq 0x20(%rsp), %rdi
leaq 0x1815ac(%rip), %rsi    # 0x1a43f9
callq 0x13120
cmpq $0x0, %rax
je 0x22e75
leaq 0x181599(%rip), %rdi    # 0x1a43f8
callq 0x1461b0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x1c8(%rax)
jmp 0x22e90
leaq 0x1884d7(%rip), %rdi    # 0x1ab353
callq 0x1461b0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x1c8(%rax)
jmp 0x22e92
jmp 0x22e94
cmpq $0x0, 0x28(%rsp)
je 0x22ee3
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x22ee1
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x16d10
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq (%rdi), %rax
callq *0x30(%rax)
cmpl $0x0, %eax
jne 0x22edf
movl $0x0, 0x44(%rsp)
jmp 0x22f2c
jmp 0x22ee1
jmp 0x22ee3
movq 0x8(%rsp), %rax
movq 0x1c8(%rax), %rdi
leaq 0x184008(%rip), %rsi    # 0x1a6efe
callq 0x137e0
cmpl $0x0, %eax
je 0x22f24
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq (%rdi), %rax
callq *0x100(%rax)
cmpl $0x0, %eax
jne 0x22f22
movl $0x0, 0x44(%rsp)
jmp 0x22f2c
jmp 0x22f24
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::SyncFile(char const*)
int R3SurfelScene::
SyncFile(const char *output_scene_filename)
{
  // Check if nothing changed
  if (!flags[R3_SURFEL_SCENE_DIRTY_FLAG]) return 1;

  // Sync surfels
  if (tree) {
    R3SurfelDatabase *database = tree->Database();
    if (database) {
      if (!database->SyncFile()) return 0;
    }
  }

  // Write scene file
  if (output_scene_filename) {
    // Write scene to new file
    if (!WriteFile(output_scene_filename)) {
      return 0;
    }
  }
  else if (this->filename && (strcmp(this->rwaccess, "r"))) {
    // Write scene over original file
    if (!WriteFile(filename)) {
      return 0;
    }
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x31a20
cmpl $0x0, %eax
jne 0x22f92
movl $0x1, 0x34(%rsp)
jmp 0x2305c
movq (%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x22fd8
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x16d10
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x22fd6
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
cmpl $0x0, %eax
jne 0x22fd4
movl $0x0, 0x34(%rsp)
jmp 0x2305c
jmp 0x22fd6
jmp 0x22fd8
cmpq $0x0, 0x20(%rsp)
je 0x23003
movq (%rsp), %rdi
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x0, %eax
jne 0x23001
movl $0x0, 0x34(%rsp)
jmp 0x2305c
jmp 0x23054
movq (%rsp), %rax
cmpq $0x0, 0x1c0(%rax)
je 0x23052
movq (%rsp), %rax
movq 0x1c8(%rax), %rdi
leaq 0x188330(%rip), %rsi    # 0x1ab353
callq 0x137e0
cmpl $0x0, %eax
je 0x23052
movq (%rsp), %rdi
movq 0x1c0(%rdi), %rsi
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x0, %eax
jne 0x23050
movl $0x0, 0x34(%rsp)
jmp 0x2305c
jmp 0x23052
jmp 0x23054
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::CloseFile(char const*)
int R3SurfelScene::
CloseFile(const char *output_scene_filename)
{
#if 1
  // Clean up
  if (tree) {
    R3SurfelDatabase *database = tree->Database();
    if (database) {
      if (database->PurgeDeletedBlocks()) {
        flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
      }
    }
  }
#endif
  
  // Sync file
  if (!SyncFile(output_scene_filename)) return 0;

  // Close surfel database file
  if (tree) {
    R3SurfelDatabase *database = tree->Database();
    if (database) {
      if (!database->CloseFile()) return 0;
    }
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x8(%rax)
je 0x230ef
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x16d10
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x230ed
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
callq *0x80(%rax)
cmpl $0x0, %eax
je 0x230eb
movq 0x10(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
jmp 0x230ed
jmp 0x230ef
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq (%rdi), %rax
callq *0xf0(%rax)
cmpl $0x0, %eax
jne 0x23111
movl $0x0, 0x44(%rsp)
jmp 0x2315e
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x23156
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x16d10
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x23154
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x0, %eax
jne 0x23152
movl $0x0, 0x44(%rsp)
jmp 0x2315e
jmp 0x23154
jmp 0x23156
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::ReadFile(char const*)
int R3SurfelScene::
ReadFile(const char *filename)
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .ssa)\n", filename);
    return 0;
  }

  // Read file of appropriate type
  if (!strncmp(extension, ".ssa", 4)) {
    return ReadAsciiFile(filename);
  }
  else if (!strncmp(extension, ".ssx", 4)) {
    return ReadBinaryFile(filename);
  }
  else { 
    RNFail("Unable to read file %s (unrecognized extension: %s)\n", filename, extension); 
    return 0; 
  }

  // Should never get here
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x2e, %esi
callq 0x13630
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0x231c1
movq 0x10(%rsp), %rsi
leaq 0x18124e(%rip), %rdi    # 0x1a43fb
movb $0x0, %al
callq 0x13070
movl $0x0, 0x24(%rsp)
jmp 0x23247
movq 0x8(%rsp), %rdi
leaq 0x181259(%rip), %rsi    # 0x1a4426
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x231f4
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x108(%rax)
movl %eax, 0x24(%rsp)
jmp 0x23247
movq 0x8(%rsp), %rdi
leaq 0x18122b(%rip), %rsi    # 0x1a442b
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x23227
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x110(%rax)
movl %eax, 0x24(%rsp)
jmp 0x23247
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x1811f8(%rip), %rdi    # 0x1a4430
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::WriteFile(char const*)
int R3SurfelScene::
WriteFile(const char *filename) 
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .ssa)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strncmp(extension, ".ssa", 4)) {
    return WriteAsciiFile(filename);
  }
  else if (!strncmp(extension, ".ssx", 4)) {
    return WriteBinaryFile(filename);
  }
  else if (!strncmp(extension, ".arff", 5)) {
    return WriteARFFFile(filename);
  }
  else if (!strncmp(extension, ".tqn", 4)) {
    return WriteTianqiangFile(filename);
  }
  else { 
    RNFail("Unable to write file %s (unrecognized extension: %s)\n", filename, extension); 
    return 0; 
  }

  // Should never get here
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x2e, %esi
callq 0x13630
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0x232a1
movq 0x10(%rsp), %rsi
leaq 0x18116e(%rip), %rdi    # 0x1a43fb
movb $0x0, %al
callq 0x13070
movl $0x0, 0x24(%rsp)
jmp 0x23393
movq 0x8(%rsp), %rdi
leaq 0x181179(%rip), %rsi    # 0x1a4426
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x232d7
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x130(%rax)
movl %eax, 0x24(%rsp)
jmp 0x23393
movq 0x8(%rsp), %rdi
leaq 0x181148(%rip), %rsi    # 0x1a442b
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x2330d
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x138(%rax)
movl %eax, 0x24(%rsp)
jmp 0x23393
movq 0x8(%rsp), %rdi
leaq 0x18114c(%rip), %rsi    # 0x1a4465
movl $0x5, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x23340
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x140(%rax)
movl %eax, 0x24(%rsp)
jmp 0x23393
movq 0x8(%rsp), %rdi
leaq 0x18111f(%rip), %rsi    # 0x1a446b
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x23373
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x148(%rax)
movl %eax, 0x24(%rsp)
jmp 0x23393
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x1810ec(%rip), %rdi    # 0x1a4470
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::ReadAsciiFile(char const*)
int R3SurfelScene::
ReadAsciiFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "r"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read ascii stream
  int status = ReadAsciiStream(fp);

  // Close file
  fclose(fp);

  // Return status
  return status;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x187f8f(%rip), %rsi    # 0x1ab353
callq 0x13690
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
jne 0x233f1
movq 0x20(%rsp), %rsi
leaq 0x1810c6(%rip), %rdi    # 0x1a44a6
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x34(%rsp)
jmp 0x2341a
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%rdi), %rax
callq *0x118(%rax)
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
callq 0x13560
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)