// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::SetPoints(gaps::GSVPoint const*, int)
void GSVScanline::
SetPoints(const GSVPoint *points, int npoints) 
{
  // Delete previous points
  if (this->points) delete [] this->points;

  // Reset everything
  this->npoints = npoints;
  this->points = NULL;
  this->bbox = R3null_box;

  // Copy points
  if (points && (npoints > 0)) {
    // Allocate points 
    this->points = new GSVPoint [ npoints ];
    if (!this->points) {
      RNAbort("Unable to allocate points for scanline\n");
    }
    
    // Copy points
    for (int i = 0; i < npoints; i++) {
      this->points[i] = points[i];
    }

    // Update bounding box
    for (int i = 0; i < npoints; i++) {
      bbox.Union(this->points[i].Position());
    }
  }

  // Set read count
  read_count = 1;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movl %edx, 0x84(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x28(%rax)
je 0x57542
movq 0x48(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x57540
movq 0x40(%rsp), %rdi
callq 0x296f0
jmp 0x57542
movq 0x48(%rsp), %rdi
movl 0x84(%rsp), %eax
movl %eax, 0x30(%rdi)
movq $0x0, 0x28(%rdi)
addq $0x88, %rdi
leaq 0x2aaf91(%rip), %rsi    # 0x3024f8
callq 0x386d0
cmpq $0x0, 0x88(%rsp)
je 0x57713
cmpl $0x0, 0x84(%rsp)
jle 0x57713
movslq 0x84(%rsp), %rax
movq %rax, 0x30(%rsp)
movl $0x50, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0x28(%rsp)
callq 0x29820
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x38(%rsp)
cmpq $0x0, %rax
je 0x57616
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x5ee80
jmp 0x575fe
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0x575ed
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rax)
cmpq $0x0, 0x28(%rax)
jne 0x5765d
leaq 0x20fd96(%rip), %rdi    # 0x2673c8
movb $0x0, %al
callq 0x1cbee0
jmp 0x5765d
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
callq 0x29030
jmp 0x57727
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
cmpl 0x84(%rsp), %eax
jge 0x576b2
movq 0x48(%rsp), %rax
movq 0x88(%rsp), %rsi
movslq 0x70(%rsp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rsi
movq 0x28(%rax), %rdi
movslq 0x70(%rsp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rdi
movl $0x4e, %edx
callq 0x29120
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x57665
movl $0x0, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
cmpl 0x84(%rsp), %eax
jge 0x57711
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x88, %rcx
movq %rcx, 0x8(%rsp)
movq 0x28(%rax), %rsi
movslq 0x6c(%rsp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rsi
leaq 0x50(%rsp), %rdi
callq 0x3a200
movq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x153680
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x576ba
jmp 0x57713
movq 0x48(%rsp), %rax
movl $0x1, 0x20(%rax)
addq $0x98, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x29c10
nopw %cs:(%rax,%rax)