// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::R3SegmentationCluster(gaps::R3SegmentationPoint*, int)
R3SegmentationCluster::
R3SegmentationCluster(R3SegmentationPoint *seed_point, int primitive_type)
  : seed_point(seed_point),
    points(),
    parent(NULL),
    children(),
    pairs(),
    primitive(primitive_type),
    area(0),
    color(0,0,0),
    timestamp(0),
    category_identifier(-1),
    category_confidence(0),
    possible_affinity(0),
    total_affinity(0),
    segmentation(NULL),
    segmentation_index(-1)
{
  // Update primitive and color and area
  if (seed_point) primitive.Update(seed_point);
  if (seed_point) color = seed_point->color;
  if (seed_point) timestamp = seed_point->timestamp;
  if (seed_point) area = seed_point->area;
  if (seed_point) category_identifier = seed_point->category_identifier;
  if (seed_point) category_confidence = seed_point->category_confidence;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, 0x18(%rsp)
callq 0x20260
movq 0x20(%rsp), %rdi
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
movq %rdi, 0x28(%rsp)
callq 0x47650
jmp 0x3d22f
movq 0x20(%rsp), %rdi
addq $0x30, %rdi
movq %rdi, 0x10(%rsp)
callq 0x47660
jmp 0x3d244
movq 0x20(%rsp), %rdi
addq $0x40, %rdi
movq %rdi, 0x8(%rsp)
movl 0x44(%rsp), %esi
callq 0x3bfc0
jmp 0x3d25d
movq 0x20(%rsp), %rdi
movq $0x0, 0xe8(%rdi)
addq $0xf0, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x1731f0
jmp 0x3d284
movq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x108(%rax)
movl $0xffffffff, 0x110(%rax) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movsd %xmm0, 0x118(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x120(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x128(%rax)
movq $0x0, 0x130(%rax)
movl $0xffffffff, 0x138(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, 0x48(%rsp)
je 0x3d34d
movq 0x20(%rsp), %rdi
addq $0x40, %rdi
movq 0x48(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3c1e0
jmp 0x3d2f5
jmp 0x3d34d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x3d40a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x3d400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x3d3f6
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
callq 0x47670
jmp 0x3d3f6
cmpq $0x0, 0x48(%rsp)
je 0x3d373
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rsi
addq $0x78, %rsi
addq $0xf0, %rdi
callq 0x173370
jmp 0x3d371
jmp 0x3d373
cmpq $0x0, 0x48(%rsp)
je 0x3d392
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x108(%rax)
cmpq $0x0, 0x48(%rsp)
je 0x3d3b1
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movsd 0x70(%rcx), %xmm0
movsd %xmm0, 0xe8(%rax)
cmpq $0x0, 0x48(%rsp)
je 0x3d3cf
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movl 0x90(%rcx), %ecx
movl %ecx, 0x110(%rax)
cmpq $0x0, 0x48(%rsp)
je 0x3d3f1
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movsd 0x98(%rcx), %xmm0
movsd %xmm0, 0x118(%rax)
addq $0x58, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0x47690
movq 0x28(%rsp), %rdi
callq 0x476a0
movq 0x18(%rsp), %rdi
callq 0x1f730
movq 0x38(%rsp), %rdi
callq 0x16ca0
nop