// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::R3SurfelImage(gaps::R3SurfelImage const&)
R3SurfelImage::
R3SurfelImage(const R3SurfelImage& image)
  : scene(NULL),
    scene_index(-1),
    scan(NULL),
    channels(),
    pose(image.pose),
    timestamp(image.timestamp),
    image_width(image.image_width), 
    image_height(image.image_height),
    image_center(image.image_center),
    xfocal(image.xfocal),
    yfocal(image.yfocal),
    distortion_type(R3_SURFEL_NO_DISTORTION),
    name((image.name) ? RNStrdup(image.name) : NULL),
    flags(0),
    data(NULL)
{
  // Intialize distortion parameters
  radial_distortion[0] = image.radial_distortion[0];
  radial_distortion[1] = image.radial_distortion[1];
  radial_distortion[2] = image.radial_distortion[2];
  tangential_distortion[0] = image.tangential_distortion[0];
  tangential_distortion[1] = image.tangential_distortion[1];

  // Initialize rolling shutter pose parameters
  rolling_shutter_poses[0] = image.rolling_shutter_poses[0];
  rolling_shutter_poses[1] = image.rolling_shutter_poses[1];
  rolling_shutter_timestamps[0] = image.rolling_shutter_timestamps[0];
  rolling_shutter_timestamps[1] = image.rolling_shutter_timestamps[1];

  // Copy all channels
  for (int i = 0; i < image.channels.NEntries(); i++) {
    R2Grid *channel = image.channels.Kth(i);
    if (channel) channels.Insert(new R2Grid(*channel));
    else channels.Insert(NULL);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r15
leaq 0xe88bb(%rip), %rax     # 0x11fc70
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
orl $-0x1, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x9a7ae
leaq 0x30(%r15), %rdi
leaq 0x30(%r14), %rsi
callq 0x66ee8
movsd 0x90(%r14), %xmm0
movsd %xmm0, 0x90(%r15)
movq 0x98(%r14), %rax
movq %rax, 0x98(%r15)
movl $0xa0, %esi
leaq (%r15,%rsi), %rdi
addq %r14, %rsi
callq 0x93a3a
movups 0xb0(%r14), %xmm0
movups %xmm0, 0xb0(%r15)
andl $0x0, 0xc0(%r15)
leaq 0xf0(%r15), %r13
movq %r13, %rdi
callq 0x66ed2
leaq 0x150(%r15), %r12
movq %r12, %rdi
callq 0x66ed2
movq 0x1c0(%r14), %rdi
testq %rdi, %rdi
je 0x3745c
callq 0x9cc91
jmp 0x3745e
xorl %eax, %eax
movq %rax, 0x1c0(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x1c8(%r15)
movsd 0xc8(%r14), %xmm0
movsd %xmm0, 0xc8(%r15)
movsd 0xd0(%r14), %xmm0
movsd %xmm0, 0xd0(%r15)
movsd 0xd8(%r14), %xmm0
movsd %xmm0, 0xd8(%r15)
movsd 0xe0(%r14), %xmm0
movsd %xmm0, 0xe0(%r15)
movsd 0xe8(%r14), %xmm0
movsd %xmm0, 0xe8(%r15)
leaq 0xf0(%r14), %rsi
movq %r13, %rdi
callq 0x28a32
leaq 0x150(%r14), %rsi
movq %r12, %rdi
callq 0x28a32
movsd 0x1b0(%r14), %xmm0
movsd %xmm0, 0x1b0(%r15)
movsd 0x1b8(%r14), %xmm0
movsd %xmm0, 0x1b8(%r15)
xorl %r13d, %r13d
movslq 0x2c(%r14), %rax
cmpq %rax, %r13
jge 0x37559
movq 0x20(%r14), %rax
movq (%rax,%r13,8), %r12
testq %r12, %r12
je 0x3754a
movl $0xd0, %edi
callq 0x134f0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x844f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1784c
jmp 0x37554
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1784c
incq %r13
jmp 0x3750f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x37579
jmp 0x37579
movq %rax, %r14
movl $0xd0, %esi
movq %r15, %rdi
callq 0x13500
jmp 0x3757c
movq %rax, %r14
movq %rbx, %rdi
callq 0x9a81c
movq %r14, %rdi
callq 0x138f0