// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelPointSet.cpp
// Function: gaps::R3SurfelPointSet::InsertPoints(gaps::R3SurfelBlock*, gaps::R3SurfelConstraint const&)
void R3SurfelPointSet::
InsertPoints(R3SurfelBlock *block, const R3SurfelConstraint& constraint)
{
  // Check block
  if (block->NSurfels() == 0) return;
  if (!constraint.Check(block->BBox())) return;

  // Allocate space for points
  AllocatePoints(npoints + block->NSurfels());

  // Read block
  if (block->database) block->database->ReadBlock(block);

  // Copy points
  for (int i = 0; i < block->NSurfels(); i++) {
    const R3Surfel *surfel = block->Surfel(i);
    if (!constraint.Check(block, surfel)) continue;
    points[npoints].Reset(block, surfel);
    bbox.Union(points[npoints].Position());
    timestamp_range.Union(points[npoints].Timestamp());
    npoints++;
  }

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

// Assembly:
cmpl $0x0, 0x8(%rsi)
je 0x33950
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2cb9e
movq (%r14), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
testl %eax, %eax
je 0x33942
movl 0x8(%rbx), %esi
addl 0x10(%r15), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0x80(%rax)
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x337d5
movl 0xb4(%rbx), %eax
testl %eax, %eax
jne 0x337cd
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movl 0x28(%rdi), %ecx
movq %rbx, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x337d5
movl 0xb4(%rbx), %eax
incl %eax
movl %eax, 0xb4(%rbx)
cmpl $0x0, 0x8(%rbx)
jle 0x338d6
leaq 0x18(%r15), %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rbx), %rbp
addq %r12, %rbp
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq *0x28(%rax)
testl %eax, %eax
je 0x338c2
movslq 0x10(%r15), %rdi
shlq $0x4, %rdi
addq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x3221e
movq 0x8(%r15), %rax
movslq 0x10(%r15), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
addsd 0x10(%rdx), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rax), %xmm1
addsd 0x18(%rdx), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rax), %xmm2
addsd 0x20(%rdx), %xmm2
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
callq 0x83dc2
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x6dd46
movq 0x8(%r15), %rcx
movslq 0x10(%r15), %rax
movq %rax, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rsi
movq 0x8(%rcx,%rdx), %rcx
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rcx), %xmm0
addsd 0x60(%rsi), %xmm0
movsd 0x50(%r15), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x338ae
movsd %xmm0, 0x50(%r15)
ucomisd 0x58(%r15), %xmm0
jbe 0x338bc
movsd %xmm0, 0x58(%r15)
incl %eax
movl %eax, 0x10(%r15)
incq %r13
movslq 0x8(%rbx), %rax
addq $0x30, %r12
cmpq %rax, %r13
jl 0x337ee
movq 0x98(%rbx), %r14
testq %r14, %r14
je 0x33942
movl 0xb4(%rbx), %eax
cmpl $0x1, %eax
jne 0x3390e
movq (%r14), %rax
movq 0x8(%r14), %rdx
movl 0x28(%r14), %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x33942
movl 0xb4(%rbx), %eax
decl %eax
movl %eax, 0xb4(%rbx)
jne 0x33942
testb $0x2, 0x89(%rbx)
je 0x33942
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ca06
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop