// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelImage.cpp
// Function: gaps::R3SurfelImage::operator=(gaps::R3SurfelImage const&)
R3SurfelImage& R3SurfelImage::
operator=(const R3SurfelImage& image)
{
  // Copy properties
  this->pose = image.pose;
  this->timestamp = image.timestamp;
  this->image_width = image.image_width; 
  this->image_height = image.image_height;
  this->image_center = image.image_center;
  this->xfocal = image.xfocal;
  this->yfocal = image.yfocal;
  this->distortion_type = image.distortion_type;
  this->radial_distortion[0] = image.radial_distortion[0];
  this->radial_distortion[1] = image.radial_distortion[1];
  this->radial_distortion[2] = image.radial_distortion[2];
  this->tangential_distortion[0] = image.tangential_distortion[0];
  this->tangential_distortion[1] = image.tangential_distortion[1];
  this->rolling_shutter_poses[0] = image.rolling_shutter_poses[0];
  this->rolling_shutter_poses[1] = image.rolling_shutter_poses[1];
  this->rolling_shutter_timestamps[0] = image.rolling_shutter_timestamps[0];
  this->rolling_shutter_timestamps[1] = image.rolling_shutter_timestamps[1];
  this->name = (image.name) ? RNStrdup(image.name) : NULL;
  this->flags = 0;

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

  // Return this
  return *this;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movq 0x58(%rsp), %rsi
addq $0x30, %rsi
addq $0x30, %rdi
callq 0x457f0
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rax
movsd 0x90(%rax), %xmm0
movsd %xmm0, 0x90(%rdi)
movq 0x58(%rsp), %rax
movl 0x98(%rax), %eax
movl %eax, 0x98(%rdi)
movq 0x58(%rsp), %rax
movl 0x9c(%rax), %eax
movl %eax, 0x9c(%rdi)
movq 0x58(%rsp), %rsi
addq $0xa0, %rsi
addq $0xa0, %rdi
callq 0x133c00
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rax
movsd 0xb0(%rax), %xmm0
movsd %xmm0, 0xb0(%rdi)
movq 0x58(%rsp), %rax
movsd 0xb8(%rax), %xmm0
movsd %xmm0, 0xb8(%rdi)
movq 0x58(%rsp), %rax
movl 0xc0(%rax), %eax
movl %eax, 0xc0(%rdi)
movq 0x58(%rsp), %rax
movsd 0xc8(%rax), %xmm0
movsd %xmm0, 0xc8(%rdi)
movq 0x58(%rsp), %rax
movsd 0xd0(%rax), %xmm0
movsd %xmm0, 0xd0(%rdi)
movq 0x58(%rsp), %rax
movsd 0xd8(%rax), %xmm0
movsd %xmm0, 0xd8(%rdi)
movq 0x58(%rsp), %rax
movsd 0xe0(%rax), %xmm0
movsd %xmm0, 0xe0(%rdi)
movq 0x58(%rsp), %rax
movsd 0xe8(%rax), %xmm0
movsd %xmm0, 0xe8(%rdi)
movq 0x58(%rsp), %rsi
addq $0xf0, %rsi
addq $0xf0, %rdi
callq 0x457f0
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rsi
addq $0xf0, %rsi
addq $0x60, %rsi
addq $0xf0, %rdi
addq $0x60, %rdi
callq 0x457f0
movq 0x28(%rsp), %rax
movq 0x58(%rsp), %rcx
movsd 0x1b0(%rcx), %xmm0
movsd %xmm0, 0x1b0(%rax)
movq 0x58(%rsp), %rcx
movsd 0x1b8(%rcx), %xmm0
movsd %xmm0, 0x1b8(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x1c0(%rax)
je 0x682fa
movq 0x58(%rsp), %rax
movq 0x1c0(%rax), %rdi
callq 0x1461b0
movq %rax, 0x20(%rsp)
jmp 0x68303
xorl %eax, %eax
movq %rax, 0x20(%rsp)
jmp 0x68303
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0x1c0(%rax)
leaq 0x50(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b970
movq 0x28(%rsp), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x1c8(%rax)
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x58(%rsp), %rdi
addq $0x20, %rdi
callq 0x16d50
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x68401
movq 0x58(%rsp), %rdi
addq $0x20, %rdi
movl 0x4c(%rsp), %esi
callq 0x6b840
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x683dd
movq 0x28(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x8(%rsp)
movl $0xd0, %edi
callq 0x13570
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rsi
callq 0x1124c0
jmp 0x683ad
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x6b860
jmp 0x683ef
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
movl $0xd0, %esi
callq 0x13580
jmp 0x6840b
movq 0x28(%rsp), %rdi
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6b860
jmp 0x683f1
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x6833b
movq 0x28(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)