// File: 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
subq $0x130, %rsp            # imm = 0x130
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xb040
movq -0xc0(%rbp), %rax
leaq 0xc650(%rip), %rcx      # 0x1da88
movq %rcx, (%rax)
movb $0x1, 0x38(%rax)
movb $0x1, 0x3a(%rax)
movb $0x1, 0x39(%rax)
movl $0x3b83126f, 0x3c(%rax) # imm = 0x3B83126F
movl $0x3e4ccccd, 0x40(%rax) # imm = 0x3E4CCCCD
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x3f800000, -0x2c(%rbp) # imm = 0x3F800000
leaq -0x20(%rbp), %rdi
leaq -0x24(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
callq 0x8c30
jmp 0x11481
movq -0xc0(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x3f800000, -0x54(%rbp) # imm = 0x3F800000
leaq -0x48(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x54(%rbp), %rcx
callq 0x8c30
jmp 0x114c2
movq -0xc0(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x2c(%rax)
movl -0x40(%rbp), %ecx
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
callq 0x13790
cmpq $0x0, %rax
jbe 0x114ec
jmp 0x11528
leaq 0x6525(%rip), %rdi      # 0x17a18
leaq 0x5f76(%rip), %rsi      # 0x17470
movl $0x3de, %edx            # imm = 0x3DE
leaq 0x652b(%rip), %rcx      # 0x17a31
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0xb2d0
jmp 0x1170d
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
callq 0x13790
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0x11704
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movl -0x58(%rbp), %eax
movl %eax, %esi
callq 0x13d30
movq %rax, %rdi
callq 0x8ea0
movss %xmm1, -0xe4(%rbp)
movaps %xmm0, -0xe0(%rbp)
jmp 0x11584
movss -0xe4(%rbp), %xmm0
movaps -0xe0(%rbp), %xmm1
movlpd %xmm1, -0x80(%rbp)
movss %xmm0, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x64(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x8e00
jmp 0x115ba
testb $0x1, -0x11(%rbp)
je 0x116dc
leaq -0x64(%rbp), %rdi
callq 0x93d0
movq %rax, -0xf0(%rbp)
jmp 0x115d6
movq -0xf0(%rbp), %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x116dc
leaq -0x64(%rbp), %rdi
callq 0x93d0
movq %rax, -0xf8(%rbp)
jmp 0x11605
movq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
movl $0x0, -0xa8(%rbp)
leaq -0x64(%rbp), %rdi
callq 0x93d0
movq %rax, -0x100(%rbp)
jmp 0x1162f
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rcx
addq $0x8, %rcx
leaq -0xa4(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x8c30
jmp 0x11656
leaq -0xa4(%rbp), %rdi
callq 0x8ea0
movss %xmm1, -0x124(%rbp)
movaps %xmm0, -0x120(%rbp)
jmp 0x11673
movss -0x124(%rbp), %xmm0
movaps -0x120(%rbp), %xmm1
movlpd %xmm1, -0xb8(%rbp)
movss %xmm0, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
movl %eax, -0x90(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x8c(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x8e00
jmp 0x116c1
movq -0xc0(%rbp), %rdi
addq $0x68, %rdi
leaq -0x8c(%rbp), %rsi
callq 0x13cc0
jmp 0x116da
jmp 0x116f4
movq -0xc0(%rbp), %rdi
addq $0x68, %rdi
leaq -0x64(%rbp), %rsi
callq 0x13cc0
jmp 0x116f2
jmp 0x116f4
jmp 0x116f6
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1152f
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3280
nopw %cs:(%rax,%rax)