// File: /workspace/github_cpp_makefile_star2_O3/carlos-urena[P]svg-gen/svgobjects.cpp
// Function: SpherePolygon::SpherePolygon(Polygon const&, bool)
SpherePolygon::SpherePolygon( const Polygon & orig, bool clip )
{
  style.draw_lines   = true ;
  style.draw_filled  = true ;
  style.close_lines  = true ;
  style.lines_width  = 0.004 ;
  style.fill_opacity = 0.2 ;
  style.lines_color  = vec3( 0.0, 0.0, 1.0 );
  style.fill_color   = vec3( 0.0, 0.0, 1.0 );

  assert( orig.points3D.size() > 0 );

  for( unsigned i = 0 ; i < orig.points3D.size() ; i++ )
  {
      vec3 pesf = orig.points3D[i].normalized();

      if ( clip && pesf[1] < 0.0 )
      {
         const vec3 pcirc = vec3( pesf[0], 0.0, pesf[2] ).normalized() ;
         points3D.push_back( pcirc );
      }
      else
         points3D.push_back( pesf );
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movb $0x0, 0x8(%rdi)
leaq 0x6dd1(%rip), %rax      # 0x11760
movq %rax, (%rdi)
addq $0x20, %rdi
callq 0x6c64
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x68(%rbx)
leaq 0x70ec(%rip), %rax      # 0x11aa0
movq %rax, (%rbx)
movw $0x101, 0x38(%rbx)      # imm = 0x101
movb $0x1, 0x3a(%rbx)
movabsq $0x3e4ccccd3b83126f, %rax # imm = 0x3E4CCCCD3B83126F
movq %rax, 0x3c(%rbx)
movapd 0x2889(%rip), %xmm0     # 0xd260
movupd %xmm0, 0x20(%rbx)
movabsq $0x3f80000000000000, %rax # imm = 0x3F80000000000000
movq %rax, 0x30(%rbx)
movq 0x68(%r15), %rax
cmpq %rax, 0x70(%r15)
je 0xab9a
leaq 0x68(%rbx), %rcx
movq %rcx, -0x68(%rbp)
xorl %r13d, %r13d
movl %r13d, %ecx
shlq $0x2, %rcx
leaq (%rcx,%rcx,2), %r12
addq %rax, %r12
xorpd %xmm0, %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
cvtss2sd (%r12,%rax,4), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0xaa17
cvtsd2ss %xmm0, %xmm0
ucomiss 0x2870(%rip), %xmm0     # 0xd2ac
jb 0xaa44
sqrtss %xmm0, %xmm0
jmp 0xaa49
callq 0x32d0
xorl %eax, %eax
movss (%r12,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0xaa4b
movsd -0x38(%rbp), %xmm1
movss -0x30(%rbp), %xmm0
movss %xmm1, -0x50(%rbp)
movaps %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
movss %xmm2, -0x4c(%rbp)
movss %xmm0, -0x48(%rbp)
testb %r14b, %r14b
je 0xaad5
xorps %xmm3, %xmm3
ucomiss %xmm2, %xmm3
jbe 0xaad5
movss %xmm1, -0x5c(%rbp)
movl $0x0, -0x58(%rbp)
movss %xmm0, -0x54(%rbp)
xorpd %xmm0, %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
cvtss2sd -0x5c(%rbp,%rax,4), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0xaaa8
cvtsd2ss %xmm0, %xmm0
ucomiss 0x27df(%rip), %xmm0     # 0xd2ac
jb 0xaaeb
sqrtss %xmm0, %xmm0
jmp 0xaaf0
movq 0x70(%rbx), %rsi
cmpq 0x78(%rbx), %rsi
je 0xab46
movl -0x48(%rbp), %eax
movl %eax, 0x8(%rsi)
movq -0x50(%rbp), %rax
jmp 0xab3c
callq 0x32d0
xorl %eax, %eax
movss -0x5c(%rbp,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0xaaf2
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss %xmm0, -0x44(%rbp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, -0x40(%rbp)
movss %xmm1, -0x3c(%rbp)
movq 0x70(%rbx), %rsi
cmpq 0x78(%rbx), %rsi
je 0xab55
movl -0x3c(%rbp), %eax
movl %eax, 0x8(%rsi)
movq -0x44(%rbp), %rax
movq %rax, (%rsi)
addq $0xc, 0x70(%rbx)
jmp 0xab62
movq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0xc3cc
jmp 0xab62
movq -0x68(%rbp), %rdi
leaq -0x44(%rbp), %rdx
callq 0xc3cc
incl %r13d
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %r13, %rcx
ja 0xaa03
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2eb7(%rip), %rdi      # 0xda58
leaq 0x2908(%rip), %rsi      # 0xd4b0
leaq 0x2ec2(%rip), %rcx      # 0xda71
movl $0x3de, %edx            # imm = 0x3DE
callq 0x3120
jmp 0xabbb
movq %rax, %r14
movq %rbx, %rdi
callq 0xbbb4
movq %r14, %rdi
callq 0x32b0