// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Shape.cpp
// Function: gaps::R3Shape::Copy() const
R3Shape *R3Shape::
Copy(void) const
{
  // Return copy of appropriate type
  if (ClassID() == R3Box::CLASS_ID()) return new R3Box(*((R3Box *) this));
  else if (ClassID() == R3OrientedBox::CLASS_ID()) return new R3OrientedBox(*((R3OrientedBox *) this));
  else if (ClassID() == R3Cylinder::CLASS_ID()) return new R3Cylinder(*((R3Cylinder *) this));
  else if (ClassID() == R3Cone::CLASS_ID()) return new R3Cone(*((R3Cone *) this));
  else if (ClassID() == R3Ellipsoid::CLASS_ID()) return new R3Ellipsoid(*((R3Ellipsoid *) this));
  else if (ClassID() == R3Sphere::CLASS_ID()) return new R3Sphere(*((R3Sphere *) this));
  else if (ClassID() == R3Triangle::CLASS_ID()) return new R3Triangle(*((R3Triangle *) this));
  else if (ClassID() == R3TriangleArray::CLASS_ID()) return new R3TriangleArray(*((R3TriangleArray *) this));
  else if (ClassID() == R3Circle::CLASS_ID()) return new R3Circle(*((R3Circle *) this));
  else if (ClassID() == R3Ellipse::CLASS_ID()) return new R3Ellipse(*((R3Ellipse *) this));
  else if (ClassID() == R3Rectangle::CLASS_ID()) return new R3Rectangle(*((R3Rectangle *) this));
  else if (ClassID() == R3Polyline::CLASS_ID()) return new R3Polyline(*((R3Polyline *) this));
  else if (ClassID() == R3CatmullRomSpline::CLASS_ID()) return new R3CatmullRomSpline(*((R3CatmullRomSpline *) this));

  // Should never get here
  RNAbort("Unrecognized shape class id: %d\n", ClassID());
  return NULL;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0xd8(%rsp)
callq 0x427e0
movl %eax, %ecx
movl 0xd8(%rsp), %eax
cmpl %ecx, %eax
jne 0x452f8
movl $0x38, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0xc8(%rsp)
callq 0x428c0
jmp 0x452b8
movq 0xc8(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0xc8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x38, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0xc4(%rsp)
callq 0x9eed0
movl %eax, %ecx
movl 0xc4(%rsp), %eax
cmpl %ecx, %eax
jne 0x45389
movl $0x80, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0xb8(%rsp)
callq 0x9efa0
jmp 0x45349
movq 0xb8(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0xb8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x80, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0xb4(%rsp)
callq 0x9e140
movl %eax, %ecx
movl 0xb4(%rsp), %eax
cmpl %ecx, %eax
jne 0x4541a
movl $0xe8, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0xa8(%rsp)
callq 0x9e250
jmp 0x453da
movq 0xa8(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0xa8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0xe8, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0xa4(%rsp)
callq 0x9d5b0
movl %eax, %ecx
movl 0xa4(%rsp), %eax
cmpl %ecx, %eax
jne 0x454ab
movl $0xa0, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x98(%rsp)
callq 0x9d690
jmp 0x4546b
movq 0x98(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x98(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0xa0, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x94(%rsp)
callq 0x9cc60
movl %eax, %ecx
movl 0x94(%rsp), %eax
cmpl %ecx, %eax
jne 0x4553c
movl $0xb8, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x88(%rsp)
callq 0x9cd50
jmp 0x454fc
movq 0x88(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x88(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0xb8, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x84(%rsp)
callq 0x41f20
movl %eax, %ecx
movl 0x84(%rsp), %eax
cmpl %ecx, %eax
jne 0x455c4
movl $0x28, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x78(%rsp)
callq 0x41ff0
jmp 0x4558a
movq 0x78(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x78(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x28, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x74(%rsp)
callq 0x9a750
movl %eax, %ecx
movl 0x74(%rsp), %eax
cmpl %ecx, %eax
jne 0x45646
movl $0x88, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x68(%rsp)
callq 0x9af30
jmp 0x4560c
movq 0x68(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x68(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x88, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x64(%rsp)
callq 0x964f0
movl %eax, %ecx
movl 0x64(%rsp), %eax
cmpl %ecx, %eax
jne 0x456c8
movl $0x70, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x58(%rsp)
callq 0x96670
jmp 0x4568e
movq 0x58(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x58(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x70, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x54(%rsp)
callq 0x95c70
movl %eax, %ecx
movl 0x54(%rsp), %eax
cmpl %ecx, %eax
jne 0x4574a
movl $0x48, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
callq 0x95ea0
jmp 0x45710
movq 0x48(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x48, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x44(%rsp)
callq 0x953e0
movl %eax, %ecx
movl 0x44(%rsp), %eax
cmpl %ecx, %eax
jne 0x457cc
movl $0xb0, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x38(%rsp)
callq 0x954d0
jmp 0x45792
movq 0x38(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0xb0, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x34(%rsp)
callq 0x94060
movl %eax, %ecx
movl 0x34(%rsp), %eax
cmpl %ecx, %eax
jne 0x4584e
movl $0x78, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
callq 0x94130
jmp 0x45814
movq 0x28(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x78, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x24(%rsp)
callq 0x451e0
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jne 0x458d0
movl $0x60, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
callq 0x91ae0
jmp 0x45896
movq 0x18(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x60, %esi
callq 0xf4d0
jmp 0x459a1
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x14(%rsp)
callq 0x451e0
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jne 0x4594c
movl $0x68, %edi
callq 0xf4c0
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x90730
jmp 0x45918
movq 0x8(%rsp), %rax
movq %rax, 0xf0(%rsp)
jmp 0x45991
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
movl $0x68, %esi
callq 0xf4d0
jmp 0x459a1
jmp 0x4594e
jmp 0x45950
jmp 0x45952
jmp 0x45954
jmp 0x45956
jmp 0x45958
jmp 0x4595a
jmp 0x4595c
jmp 0x4595e
jmp 0x45960
jmp 0x45962
jmp 0x45964
movq 0xd0(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, %esi
leaq 0xee3bc(%rip), %rdi     # 0x133d3a
movb $0x0, %al
callq 0xd4e20
movq $0x0, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
addq $0xf8, %rsp
retq
movq 0xe0(%rsp), %rdi
callq 0xf890
nop