// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelObjectProperty.cpp
// Function: gaps::R3SurfelObjectProperty::Draw(gaps::RNFlags) const
void R3SurfelObjectProperty::
Draw(RNFlags flags) const
{
  // Draw property based on type
  switch (type) {
  case R3_SURFEL_OBJECT_PCA_PROPERTY: 
    if (noperands == 21) {
      R3Point centroid(operands[0], operands[1], operands[2]);
      R3Vector axis1(operands[3], operands[4], operands[5]);
      R3Vector axis2(operands[6], operands[7], operands[8]);
      R3Vector axis3(operands[9], operands[10], operands[11]);
      RNScalar stddev1 = sqrt(operands[12]);
      RNScalar stddev2 = sqrt(operands[13]);
      RNScalar stddev3 = sqrt(operands[14]);
      RNScalar extent01 = operands[15];
      RNScalar extent02 = operands[16];
      RNScalar extent03 = operands[17];
      RNScalar extent11 = operands[18];
      RNScalar extent12 = operands[19];
      RNScalar extent13 = operands[20];

      // Draw normal
      glLineWidth(5);
      RNGrfxBegin(RN_GRFX_LINES);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(0, 0, 1);
      R3LoadPoint(centroid);
      R3LoadPoint(centroid + extent13*axis3);
      RNGrfxEnd();

      // Draw stddevs
      glLineWidth(2);
      RNGrfxBegin(RN_GRFX_LINES);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(1, 0, 0);
      R3LoadPoint(centroid - stddev1 * axis1);
      R3LoadPoint(centroid + stddev1 * axis1);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(0, 1, 0);
      R3LoadPoint(centroid - stddev2 * axis2);
      R3LoadPoint(centroid + stddev2 * axis2);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(0, 0, 1);
      R3LoadPoint(centroid - stddev3 * axis3);
      R3LoadPoint(centroid + stddev3 * axis3);
      RNGrfxEnd();

      // Draw extents
      glLineWidth(1);
      RNGrfxBegin(RN_GRFX_LINES);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(1, 0, 0);
      R3LoadPoint(centroid + extent01 * axis1);
      R3LoadPoint(centroid + extent11 * axis1);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(0, 1, 0);
      R3LoadPoint(centroid + extent02 * axis2);
      R3LoadPoint(centroid + extent12 * axis2);
      if (flags[R3_SURFEL_COLOR_DRAW_FLAG]) RNLoadRgb(0, 0, 1);
      R3LoadPoint(centroid + extent03 * axis3);
      R3LoadPoint(centroid + extent13 * axis3);
      RNGrfxEnd();
    }
    break; 

  case R3_SURFEL_OBJECT_AMODAL_OBB_PROPERTY: 
    if (noperands == 20) {
      // Parse operands
      R3Point centroid(operands[0], operands[1], operands[2]);
      R3Vector axis1(operands[3], operands[4], operands[5]);
      R3Vector axis2(operands[6], operands[7], operands[8]);
      R3Vector axis3(operands[9], operands[10], operands[11]);
      RNScalar radius1 = operands[12];
      RNScalar radius2 = operands[13];
      RNScalar radius3 = operands[14];
      // RNScalar confidence = operands[15];
      // int originator = (int) (operands[16] + 0.5);

      // Check if should draw nose
      RNBoolean draw_nose = TRUE;
      R3SurfelLabel *label = (object) ? object->CurrentLabel() : NULL;
      if (label && label->Flags()[R3_SURFEL_LABEL_UNORIENTABLE_FLAG]) draw_nose = FALSE;

      // Draw obb
      R3OrientedBox obb(centroid, axis1, axis2, radius1, radius2, radius3);
      obb.Outline();

      // Draw nose
      if (draw_nose) {
        double min_nose_vector_length = 0.5;
        double nose_vector_length = 0.25 * radius1;
        if (nose_vector_length < min_nose_vector_length)
          nose_vector_length = min_nose_vector_length;
        R3Point start = centroid + radius1 * axis1;
        R3Point end = start + nose_vector_length * axis1;
        R3Span(start, end).Draw();
      }
    }
    break; 
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r14
movl 0x2c(%rdi), %eax
cmpl $0x2, %eax
je 0x3a8b1
cmpl $0x1, %eax
jne 0x3af20
cmpl $0x15, 0x28(%r14)
jne 0x3af20
movq %rsi, %rbx
movq 0x20(%r14), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
leaq 0x110(%rsp), %rdi
callq 0x781bc
movq 0x20(%r14), %rax
movsd 0x18(%rax), %xmm0
movsd 0x20(%rax), %xmm1
movsd 0x28(%rax), %xmm2
leaq 0xc0(%rsp), %rdi
callq 0x7897c
movq 0x20(%r14), %rax
movsd 0x30(%rax), %xmm0
movsd 0x38(%rax), %xmm1
movsd 0x40(%rax), %xmm2
leaq 0x90(%rsp), %rdi
callq 0x7897c
movq 0x20(%r14), %rax
movsd 0x48(%rax), %xmm0
movsd 0x50(%rax), %xmm1
movsd 0x58(%rax), %xmm2
leaq 0x50(%rsp), %rdi
callq 0x7897c
movq 0x20(%r14), %rax
movsd 0x60(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x3a984
sqrtsd %xmm0, %xmm0
jmp 0x3a98d
cmpl $0x14, 0x28(%r14)
jne 0x3af20
movq 0x20(%r14), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
leaq 0x90(%rsp), %rdi
callq 0x781bc
movq 0x20(%r14), %rax
movsd 0x18(%rax), %xmm0
movsd 0x20(%rax), %xmm1
movsd 0x28(%rax), %xmm2
leaq 0x50(%rsp), %rdi
callq 0x7897c
movq 0x20(%r14), %rax
movsd 0x30(%rax), %xmm0
movsd 0x38(%rax), %xmm1
movsd 0x40(%rax), %xmm2
leaq 0x18(%rsp), %rdi
callq 0x7897c
movq 0x20(%r14), %rax
movsd 0x48(%rax), %xmm0
movsd 0x50(%rax), %xmm1
movsd 0x58(%rax), %xmm2
leaq 0x30(%rsp), %rdi
callq 0x7897c
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rax
movsd 0x60(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x68(%rax), %xmm1
movsd 0x70(%rax), %xmm2
testq %rdi, %rdi
je 0x3ae1e
movsd %xmm2, (%rsp)
movsd %xmm1, 0x8(%rsp)
callq 0x16d9c
testq %rax, %rax
je 0x3ae22
movb 0x88(%rax), %bpl
andb $0x2, %bpl
shrb %bpl
jmp 0x3ae24
callq 0x133d0
xorpd %xmm1, %xmm1
movsd %xmm0, 0x48(%rsp)
movq 0x20(%r14), %rax
movsd 0x68(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x3a9a8
sqrtsd %xmm0, %xmm0
jmp 0x3a9ad
callq 0x133d0
movsd %xmm0, (%rsp)
movq 0x20(%r14), %rax
movsd 0x70(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x3a9cb
sqrtsd %xmm0, %xmm0
jmp 0x3a9d0
callq 0x133d0
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r14), %rax
movsd 0x78(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x80(%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x88(%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x90(%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x98(%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0xa0(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movss 0x8ed97(%rip), %xmm0    # 0xc97d0
callq 0x13930
pushq $0x1
popq %rdi
callq 0x13130
testb $0x1, %bl
je 0x3aa5f
movss 0x8ed81(%rip), %xmm2    # 0xc97d4
xorps %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x13a20
leaq 0x110(%rsp), %r14
movq %r14, %rdi
callq 0x13150
leaq 0x30(%rsp), %r15
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x78483
movq %r12, %rdi
callq 0x13150
callq 0x136d0
movss 0x8ed29(%rip), %xmm0    # 0xc97d8
callq 0x13930
pushq $0x1
popq %rdi
callq 0x13130
testb $0x1, %bl
je 0x3aad5
movss 0x8ed0b(%rip), %xmm0    # 0xc97d4
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x13a20
leaq 0x30(%rsp), %r14
leaq 0xc0(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movsd 0x48(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r12
leaq 0x110(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x7890d
movq %r12, %rdi
callq 0x13150
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movsd 0x48(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r15, %rdi
callq 0x13150
testb $0x1, %bl
je 0x3ab5f
movss 0x8ec80(%rip), %xmm1    # 0xc97d4
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0x13a20
leaq 0x30(%rsp), %r14
leaq 0x90(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r12
leaq 0x110(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x7890d
movq %r12, %rdi
callq 0x13150
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r15, %rdi
callq 0x13150
testb $0x1, %bl
je 0x3abe8
movss 0x8ebf8(%rip), %xmm2    # 0xc97d4
xorps %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x13a20
leaq 0x30(%rsp), %r14
leaq 0x50(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r12
leaq 0x110(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x7890d
movq %r12, %rdi
callq 0x13150
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r15, %rdi
callq 0x13150
callq 0x136d0
movss 0x8eb70(%rip), %xmm0    # 0xc97d4
callq 0x13930
pushq $0x1
popq %rdi
callq 0x13130
testb $0x1, %bl
je 0x3ac8a
movss 0x8eb56(%rip), %xmm0    # 0xc97d4
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x13a20
leaq 0x30(%rsp), %r14
leaq 0xc0(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movsd 0x68(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r12
leaq 0x110(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r12, %rdi
callq 0x13150
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movsd 0x70(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r15, %rdi
callq 0x13150
testb $0x1, %bl
je 0x3ad14
movss 0x8eacb(%rip), %xmm1    # 0xc97d4
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0x13a20
leaq 0x30(%rsp), %r14
leaq 0x90(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movsd 0x78(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r12
leaq 0x110(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r12, %rdi
callq 0x13150
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movsd 0x80(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x78483
movq %r15, %rdi
callq 0x13150
testb $0x1, %bl
je 0x3ada2
movss 0x8ea3e(%rip), %xmm2    # 0xc97d4
xorps %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x13a20
leaq 0x30(%rsp), %rbx
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movsd 0x88(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r15
leaq 0x110(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x78483
movq %r15, %rdi
callq 0x13150
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
callq 0x79072
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x78483
movq %r14, %rdi
callq 0x13150
callq 0x136d0
jmp 0x3af20
xorl %ebp, %ebp
jmp 0x3ae2f
xorl %ebp, %ebp
movsd 0x8(%rsp), %xmm1
movsd (%rsp), %xmm2
leaq 0x110(%rsp), %rbx
leaq 0x90(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x62aea
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x64e70
testb %bpl, %bpl
jne 0x3af13
leaq 0xc0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
movsd 0x10(%rsp), %xmm0
callq 0x79072
leaq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x78483
movsd 0x10(%rsp), %xmm1
mulsd 0x8dc32(%rip), %xmm1    # 0xc8ae0
movsd 0x8d282(%rip), %xmm0    # 0xc8138
maxsd %xmm1, %xmm0
leaq 0xc0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x79072
leaq 0x190(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x78483
leaq 0xc0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x77670
leaq 0xc0(%rsp), %rdi
callq 0x3e642
leaq 0x110(%rsp), %rdi
callq 0x649ae
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3af38
jmp 0x3af38
jmp 0x3af38
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x649ae
movq %rbx, %rdi
callq 0x138f0