// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelLabel.cpp
// Function: gaps::R3SurfelLabel::~R3SurfelLabel()
R3SurfelLabel::
~R3SurfelLabel(void)
{
  // Delete label properties
  while (NLabelProperties() > 0) {
    R3SurfelLabelProperty *property = LabelProperty(NLabelProperties()-1);
    delete property;
  }

  // Delete label relationships
  while (NLabelRelationships() > 0) {
    R3SurfelLabelRelationship *relationship = LabelRelationship(NLabelRelationships()-1);
    delete relationship;
  }

  // Delete label assignments
  while (NLabelAssignments() > 0) {
    R3SurfelLabelAssignment *assignment = LabelAssignment(NLabelAssignments()-1);
    delete assignment;
  }

  // Delete parts
  while (NParts() > 0) {
    R3SurfelLabel *part = Part(NParts()-1);
    delete part;
  }

  // Remove from parent
  SetParent(NULL);

  // Remove label from scene (handles all removals)
  if (scene) scene->RemoveLabel(this);

  // Delete name
  if (name) free(name);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x17eb05(%rip), %rcx    # 0x1eef18
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x68(%rsp), %rdi
callq 0x30b20
movl %eax, 0x64(%rsp)
jmp 0x7042a
movl 0x64(%rsp), %eax
cmpl $0x0, %eax
jle 0x70487
movq 0x68(%rsp), %rdi
callq 0x30b20
movl %eax, 0x60(%rsp)
jmp 0x70443
movq 0x68(%rsp), %rdi
movl 0x60(%rsp), %esi
decl %esi
callq 0x30b40
movq %rax, 0x58(%rsp)
jmp 0x7045a
movq 0x58(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0x70485
movq 0x50(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x7041a
jmp 0x70489
movq 0x68(%rsp), %rdi
callq 0x30b70
movl %eax, 0x4c(%rsp)
jmp 0x70499
movl 0x4c(%rsp), %eax
cmpl $0x0, %eax
jle 0x704f6
movq 0x68(%rsp), %rdi
callq 0x30b70
movl %eax, 0x48(%rsp)
jmp 0x704b2
movq 0x68(%rsp), %rdi
movl 0x48(%rsp), %esi
decl %esi
callq 0x30b90
movq %rax, 0x40(%rsp)
jmp 0x704c9
movq 0x40(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x704f4
movq 0x38(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x70489
jmp 0x704f8
movq 0x68(%rsp), %rdi
callq 0x30bc0
movl %eax, 0x34(%rsp)
jmp 0x70508
movl 0x34(%rsp), %eax
cmpl $0x0, %eax
jle 0x7055f
movq 0x68(%rsp), %rdi
callq 0x30bc0
movl %eax, 0x30(%rsp)
jmp 0x70521
movq 0x68(%rsp), %rdi
movl 0x30(%rsp), %esi
decl %esi
callq 0x30be0
movq %rax, 0x28(%rsp)
jmp 0x70538
movq 0x28(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x7055d
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x704f8
jmp 0x70561
movq 0x68(%rsp), %rdi
callq 0x30c50
movl %eax, 0x1c(%rsp)
jmp 0x70571
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
jle 0x705c8
movq 0x68(%rsp), %rdi
callq 0x30c50
movl %eax, 0x18(%rsp)
jmp 0x7058a
movq 0x68(%rsp), %rdi
movl 0x18(%rsp), %esi
decl %esi
callq 0x30c70
movq %rax, 0x10(%rsp)
jmp 0x705a1
movq 0x10(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x705c6
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x70561
movq 0x68(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
jmp 0x705dc
movq 0x68(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x705fe
movq 0x68(%rsp), %rsi
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
jmp 0x705fc
jmp 0x705fe
movq 0x68(%rsp), %rax
cmpq $0x0, 0x60(%rax)
je 0x70618
movq 0x68(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0x136a0
movq 0x68(%rsp), %rdi
addq $0x50, %rdi
callq 0x1b9b0
movq 0x68(%rsp), %rdi
addq $0x40, %rdi
callq 0x30600
movq 0x68(%rsp), %rdi
addq $0x30, %rdi
callq 0x30610
movq 0x68(%rsp), %rdi
addq $0x20, %rdi
callq 0x30620
addq $0x98, %rsp
retq
movq %rax, %rdi
callq 0x187d0