// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelBlock.cpp
// Function: gaps::R3SurfelBlock::R3SurfelBlock(gaps::R3SurfelBlock const&)
R3SurfelBlock::
R3SurfelBlock(const R3SurfelBlock& block)
  : surfels(NULL),
    nsurfels(block.nsurfels),
    position_origin(block.position_origin),
    bbox(block.bbox),
    timestamp_origin(block.timestamp_origin),
    timestamp_range(block.timestamp_range),
    min_identifier(block.min_identifier),
    max_identifier(block.max_identifier),
    resolution(block.resolution),
    flags(block.flags & R3_SURFEL_BLOCK_PROPERTY_FLAGS),
    data(NULL),
    database(NULL),
    database_index(-1),
    file_surfels_offset(0),
    file_surfels_count(0),
    file_read_count(0),
    node(NULL),
    opengl_id(0)
{
  // Copy surfels
  if (nsurfels > 0) {
    surfels = new R3Surfel [ nsurfels ];
    for (int i = 0; i < nsurfels; i++) {
      surfels[i] = block.surfels[i];
    }
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, 0x50(%rsp)
movq $0x0, (%rdi)
movq 0x68(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
movq 0x68(%rsp), %rsi
addq $0x10, %rsi
callq 0xf8390
movq 0x50(%rsp), %rdi
addq $0x28, %rdi
movq %rdi, 0x48(%rsp)
movq 0x68(%rsp), %rsi
addq $0x28, %rsi
callq 0xc9de0
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rax
movsd 0x60(%rax), %xmm0
movsd %xmm0, 0x60(%rdi)
addq $0x68, %rdi
movq 0x68(%rsp), %rsi
addq $0x68, %rsi
callq 0x144dc0
jmp 0x48000
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
movl 0x78(%rcx), %ecx
movl %ecx, 0x78(%rax)
movq 0x68(%rsp), %rcx
movl 0x7c(%rcx), %ecx
movl %ecx, 0x7c(%rax)
movq 0x68(%rsp), %rcx
movsd 0x80(%rcx), %xmm0
movsd %xmm0, 0x80(%rax)
addq $0x88, %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rdi
addq $0x88, %rdi
callq 0x1c310
movq %rax, 0x40(%rsp)
jmp 0x48053
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rax
movzbl %al, %eax
movl %eax, %esi
callq 0x1b970
jmp 0x48069
movq 0x50(%rsp), %rax
movq $0x0, 0x90(%rax)
movq $0x0, 0x98(%rax)
movl $0xffffffff, 0xa0(%rax) # imm = 0xFFFFFFFF
movq $0x0, 0xa8(%rax)
movl $0x0, 0xb0(%rax)
movl $0x0, 0xb4(%rax)
movq $0x0, 0xb8(%rax)
movl $0x0, 0xc0(%rax)
cmpl $0x0, 0x8(%rax)
jle 0x481e6
movq 0x50(%rsp), %rax
movslq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movl $0x30, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, 0x28(%rsp)
callq 0x13030
movq %rax, 0x30(%rsp)
jmp 0x48101
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
je 0x48153
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
imulq $0x30, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x47310
jmp 0x4813b
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
addq $0x30, %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x4812a
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
movl $0x0, 0x58(%rsp)
movq 0x50(%rsp), %rcx
movl 0x58(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0x481e4
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
movq (%rcx), %rsi
movslq 0x58(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rsi
movq (%rax), %rdi
movslq 0x58(%rsp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl $0x30, %edx
callq 0x13460
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x48168
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
jmp 0x481eb
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
callq 0x13a90
jmp 0x481eb
jmp 0x481e6
addq $0x78, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x1b990
movq 0x60(%rsp), %rdi
callq 0x13970
nop