LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::UpdateBBox()
void R3SurfelBlock::
UpdateBBox(void)
{
  // Read block
  if (database) database->ReadBlock(this);

  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < nsurfels; i++) {
    const float *p = surfels[i].PositionPtr();
    bbox.Union(R3Point(p[0], p[1], p[2]));
  }

  // Release block
  if (database) database->ReleaseBlock(this);

  // Translate bounding box by position_origin
  bbox.Translate(position_origin.Vector());

  // Mark bbox uptodate
  flags.Add(R3_SURFEL_BLOCK_BBOX_UPTODATE_FLAG);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x2d026
cmpl $0x0, 0xb4(%rbx)
jne 0x2d020
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x2d026
incl 0xb4(%rbx)
leaq 0x28(%rbx), %r14
leaq 0x30(%rbx), %rdi
leaq 0x108993(%rip), %r15    # 0x1359c8
leaq 0x8(%r15), %rsi
callq 0x850ec
leaq 0x48(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x850ec
cmpl $0x0, 0x8(%rbx)
jle 0x2d0a5
movl $0x8, %r12d
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movq (%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd -0x8(%rax,%r12), %xmm0
xorps %xmm1, %xmm1
cvtss2sd -0x4(%rax,%r12), %xmm1
xorps %xmm2, %xmm2
cvtss2sd (%rax,%r12), %xmm2
movq %r15, %rdi
callq 0x84d7e
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e9a6
incq %r13
movslq 0x8(%rbx), %rax
addq $0x30, %r12
cmpq %rax, %r13
jl 0x2d062
movq 0x98(%rbx), %r15
testq %r15, %r15
je 0x2d107
cmpl $0x1, 0xb4(%rbx)
jne 0x2d0d5
movq (%r15), %rax
movq 0x8(%r15), %rdx
movl 0x28(%r15), %ecx
movq %r15, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x2d107
decl 0xb4(%rbx)
jne 0x2d107
testb $0x2, 0x89(%rbx)
je 0x2d107
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
movsd 0x10(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
movsd 0x20(%rbx), %xmm2
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x85816
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e97c
orb $0x1, 0x88(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ElevationRange() const
RNInterval R3SurfelBlock::
ElevationRange(void) const
{
  // Initialize elevation range
  RNInterval elevation_range = RNnull_interval;

  // Read block
  if (database) database->ReadBlock((R3SurfelBlock *) this);
  
  // Compute elevation range
  for (int i = 0; i < nsurfels; i++) {
    double elevation = SurfelElevation(i);
    elevation_range.Union(elevation);
  }

  // Release block
  if (database) database->ReleaseBlock((R3SurfelBlock *) this);

  // Return elevation range
  return elevation_range;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50a67a(%rip), %rsi    # 0x5377d0
callq 0xacea8
movq 0x98(%r14), %rdi
testq %rdi, %rdi
je 0x2d18f
cmpl $0x0, 0xb4(%r14)
jne 0x2d188
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %r14, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x2d18f
incl 0xb4(%r14)
movslq 0x8(%r14), %rcx
testq %rcx, %rcx
jle 0x2d1f4
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq (%r14), %rax
shlq $0x4, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
movsd 0xb1c2a(%rip), %xmm2    # 0xdede0
movswl 0x2a(%rax,%rdx), %esi
xorps %xmm3, %xmm3
cvtsi2sd %esi, %xmm3
divsd %xmm2, %xmm3
cvtsd2ss %xmm3, %xmm3
cvtss2sd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jbe 0x2d1dc
movsd %xmm3, (%rbx)
movapd %xmm3, %xmm0
ucomisd %xmm1, %xmm3
jbe 0x2d1eb
movsd %xmm3, 0x8(%rbx)
movapd %xmm3, %xmm1
addq $0x30, %rdx
cmpq %rdx, %rcx
jne 0x2d1b6
movq 0x98(%r14), %r15
testq %r15, %r15
je 0x2d259
cmpl $0x1, 0xb4(%r14)
jne 0x2d225
movq (%r15), %rax
movq 0x8(%r15), %rdx
movl 0x28(%r15), %ecx
movq %r15, %rdi
movq %r14, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x2d259
decl 0xb4(%r14)
jne 0x2d259
testb $0x2, 0x89(%r14)
je 0x2d259
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x18(%rax)
movq %r14, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %r14, %rdi
callq 0x134f0
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::UpdateTimestampRange()
void R3SurfelBlock::
UpdateTimestampRange(void)
{
  // Read block
  if (database) database->ReadBlock(this);

  // Update timestamp range
  timestamp_range = RNnull_interval;
  for (int i = 0; i < nsurfels; i++) {
    float t = surfels[i].Timestamp();
    timestamp_range.Union(t);
  }

  // Release block
  if (database) database->ReleaseBlock(this);

  // Translate bounding box by timestamp origin
  timestamp_range += timestamp_origin;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x2d2b7
cmpl $0x0, 0xb4(%rbx)
jne 0x2d2b1
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x2d2b7
incl 0xb4(%rbx)
leaq 0x50a512(%rip), %rax    # 0x5377d0
movupd (%rax), %xmm0
movupd %xmm0, 0x68(%rbx)
movslq 0x8(%rbx), %rdx
testq %rdx, %rdx
jle 0x2d31a
leaq 0x68(%rbx), %rax
movsd 0x68(%rbx), %xmm0
movq (%rbx), %rcx
movsd 0x70(%rbx), %xmm1
shlq $0x4, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
xorps %xmm2, %xmm2
cvtss2sd 0xc(%rcx,%rsi), %xmm2
ucomisd %xmm2, %xmm0
jbe 0x2d302
movsd %xmm2, (%rax)
movapd %xmm2, %xmm0
ucomisd %xmm1, %xmm2
jbe 0x2d311
movsd %xmm2, 0x70(%rbx)
movapd %xmm2, %xmm1
addq $0x30, %rsi
cmpq %rsi, %rdx
jne 0x2d2eb
movq 0x98(%rbx), %r14
testq %r14, %r14
je 0x2d37c
cmpl $0x1, 0xb4(%rbx)
jne 0x2d34a
movq (%r14), %rax
movq 0x8(%r14), %rdx
movl 0x28(%r14), %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x2d37c
decl 0xb4(%rbx)
jne 0x2d37c
testb $0x2, 0x89(%rbx)
je 0x2d37c
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
movupd 0x60(%rbx), %xmm0
movapd %xmm0, %xmm1
shufpd $0x1, %xmm0, %xmm1      # xmm1 = xmm1[1],xmm0[0]
movhpd 0x70(%rbx), %xmm0       # xmm0 = xmm0[0],mem[0]
addpd %xmm1, %xmm0
movupd %xmm0, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::UpdateIdentifierRange()
void R3SurfelBlock::
UpdateIdentifierRange(void)
{
  // Read block
  if (database) database->ReadBlock(this);

  // Update max identifier
  min_identifier = UINT_MAX;
  max_identifier = 0;
  for (int i = 0; i < nsurfels; i++) {
    unsigned int id = surfels[i].Identifier();
    if (id < min_identifier) min_identifier = id;
    if (id > max_identifier) max_identifier = id;
  }

  // Release block
  if (database) database->ReleaseBlock(this);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x2d3f3
cmpl $0x0, 0xb4(%rbx)
jne 0x2d3ed
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x2d3f3
incl 0xb4(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x78(%rbx)
movslq 0x8(%rbx), %rsi
testq %rsi, %rsi
jle 0x2d43e
movl 0x7c(%rbx), %ecx
movl 0x78(%rbx), %edx
movq (%rbx), %rax
shlq $0x4, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
movl 0x20(%rax,%rdi), %r8d
cmpl %edx, %r8d
jae 0x2d429
movl %r8d, 0x78(%rbx)
movl %r8d, %edx
cmpl %ecx, %r8d
jbe 0x2d435
movl %r8d, 0x7c(%rbx)
movl %r8d, %ecx
addq $0x30, %rdi
cmpq %rdi, %rsi
jne 0x2d418
movq 0x98(%rbx), %r14
testq %r14, %r14
je 0x2d47f
cmpl $0x1, 0xb4(%rbx)
jne 0x2d46e
movq (%r14), %rax
movq 0x8(%r14), %rdx
movl 0x28(%r14), %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x2d47f
decl 0xb4(%rbx)
jne 0x2d47f
testb $0x2, 0x89(%rbx)
jne 0x2d487
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x134f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::UpdateResolution()
void R3SurfelBlock::
UpdateResolution(void)
{
  // Initialize resolution
  resolution = 0;

#if 0
  // Estimate resoluton based on surfel radii
  if (nsurfels > 0) {
    // Read block
    if (database) database->ReadBlock(this);

    // Sum surfel radii
    int nsamples = 1000;
    if (nsurfels < nsamples) nsamples = nsurfels;
    int step = nsurfels / nsamples;
    RNLength total_radius = 0;
    for (int i = 0; i < nsamples; i++) {
      R3Surfel *surfel = &surfels[i*step];
      RNLength radius = surfel->Radius();
      total_radius += radius;
    }

    // Resolution is samples / area
    if (RNIsZero(total_radius)) return;
    RNLength average_radius = total_radius / nsamples;
    RNScalar area = RN_PI * average_radius * average_radius;
    resolution = 1.0 / area;

    // Release block
    if (database) database->ReleaseBlock(this);
  }
#else
  // Estimate resolution based on number of surfels per cross-section of bounding box
  R3Box box = BBox();
  int dim = box.ShortestAxis();
  RNLength length1 = box.AxisLength((dim+1)%3);
  RNLength length2 = box.AxisLength((dim+2)%3);
  RNArea area = length1 * length2;
  resolution = (area > 0) ? sqrt(nsurfels / area) : 0;
#endif

  // Mark resolution uptodate
  flags.Add(R3_SURFEL_BLOCK_RESOLUTION_UPTODATE_FLAG);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq $0x0, 0x80(%rdi)
testb $0x1, 0x88(%rdi)
jne 0x2d510
movq %rbx, %rdi
callq 0x2cfe4
leaq 0x28(%rbx), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x6df88
movq %r14, %rdi
callq 0x6e538
leal 0x1(%rax), %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %eax, %ecx
incl %ecx
movslq %ecx, %rcx
movsd 0x20(%rsp,%rcx,8), %xmm0
subsd 0x8(%rsp,%rcx,8), %xmm0
movl %eax, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %ecx, %eax
addl $0x2, %eax
cltq
movsd 0x20(%rsp,%rax,8), %xmm1
subsd 0x8(%rsp,%rax,8), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x2d5bc
xorps %xmm0, %xmm0
cvtsi2sdl 0x8(%rbx), %xmm0
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2d5b7
sqrtsd %xmm0, %xmm0
jmp 0x2d5bc
callq 0x133c0
movsd %xmm0, 0x80(%rbx)
orb $0x2, 0x88(%rbx)
movq %rsp, %rdi
callq 0x6ede0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6ede0
movq %rbx, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::HasActive() const
RNBoolean R3SurfelBlock::
HasActive(void) const
{
  // Update active flags
  if (!flags[R3_SURFEL_BLOCK_FLAGS_UPTODATE_FLAG]) {
    R3SurfelBlock *block = (R3SurfelBlock *) this;
    block->UpdateFlags();
  }

   // Return whether block has active 
  return flags[R3_SURFEL_BLOCK_HAS_ACTIVE_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0x88(%rdi)
jne 0x2d603
movq %rbx, %rdi
callq 0x2d612
movl 0x88(%rbx), %eax
shrl $0x6, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::UpdateFlags()
void R3SurfelBlock::
UpdateFlags(void)
{
  // Read block
  if (database) database->ReadBlock(this);

  // Reset flags
  flags.Remove(R3_SURFEL_BLOCK_HAS_ACTIVE_FLAG);
  flags.Remove(R3_SURFEL_BLOCK_HAS_NORMALS_FLAG);
  flags.Remove(R3_SURFEL_BLOCK_HAS_AERIAL_FLAG);
  flags.Remove(R3_SURFEL_BLOCK_HAS_TERRESTRIAL_FLAG);

  // Update flags
  for (int i = 0; i < nsurfels; i++) {
    if (surfels[i].IsActive()) flags.Add(R3_SURFEL_BLOCK_HAS_ACTIVE_FLAG);
    if (surfels[i].HasNormal()) flags.Add(R3_SURFEL_BLOCK_HAS_NORMALS_FLAG);
    if (surfels[i].HasTangent()) flags.Add(R3_SURFEL_BLOCK_HAS_TANGENTS_FLAG);
    if (surfels[i].IsAerial()) flags.Add(R3_SURFEL_BLOCK_HAS_AERIAL_FLAG);
    else flags.Add(R3_SURFEL_BLOCK_HAS_TERRESTRIAL_FLAG);
  }

  // Release block
  if (database) database->ReleaseBlock(this);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x2d64b
cmpl $0x0, 0xb4(%rbx)
jne 0x2d645
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x2d64b
incl 0xb4(%rbx)
andb $0xf, 0x88(%rbx)
movslq 0x8(%rbx), %rcx
testq %rcx, %rcx
jle 0x2d6be
movq (%rbx), %rax
movq 0x88(%rbx), %rsi
shlq $0x4, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
movzbl 0x2f(%rax,%rdx), %edi
movl %edi, %r8d
shll $0x4, %r8d
andl $0x40, %r8d
orq %rsi, %r8
movl %edi, %esi
andl $0x40, %esi
addl %esi, %esi
movl %edi, %r9d
shll $0x3, %r9d
andl $0x8, %r9d
orq %rsi, %r9
orq %r8, %r9
xorl %esi, %esi
testb $0x2, %dil
sete %sil
shll $0x4, %esi
addq $0x10, %rsi
orq %r9, %rsi
addq $0x30, %rdx
cmpq %rdx, %rcx
jne 0x2d66f
movq %rsi, 0x88(%rbx)
movq 0x98(%rbx), %r14
testq %r14, %r14
je 0x2d720
cmpl $0x1, 0xb4(%rbx)
jne 0x2d6ee
movq (%r14), %rax
movq 0x8(%r14), %rdx
movl 0x28(%r14), %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x2d720
decl 0xb4(%rbx)
jne 0x2d720
testb $0x2, 0x89(%rbx)
je 0x2d720
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
orb $0x4, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::HasNormals() const
RNBoolean R3SurfelBlock::
HasNormals(void) const
{
  // Update normals flags
  if (!flags[R3_SURFEL_BLOCK_FLAGS_UPTODATE_FLAG]) {
    R3SurfelBlock *block = (R3SurfelBlock *) this;
    block->UpdateFlags();
  }

   // Return whether block has normals 
  return flags[R3_SURFEL_BLOCK_HAS_NORMALS_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0x88(%rdi)
jne 0x2d745
movq %rbx, %rdi
callq 0x2d612
movl 0x88(%rbx), %eax
shrl $0x7, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::HasTangents() const
RNBoolean R3SurfelBlock::
HasTangents(void) const
{
  // Update tangents flags
  if (!flags[R3_SURFEL_BLOCK_FLAGS_UPTODATE_FLAG]) {
    R3SurfelBlock *block = (R3SurfelBlock *) this;
    block->UpdateFlags();
  }

   // Return whether block has tangents 
  return flags[R3_SURFEL_BLOCK_HAS_TANGENTS_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0x88(%rdi)
jne 0x2d769
movq %rbx, %rdi
callq 0x2d612
movl 0x88(%rbx), %eax
shrl $0x3, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::HasAerial() const
RNBoolean R3SurfelBlock::
HasAerial(void) const
{
  // Update aerial/terrestrial flags
  if (!flags[R3_SURFEL_BLOCK_FLAGS_UPTODATE_FLAG]) {
    R3SurfelBlock *block = (R3SurfelBlock *) this;
    block->UpdateFlags();
  }

   // Return whether block has aerial scanner points
  return flags[R3_SURFEL_BLOCK_HAS_AERIAL_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0x88(%rdi)
jne 0x2d78d
movq %rbx, %rdi
callq 0x2d612
movl 0x88(%rbx), %eax
shrl $0x4, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::HasTerrestrial() const
RNBoolean R3SurfelBlock::
HasTerrestrial(void) const
{
  // Update aerial/terrestrial flags
  if (!flags[R3_SURFEL_BLOCK_FLAGS_UPTODATE_FLAG]) {
    R3SurfelBlock *block = (R3SurfelBlock *) this;
    block->UpdateFlags();
  }

  // Return whether block has terrestrial scanner points
  return flags[R3_SURFEL_BLOCK_HAS_TERRESTRIAL_FLAG];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x4, 0x88(%rdi)
jne 0x2d7b1
movq %rbx, %rdi
callq 0x2d612
movl 0x88(%rbx), %eax
shrl $0x5, %eax
andl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelPosition(int, gaps::R3Point const&)
void R3SurfelBlock::
SetSurfelPosition(int surfel_index, const R3Point& position)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel position (relative to position origin)
  float x = position[0] - position_origin[0];
  float y = position[1] - position_origin[1];
  float z = position[2] - position_origin[2];
  surfels[surfel_index].SetPosition(x, y, z);

  // Mark properties out of date
  flags.Remove(R3_SURFEL_BLOCK_BBOX_UPTODATE_FLAG);
  flags.Remove(R3_SURFEL_BLOCK_RESOLUTION_UPTODATE_FLAG);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2d863
movsd 0x10(%rdx), %xmm0
subsd 0x20(%rdi), %xmm0
cvtsd2ss %xmm0, %xmm0
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
movupd (%rdx), %xmm1
movupd 0x10(%rdi), %xmm2
subpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm1
shlq $0x4, %rcx
movlpd %xmm1, (%rax,%rcx)
movss %xmm0, 0x8(%rax,%rcx)
movq $-0x104, %rax           # imm = 0xFEFC
andq 0x88(%rdi), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x88(%rdi)
retq
pushq %rax
leaq 0xb15c5(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelNormal(int, gaps::R3Vector const&)
void R3SurfelBlock::
SetSurfelNormal(int surfel_index, const R3Vector& normal)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel normal
  surfels[surfel_index].SetNormal(normal.X(), normal.Y(), normal.Z());

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2d90d
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
cvtsd2ss 0x10(%rdx), %xmm0
movupd (%rdx), %xmm1
cvtpd2ps %xmm1, %xmm1
cvtps2pd %xmm1, %xmm2
mulpd 0xb14ed(%rip), %xmm2    # 0xded90
addpd 0xb14f5(%rip), %xmm2    # 0xdeda0
shlq $0x4, %rcx
cvttpd2dq %xmm2, %xmm2
pshuflw $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3,4,5,6,7]
movd %xmm2, 0x10(%rax,%rcx)
xorps %xmm2, %xmm2
cvtss2sd %xmm0, %xmm2
mulsd 0xb1503(%rip), %xmm2    # 0xdedd0
addsd 0xb086b(%rip), %xmm2    # 0xde140
cvttsd2si %xmm2, %edx
movw %dx, 0x14(%rax,%rcx)
xorpd %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x2d8fe
jp 0x2d8fe
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm2, %xmm1
jne 0x2d8fe
jp 0x2d8fe
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2d8fe
jnp 0x2d905
addq %rcx, %rax
orb $0x40, 0x2f(%rax)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb151b(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelTangent(int, gaps::R3Vector const&)
void R3SurfelBlock::
SetSurfelTangent(int surfel_index, const R3Vector& tangent)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel tangent
  surfels[surfel_index].SetTangent(tangent.X(), tangent.Y(), tangent.Z());

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2d9b7
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
cvtsd2ss 0x10(%rdx), %xmm0
movupd (%rdx), %xmm1
cvtpd2ps %xmm1, %xmm1
cvtps2pd %xmm1, %xmm2
mulpd 0xb1443(%rip), %xmm2    # 0xded90
addpd 0xb144b(%rip), %xmm2    # 0xdeda0
shlq $0x4, %rcx
cvttpd2dq %xmm2, %xmm2
pshuflw $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3,4,5,6,7]
movd %xmm2, 0x16(%rax,%rcx)
xorps %xmm2, %xmm2
cvtss2sd %xmm0, %xmm2
mulsd 0xb1459(%rip), %xmm2    # 0xdedd0
addsd 0xb07c1(%rip), %xmm2    # 0xde140
cvttsd2si %xmm2, %edx
movw %dx, 0x1a(%rax,%rcx)
xorpd %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x2d9a8
jp 0x2d9a8
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm2, %xmm1
jne 0x2d9a8
jp 0x2d9a8
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2d9a8
jnp 0x2d9af
addq %rcx, %rax
orb $0x1, 0x2f(%rax)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1471(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelRadius(int, double)
void R3SurfelBlock::
SetSurfelRadius(int surfel_index, RNLength radius)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel normal
  surfels[surfel_index].SetRadius(radius);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2da1d
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0xb13ed(%rip), %xmm0    # 0xdedd8
addsd 0xb074d(%rip), %xmm0    # 0xde140
shlq $0x4, %rcx
cvtsd2ss %xmm0, %xmm0
movss 0xb13e5(%rip), %xmm1    # 0xdede8
minss %xmm0, %xmm1
cvttss2si %xmm1, %edx
movw %dx, 0x1c(%rax,%rcx)
movw %dx, 0x1e(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb140b(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelRadius(int, int, double)
void R3SurfelBlock::
SetSurfelRadius(int surfel_index, int axis, RNLength radius)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel normal
  surfels[surfel_index].SetRadius(axis, radius);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2da84
cvtsd2ss %xmm0, %xmm0
movslq %esi, %rcx
cvtss2sd %xmm0, %xmm0
mulsd 0xb138b(%rip), %xmm0    # 0xdedd8
addsd 0xb06eb(%rip), %xmm0    # 0xde140
cvtsd2ss %xmm0, %xmm0
movss 0xb1387(%rip), %xmm1    # 0xdede8
minss %xmm0, %xmm1
cvttss2si %xmm1, %esi
movslq %edx, %rdx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw %si, 0x1c(%rax,%rdx,2)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb13a4(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelDepth(int, double)
void R3SurfelBlock::
SetSurfelDepth(int surfel_index, RNLength depth)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel normal
  surfels[surfel_index].SetDepth(depth);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dae4
movslq %esi, %rcx
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0xb132d(%rip), %xmm0    # 0xdede0
addsd 0xb0685(%rip), %xmm0    # 0xde140
cvtsd2ss %xmm0, %xmm0
movss 0xb1321(%rip), %xmm1    # 0xdede8
minss %xmm0, %xmm1
cvttss2si %xmm1, %edx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movw %dx, 0x28(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1344(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelElevation(int, double)
void R3SurfelBlock::
SetSurfelElevation(int surfel_index, RNLength elevation)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel normal
  surfels[surfel_index].SetElevation(elevation);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2db59
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0xb12d0(%rip), %xmm0    # 0xdede0
addsd 0xb0628(%rip), %xmm0    # 0xde140
cvtsd2ss %xmm0, %xmm1
movss 0xb12c8(%rip), %xmm0    # 0xdedec
ucomiss %xmm1, %xmm0
ja 0x2db3d
ucomiss 0xb12c0(%rip), %xmm1    # 0xdedf0
movaps %xmm1, %xmm0
jbe 0x2db3d
movss 0xb12b3(%rip), %xmm0    # 0xdedf0
movslq %esi, %rcx
cvttss2si %xmm0, %edx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movw %dx, 0x2a(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb12cf(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelColor(int, gaps::RNRgb const&)
void R3SurfelBlock::
SetSurfelColor(int surfel_index, const RNRgb& color)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel color
  surfels[surfel_index].SetColor(color);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dbc1
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movsd 0xb126f(%rip), %xmm0    # 0xdedf8
movsd (%rdx), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
movb %sil, 0x2c(%rax,%rcx)
movsd 0x8(%rdx), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
movb %sil, 0x2d(%rax,%rcx)
mulsd 0x10(%rdx), %xmm0
cvttsd2si %xmm0, %edx
movb %dl, 0x2e(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1267(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelTimestamp(int, double)
void R3SurfelBlock::
SetSurfelTimestamp(int surfel_index, RNScalar timestamp)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel timestamp (relative to timestamp_origin)
  surfels[surfel_index].SetTimestamp(timestamp - timestamp_origin);

  // Remember that timestamp range is out of date
  timestamp_range.Empty();

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dc1b
movslq %esi, %rcx
subsd 0x60(%rdi), %xmm0
cvtsd2ss %xmm0, %xmm0
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movss %xmm0, 0xc(%rax,%rcx)
leaq 0x107019(%rip), %rax    # 0x134c18
movsd (%rax), %xmm0
movsd %xmm0, 0x68(%rdi)
xorps 0xb0791(%rip), %xmm0    # 0xde3a0
movlps %xmm0, 0x70(%rdi)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb120d(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelAttribute(int, unsigned int)
void R3SurfelBlock::
SetSurfelAttribute(int surfel_index, unsigned int attribute)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel attribute
  surfels[surfel_index].SetAttribute(attribute);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dc8b
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl %edx, 0x24(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb119d(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelActive(int, int)
void R3SurfelBlock::
SetSurfelActive(int surfel_index, RNBoolean active)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel active
  surfels[surfel_index].SetActive(active);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dcd3
movslq %esi, %rcx
testl %edx, %edx
setne %dl
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x2f(%rax,%rcx), %sil
andb $-0x5, %sil
shlb $0x2, %dl
orb %sil, %dl
movb %dl, 0x2f(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1155(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelAerial(int, int)
void R3SurfelBlock::
SetSurfelAerial(int surfel_index, RNBoolean aerial)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel position for non-resident block\n");
    abort();
  }

  // Set surfel aerial
  surfels[surfel_index].SetAerial(aerial);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dd1a
movslq %esi, %rcx
testl %edx, %edx
setne %dl
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x2f(%rax,%rcx), %sil
andb $-0x3, %sil
addb %dl, %dl
orb %sil, %dl
movb %dl, 0x2f(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb110e(%rip), %rdi     # 0xdee30
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelFlags(int, unsigned char)
void R3SurfelBlock::
SetSurfelFlags(int surfel_index, unsigned char flags)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel property for non-resident block\n");
    abort();
  }

  // Set surfel mark
  surfels[surfel_index].SetFlags(flags);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dd4d
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb %dl, 0x2f(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1111(%rip), %rdi     # 0xdee66
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelSilhouetteBoundary(int, int)
void R3SurfelBlock::
SetSurfelSilhouetteBoundary(int surfel_index, RNBoolean boundary)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel property for non-resident block\n");
    abort();
  }

  // Set surfel mark
  surfels[surfel_index].SetSilhouetteBoundary(boundary);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dd95
movslq %esi, %rcx
testl %edx, %edx
setne %dl
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x2f(%rax,%rcx), %sil
andb $-0x11, %sil
shlb $0x4, %dl
orb %sil, %dl
movb %dl, 0x2f(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb10c9(%rip), %rdi     # 0xdee66
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelShadowBoundary(int, int)
void R3SurfelBlock::
SetSurfelShadowBoundary(int surfel_index, RNBoolean boundary)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel property for non-resident block\n");
    abort();
  }

  // Set surfel mark
  surfels[surfel_index].SetShadowBoundary(boundary);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2dddd
movslq %esi, %rcx
testl %edx, %edx
setne %dl
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x2f(%rax,%rcx), %sil
andb $-0x21, %sil
shlb $0x5, %dl
orb %sil, %dl
movb %dl, 0x2f(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1081(%rip), %rdi     # 0xdee66
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelBorderBoundary(int, int)
void R3SurfelBlock::
SetSurfelBorderBoundary(int surfel_index, RNBoolean boundary)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel property for non-resident block\n");
    abort();
  }

  // Set surfel mark
  surfels[surfel_index].SetBorderBoundary(boundary);

  // Remember that block is dirty
  SetDirty();
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2de2a
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x2f(%rax,%rcx), %sil
andb $-0x31, %sil
testl %edx, %edx
movl $0x30, %r8d
cmovel %edx, %r8d
orb %sil, %r8b
movb %r8b, 0x2f(%rax,%rcx)
orb $0x1, 0x89(%rdi)
retq
pushq %rax
leaq 0xb1034(%rip), %rdi     # 0xdee66
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetSurfelMark(int, int)
void R3SurfelBlock::
SetSurfelMark(int surfel_index, RNBoolean mark)
{
  // Check if surfels are resident
  if (!surfels) {
    RNFail("Unable to set surfel property for non-resident block\n");
    abort();
  }

  // Set surfel mark
  surfels[surfel_index].SetMark(mark);
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2de6a
movslq %esi, %rcx
testl %edx, %edx
setne %dl
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x2f(%rax,%rcx), %sil
andb $0x7f, %sil
shlb $0x7, %dl
orb %sil, %dl
movb %dl, 0x2f(%rax,%rcx)
retq
pushq %rax
leaq 0xb0ff4(%rip), %rdi     # 0xdee66
xorl %eax, %eax
callq 0xaddb2
callq 0x132b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::SetMarks(int)
void R3SurfelBlock::
SetMarks(RNBoolean mark)
{
  // Check surfels
  if (!mark && !surfels) return;

  // Set mark for all surfels
  for (int i = 0; i < nsurfels; i++) {
    surfels[i].SetMark(mark);
  }
}

// Assembly:
testl %esi, %esi
sete %cl
movq (%rdi), %rax
testq %rax, %rax
sete %dl
testb %dl, %cl
jne 0x2dec5
movslq 0x8(%rdi), %rdx
testq %rdx, %rdx
jle 0x2dec5
testl %esi, %esi
setne %cl
shlb $0x7, %cl
shlq $0x4, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movb 0x2f(%rax,%rsi), %dil
andb $0x7f, %dil
orb %cl, %dil
movb %dil, 0x2f(%rax,%rsi)
addq $0x30, %rsi
cmpq %rsi, %rdx
jne 0x2deab
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::UpdateProperties()
void R3SurfelBlock::
UpdateProperties(void)
{
  // Read block
  if (database) database->ReadBlock(this);

  // Update properties
  double dummy = 0;
  dummy += BBox().Min().X();
  dummy += TimestampRange().Min();
  dummy += MinIdentifier();
  dummy += MaxIdentifier();
  dummy += Resolution();
  dummy += (HasAerial()) ? 1 : 2;
  if (dummy == 927612.21242) {
    printf("Amazing!\n");
  }

  // Update normals
  UpdateSurfelNormals();

  // Release block
  if (database) database->ReleaseBlock(this);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x2e39d
cmpl $0x0, 0xb4(%rbx)
jne 0x2e397
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x2e39d
incl 0xb4(%rbx)
testb $0x1, 0x88(%rbx)
jne 0x2e3ae
movq %rbx, %rdi
callq 0x2cfe4
xorpd %xmm1, %xmm1
addsd 0x30(%rbx), %xmm1
movsd 0x68(%rbx), %xmm0
ucomisd 0x70(%rbx), %xmm0
jbe 0x2e3d5
movq %rbx, %rdi
movsd %xmm1, (%rsp)
callq 0x2d27e
movsd (%rsp), %xmm1
addsd 0x68(%rbx), %xmm1
movl 0x7c(%rbx), %eax
cmpl 0x78(%rbx), %eax
jae 0x2e3f4
movq %rbx, %rdi
movsd %xmm1, (%rsp)
callq 0x2d3ba
movsd (%rsp), %xmm1
movl 0x78(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm0, %xmm1
cmpl %eax, 0x7c(%rbx)
jae 0x2e41a
movq %rbx, %rdi
movsd %xmm1, (%rsp)
callq 0x2d3ba
movsd (%rsp), %xmm1
movl 0x7c(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd %xmm0, %xmm1
testb $0x2, 0x88(%rbx)
jne 0x2e444
movq %rbx, %rdi
movsd %xmm1, (%rsp)
callq 0x2d4ea
movsd (%rsp), %xmm1
addsd 0x80(%rbx), %xmm1
testb $0x4, 0x88(%rbx)
jne 0x2e467
movq %rbx, %rdi
movsd %xmm1, (%rsp)
callq 0x2d612
movsd (%rsp), %xmm1
xorl %eax, %eax
testb $0x10, 0x88(%rbx)
sete %al
leaq 0xb09a6(%rip), %rcx     # 0xdee20
addsd (%rcx,%rax,8), %xmm1
ucomisd 0xafea1(%rip), %xmm1    # 0xde328
jne 0x2e497
jp 0x2e497
leaq 0xafeb6(%rip), %rdi     # 0xde348
callq 0x137c0
movq %rbx, %rdi
callq 0x2e510
movq 0x98(%rbx), %r14
testq %r14, %r14
je 0x2e4e0
cmpl $0x1, 0xb4(%rbx)
jne 0x2e4cf
movq (%r14), %rax
movq 0x8(%r14), %rdx
movl 0x28(%r14), %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x2e4e0
decl 0xb4(%rbx)
jne 0x2e4e0
testb $0x2, 0x89(%rbx)
jne 0x2e4e8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x134f0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::Print(_IO_FILE*, char const*, char const*) const
void R3SurfelBlock::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print block
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%d %d", DatabaseIndex(), NSurfels());
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
jne 0x2e99b
movq 0x1055d8(%rip), %rax    # 0x133f70
movq (%rax), %rbx
testq %rdx, %rdx
je 0x2e9ab
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x135b0
movl 0x8(%r15), %ecx
movl 0xa0(%r15), %edx
leaq 0xaff1f(%rip), %rsi     # 0xde8dc
movq %rbx, %rdi
xorl %eax, %eax
callq 0x13740
testq %r14, %r14
je 0x2e9d7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x135b0
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x13670
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadFile(char const*)
int R3SurfelBlock::
ReadFile(const char *filename)
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .ply)\n", filename);
    return 0;
  }

  // Read file of appropriate type
  if (!strncmp(extension, ".obj", 4)) {
    return ReadOBJFile(filename);
  }
  else if (!strncmp(extension, ".ply", 4)) {
    return ReadPlyFile(filename);
  }
  else if (!strncmp(extension, ".xyz", 4)) {
    return ReadXYZAsciiFile(filename);
  }
  else if (!strncmp(extension, ".bin", 4)) {
    return ReadXYZBinaryFile(filename);
  }
  else if (!strncmp(extension, ".blk", 4)) {
    return ReadBinaryFile(filename);
  }
  else if (!strncmp(extension, ".upc", 4)) {
    return ReadUPCFile(filename);
  }
  else { 
    RNFail("Unable to read file %s (unrecognized extension: %s)\n", filename, extension); 
    return 0; 
  }

  // Should never get here
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x13560
testq %rax, %rax
je 0x2eac8
movq %rax, %r15
leaq 0xb04b2(%rip), %rsi     # 0xdeec7
movl $0x4, %edx
movq %rax, %rdi
callq 0x13240
testl %eax, %eax
je 0x2eae1
leaq 0xb049b(%rip), %rsi     # 0xdeecc
movl $0x4, %edx
movq %r15, %rdi
callq 0x13240
testl %eax, %eax
je 0x2eaf1
leaq 0xb0484(%rip), %rsi     # 0xdeed1
movl $0x4, %edx
movq %r15, %rdi
callq 0x13240
testl %eax, %eax
je 0x2eb01
leaq 0xb046d(%rip), %rsi     # 0xdeed6
movl $0x4, %edx
movq %r15, %rdi
callq 0x13240
testl %eax, %eax
je 0x2eb11
leaq 0xb0456(%rip), %rsi     # 0xdeedb
movl $0x4, %edx
movq %r15, %rdi
callq 0x13240
testl %eax, %eax
je 0x2eb21
leaq 0xb043f(%rip), %rsi     # 0xdeee0
movl $0x4, %edx
movq %r15, %rdi
callq 0x13240
testl %eax, %eax
je 0x2eb31
leaq 0xaf9a3(%rip), %rdi     # 0xde45c
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xaddb2
jmp 0x2ead9
leaq 0xb03cd(%rip), %rdi     # 0xdee9c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x13070
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2eb42
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2ebc2
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2ec42
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2ecc2
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2ed42
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2edc2
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadOBJFile(char const*)
int R3SurfelBlock::
ReadOBJFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "r"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read file
  if (!ReadOBJ(fp)) {
    RNFail("Unable to read OBJ file %s\n", filename);
    fclose(fp);
    return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xbad2d(%rip), %rsi     # 0xe9883
movq %rbx, %rdi
callq 0x135d0
testq %rax, %rax
je 0x2eb84
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2efac
testl %eax, %eax
je 0x2eb99
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebp
jmp 0x2ebb4
leaq 0xaf947(%rip), %rdi     # 0xde4d2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
jmp 0x2ebb4
leaq 0xb0345(%rip), %rdi     # 0xdeee5
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
movq %r14, %rdi
callq 0x134d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadPlyFile(char const*)
int R3SurfelBlock::
ReadPlyFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "r"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read file
  if (!ReadPly(fp)) {
    RNFail("Unable to read ply file %s\n", filename);
    fclose(fp);
    return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xbacad(%rip), %rsi     # 0xe9883
movq %rbx, %rdi
callq 0x135d0
testq %rax, %rax
je 0x2ec04
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2f26a
testl %eax, %eax
je 0x2ec19
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebp
jmp 0x2ec34
leaq 0xaf8c7(%rip), %rdi     # 0xde4d2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
jmp 0x2ec34
leaq 0xb031f(%rip), %rdi     # 0xdef3f
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
movq %r14, %rdi
callq 0x134d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadXYZAsciiFile(char const*)
int R3SurfelBlock::
ReadXYZAsciiFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "r"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read file
  if (!ReadXYZAscii(fp)) {
    RNFail("Unable to read XYZ file %s\n", filename);
    fclose(fp);
    return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xbac2d(%rip), %rsi     # 0xe9883
movq %rbx, %rdi
callq 0x135d0
testq %rax, %rax
je 0x2ec84
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2f566
testl %eax, %eax
je 0x2ec99
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebp
jmp 0x2ecb4
leaq 0xaf847(%rip), %rdi     # 0xde4d2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
jmp 0x2ecb4
leaq 0xb02bb(%rip), %rdi     # 0xdef5b
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
movq %r14, %rdi
callq 0x134d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadXYZBinaryFile(char const*)
int R3SurfelBlock::
ReadXYZBinaryFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "rb"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read file
  if (!ReadXYZBinary(fp)) {
    RNFail("Unable to read XYZ binary file %s\n", filename);
    fclose(fp);
    return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xaf507(%rip), %rsi     # 0xde1dd
movq %rbx, %rdi
callq 0x135d0
testq %rax, %rax
je 0x2ed04
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2f8f2
testl %eax, %eax
je 0x2ed19
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebp
jmp 0x2ed34
leaq 0xaf7c7(%rip), %rdi     # 0xde4d2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
jmp 0x2ed34
leaq 0xb026e(%rip), %rdi     # 0xdef8e
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
movq %r14, %rdi
callq 0x134d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadBinaryFile(char const*)
int R3SurfelBlock::
ReadBinaryFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "rb"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read file
  if (!ReadBinary(fp)) {
    RNFail("Unable to read surfel file %s\n", filename);
    fclose(fp);
    return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xaf487(%rip), %rsi     # 0xde1dd
movq %rbx, %rdi
callq 0x135d0
testq %rax, %rax
je 0x2ed84
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2fb16
testl %eax, %eax
je 0x2ed99
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebp
jmp 0x2edb4
leaq 0xaf747(%rip), %rdi     # 0xde4d2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
jmp 0x2edb4
leaq 0xb022a(%rip), %rdi     # 0xdefca
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
movq %r14, %rdi
callq 0x134d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::ReadUPCFile(char const*)
int R3SurfelBlock::
ReadUPCFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "rb"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read file
  if (!ReadUPC(fp)) {
    RNFail("Unable to read surfel file %s\n", filename);
    return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xaf407(%rip), %rsi     # 0xde1dd
movq %rbx, %rdi
callq 0x135d0
testq %rax, %rax
je 0x2ee04
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2fe18
testl %eax, %eax
je 0x2ee0d
movq %r14, %rdi
callq 0x134d0
movl $0x1, %ebp
jmp 0x2ee20
leaq 0xaf6c7(%rip), %rdi     # 0xde4d2
jmp 0x2ee14
leaq 0xb01b6(%rip), %rdi     # 0xdefca
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaddb2
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop