LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateFlags()
void R3SurfelNode::
UpdateFlags(void)
{
  // Reset flags
  flags.Remove(R3_SURFEL_NODE_HAS_ACTIVE_FLAG);
  flags.Remove(R3_SURFEL_NODE_HAS_NORMALS_FLAG);
  flags.Remove(R3_SURFEL_NODE_HAS_AERIAL_FLAG);
  flags.Remove(R3_SURFEL_NODE_HAS_TERRESTRIAL_FLAG);

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

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

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x48(%rsp)
addq $0xc0, %rax
movq %rax, 0x30(%rsp)
leaq 0xa8(%rsp), %rdi
movl $0x40, %esi
callq 0x1b970
movq 0x30(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x31a80
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x38(%rsp)
leaq 0xa0(%rsp), %rdi
movl $0x80, %esi
callq 0x1b970
movq 0x38(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x31a80
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x40(%rsp)
leaq 0x98(%rsp), %rdi
movl $0x10, %esi
callq 0x1b970
movq 0x40(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x31a80
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x50(%rsp)
leaq 0x90(%rsp), %rdi
movl $0x20, %esi
callq 0x1b970
movq 0x50(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x31a80
movl $0x0, 0x8c(%rsp)
movq 0x48(%rsp), %rdi
movl 0x8c(%rsp), %eax
movl %eax, 0x2c(%rsp)
callq 0x186b0
movl %eax, %ecx
movl 0x2c(%rsp), %eax
cmpl %ecx, %eax
jge 0x60ee6
movq 0x48(%rsp), %rdi
movl 0x8c(%rsp), %esi
callq 0x186d0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x4ac20
cmpl $0x0, %eax
je 0x60e0e
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x20(%rsp)
leaq 0x78(%rsp), %rdi
movl $0x40, %esi
callq 0x1b970
movq 0x20(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x1c2d0
movq 0x80(%rsp), %rdi
callq 0x4afc0
cmpl $0x0, %eax
je 0x60e4e
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x18(%rsp)
leaq 0x70(%rsp), %rdi
movl $0x80, %esi
callq 0x1b970
movq 0x18(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x1c2d0
movq 0x80(%rsp), %rdi
callq 0x4b0e0
cmpl $0x0, %eax
je 0x60e8e
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
movl $0x10, %esi
callq 0x1b970
movq 0x10(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x1c2d0
movq 0x80(%rsp), %rdi
callq 0x4b170
cmpl $0x0, %eax
je 0x60ece
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x8(%rsp)
leaq 0x60(%rsp), %rdi
movl $0x20, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x1c2d0
jmp 0x60ed0
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x60d92
movq 0x48(%rsp), %rax
addq $0xc0, %rax
movq %rax, (%rsp)
leaq 0x58(%rsp), %rdi
movl $0x4, %esi
callq 0x1b970
movq (%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x1c2d0
addq $0xb8, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNode.cpp
// Function: gaps::R3SurfelNode::UpdateSurfelNormals()
void R3SurfelNode::
UpdateSurfelNormals(void) 
{
#if 0
  // Create pointset
  R3SurfelPointSet pointset;
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    pointset.InsertPoints(block);
  }

  // Update normals
  pointset.UpdateNormals();
#else
  // Update normals block-by-block
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    block->UpdateSurfelNormals();
  }
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x186b0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x60f81
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x186d0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x4c4e0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x60f3b
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNodes(gaps::R3SurfelObject*, double)
void R3SurfelNodeSet::
InsertNodes(R3SurfelObject *object, RNScalar max_resolution)
{
  // Insert cut at nodes rooted at object
  for (int i = 0; i < object->NNodes(); i++) {
    R3SurfelNode *node = object->Node(i);
    InsertNodes(node, max_resolution);
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x28(%rsp), %rdi
callq 0x18660
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x61328
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x18680
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movsd 0x20(%rsp), %xmm0
movq (%rdi), %rax
callq *0x18(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x612d6
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNodes(gaps::R3SurfelTree*, gaps::R3Point const&, double, double, double, double, double, double)
void R3SurfelNodeSet::
InsertNodes(R3SurfelTree *tree, 
  const R3Point& xycenter, RNLength xyradius, 
  RNCoord zmin, RNCoord zmax,
  RNScalar center_resolution, RNScalar perimeter_resolution,
  RNScalar focus_exponent)
{
  // Insert nodes recursively starting at root
  InsertNodes(tree, tree->RootNode(), 
    xycenter, xyradius, zmin, zmax, 
    center_resolution, perimeter_resolution, focus_exponent);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm3, 0x20(%rsp)
movsd %xmm4, 0x18(%rsp)
movsd %xmm5, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
callq 0x31030
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
movq 0x40(%rsp), %rcx
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movsd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
movsd 0x10(%rsp), %xmm5
movq (%rdi), %rax
callq *0x30(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNodes(gaps::R3SurfelTree*)
void R3SurfelNodeSet::
InsertNodes(R3SurfelTree *tree)
{
  // Insert all leaf nodes 
  for (int i = 0; i < tree->NNodes(); i++) {
    R3SurfelNode *node = tree->Node(i);
    if (node->NParts() > 0) continue;
    InsertNode(node);
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
callq 0x16cf0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x61a1d
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x30a90
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x31660
cmpl $0x0, %eax
jle 0x61a00
jmp 0x61a10
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%rdi), %rax
callq *0x38(%rax)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x619c0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::InsertNode(gaps::R3SurfelNode*)
void R3SurfelNodeSet::
InsertNode(R3SurfelNode *node)
{
  // Insert node
  nodes.Insert(node);

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

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

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

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x8, %rdi
movq 0x18(%rsp), %rsi
callq 0x1bee0
movq 0x18(%rsp), %rdi
callq 0x5ecb0
movq 0x8(%rsp), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
addq $0x20, %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x5ee30
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xcbc30
movq 0x8(%rsp), %rax
addq $0x58, %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x5eee0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x1bbc0
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::RemoveNode(int)
void R3SurfelNodeSet::
RemoveNode(int k)
{
  // Update complexity
  complexity -= nodes[k]->Complexity();

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

  // Update bounding box
  // XXX

  // Update timestamp range
  // XXX
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x8, %rdi
movl 0x2c(%rsp), %esi
callq 0x61f10
movq (%rax), %rdi
callq 0x5ecb0
movq 0x10(%rsp), %rdi
movaps %xmm0, %xmm1
movsd 0x18(%rdi), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rdi)
addq $0x8, %rdi
movl 0x2c(%rsp), %esi
callq 0x1c080
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x8, %rdi
callq 0x61f30
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x8, %rdi
movq 0x20(%rsp), %rsi
callq 0x61f40
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
addq $0x8, %rdi
callq 0x1c0c0
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::Empty()
void R3SurfelNodeSet::
Empty(void)
{
  // Remove nodes
  nodes.Empty();

  // Update complexity
  complexity = 0;

  // Update bounding box
  bbox = R3null_box;

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x8, %rdi
xorl %esi, %esi
callq 0x142550
movq 0x8(%rsp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rdi)
addq $0x20, %rdi
leaq 0x19b712(%rip), %rsi    # 0x1fd308
callq 0x1bd40
movq 0x8(%rsp), %rdi
addq $0x58, %rdi
movsd 0x142584(%rip), %xmm0   # 0x1a4190
movsd 0x142574(%rip), %xmm1   # 0x1a4188
callq 0x1c150
addq $0x18, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::ReadBlocks()
void R3SurfelNodeSet::
ReadBlocks(void)
{
  // Read nodes in set
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->ReadBlocks();
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x61f50
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x61c83
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x61f70
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x5fe30
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x61c3b
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::ReleaseBlocks()
void R3SurfelNodeSet::
ReleaseBlocks(void)
{
  // Release nodes in set
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->ReleaseBlocks();
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x61f50
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x61cf3
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x61f70
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x5ff20
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x61cab
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::AreBlocksResident() const
RNBoolean R3SurfelNodeSet::
AreBlocksResident(void) const
{
  // Return whether nodes are in memory
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    if (!node->AreBlocksResident()) return FALSE;
  }

  // All nodes are resident
  return TRUE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x24(%rsp)
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x61f50
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x61d72
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x61f70
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x60010
cmpl $0x0, %eax
jne 0x61d63
movl $0x0, 0x34(%rsp)
jmp 0x61d7a
jmp 0x61d65
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x61d1b
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::Draw(gaps::RNFlags) const
void R3SurfelNodeSet::
Draw(RNFlags flags) const
{
  // Draw nodes
  for (int i = 0; i < NNodes(); i++) {
    R3SurfelNode *node = Node(i);
    node->Draw(flags);
  }
}

// Assembly:
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 0x61f50
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x61e06
movq 0x8(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x61f70
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 0x61db0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelNodeSet.cpp
// Function: gaps::R3SurfelNodeSet::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelNodeSet::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

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

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x61e49
movq 0x19114f(%rip), %rax    # 0x1f2f90
movq (%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x61e69
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rdx
leaq 0x145761(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movl $0x0, 0x24(%rsp)
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x61f50
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x61ed4
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x61f70
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x31130
movq (%rsp), %rdi
movl %eax, %edx
leaq 0x1429bf(%rip), %rsi    # 0x1a487f
movb $0x0, %al
callq 0x13810
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x61e71
cmpq $0x0, 0x28(%rsp)
je 0x61ef4
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x1456d6(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x38(%rsp), %rdi
leaq 0x1497f2(%rip), %rsi    # 0x1ab6f2
movb $0x0, %al
callq 0x13810
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::R3SurfelTree()
R3SurfelTree::
R3SurfelTree(void)
  : scene(NULL),
    database(NULL),
    nodes()
{
  // Create database
  database = new R3SurfelDatabase();
  database->tree = this;

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

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x18cb5e(%rip), %rax    # 0x1eeb18
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
addq $0x18, %rdi
movq %rdi, 0x18(%rsp)
callq 0x1b960
movl $0xc0, %edi
callq 0x13570
movq %rax, 0x20(%rsp)
jmp 0x61fec
movq 0x20(%rsp), %rdi
callq 0x71c40
jmp 0x61ff8
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rcx)
movq 0x10(%rcx), %rax
movq %rcx, 0xb0(%rax)
movl $0xd0, %edi
callq 0x13570
movq %rax, 0x8(%rsp)
jmp 0x62022
movq 0x8(%rsp), %rdi
leaq 0x1423aa(%rip), %rsi    # 0x1a43d8
callq 0x5e770
jmp 0x62035
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x620c0
jmp 0x62054
addq $0x48, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x620a5
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
movl $0xc0, %esi
callq 0x13580
jmp 0x620a5
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
movl $0xd0, %esi
callq 0x13580
movq 0x18(%rsp), %rdi
callq 0x1b9a0
movq 0x38(%rsp), %rdi
callq 0x13970
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq %rdi, 0x18(%rax)
addq $0x18, %rdi
callq 0x16d50
movq 0x8(%rsp), %rdi
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x20(%rax)
addq $0x18, %rdi
movq 0x18(%rsp), %rsi
callq 0x1bee0
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x28(%rax)
cmpq $0x0, 0x10(%rsp)
je 0x62135
movq 0x10(%rsp), %rdi
addq $0x30, %rdi
movq 0x18(%rsp), %rsi
callq 0x1bee0
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x60590
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6215e
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1bea0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x18c92e(%rip), %rax    # 0x1eeb18
movq %rax, (%rdi)
callq 0x31030
movq %rax, 0x18(%rsp)
jmp 0x621f9
movq 0x18(%rsp), %rax
cmpq $0x0, %rax
je 0x6222d
movq 0x10(%rsp), %rdi
callq 0x31030
movq %rax, 0x8(%rsp)
jmp 0x62215
movq 0x8(%rsp), %rax
cmpq $0x0, %rax
je 0x6222b
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x6222d
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6224a
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x8(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x62275
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x62273
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x62275
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
callq 0x1b9a0
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x187d0
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x16cf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x62358
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x30a90
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x31110
cmpq $0x0, %rax
jne 0x62321
jmp 0x6234b
movq 0x10(%rsp), %rdi
callq 0x31110
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x137e0
cmpl $0x0, %eax
je 0x6233f
jmp 0x6234b
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x62361
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x622e0
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x60640
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x623b5
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdi
addq $0x30, %rdi
movq 0x28(%rsp), %rsi
callq 0x1bf30
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movq $0x0, 0x28(%rax)
addq $0x18, %rdi
movq 0x28(%rsp), %rax
movl 0x20(%rax), %esi
callq 0x1c080
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x18, %rdi
callq 0x61f30
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl 0x20(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x18, %rdi
movq 0x20(%rsp), %rsi
callq 0x61f40
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
addq $0x18, %rdi
callq 0x1c0c0
movq 0x10(%rsp), %rax
movq 0x28(%rsp), %rcx
movl $0xffffffff, 0x20(%rcx) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rcx
movq $0x0, 0x18(%rcx)
cmpq $0x0, 0x8(%rax)
je 0x62466
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1bea0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movl %edx, 0xa4(%rsp)
movl %ecx, 0xa0(%rsp)
movsd %xmm0, 0x98(%rsp)
movsd %xmm1, 0x90(%rsp)
movsd %xmm2, 0x88(%rsp)
movsd %xmm3, 0x80(%rsp)
movl %r8d, 0x7c(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x68(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x1b960
movq 0x40(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x1bee0
jmp 0x6483e
movl $0x0, 0x58(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x31da0
movl %eax, 0x34(%rsp)
jmp 0x64856
movl 0x34(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x6486b
jmp 0x6496e
leaq 0x68(%rsp), %rdi
callq 0x61f30
movq %rax, 0x28(%rsp)
jmp 0x6487c
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1c0c0
jmp 0x64892
movq 0x38(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl 0xa4(%rsp), %edx
movl 0xa0(%rsp), %ecx
movsd 0x98(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x88(%rsp), %xmm2
movsd 0x80(%rsp), %xmm3
movl 0x7c(%rsp), %r8d
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movl %eax, 0x24(%rsp)
jmp 0x648e2
movl 0x24(%rsp), %eax
orl 0x58(%rsp), %eax
movl %eax, 0x58(%rsp)
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x50(%rsp), %rdi
callq 0x31660
movl %eax, 0x20(%rsp)
jmp 0x6490e
movl 0x1c(%rsp), %eax
movl 0x20(%rsp), %ecx
cmpl %ecx, %eax
jge 0x64969
movq 0x50(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0x43680
movq %rax, 0x10(%rsp)
jmp 0x6492f
movq 0x10(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x1bee0
jmp 0x64940
jmp 0x64942
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x648f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1b9a0
jmp 0x6498c
jmp 0x64846
movl 0x58(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1b9a0
movl 0xc(%rsp), %eax
addq $0xb8, %rsp
retq
movq 0x60(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelTree.cpp
// Function: gaps::R3SurfelTree::SplitNodes(int, int, double, double, double, double, int)
int R3SurfelTree::
SplitNodes(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)
{
  // Split all nodes starting at root node
  return SplitNodes(RootNode(),
      max_parts_per_node, max_blocks_per_node, 
      max_leaf_complexity, max_block_complexity, 
      max_leaf_extent, max_block_extent, 
      max_levels);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movsd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm2, 0x20(%rsp)
movsd %xmm3, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x31030
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl 0x3c(%rsp), %edx
movl 0x38(%rsp), %ecx
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movl 0x14(%rsp), %r8d
movq (%rdi), %rax
callq *0x18(%rax)
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x448, %rsp            # imm = 0x448
movq %rdi, 0x440(%rsp)
movq %rsi, 0x438(%rsp)
movq %rdx, 0x430(%rsp)
movq %rcx, 0x428(%rsp)
movq 0x440(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x438(%rsp)
jne 0x661d1
movq 0x18cdca(%rip), %rax    # 0x1f2f90
movq (%rax), %rax
movq %rax, 0x438(%rsp)
cmpq $0x0, 0x430(%rsp)
je 0x661fa
movq 0x438(%rsp), %rdi
movq 0x430(%rsp), %rdx
leaq 0x1413d0(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x438(%rsp), %rdi
leaq 0x1413ba(%rip), %rsi    # 0x1a75c3
leaq 0x13f66b(%rip), %rdx    # 0x1a587b
movb $0x0, %al
callq 0x13810
cmpq $0x0, 0x428(%rsp)
je 0x66240
movq 0x438(%rsp), %rdi
movq 0x428(%rsp), %rdx
leaq 0x14138a(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x438(%rsp), %rdi
leaq 0x1454a3(%rip), %rsi    # 0x1ab6f2
movb $0x0, %al
callq 0x13810
leaq 0x20(%rsp), %rdi
movq 0x430(%rsp), %rdx
leaq 0x13e189(%rip), %rsi    # 0x1a43f3
movb $0x0, %al
callq 0x130f0
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x16cf0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x662d5
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x30a90
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x438(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq 0x428(%rsp), %rcx
movq (%rdi), %rax
callq *0x60(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x66279
addq $0x448, %rsp            # imm = 0x448
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x1884be(%rip), %rcx    # 0x1eeba8
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x18(%rax)
je 0x6670e
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq 0x78(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
jmp 0x6670c
jmp 0x6670e
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x66733
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq 0x80(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
jmp 0x66731
jmp 0x66733
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x66758
movq 0x8(%rsp), %rsi
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
movq 0x98(%rax), %rax
callq *%rax
jmp 0x66756
jmp 0x66758
movq 0x8(%rsp), %rax
cmpq $0x0, 0xb8(%rax)
je 0x66778
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rdi
callq 0x136a0
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x187d0
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x18(%rsp), %rsi
addq $0x28, %rsi
addq $0x28, %rdi
callq 0x457f0
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rax
movsd 0x88(%rax), %xmm0
movsd %xmm0, 0x88(%rdi)
movq 0x18(%rsp), %rax
movl 0x90(%rax), %eax
movl %eax, 0x90(%rdi)
movq 0x18(%rsp), %rax
movl 0x94(%rax), %eax
movl %eax, 0x94(%rdi)
movq 0x18(%rsp), %rsi
addq $0x98, %rsi
addq $0x98, %rdi
callq 0x133c00
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movsd 0xa8(%rcx), %xmm0
movsd %xmm0, 0xa8(%rax)
movq 0x18(%rsp), %rcx
movsd 0xb0(%rcx), %xmm0
movsd %xmm0, 0xb0(%rax)
movq 0x18(%rsp), %rax
cmpq $0x0, 0xb8(%rax)
je 0x668e3
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rdi
callq 0x1461b0
movq %rax, (%rsp)
jmp 0x668eb
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x668eb
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0xb8(%rax)
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b970
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0xc0(%rax)
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0xb8(%rax)
je 0x66a93
movq 0x10(%rsp), %rax
movq 0xb8(%rax), %rdi
callq 0x136a0
cmpq $0x0, 0x18(%rsp)
je 0x66aac
movq 0x18(%rsp), %rdi
callq 0x1461b0
movq %rax, 0x8(%rsp)
jmp 0x66ab5
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x66ab5
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0xb8(%rdi)
callq 0x67080
cmpq $0x0, %rax
je 0x66ae3
movq 0x10(%rsp), %rdi
callq 0x67080
movq %rax, %rdi
callq 0x1bea0
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::SetNode(gaps::R3SurfelNode*)
void R3SurfelScan::
SetNode(R3SurfelNode *node)
{
  // Check if the same
  if (this->node == node) return;

  // Update old node
  if (this->node) {
    assert(this->node->scan == this);
    this->node->scan = NULL;
  }

  // Update new node
  if (node) {
    assert(node->scan == NULL);
    node->scan = this;
  }

  // Assign node
  this->node = node;

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x66be4
jmp 0x66c3d
movq (%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x66bff
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, 0x8(%rsp)
je 0x66c14
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rdi)
callq 0x67080
cmpq $0x0, %rax
je 0x66c3d
movq (%rsp), %rdi
callq 0x67080
movq %rax, %rdi
callq 0x1bea0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScan.cpp
// Function: gaps::R3SurfelScan::SetImage(gaps::R3SurfelImage*)
void R3SurfelScan::
SetImage(R3SurfelImage *image)
{
  // Check if the same
  if (this->image == image) return;

  // Update old image
  if (this->image) {
    assert(this->image->scan == this);
    this->image->scan = NULL;
  }

  // Update new image
  if (image) {
    assert(image->scan == NULL);
    image->scan = this;
  }

  // Assign image
  this->image = image;

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x66c74
jmp 0x66ccd
movq (%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x66c8f
movq (%rsp), %rax
movq 0x20(%rax), %rax
movq $0x0, 0x18(%rax)
cmpq $0x0, 0x8(%rsp)
je 0x66ca4
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rdi)
callq 0x67080
cmpq $0x0, %rax
je 0x66ccd
movq (%rsp), %rdi
callq 0x67080
movq %rax, %rdi
callq 0x1bea0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x66d19
movq 0x18c27f(%rip), %rax    # 0x1f2f90
movq (%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x66d39
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rdx
leaq 0x140891(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
callq 0x31650
movq 0x30(%rsp), %rdi
movl %eax, 0x2c(%rsp)
callq 0x30870
cmpq $0x0, %rax
je 0x66d72
movq 0x30(%rsp), %rdi
callq 0x30870
movq %rax, 0x18(%rsp)
jmp 0x66d80
leaq 0x13d5f3(%rip), %rax    # 0x1a436c
movq %rax, 0x18(%rsp)
jmp 0x66d80
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x314f0
cmpq $0x0, %rax
je 0x66dae
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x31130
movl %eax, 0xc(%rsp)
jmp 0x66db9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc(%rsp)
jmp 0x66db9
movq 0x30(%rsp), %rdi
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
callq 0x67090
cmpq $0x0, %rax
je 0x66de5
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x670a0
movl %eax, 0x4(%rsp)
jmp 0x66df0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x4(%rsp)
jmp 0x66df0
movl 0x8(%rsp), %r8d
movq 0x10(%rsp), %rcx
movl 0x2c(%rsp), %edx
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %r9d
leaq 0x13ea87(%rip), %rsi    # 0x1a5896
movb $0x0, %al
callq 0x13810
cmpq $0x0, 0x38(%rsp)
je 0x66e36
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rdx
leaq 0x140794(%rip), %rsi    # 0x1a75c3
movb $0x0, %al
callq 0x13810
movq 0x48(%rsp), %rdi
leaq 0x1448b0(%rip), %rsi    # 0x1ab6f2
movb $0x0, %al
callq 0x13810
addq $0x58, %rsp
retq
nop
// File: 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:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq %rdx, 0x100(%rsp)
movq 0x108(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x31400
movq %rax, %rsi
leaq 0x68(%rsp), %rdi
callq 0xd5640
movq 0x100(%rsp), %rdx
leaq 0xe8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xdc230
leaq 0xe8(%rsp), %rdi
callq 0x187a0
leaq 0x19562f(%rip), %rax    # 0x1fc548
movsd (%rax), %xmm1
callq 0x503b0
cmpl $0x0, %eax
je 0x66f3d
movq 0x30(%rsp), %rdi
leaq 0x597fc5(%rip), %rsi    # 0x5feef8
callq 0x133990
jmp 0x67070
movq 0x40(%rsp), %rdi
callq 0x314b0
movq %rax, %rsi
leaq 0x58(%rsp), %rdi
callq 0x133990
leaq 0x58(%rsp), %rdi
callq 0x308e0
movq 0x40(%rsp), %rax
movsd %xmm0, 0x10(%rsp)
movsd 0xa8(%rax), %xmm0
movsd %xmm0, (%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x187b0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x187a0
movsd 0x8(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x10(%rsp), %xmm0
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x30910
movq 0x40(%rsp), %rax
movsd %xmm0, 0x28(%rsp)
movsd 0xb0(%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x187c0
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x187a0
movsd 0x20(%rsp), %xmm1
movq 0x30(%rsp), %rdi
movaps %xmm0, %xmm2
movsd 0x28(%rsp), %xmm0
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
callq 0x133960
movq 0x38(%rsp), %rax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x187546(%rip), %rcx    # 0x1eec60
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x18(%rax)
je 0x67741
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0xd0(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
jmp 0x6773f
jmp 0x67741
movq 0x18(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x67766
movq 0x18(%rsp), %rsi
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
movq 0xa8(%rax), %rax
callq *%rax
jmp 0x67764
jmp 0x67766
movl $0x0, 0x2c(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0x10(%rsp)
addq $0x20, %rdi
callq 0x16d50
movl %eax, 0x14(%rsp)
jmp 0x6778a
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %eax
jge 0x677fb
movq 0x18(%rsp), %rdi
addq $0x20, %rdi
movl 0x2c(%rsp), %esi
callq 0x6b840
movq %rax, 0x8(%rsp)
jmp 0x677af
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x677e9
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x677e7
movq (%rsp), %rdi
callq 0x1127b0
movq (%rsp), %rdi
movl $0xd0, %esi
callq 0x13580
jmp 0x677e9
jmp 0x677eb
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x6776e
movq 0x18(%rsp), %rax
cmpq $0x0, 0x1c0(%rax)
je 0x6781b
movq 0x18(%rsp), %rax
movq 0x1c0(%rax), %rdi
callq 0x136a0
movq 0x18(%rsp), %rdi
addq $0x20, %rdi
callq 0x6b830
addq $0x38, %rsp
retq
movq %rax, %rdi
callq 0x187d0
nopw %cs:(%rax,%rax)
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movsd %xmm0, 0x90(%rsp)
movsd %xmm1, 0x88(%rsp)
movq 0x98(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x31540
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x80(%rsp)
callq 0x31560
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x78(%rsp)
callq 0x31580
movq %rax, %rdi
callq 0x308e0
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x70(%rsp)
callq 0x31580
movq %rax, %rdi
callq 0x30910
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x68(%rsp)
callq 0x308f0
movq 0x40(%rsp), %rdi
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x60(%rsp)
callq 0x30920
movq 0x48(%rsp), %rdi
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x13c522(%rip), %xmm0   # 0x1a4178
mulsd 0x80(%rsp), %xmm0
divsd 0x60(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
divsd 0x60(%rsp), %xmm1
addsd %xmm1, %xmm1
movsd 0x13c4eb(%rip), %xmm2   # 0x1a4168
subsd %xmm1, %xmm2
movsd 0x13c4ef(%rip), %xmm5   # 0x1a4178
mulsd 0x78(%rsp), %xmm5
divsd 0x58(%rsp), %xmm5
movsd 0x68(%rsp), %xmm1
divsd 0x58(%rsp), %xmm1
addsd %xmm1, %xmm1
movsd 0x13c4bb(%rip), %xmm6   # 0x1a4168
subsd %xmm1, %xmm6
movsd 0x88(%rsp), %xmm1
addsd 0x90(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm11
movsd 0x88(%rsp), %xmm1
subsd 0x90(%rsp), %xmm1
divsd %xmm1, %xmm11
movsd 0x13cdf6(%rip), %xmm10  # 0x1a4af0
mulsd 0x90(%rsp), %xmm10
mulsd 0x88(%rsp), %xmm10
movsd 0x88(%rsp), %xmm1
subsd 0x90(%rsp), %xmm1
divsd %xmm1, %xmm10
xorps %xmm8, %xmm8
movsd 0x13c44e(%rip), %xmm9   # 0x1a4180
movaps %xmm8, %xmm1
movaps %xmm8, %xmm3
movaps %xmm8, %xmm4
movaps %xmm8, %xmm7
movsd %xmm8, (%rsp)
movsd %xmm8, 0x8(%rsp)
movsd %xmm11, 0x10(%rsp)
movsd %xmm10, 0x18(%rsp)
movsd %xmm8, 0x20(%rsp)
movsd %xmm8, 0x28(%rsp)
movsd %xmm9, 0x30(%rsp)
movsd %xmm8, 0x38(%rsp)
callq 0xd8c40
movq 0x50(%rsp), %rax
addq $0xa8, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x50(%rsp)
movq %rdi, %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x230(%rsp)
movq %rsi, 0x228(%rsp)
movq %rdx, 0x220(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x60(%rsp)
movsd 0xb0(%rax), %xmm0
leaq 0x194770(%rip), %rax    # 0x1fc548
movsd (%rax), %xmm1
callq 0x50350
cmpl $0x0, %eax
je 0x67dfc
movq 0x50(%rsp), %rdi
leaq 0x59601e(%rip), %rsi    # 0x5fde10
callq 0xf7c10
jmp 0x67faf
movq 0x60(%rsp), %rax
movsd 0xb8(%rax), %xmm0
leaq 0x194738(%rip), %rax    # 0x1fc548
movsd (%rax), %xmm1
callq 0x50350
cmpl $0x0, %eax
je 0x67e34
movq 0x50(%rsp), %rdi
leaq 0x595fe6(%rip), %rsi    # 0x5fde10
callq 0xf7c10
jmp 0x67faf
leaq 0x208(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xf8340
movq 0x220(%rsp), %rdi
xorl %esi, %esi
movl %esi, 0x44(%rsp)
callq 0x45390
movq 0x60(%rsp), %rdi
movsd %xmm0, (%rsp)
addq $0xa0, %rdi
movq %rdi, 0x10(%rsp)
callq 0x308e0
movq 0x30(%rsp), %rdi
movq 0x60(%rsp), %rax
movl 0x44(%rsp), %esi
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
subsd %xmm1, %xmm0
movsd 0xb0(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x1bde0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x220(%rsp), %rdi
movl $0x1, %esi
movl %esi, 0x1c(%rsp)
callq 0x45390
movq 0x10(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
callq 0x30910
movl 0x1c(%rsp), %esi
movq 0x30(%rsp), %rdi
movq 0x60(%rsp), %rax
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd 0xb8(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0x1bde0
movsd 0x28(%rsp), %xmm0
movq 0x30(%rsp), %rdi
movsd %xmm0, (%rax)
movl $0x2, %esi
callq 0x1bde0
movq 0x30(%rsp), %rdx
movq 0x50(%rsp), %rdi
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
leaq 0x596172(%rip), %rsi    # 0x5fe0b0
callq 0xf7c80
movq 0x60(%rsp), %rsi
leaq 0x78(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x6b8f0
movq 0x38(%rsp), %rsi
movl 0x44(%rsp), %edx
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xd4480
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xf7e30
jmp 0x67f83
leaq 0xf8(%rsp), %rdi
callq 0xd4520
jmp 0x67faf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0xd4520
jmp 0x67fbc
movq 0x58(%rsp), %rax
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x70(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)