LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelProperty.cpp
// Function: gaps::R3SurfelLabelProperty::R3SurfelLabelProperty(gaps::R3SurfelLabelProperty const&)
R3SurfelLabelProperty::
R3SurfelLabelProperty(const R3SurfelLabelProperty& property)
  : scene(NULL),
    scene_index(-1),
    label(property.label),
    operands(NULL),
    noperands(0),
    type(property.type)
{
  // Copy operands
  if ((property.noperands > 0) && (property.operands)) {
    this->noperands = property.noperands;
    this->operands = new RNScalar [ this->noperands ];
    for (int i = 0; i < this->noperands; i++) {
      this->operands[i] = property.operands[i];
    }
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x17dec9(%rip), %rcx    # 0x1eef88
addq $0x10, %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq $0x0, 0x20(%rax)
movl $0x0, 0x28(%rax)
movq 0x18(%rsp), %rcx
movl 0x2c(%rcx), %ecx
movl %ecx, 0x2c(%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x28(%rax)
jle 0x711a7
movq 0x18(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x711a7
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, 0x28(%rax)
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x13030
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x28(%rcx), %eax
jge 0x711a5
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x20(%rcx), %rcx
movslq 0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x20(%rax), %rax
movslq 0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x71164
jmp 0x711a7
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelProperty.cpp
// Function: gaps::R3SurfelLabelProperty::~R3SurfelLabelProperty()
R3SurfelLabelProperty::
~R3SurfelLabelProperty(void)
{
  // Remove from scene (removes from everything)
  if (scene) scene->RemoveLabelProperty(this);

  // Delete operands
  if (operands) delete [] operands;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x17ddbe(%rip), %rcx    # 0x1eef88
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x8(%rax)
je 0x711ee
movq 0x8(%rsp), %rsi
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
jmp 0x711ec
jmp 0x711ee
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x71218
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x71216
movq (%rsp), %rdi
callq 0x13750
jmp 0x71218
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x187d0
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelProperty.cpp
// Function: gaps::R3SurfelLabelProperty::operator=(gaps::R3SurfelLabelProperty const&)
R3SurfelLabelProperty& R3SurfelLabelProperty::
operator=(const R3SurfelLabelProperty& property)
{
  // Assign stuff
  this->label = property.label;
  this->type = property.type;
  
  // Delete previous operands
  if (this->operands) {
    delete [] this->operands;
    this->operands = NULL;
    this->noperands = 0;
  }

  // Copy operands
  if ((property.noperands > 0) && (property.operands)) {
    this->noperands = property.noperands;
    this->operands = new RNScalar [ this->noperands ];
    for (int i = 0; i < this->noperands; i++) {
      this->operands[i] = property.operands[i];
    }
  }

  // Return this
  return *this;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rcx
movl 0x2c(%rcx), %ecx
movl %ecx, 0x2c(%rax)
cmpq $0x0, 0x20(%rax)
je 0x712c7
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x712b3
movq (%rsp), %rdi
callq 0x13750
movq 0x8(%rsp), %rax
movq $0x0, 0x20(%rax)
movl $0x0, 0x28(%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x28(%rax)
jle 0x71372
movq 0x18(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x71372
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, 0x28(%rax)
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x13030
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x28(%rcx), %eax
jge 0x71370
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x20(%rcx), %rcx
movslq 0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x20(%rax), %rax
movslq 0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x7132f
jmp 0x71372
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelRelationship.cpp
// Function: gaps::R3SurfelLabelRelationship::R3SurfelLabelRelationship(int, gaps::RNArray<gaps::R3SurfelLabel*> const&, double*, int)
R3SurfelLabelRelationship::
R3SurfelLabelRelationship(int type, const RNArray<R3SurfelLabel *>& labels, RNScalar *operands, int noperands)
  : scene(NULL),
    scene_index(-1),
    labels(labels),
    operands(NULL),
    noperands(0),
    type(type)
{
  // Copy operands, if provided
  if ((noperands > 0) && (operands)) {
    this->noperands = noperands;
    this->operands = new RNScalar [ this->noperands ];
    for (int i = 0; i < this->noperands; i++) {
      this->operands[i] = operands[i];
    }
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movl %r8d, 0x34(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
leaq 0x17dbfb(%rip), %rax    # 0x1eefb8
addq $0x10, %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
addq $0x18, %rdi
movq %rdi, 0x10(%rsp)
movq 0x40(%rsp), %rsi
callq 0x71960
movq 0x18(%rsp), %rax
movq $0x0, 0x28(%rax)
movl $0x0, 0x30(%rax)
movl 0x4c(%rsp), %ecx
movl %ecx, 0x34(%rax)
cmpl $0x0, 0x34(%rsp)
jle 0x714b9
cmpq $0x0, 0x38(%rsp)
je 0x714b9
movq 0x18(%rsp), %rax
movl 0x34(%rsp), %ecx
movl %ecx, 0x30(%rax)
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x13030
movq %rax, 0x8(%rsp)
jmp 0x7144a
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x28(%rax)
movl $0x0, 0x20(%rsp)
movq 0x18(%rsp), %rcx
movl 0x20(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x714b7
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
movslq 0x20(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x28(%rax), %rax
movslq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x71460
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x30620
jmp 0x714be
jmp 0x714b9
addq $0x58, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x13970
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelRelationship.cpp
// Function: gaps::R3SurfelLabelRelationship::R3SurfelLabelRelationship(int, gaps::R3SurfelLabel*, gaps::R3SurfelLabel*, double*, int)
R3SurfelLabelRelationship::
R3SurfelLabelRelationship(int type, R3SurfelLabel *label0, R3SurfelLabel *label1, RNScalar *operands, int noperands)
  : scene(NULL),
    scene_index(-1),
    labels(),
    operands(NULL),
    noperands(0),
    type(type)
{
  // Insert labels
  labels.Insert(label0);
  labels.Insert(label1);

  // Copy operands, if provided
  if ((noperands > 0) && (operands)) {
    this->noperands = noperands;
    this->operands = new RNScalar [ this->noperands ];
    for (int i = 0; i < this->noperands; i++) {
      this->operands[i] = operands[i];
    }
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x17dac6(%rip), %rax    # 0x1eefc8
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
addq $0x18, %rdi
movq %rdi, 0x10(%rsp)
callq 0x30550
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdi
movq $0x0, 0x28(%rax)
movl $0x0, 0x30(%rax)
movl 0x4c(%rsp), %ecx
movl %ecx, 0x34(%rax)
movq 0x40(%rsp), %rsi
callq 0x30ae0
jmp 0x7154e
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movq 0x38(%rsp), %rsi
callq 0x30ae0
jmp 0x71563
cmpl $0x0, 0x2c(%rsp)
jle 0x71619
cmpq $0x0, 0x30(%rsp)
je 0x71619
movq 0x8(%rsp), %rax
movl 0x2c(%rsp), %ecx
movl %ecx, 0x30(%rax)
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x13030
movq %rax, (%rsp)
jmp 0x715ab
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0x28(%rax)
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rcx
movl 0x18(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x71617
movq 0x8(%rsp), %rax
movq 0x30(%rsp), %rcx
movslq 0x18(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x28(%rax), %rax
movslq 0x18(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x715c0
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x30620
jmp 0x7161e
jmp 0x71619
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x13970
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelRelationship.cpp
// Function: gaps::R3SurfelLabelRelationship::R3SurfelLabelRelationship(gaps::R3SurfelLabelRelationship const&)
R3SurfelLabelRelationship::
R3SurfelLabelRelationship(const R3SurfelLabelRelationship& relationship)
  : scene(NULL),
    scene_index(-1),
    labels(relationship.labels),
    operands(NULL),
    noperands(0),
    type(relationship.type)
{
  // Copy operands
  if ((relationship.noperands > 0) && (relationship.operands)) {
    this->noperands = relationship.noperands;
    this->operands = new RNScalar [ this->noperands ];
    for (int i = 0; i < this->noperands; i++) {
      this->operands[i] = relationship.operands[i];
    }
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x17d969(%rip), %rax    # 0x1eefb8
addq $0x10, %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
addq $0x18, %rdi
movq %rdi, 0x8(%rsp)
movq 0x28(%rsp), %rsi
addq $0x18, %rsi
callq 0x71960
movq 0x10(%rsp), %rax
movq $0x0, 0x28(%rax)
movl $0x0, 0x30(%rax)
movq 0x28(%rsp), %rcx
movl 0x34(%rcx), %ecx
movl %ecx, 0x34(%rax)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jle 0x71761
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x71761
movq 0x10(%rsp), %rax
movq 0x28(%rsp), %rcx
movl 0x30(%rcx), %ecx
movl %ecx, 0x30(%rax)
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x13030
movq %rax, (%rsp)
jmp 0x716ef
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0x28(%rax)
movl $0x0, 0x18(%rsp)
movq 0x10(%rsp), %rcx
movl 0x18(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x7175f
movq 0x10(%rsp), %rax
movq 0x28(%rsp), %rcx
movq 0x28(%rcx), %rcx
movslq 0x18(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x28(%rax), %rax
movslq 0x18(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x71704
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x30620
jmp 0x71766
jmp 0x71761
addq $0x38, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x13970
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelRelationship.cpp
// Function: gaps::R3SurfelLabelRelationship::~R3SurfelLabelRelationship()
R3SurfelLabelRelationship::
~R3SurfelLabelRelationship(void)
{
  // Remove from scene (and everything in it)
  if (scene) scene->RemoveLabelRelationship(this);

  // Delete operands
  if (operands) delete [] operands;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x17d82e(%rip), %rcx    # 0x1eefb8
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x8(%rax)
je 0x717ae
movq 0x8(%rsp), %rsi
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
movq 0x78(%rax), %rax
callq *%rax
jmp 0x717ac
jmp 0x717ae
movq 0x8(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x717d8
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x717d6
movq (%rsp), %rdi
callq 0x13750
jmp 0x717d8
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
callq 0x30620
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x187d0
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelRelationship.cpp
// Function: gaps::R3SurfelLabelRelationship::operator=(gaps::R3SurfelLabelRelationship const&)
R3SurfelLabelRelationship& R3SurfelLabelRelationship::
operator=(const R3SurfelLabelRelationship& relationship)
{
  // Copy stuff
  this->labels = relationship.labels;
  this->type = relationship.type;

  // Delete previous operands
  if (this->operands) {
    delete [] this->operands;
    this->operands = NULL;
    this->noperands =0;
  }
  
  // Copy operands
  if ((relationship.noperands > 0) && (relationship.operands)) {
    this->noperands = relationship.noperands;
    this->operands = new RNScalar [ this->noperands ];
    for (int i = 0; i < this->noperands; i++) {
      this->operands[i] = relationship.operands[i];
    }
  }

  // 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 $0x18, %rsi
addq $0x18, %rdi
callq 0x71990
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movl 0x34(%rcx), %ecx
movl %ecx, 0x34(%rax)
cmpq $0x0, 0x28(%rax)
je 0x718a1
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x7188d
movq (%rsp), %rdi
callq 0x13750
movq 0x8(%rsp), %rax
movq $0x0, 0x28(%rax)
movl $0x0, 0x30(%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jle 0x7194c
movq 0x18(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x7194c
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movl 0x30(%rcx), %ecx
movl %ecx, 0x30(%rax)
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x13030
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x7194a
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x28(%rcx), %rcx
movslq 0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x28(%rax), %rax
movslq 0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x71909
jmp 0x7194c
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabelAssignment.cpp
// Function: gaps::R3SurfelLabelAssignment::operator=(gaps::R3SurfelLabelAssignment const&)
R3SurfelLabelAssignment& R3SurfelLabelAssignment::
operator=(const R3SurfelLabelAssignment& assignment)
{
  // Copy properties
  this->object = assignment.object;
  this->object_index = -1;
  this->label = assignment.label;
  this->label_index = -1;
  this->confidence = assignment.confidence;
  this->originator = assignment.originator;

  // Return this
  return *this;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq %rcx, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rsp), %rcx
movsd 0x38(%rcx), %xmm0
movsd %xmm0, 0x38(%rax)
movq -0x10(%rsp), %rcx
movl 0x40(%rcx), %ecx
movl %ecx, 0x40(%rax)
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::~R3SurfelDatabase()
R3SurfelDatabase::
~R3SurfelDatabase(void)
{
  // Close database
  if (IsOpen()) CloseFile();

  // Delete blocks
  while (NBlocks() > 0) {
    R3SurfelBlock *block = Block(NBlocks()-1);
    // This allows delete of database without releasing all blocks
    block->file_read_count = 0; 
    RemoveBlock(block);
    delete block;
  }

  // Remove from tree
  if (tree) tree->database = NULL;

  // Delete filename
  if (filename) free(filename);

  // Delete rwaccess
  if (rwaccess) free(rwaccess);

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

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x18(%rsp)
leaq 0x17d116(%rip), %rax    # 0x1ef030
movq %rax, (%rdi)
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movl %eax, 0x24(%rsp)
jmp 0x71f2c
movl 0x24(%rsp), %eax
cmpl $0x0, %eax
je 0x71f47
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
jmp 0x71f45
jmp 0x71f47
jmp 0x71f49
movq 0x18(%rsp), %rdi
callq 0x16d20
movl %eax, 0x14(%rsp)
jmp 0x71f59
movl 0x14(%rsp), %eax
cmpl $0x0, %eax
jle 0x71fe6
movq 0x18(%rsp), %rdi
callq 0x16d20
movl %eax, 0x10(%rsp)
jmp 0x71f76
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
decl %esi
callq 0x31a50
movq %rax, 0x8(%rsp)
jmp 0x71f8d
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl $0x0, 0xb4(%rax)
movq 0x28(%rsp), %rsi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x71fbb
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x71fe1
movq (%rsp), %rdi
callq 0x4a1c0
movq (%rsp), %rdi
movl $0xc8, %esi
callq 0x13580
jmp 0x71f49
movq 0x18(%rsp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x72009
movq 0x18(%rsp), %rax
movq 0xb0(%rax), %rax
movq $0x0, 0x10(%rax)
movq 0x18(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x72023
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x136a0
movq 0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x7203d
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x136a0
movq 0x18(%rsp), %rax
cmpq $0x0, 0xa8(%rax)
je 0x7205d
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rdi
callq 0x136a0
movq 0x18(%rsp), %rdi
addq $0x58, %rdi
callq 0x1b990
movq 0x18(%rsp), %rdi
addq $0x40, %rdi
callq 0x43730
addq $0x38, %rsp
retq
movq %rax, %rdi
callq 0x187d0
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::SetMarks(int)
void R3SurfelDatabase::
SetMarks(RNBoolean mark)
{
  // Mark all surfels
  for (int i = 0; i < NBlocks(); i++) {
    R3SurfelBlock *block = Block(i);
    block->SetMarks(mark);
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x16d20
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x72199
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x31a50
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x4bcd0
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x7214f
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::InsertBlock(gaps::R3SurfelBlock*)
void R3SurfelDatabase::
InsertBlock(R3SurfelBlock *block)
{
  // Just checking
  assert(block->database == NULL);
  assert(block->database_index == -1);
  assert(block->file_surfels_offset == 0);
  assert(block->file_surfels_count == 0);
  assert(block->file_read_count == 0);

  // Update block database info
  block->database = this;
  block->database_index = blocks.NEntries();
  block->file_surfels_offset = 0;
  block->file_surfels_count = 0;
  block->file_read_count = (block->surfels) ? 1 : 0;
  block->SetDirty(TRUE);

  // Insert block
  blocks.Insert(block);

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

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

  // Update max identifier
  if (block->MaxIdentifier() > max_identifier)
    max_identifier = block->MaxIdentifier();

  // Update number of surfels
  nsurfels += block->NSurfels();

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

  // Update resident surfels
  if (block->surfels) resident_surfels += block->NSurfels();

#ifdef PRINT_DEBUG
  // Print debug message
  printf("Inserted Block %6d : %6d %9ld : %9.3f %9.3f %9.3f\n", 
    block->database_index, block->nsurfels, resident_surfels,
    block->Centroid().X(), block->Centroid().Y(), block->Centroid().Z()); 
  fflush(stdout);
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rdi, 0x98(%rax)
addq $0x40, %rdi
callq 0x16d50
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xa0(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0xb0(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rdx
xorl %ecx, %ecx
movl $0x1, %eax
cmpq $0x0, %rdx
cmovnel %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xb4(%rax)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x4b240
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
movq 0x18(%rsp), %rsi
callq 0x436c0
movq 0x10(%rsp), %rax
addq $0x58, %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x4a500
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xcbc30
movq 0x10(%rsp), %rax
addq $0x90, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0x4a780
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x1bbc0
movq 0x18(%rsp), %rdi
callq 0x4a9c0
movq 0x10(%rsp), %rcx
cmpl 0xa0(%rcx), %eax
jbe 0x722b4
movq 0x18(%rsp), %rdi
callq 0x4a9c0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xa0(%rax)
movq 0x18(%rsp), %rdi
callq 0x1c0e0
movq 0x10(%rsp), %rsi
cltq
addq 0x50(%rsi), %rax
movq %rax, 0x50(%rsi)
movq 0x18(%rsp), %rdi
callq 0x763b0
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0x72304
movq 0x18(%rsp), %rdi
callq 0x1c0e0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movslq %ecx, %rcx
addq 0xb8(%rax), %rcx
movq %rcx, 0xb8(%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::RemoveBlock(gaps::R3SurfelBlock*)
void R3SurfelDatabase::
RemoveBlock(R3SurfelBlock *block)
{
  // Just checking
  assert(block->file_read_count == 0);
  assert(block->database == this);
  assert(block->node == NULL);
    
  // Update resident surfels
  if (block->surfels) resident_surfels -= block->NSurfels();
  assert(resident_surfels >= 0);
    
  // Update block
  block->UpdateBeforeRemove(this);
    
  // Find block
  RNArrayEntry *entry = blocks.KthEntry(block->database_index);
  if (!entry) return;
  R3SurfelBlock *tail = blocks.Tail();
  blocks.EntryContents(entry) = tail;
  tail->database_index = block->database_index;
  blocks.RemoveTail();
    
  // Reset block database info
  block->database = NULL;
  block->database_index = -1;
  block->file_surfels_offset = 0;
  block->file_surfels_count = 0;
  block->file_read_count = 0;
  block->SetDirty(FALSE);
    
  // Update number of surfels
  nsurfels -= block->NSurfels();
  assert(nsurfels >= 0);

  // Does not update bounding box
  // XXX

#ifdef PRINT_DEBUG
  // Print debug message
  printf("Removed Block  %6d : %6d %9ld : %9.3f %9.3f %9.3f\n", 
         block->database_index, block->nsurfels, resident_surfels,
         block->Centroid().X(), block->Centroid().Y(), block->Centroid().Z()); 
  fflush(stdout);
#endif
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x72358
movq 0x28(%rsp), %rdi
callq 0x1c0e0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movslq %ecx, %rdx
movq 0xb8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xb8(%rax)
movq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x763c0
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
movq 0x28(%rsp), %rax
movl 0xa0(%rax), %esi
callq 0x1c080
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x72392
jmp 0x72466
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
callq 0x66330
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x40, %rdi
movq 0x20(%rsp), %rsi
callq 0x763d0
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl 0xa0(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xa0(%rax)
addq $0x40, %rdi
callq 0x1c0c0
movq 0x28(%rsp), %rax
movq $0x0, 0x98(%rax)
movq 0x28(%rsp), %rax
movl $0xffffffff, 0xa0(%rax) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x28(%rsp), %rax
movl $0x0, 0xb0(%rax)
movq 0x28(%rsp), %rax
movl $0x0, 0xb4(%rax)
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x4b240
movq 0x28(%rsp), %rdi
callq 0x1c0e0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movslq %ecx, %rdx
movq 0x50(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x50(%rax)
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::RemoveAndDeleteBlock(gaps::R3SurfelBlock*)
void R3SurfelDatabase::
RemoveAndDeleteBlock(R3SurfelBlock *block)
{
  // Check if still referenced
  if (block->file_read_count == 0) {
    // Block is not referenced, can simply delete it
    RemoveBlock(block);
    delete block;
  }
  else {
    // Block is referenced, mark for delete later
    block->flags.Add(R3_SURFEL_BLOCK_DELETE_PENDING_FLAG);
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, 0xb4(%rax)
jne 0x724d1
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x724cf
movq 0x10(%rsp), %rdi
callq 0x4a1c0
movq 0x10(%rsp), %rdi
movl $0xc8, %esi
callq 0x13580
jmp 0x724ff
movq 0x28(%rsp), %rax
addq $0x88, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1c2d0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::NBytesPerSurfel() const
int R3SurfelDatabase::
NBytesPerSurfel(void) const
{
  // Return number of bytes per surfel
  if (major_version == current_major_version) {
    return sizeof(R3Surfel);
  }
  else {
    switch (major_version) {
    case 6: return 48;
    case 5: return 44;
    case 4: return 40;
    case 3: return 24;
    default: return 16;
    }
  }

  // Should never get here
  return sizeof(R3Surfel);
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x18(%rsp)
movl 0x20(%rax), %eax
cmpl 0x180c70(%rip), %eax    # 0x1f3588
jne 0x72924
movl $0x30, -0x4(%rsp)
jmp 0x72980
movq -0x18(%rsp), %rax
movl 0x20(%rax), %eax
addl $-0x3, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rsp)
subl $0x3, %eax
ja 0x72978
movq -0x20(%rsp), %rax
leaq 0x133129(%rip), %rcx    # 0x1a5a70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x30, -0x4(%rsp)
jmp 0x72980
movl $0x2c, -0x4(%rsp)
jmp 0x72980
movl $0x28, -0x4(%rsp)
jmp 0x72980
movl $0x18, -0x4(%rsp)
jmp 0x72980
movl $0x10, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelDatabase::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print name
  fprintf(fp, "%s%s%s\n", (prefix) ? prefix : "", (name) ? name : "Database", (suffix) ? suffix : "");

  // Add indent to prefix
  char indent_prefix[1024];
  sprintf(indent_prefix, "%s  ", (prefix) ? prefix : "");

  // Print blocks
  for (int i = 0; i < NBlocks(); i++) {
    blocks[i]->Print(fp, indent_prefix, suffix);
  }
}

// Assembly:
subq $0x488, %rsp            # imm = 0x488
movq %rdi, 0x480(%rsp)
movq %rsi, 0x478(%rsp)
movq %rdx, 0x470(%rsp)
movq %rcx, 0x468(%rsp)
movq 0x480(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x478(%rsp)
jne 0x72a61
movq 0x18053a(%rip), %rax    # 0x1f2f90
movq (%rax), %rax
movq %rax, 0x478(%rsp)
movq 0x478(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x470(%rsp)
je 0x72a88
movq 0x470(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x72a96
leaq 0x13364e(%rip), %rax    # 0x1a60dd
movq %rax, 0x40(%rsp)
jmp 0x72a96
movq 0x50(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, 0x38(%rsp)
cmpq $0x0, 0xa8(%rax)
je 0x72ac2
movq 0x50(%rsp), %rax
movq 0xa8(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x72ad0
leaq 0x133115(%rip), %rax    # 0x1a5bde
movq %rax, 0x30(%rsp)
jmp 0x72ad0
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x468(%rsp)
je 0x72af4
movq 0x468(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x72b02
leaq 0x1335e2(%rip), %rax    # 0x1a60dd
movq %rax, 0x20(%rsp)
jmp 0x72b02
movq 0x28(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %r8
leaq 0x132f87(%rip), %rsi    # 0x1a5aa4
movb $0x0, %al
callq 0x13810
leaq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x470(%rsp)
je 0x72b48
movq 0x470(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b56
leaq 0x13358e(%rip), %rax    # 0x1a60dd
movq %rax, 0x10(%rsp)
jmp 0x72b56
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x13188c(%rip), %rsi    # 0x1a43f3
movb $0x0, %al
callq 0x130f0
movl $0x0, 0x5c(%rsp)
movq 0x50(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x16d20
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x72bce
movq 0x50(%rsp), %rdi
addq $0x40, %rdi
movl 0x5c(%rsp), %esi
callq 0x188a0
movq %rax, %rdi
movq 0x478(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq 0x468(%rsp), %rcx
callq 0x4cc70
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x72b76
addq $0x488, %rsp            # imm = 0x488
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::WriteFile(char const*)
int R3SurfelDatabase::
WriteFile(const char *filename)
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .xyz)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strncmp(extension, ".ssb", 5)) {
    // Open file
    FILE *f = fopen(filename, "wb");
    if (!f) {
      RNFail("Unable to open file %s\n", filename);
      return 0;
    }

    // Write stream
    if (!WriteStream(f)) {
      fclose(f);
      return 0;
    }

    // Close file
    fclose(f);
  }
  else if (NBlocks() == 1) {
    R3SurfelDatabase *database = (R3SurfelDatabase *) this;
    R3SurfelBlock *block = Block(0);
    if (!database->ReadBlock(block)) return 0;
    if (!block->WriteFile(filename)) return 0;
    if (!database->ReleaseBlock(block)) return 0;
  }
  else {
    RNFail("Invalid file extension %s for database with more than one block\n", extension);
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl $0x2e, %esi
callq 0x13630
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
jne 0x73002
movq 0x30(%rsp), %rsi
leaq 0x132b00(%rip), %rdi    # 0x1a5aee
movb $0x0, %al
callq 0x13070
movl $0x0, 0x44(%rsp)
jmp 0x7313e
movq 0x28(%rsp), %rdi
leaq 0x132a9e(%rip), %rsi    # 0x1a5aac
movl $0x5, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0x73096
movq 0x30(%rsp), %rdi
leaq 0x1320ee(%rip), %rsi    # 0x1a5117
callq 0x13690
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x7305b
movq 0x30(%rsp), %rsi
leaq 0x13145f(%rip), %rdi    # 0x1a44a6
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x44(%rsp)
jmp 0x7313e
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
callq *0x68(%rax)
cmpl $0x0, %eax
jne 0x73087
movq 0x20(%rsp), %rdi
callq 0x13560
movl $0x0, 0x44(%rsp)
jmp 0x7313e
movq 0x20(%rsp), %rdi
callq 0x13560
jmp 0x73136
movq 0x8(%rsp), %rdi
callq 0x16d20
cmpl $0x1, %eax
jne 0x73117
movq 0x8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
xorl %esi, %esi
callq 0x31a50
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x31140
cmpl $0x0, %eax
jne 0x730d9
movl $0x0, 0x44(%rsp)
jmp 0x7313e
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x4d2f0
cmpl $0x0, %eax
jne 0x730f7
movl $0x0, 0x44(%rsp)
jmp 0x7313e
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x311c0
cmpl $0x0, %eax
jne 0x73115
movl $0x0, 0x44(%rsp)
jmp 0x7313e
jmp 0x73134
movq 0x28(%rsp), %rsi
leaq 0x1329f6(%rip), %rdi    # 0x1a5b19
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x44(%rsp)
jmp 0x7313e
jmp 0x73136
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::InternalSyncBlock(gaps::R3SurfelBlock*, _IO_FILE*, int)
int R3SurfelDatabase::
InternalSyncBlock(R3SurfelBlock *block, FILE *fp, int swap_endian)
{
  // Check file
  if (!fp) return 1;

  // Check number of surfels
  if (block->NSurfels() == 0) return 1;

  // Check file rwaccess
  if (!strstr(rwaccess, "+")) {
    RNFail("Unable to write block to read-only file\n");
    return 0;
  }

#if 0
  // Check database version
  if ((major_version != current_major_version) || (minor_version != current_minor_version)) {
    RNFail("Unable to write block to database with different version\n");
    return 0;
  }
#endif
  
  // Just checking
  assert(block->database == this);

  // Check if surfels can be put at original offset in file
  if ((block->file_surfels_offset > 0) && ((unsigned int) block->nsurfels <= block->file_surfels_count)) {
    // Surfels fit at original offset in file
    RNFileSeek(fp, block->file_surfels_offset, RN_FILE_SEEK_SET);
  }
  else {
    // Surfels must be put at end of file
    RNFileSeek(fp, 0, RN_FILE_SEEK_END);
    block->file_surfels_offset = RNFileTell(fp);
    block->file_surfels_count = block->nsurfels;
  }

  // Write surfels to file
  if (!WriteSurfel(fp, block->surfels, block->nsurfels, swap_endian, major_version, minor_version)) return 0;

#ifdef PRINT_DEBUG
  // Print debug message
  printf("Synced Block %6d : %6d %9ld : %9.3f %9.3f %9.3f\n", 
         block->database_index, block->nsurfels, resident_surfels,
         block->Centroid().X(), block->Centroid().Y(), block->Centroid().Z()); 
  fflush(stdout);
#endif

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x744b6
movl $0x1, 0x34(%rsp)
jmp 0x745d0
movq 0x20(%rsp), %rdi
callq 0x1c0e0
cmpl $0x0, %eax
jne 0x744d2
movl $0x1, 0x34(%rsp)
jmp 0x745d0
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
leaq 0x12ff17(%rip), %rsi    # 0x1a43f9
callq 0x13120
cmpq $0x0, %rax
jne 0x74508
leaq 0x1316b9(%rip), %rdi    # 0x1a5bad
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x34(%rsp)
jmp 0x745d0
movq 0x20(%rsp), %rax
cmpq $0x0, 0xa8(%rax)
jbe 0x74546
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0xb0(%rcx), %eax
ja 0x74546
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0xa8(%rax), %rsi
xorl %edx, %edx
callq 0x145360
jmp 0x74585
movq 0x18(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x145360
movq 0x18(%rsp), %rdi
callq 0x1453b0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0xa8(%rax)
movq 0x20(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xb0(%rax)
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
movq (%rax), %rdx
movq 0x20(%rsp), %rax
movl 0x8(%rax), %ecx
movl 0x14(%rsp), %r8d
movl 0x20(%rdi), %r9d
movl 0x24(%rdi), %r10d
movq (%rdi), %rax
movl %r10d, (%rsp)
callq *0xa8(%rax)
cmpl $0x0, %eax
jne 0x745c8
movl $0x0, 0x34(%rsp)
jmp 0x745d0
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::PurgeDeletedBlocks()
int R3SurfelDatabase::
PurgeDeletedBlocks(void)
{
  // Execute pending deletes
  RNArray<R3SurfelBlock *> blocks_to_delete;
  for (int i = 0; i < blocks.NEntries(); i++) {
    R3SurfelBlock *block = blocks.Kth(i);
    if (block->flags[R3_SURFEL_BLOCK_DELETE_PENDING_FLAG]) {
      blocks_to_delete.Insert(block);
    }
  }

  // Delete blocks
  for (int i = 0; i < blocks_to_delete.NEntries(); i++) {
    R3SurfelBlock *block = blocks_to_delete.Kth(i);
    block->file_read_count = 0;
    RemoveBlock(block);
    delete block;
  }

  // Return number of blocks deleted
  return blocks_to_delete.NEntries();
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x436b0
movl $0x0, 0x7c(%rsp)
movq 0x40(%rsp), %rdi
movl 0x7c(%rsp), %eax
movl %eax, 0x38(%rsp)
addq $0x40, %rdi
callq 0x16d50
movl %eax, 0x3c(%rsp)
jmp 0x7565d
movl 0x38(%rsp), %eax
movl 0x3c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x75717
movq 0x40(%rsp), %rdi
addq $0x40, %rdi
movl 0x7c(%rsp), %esi
callq 0x436f0
movq %rax, 0x30(%rsp)
jmp 0x75686
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x88, %rax
movq %rax, 0x28(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1b970
jmp 0x756b1
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x31a20
movl %eax, 0x24(%rsp)
jmp 0x756c6
movl 0x24(%rsp), %eax
cmpl $0x0, %eax
je 0x75705
movq 0x60(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x436c0
jmp 0x756e3
jmp 0x75705
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x43730
jmp 0x757f7
jmp 0x75707
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x75641
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x1c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x16d50
movl %eax, 0x20(%rsp)
jmp 0x7573a
movl 0x1c(%rsp), %eax
movl 0x20(%rsp), %ecx
cmpl %ecx, %eax
jge 0x757cb
movl 0x54(%rsp), %esi
leaq 0x80(%rsp), %rdi
callq 0x436f0
movq %rax, 0x10(%rsp)
jmp 0x75762
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movl $0x0, 0xb4(%rax)
movq 0x48(%rsp), %rsi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x75790
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x757b9
movq 0x8(%rsp), %rdi
callq 0x4a1c0
movq 0x8(%rsp), %rdi
movl $0xc8, %esi
callq 0x13580
jmp 0x757bb
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x7571f
leaq 0x80(%rsp), %rdi
callq 0x16d50
movl %eax, 0x4(%rsp)
jmp 0x757de
leaq 0x80(%rsp), %rdi
callq 0x43730
movl 0x4(%rsp), %eax
addq $0x98, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::CloseFile()
int R3SurfelDatabase::
CloseFile(void)
{
  // Sync file
  if (!SyncFile()) return 0;

  // Close file
  fclose(fp);
  fp = NULL;

  // Reset filename
  if (filename) free(filename);
  filename = NULL;

  // Reset rwaccess
  if (rwaccess) free(rwaccess);
  rwaccess = NULL;

  // Return success
  return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %rdi, (%rsp)
movq (%rdi), %rax
callq *0x38(%rax)
cmpl $0x0, %eax
jne 0x75c97
movl $0x0, 0x14(%rsp)
jmp 0x75cf8
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x13560
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0x10(%rax)
je 0x75cc4
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x136a0
movq (%rsp), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, 0x18(%rax)
je 0x75ce4
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x136a0
movq (%rsp), %rax
movq $0x0, 0x18(%rax)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelDatabase.cpp
// Function: gaps::R3SurfelDatabase::ReadStream(_IO_FILE*)
int R3SurfelDatabase::
ReadStream(FILE *fp)
{
  // Read header
  unsigned int nblocks = 0;
  if (!ReadFileHeader(fp, nblocks)) return 0;
  
  // Read blocks
  if (!ReadBlockHeader(fp, nblocks, swap_endian)) return 0;

  // Read surfels
  for (int i = 0; i < blocks.NEntries(); i++) {
    R3SurfelBlock *block = blocks.Kth(i);
    if (!InternalReadBlock(block, fp, swap_endian)) return 0;
    block->file_read_count = 1;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
leaq 0x1c(%rsp), %rdx
callq *0xb0(%rax)
cmpl $0x0, %eax
jne 0x762e5
movl $0x0, 0x34(%rsp)
jmp 0x7639e
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0x28(%rdi), %ecx
movq (%rdi), %rax
callq *0xb8(%rax)
cmpl $0x0, %eax
jne 0x76311
movl $0x0, 0x34(%rsp)
jmp 0x7639e
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x40, %rdi
callq 0x16d50
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x76396
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movl 0x18(%rsp), %esi
callq 0x436f0
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0x28(%rdi), %ecx
movq (%rdi), %rax
callq *0x88(%rax)
cmpl $0x0, %eax
jne 0x7637a
movl $0x0, 0x34(%rsp)
jmp 0x7639e
movq 0x10(%rsp), %rax
movl $0x1, 0xb4(%rax)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x76319
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/./R3SurfelDatabase.h
// Function: gaps::R3SurfelDatabase::SyncBlock(gaps::R3SurfelBlock*)
inline int R3SurfelDatabase::
SyncBlock(R3SurfelBlock *block)
{
  // Check whether block needs to be written
  if (block->IsDirty()) {
    if (!InternalSyncBlock(block, fp, swap_endian)) return 0;
    block->SetDirty(FALSE);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x4b200
cmpl $0x0, %eax
je 0x7643c
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq (%rdi), %rax
callq *0x98(%rax)
cmpl $0x0, %eax
jne 0x76430
movl $0x0, 0x24(%rsp)
jmp 0x76444
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x4b240
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Frustum.cpp
// Function: gaps::R3Frustum::Corner(int) const
const R3Point R3Frustum::
Corner (RNOctant octant) const
{
  // Return corner point 
  switch (octant) {
  case RN_NNN_OCTANT: return Corner(RN_LO, RN_LO, RN_LO);
  case RN_NNP_OCTANT: return Corner(RN_LO, RN_LO, RN_HI);
  case RN_NPN_OCTANT: return Corner(RN_LO, RN_HI, RN_LO);
  case RN_NPP_OCTANT: return Corner(RN_LO, RN_HI, RN_HI);
  case RN_PNN_OCTANT: return Corner(RN_HI, RN_LO, RN_LO);
  case RN_PNP_OCTANT: return Corner(RN_HI, RN_LO, RN_HI);
  case RN_PPN_OCTANT: return Corner(RN_HI, RN_HI, RN_LO);
  case RN_PPP_OCTANT: return Corner(RN_HI, RN_HI, RN_HI);
  default: RNAbort("Invalid octant for frustum corner"); return R3null_point;
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x24(%rsp), %eax
movq %rax, 0x18(%rsp)
subq $0x7, %rax
ja 0xc6131
movq 0x18(%rsp), %rax
leaq 0xe06b1(%rip), %rcx     # 0x1a66f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %edx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
xorl %r8d, %r8d
movl $0x1, %ecx
movl %r8d, %edx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
xorl %edx, %edx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
movl $0x1, %r8d
xorl %ecx, %ecx
movl %r8d, %edx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
movl $0x1, %ecx
xorl %r8d, %r8d
movl %ecx, %edx
callq 0xc6160
jmp 0xc614f
movq 0x10(%rsp), %rsi
movq (%rsp), %rdi
movl $0x1, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0xc6160
jmp 0xc614f
leaq 0xe05fc(%rip), %rdi     # 0x1a6734
movb $0x0, %al
callq 0x1463a0
movq (%rsp), %rdi
leaq 0x537f66(%rip), %rsi    # 0x5fe0b0
callq 0xf8390
movq 0x8(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Frustum.cpp
// Function: gaps::R3Frustum::Corner(int, int, int) const
const R3Point R3Frustum::
Corner(int xdir, int ydir, int zdir) const
{
  // Return corner point
  double xsign = (xdir == RN_LO) ? -1 : 1;
  double ysign = (ydir == RN_LO) ? -1 : 1;
  double depth = (zdir == RN_LO) ? Near() : Far();
  R3Point corner = cs.Origin() - cs.Axes().Axis(RN_Z) * depth;
  corner += cs.Axes().Axis(RN_X) * depth * tan(xfov) * xsign;
  corner += cs.Axes().Axis(RN_Y) * depth * tan(yfov) * ysign;
  return corner;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movl %edx, 0xf4(%rsp)
movl %ecx, 0xf0(%rsp)
movl %r8d, 0xec(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0xf4(%rsp), %edx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovel %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xe0(%rsp)
movl 0xf0(%rsp), %edx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovel %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xd8(%rsp)
cmpl $0x0, 0xec(%rsp)
jne 0xc620b
movq 0x20(%rsp), %rdi
callq 0xc6f80
movsd %xmm0, 0x8(%rsp)
jmp 0xc621b
movq 0x20(%rsp), %rdi
callq 0xc6fa0
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
addq $0x8, %rdi
callq 0x31e40
movq 0x20(%rsp), %rdi
movq %rax, (%rsp)
addq $0x8, %rdi
callq 0x320f0
movq %rax, %rdi
movl $0x2, %esi
callq 0x32100
movq %rax, %rsi
movsd 0xd0(%rsp), %xmm0
leaq 0xb8(%rsp), %rdi
callq 0xfa380
movq (%rsp), %rsi
movq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0xf92b0
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
callq 0x320f0
movq %rax, %rdi
xorl %esi, %esi
callq 0x32100
movq %rax, %rsi
movsd 0xd0(%rsp), %xmm0
leaq 0x70(%rsp), %rdi
callq 0xfa380
movq 0x20(%rsp), %rax
movsd 0x128(%rax), %xmm0
callq 0x132f0
leaq 0x88(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xfa380
movsd 0xe0(%rsp), %xmm0
leaq 0xa0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xfa380
movq 0x10(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xf8a90
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
callq 0x320f0
movq %rax, %rdi
movl $0x1, %esi
callq 0x32100
movq %rax, %rsi
movsd 0xd0(%rsp), %xmm0
leaq 0x28(%rsp), %rdi
callq 0xfa380
movq 0x20(%rsp), %rax
movsd 0x130(%rax), %xmm0
callq 0x132f0
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xfa380
movsd 0xd8(%rsp), %xmm0
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xfa380
movq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0xf8a90
movq 0x18(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Frustum.cpp
// Function: gaps::R3Frustum::BBox() const
const R3Box R3Frustum::
BBox(void) const
{
  // Return bounding box
  R3Box bbox = R3null_box;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < 2; k++) {
        bbox.Union(Corner(i, j, k));
      }
    }
  }
  return bbox;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movb $0x0, 0x57(%rsp)
leaq 0x136d37(%rip), %rsi    # 0x1fd308
callq 0xc9de0
movl $0x0, 0x50(%rsp)
cmpl $0x2, 0x50(%rsp)
jge 0xc6680
movl $0x0, 0x4c(%rsp)
cmpl $0x2, 0x4c(%rsp)
jge 0xc666e
movl $0x0, 0x48(%rsp)
cmpl $0x2, 0x48(%rsp)
jge 0xc665f
movq 0x18(%rsp), %rsi
movl 0x50(%rsp), %edx
movl 0x4c(%rsp), %ecx
movl 0x48(%rsp), %r8d
leaq 0x30(%rsp), %rdi
callq 0xc6160
jmp 0xc6625
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xcb9d0
jmp 0xc6636
jmp 0xc6638
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0xc6600
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x1b990
jmp 0xc66a0
jmp 0xc6661
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0xc65f1
jmp 0xc6670
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0xc65de
movb $0x1, 0x57(%rsp)
testb $0x1, 0x57(%rsp)
jne 0xc6696
movq 0x8(%rsp), %rdi
callq 0x1b990
movq 0x10(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x13970
nopw (%rax,%rax)