// File: /workspace/github_cpp_makefile_star2_O3/carlos-urena[P]svg-gen/svgobjects.cpp
// Function: Hemisphere::Hemisphere(VectorTempl3<float> const&, float, VectorTempl3<float>, bool)
Hemisphere::Hemisphere( const vec3 & pcenter3D, real pradius3D, vec3 p_view_dir, bool flip_axes )
{


   radius3D = pradius3D ;
   center3D = pcenter3D ;
   view_dir = p_view_dir ;

   const vec3 view_dir_norm = view_dir.normalized(),
              proj_view_dir = vec3( view_dir[0], 0.0, view_dir[2] ),
              axisz         = proj_view_dir.normalized(),
              axisy         = vec3( 0.0, 1.0, 0.0 ),
              axisx         = vec3( -axisz[2], 0.0, axisz[0] ) ;

      auto * contour = new Polygon();

    // add points in the equator
    const int np = 128 ;

    // semicircunference (front side of the equator) (perp. to Y)
    for( int i = 0 ; i < np ; i++ )
    {
       const float angr = M_PI*float(i)/float(np);
       contour->points3D.push_back( center3D + radius3D*( -cos(angr)*axisx + sin(angr)*axisz )  );
    }

    // semicircunference perp. to Z
    const vec3
      axisy_rot = axisx.cross( view_dir_norm ).normalized(); // axisY, but perp. to view dir

    for( int i = 0 ; i < np ; i++ )
    {
       const float angr = M_PI*float(i)/float(np);
       contour->points3D.push_back( center3D + radius3D*(cos(angr)*axisx + sin(angr)*axisy_rot)  );
    }

    contour->style.draw_filled = true ;
    contour->style.use_grad_fill = true ;
    contour->style.grad_fill_name = "hemisphereGradFill" ;

    contour->style.draw_lines  = true ;
    contour->style.lines_width = 0.0035 ;
    contour->style.lines_color = vec3( 0.5, 0.5, 0.5 );
    contour->style.close_lines = true ;


   // back side of the equator (dashed) (perp to Y)

   auto * equator = new Polygon();

   // semicircunference at the equator (perp. to view_dir) (equalt to contour equator)
   for( int i = 0 ; i <= np ; i++ )
   {
      const float angr = M_PI*float(i)/float(np);
      equator->points3D.push_back( center3D + radius3D*( -cos(angr)*axisx - sin(angr)*axisz )  );
   }

   equator->style.draw_filled = false ;
   equator->style.draw_lines  = true ;
   equator->style.dashed_lines = true ; /// dashed!
   equator->style.lines_width = contour->style.lines_width ;
   equator->style.lines_color = contour->style.lines_color;
   equator->style.close_lines = false ;

   // axes

   add( new Axes( 0.005, flip_axes ) );

   // add objects to this object set
   add( equator );
   add( contour );


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edx, %r15d
movss %xmm2, -0x50(%rbp)
movapd %xmm1, -0xc0(%rbp)
movss %xmm0, -0x54(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
movb %al, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movq $0x0, 0x30(%rdi)
leaq 0x9ebe(%rip), %rcx      # 0x11860
movq %rcx, (%rdi)
movb %al, 0x68(%rdi)
leaq 0x9db1(%rip), %r13      # 0x11760
movq %r13, 0x60(%rdi)
addq $0x80, %rdi
callq 0x6c64
leaq 0x40(%rbx), %rax
leaq 0x60(%rbx), %rcx
movq %rcx, -0xe0(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0xe8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xc8(%rbx)
movss -0x54(%rbp), %xmm0
movss %xmm0, 0x38(%rbx)
movl 0x8(%r14), %ecx
movl %ecx, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
movaps -0xc0(%rbp), %xmm0
movlps %xmm0, 0x4c(%rbx)
movss -0x50(%rbp), %xmm0
movss %xmm0, 0x54(%rbx)
xorpd %xmm0, %xmm0
movl $0x13, %eax
xorps %xmm1, %xmm1
cvtss2sd (%rbx,%rax,4), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x16, %rax
jne 0x7a1b
cvtsd2ss %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x7a47
sqrtss %xmm0, %xmm0
jmp 0x7a4c
callq 0x32d0
xorl %eax, %eax
movss 0x4c(%rbx,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7a4e
movsd -0x38(%rbp), %xmm0
movaps %xmm0, -0xc0(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x54(%rbp)
movss 0x4c(%rbx), %xmm0
movss %xmm0, -0xd8(%rbp)
movl $0x0, -0xd4(%rbp)
movss 0x54(%rbx), %xmm0
movss %xmm0, -0xd0(%rbp)
xorpd %xmm0, %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
cvtss2sd -0xd8(%rbp,%rax,4), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0x7aa7
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x7ad6
sqrtss %xmm0, %xmm0
jmp 0x7adb
callq 0x32d0
xorl %eax, %eax
movss -0xd8(%rbp,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7add
movsd -0x38(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss %xmm1, -0xcc(%rbp)
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movss %xmm0, -0xc8(%rbp)
movss %xmm2, -0xc4(%rbp)
movaps 0x5717(%rip), %xmm0     # 0xd240
movaps %xmm2, -0x120(%rbp)
xorps %xmm2, %xmm0
movaps %xmm0, -0x110(%rbp)
movss %xmm0, -0xb0(%rbp)
movl $0x0, -0xac(%rbp)
movaps %xmm1, -0x130(%rbp)
movss %xmm1, -0xa8(%rbp)
movl $0x98, %edi
callq 0x31d0
movq %rax, %r12
movl %r15d, -0xa4(%rbp)
movb $0x0, 0x8(%rax)
movq %r13, (%rax)
leaq 0x20(%rax), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x6c64
movaps -0xc0(%rbp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, -0x100(%rbp)
leaq 0x68(%r12), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r12)
movups %xmm0, 0x78(%r12)
movups %xmm0, 0x68(%r12)
xorl %r13d, %r13d
leaq -0x60(%rbp), %r15
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
mulsd 0x561c(%rip), %xmm0     # 0xd1e8
mulsd 0x561c(%rip), %xmm0     # 0xd1f0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x32e0
cvtsd2ss %xmm0, %xmm0
xorps 0x564f(%rip), %xmm0     # 0xd240
xorl %eax, %eax
movss -0xb0(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7bf3
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x80(%rbp)
movss %xmm1, -0x78(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x3060
cvtsd2ss %xmm0, %xmm0
xorl %eax, %eax
movss -0xcc(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7c33
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x70(%rbp)
movss %xmm1, -0x68(%rbp)
xorl %eax, %eax
movss -0x80(%rbp,%rax,4), %xmm0
addss -0x70(%rbp,%rax,4), %xmm0
movss %xmm0, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7c65
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x90(%rbp)
movss %xmm1, -0x88(%rbp)
movss 0x38(%rbx), %xmm0
xorl %eax, %eax
movss -0x90(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7ca1
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x48(%rbp)
movss %xmm1, -0x40(%rbp)
xorl %eax, %eax
movss 0x40(%rbx,%rax,4), %xmm0
addss -0x48(%rbp,%rax,4), %xmm0
movss %xmm0, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7cd3
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss %xmm0, -0x60(%rbp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, -0x5c(%rbp)
movss %xmm1, -0x58(%rbp)
movq 0x70(%r12), %rsi
cmpq 0x78(%r12), %rsi
je 0x7d2c
movl -0x58(%rbp), %eax
movl %eax, 0x8(%rsi)
movq -0x60(%rbp), %rax
movq %rax, (%rsi)
addq $0xc, 0x70(%r12)
jmp 0x7d37
movq %r14, %rdi
movq %r15, %rdx
callq 0xc244
incl %r13d
cmpl $0x80, %r13d
jne 0x7bbc
movaps -0x110(%rbp), %xmm5
movaps -0x100(%rbp), %xmm2
mulss %xmm2, %xmm5
movaps -0x130(%rbp), %xmm3
mulss %xmm3, %xmm2
xorps %xmm0, %xmm0
movss -0x54(%rbp), %xmm1
mulss %xmm1, %xmm0
subss %xmm2, %xmm0
movaps -0x120(%rbp), %xmm4
mulss %xmm1, %xmm4
movaps -0xc0(%rbp), %xmm2
mulss %xmm2, %xmm3
addss %xmm4, %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movss 0x52a3(%rip), %xmm1     # 0xd03c
mulss %xmm2, %xmm1
addss %xmm5, %xmm1
movlps %xmm0, -0x48(%rbp)
movss %xmm1, -0x40(%rbp)
xorps %xmm0, %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
cvtss2sd -0x48(%rbp,%rax,4), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0x7daf
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x7ddb
sqrtss %xmm0, %xmm0
jmp 0x7de0
callq 0x32d0
xorl %eax, %eax
movss -0x48(%rbp,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7de2
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss %xmm0, -0x60(%rbp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, -0x5c(%rbp)
movss %xmm1, -0x58(%rbp)
xorl %r13d, %r13d
leaq -0x48(%rbp), %r15
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
mulsd 0x53b9(%rip), %xmm0     # 0xd1e8
mulsd 0x53b9(%rip), %xmm0     # 0xd1f0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x32e0
cvtsd2ss %xmm0, %xmm0
xorl %eax, %eax
movss -0xb0(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7e4f
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x70(%rbp)
movss %xmm1, -0x68(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x3060
cvtsd2ss %xmm0, %xmm0
xorl %eax, %eax
movss -0x60(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7e8f
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0xa0(%rbp)
movss %xmm1, -0x98(%rbp)
xorl %eax, %eax
movss -0x70(%rbp,%rax,4), %xmm0
addss -0xa0(%rbp,%rax,4), %xmm0
movss %xmm0, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7ec4
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x80(%rbp)
movss %xmm1, -0x78(%rbp)
movss 0x38(%rbx), %xmm0
xorl %eax, %eax
movss -0x80(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7efd
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x90(%rbp)
movss %xmm1, -0x88(%rbp)
xorl %eax, %eax
movss 0x40(%rbx,%rax,4), %xmm0
addss -0x90(%rbp,%rax,4), %xmm0
movss %xmm0, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x7f32
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss %xmm0, -0x48(%rbp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, -0x44(%rbp)
movss %xmm1, -0x40(%rbp)
movq 0x70(%r12), %rsi
cmpq 0x78(%r12), %rsi
je 0x7f8e
movl -0x40(%rbp), %eax
movl %eax, 0x8(%rsi)
movq -0x48(%rbp), %rax
movq %rax, (%rsi)
addq $0xc, 0x70(%r12)
jmp 0x7f99
movq %r14, %rdi
movq %r15, %rdx
callq 0xc244
incl %r13d
cmpl $0x80, %r13d
jne 0x7e1f
movb $0x1, %al
movb %al, 0x3a(%r12)
movb %al, 0x45(%r12)
movq %r12, %rdi
addq $0x48, %rdi
movq 0x50(%r12), %rdx
leaq 0x587e(%rip), %rcx      # 0xd846
movl $0x12, %r8d
xorl %esi, %esi
callq 0x3240
movw $0x101, 0x38(%r12)      # imm = 0x101
movl $0x3b656042, 0x3c(%r12) # imm = 0x3B656042
movabsq $0x3f0000003f000000, %rax # imm = 0x3F0000003F000000
movq %rax, 0x20(%r12)
movl $0x3f000000, 0x28(%r12) # imm = 0x3F000000
movl $0x98, %edi
callq 0x31d0
movq %rax, %r14
leaq 0x974e(%rip), %rax      # 0x11760
movb $0x0, 0x8(%r14)
movq %rax, (%r14)
leaq 0x20(%r14), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x6c64
movq %r14, %r13
addq $0x68, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r14)
movups %xmm0, 0x78(%r14)
movups %xmm0, 0x68(%r14)
xorl %r15d, %r15d
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
mulsd 0x518f(%rip), %xmm0     # 0xd1e8
mulsd 0x518f(%rip), %xmm0     # 0xd1f0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x32e0
cvtsd2ss %xmm0, %xmm0
xorps 0x51c2(%rip), %xmm0     # 0xd240
xorl %eax, %eax
movss -0xb0(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x8080
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x70(%rbp)
movss %xmm1, -0x68(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x3060
cvtsd2ss %xmm0, %xmm0
xorl %eax, %eax
movss -0xcc(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x80c0
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0xa0(%rbp)
movss %xmm1, -0x98(%rbp)
xorl %eax, %eax
movss -0x70(%rbp,%rax,4), %xmm0
subss -0xa0(%rbp,%rax,4), %xmm0
movss %xmm0, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x80f8
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x80(%rbp)
movss %xmm1, -0x78(%rbp)
movss 0x38(%rbx), %xmm0
xorl %eax, %eax
movss -0x80(%rbp,%rax,4), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x8131
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movsd %xmm0, -0x90(%rbp)
movss %xmm1, -0x88(%rbp)
xorl %eax, %eax
movss 0x40(%rbx,%rax,4), %xmm0
addss -0x90(%rbp,%rax,4), %xmm0
movss %xmm0, -0x38(%rbp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x8166
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss %xmm0, -0x48(%rbp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, -0x44(%rbp)
movss %xmm1, -0x40(%rbp)
movq 0x70(%r14), %rsi
cmpq 0x78(%r14), %rsi
je 0x81bf
movl -0x40(%rbp), %eax
movl %eax, 0x8(%rsi)
movq -0x48(%rbp), %rax
movq %rax, (%rsi)
addq $0xc, 0x70(%r14)
jmp 0x81cb
movq %r13, %rdi
leaq -0x48(%rbp), %rdx
callq 0xc244
incl %r15d
cmpl $0x81, %r15d
jne 0x8049
xorl %eax, %eax
movb %al, 0x3a(%r14)
movb $0x1, %cl
movb %cl, 0x38(%r14)
movb %cl, 0x44(%r14)
movss 0x3c(%r12), %xmm0
movss %xmm0, 0x3c(%r14)
movq -0xe8(%rbp), %rdx
movl 0x8(%rdx), %ecx
movq -0xc0(%rbp), %rsi
movl %ecx, 0x8(%rsi)
movq (%rdx), %rcx
movq %rcx, (%rsi)
movb %al, 0x39(%r14)
movl $0x38, %edi
callq 0x31d0
movq %rax, %r13
movzbl -0xa4(%rbp), %esi
movss 0x5062(%rip), %xmm0     # 0xd294
movq %rax, %rdi
callq 0x976c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7554
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7554
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7554
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r13, %rdi
jmp 0x8285
movq %rax, %r15
movq %r14, %rdi
jmp 0x8285
jmp 0x8299
movq %rax, %r15
movq %r12, %rdi
callq 0x31a0
jmp 0x829c
jmp 0x8299
movq %rax, %r15
jmp 0x82a8
jmp 0x8299
jmp 0x8299
jmp 0x8299
movq %rax, %r15
movq -0xe0(%rbp), %rdi
callq 0xbbb4
leaq 0x94e1(%rip), %rax      # 0x11790
movq %rax, (%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x82c0
callq 0x31a0
movq %r15, %rdi
callq 0x32b0