// File: carlos-urena[P]svg-gen/svgobjects.cpp
// Function: EllipseSectorZ::EllipseSectorZ(unsigned int, float, float)
EllipseSectorZ::EllipseSectorZ( unsigned n, real lonX, real lonY )
{
  const vec3 center = vec3(0.0,0.0,1.0),
              eje1  = vec3(lonX,0.0,0.0),
              eje2  = vec3(0.0,lonY,0.0) ;

  constexpr double alpha0 = 0.6*pi,
                   alpha1 = -alpha0 ;

  ppol = new Polygon();

  // arco de elipse
  for( unsigned i= 0 ; i < n ; i++ )
  {
    const real ang = alpha0 + (alpha1-alpha0)*real(i)/real(n) ;
    const real c = cos(double(ang)),
               s = sin(double(ang));
    ppol->points3D.push_back( center + c*eje1 + s*eje2 ) ;
  }
  // linea recta a trozos desde alpha1 y vuelta a alpha0
  const vec3 p0 = center+real(cos(alpha1))*eje1 + real(sin(alpha1))*eje2 ,
             p1 = center+real(cos(alpha0))*eje1 + real(sin(alpha0))*eje2 ;

  const unsigned nl = n/2 ;
  for( unsigned i= 0 ; i< nl ; i++ )
  {
    ppol->points3D.push_back( p0 + (real(i)/real(nl))*(p1-p0)) ;
  }
  // style del polígono
  ppol->style.draw_filled = false ;
  ppol->style.draw_lines = true ;
  ppol->style.close_lines = true ;
  ppol->style.lines_width = 0.006 ;
  ppol->style.lines_color  = vec3( 0.0, 1.0, 0.0 );

  // create points
  const vec3 colpoint = vec3(0.0, 1.0, 0.0);
  ppun0 = new Point( p0, colpoint );
  ppun1 = new Point( p1, colpoint );

  // add objects
  add( ppol );
  add( ppun0 );
  add( ppun1 );

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x540, %rsp            # imm = 0x540
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movss %xmm0, -0x10(%rbp)
movss %xmm1, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0xb5b0
movq -0x348(%rbp), %rax
leaq 0x1084e(%rip), %rcx     # 0x1d8d8
movq %rcx, (%rax)
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 0xd0b9
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x8c30
jmp 0xd0de
movl $0x0, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
leaq -0x5c(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x64(%rbp), %rcx
callq 0x8c30
jmp 0xd103
movabsq $0x3ffe28c731eb6950, %rax # imm = 0x3FFE28C731EB6950
movq %rax, -0x70(%rbp)
movabsq $-0x4001d738ce1496b0, %rax # imm = 0xBFFE28C731EB6950
movq %rax, -0x78(%rbp)
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x350(%rbp)
jmp 0xd132
movq -0x350(%rbp), %rdi
callq 0xb040
jmp 0xd140
movq -0x348(%rbp), %rax
movq -0x350(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0xd3c1
movl -0x7c(%rbp), %eax
cvtsi2ss %rax, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa087(%rip), %xmm1     # 0x17200
mulsd %xmm1, %xmm0
movl -0xc(%rbp), %eax
cvtsi2ss %rax, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd 0xa063(%rip), %xmm1     # 0x171f8
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x80(%rbp)
movss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x32b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x84(%rbp)
movss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x3060
movq -0x348(%rbp), %rax
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x88(%rbp)
movq 0x38(%rax), %rax
addq $0x68, %rax
movq %rax, -0x370(%rbp)
movss -0x84(%rbp), %xmm0
leaq -0x48(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x364(%rbp)
movaps %xmm0, -0x360(%rbp)
jmp 0xd20e
movss -0x364(%rbp), %xmm0
movaps -0x360(%rbp), %xmm1
movlpd %xmm1, -0xd0(%rbp)
movss %xmm0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x384(%rbp)
movaps %xmm0, -0x380(%rbp)
jmp 0xd268
movss -0x384(%rbp), %xmm0
movaps -0x380(%rbp), %xmm1
movlpd %xmm1, -0xe0(%rbp)
movss %xmm0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
movl %eax, -0xa8(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movss -0x88(%rbp), %xmm0
leaq -0x5c(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x3a4(%rbp)
movaps %xmm0, -0x3a0(%rbp)
jmp 0xd2c3
movss -0x3a4(%rbp), %xmm0
movaps -0x3a0(%rbp), %xmm1
movlpd %xmm1, -0x100(%rbp)
movss %xmm0, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
movl %eax, -0xe8(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x3c4(%rbp)
movaps %xmm0, -0x3c0(%rbp)
jmp 0xd320
movss -0x3c4(%rbp), %xmm0
movaps -0x3c0(%rbp), %xmm1
movlpd %xmm1, -0x110(%rbp)
movss %xmm0, -0x108(%rbp)
movl -0x108(%rbp), %eax
movl %eax, -0x98(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x94(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8e00
jmp 0xd36e
movq -0x370(%rbp), %rdi
leaq -0x94(%rbp), %rsi
callq 0x13b60
jmp 0xd383
jmp 0xd385
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xd159
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xdb4a
movq -0x350(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x3190
jmp 0xdb4a
movsd 0x9e27(%rip), %xmm0     # 0x171f0
callq 0x32b0
cvtsd2ss %xmm0, %xmm0
leaq -0x48(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x3e4(%rbp)
movaps %xmm0, -0x3e0(%rbp)
jmp 0xd3ec
movss -0x3e4(%rbp), %xmm0
movaps -0x3e0(%rbp), %xmm1
movlpd %xmm1, -0x158(%rbp)
movss %xmm0, -0x150(%rbp)
movl -0x150(%rbp), %eax
movl %eax, -0x140(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x404(%rbp)
movaps %xmm0, -0x400(%rbp)
jmp 0xd446
movss -0x404(%rbp), %xmm0
movaps -0x400(%rbp), %xmm1
movlpd %xmm1, -0x168(%rbp)
movss %xmm0, -0x160(%rbp)
movl -0x160(%rbp), %eax
movl %eax, -0x130(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x138(%rbp)
movsd 0x9d69(%rip), %xmm0     # 0x171f0
callq 0x3060
cvtsd2ss %xmm0, %xmm0
leaq -0x5c(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x424(%rbp)
movaps %xmm0, -0x420(%rbp)
jmp 0xd4aa
movss -0x424(%rbp), %xmm0
movaps -0x420(%rbp), %xmm1
movlpd %xmm1, -0x188(%rbp)
movss %xmm0, -0x180(%rbp)
movl -0x180(%rbp), %eax
movl %eax, -0x170(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x444(%rbp)
movaps %xmm0, -0x440(%rbp)
jmp 0xd507
movss -0x444(%rbp), %xmm0
movaps -0x440(%rbp), %xmm1
movlpd %xmm1, -0x198(%rbp)
movss %xmm0, -0x190(%rbp)
movl -0x190(%rbp), %eax
movl %eax, -0x120(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x11c(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x8e00
jmp 0xd555
movsd 0x9c9b(%rip), %xmm0     # 0x171f8
callq 0x32b0
cvtsd2ss %xmm0, %xmm0
leaq -0x48(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x464(%rbp)
movaps %xmm0, -0x460(%rbp)
jmp 0xd580
movss -0x464(%rbp), %xmm0
movaps -0x460(%rbp), %xmm1
movlpd %xmm1, -0x1e0(%rbp)
movss %xmm0, -0x1d8(%rbp)
movl -0x1d8(%rbp), %eax
movl %eax, -0x1c8(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x484(%rbp)
movaps %xmm0, -0x480(%rbp)
jmp 0xd5da
movss -0x484(%rbp), %xmm0
movaps -0x480(%rbp), %xmm1
movlpd %xmm1, -0x1f0(%rbp)
movss %xmm0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movsd 0x9bdd(%rip), %xmm0     # 0x171f8
callq 0x3060
cvtsd2ss %xmm0, %xmm0
leaq -0x5c(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x4a4(%rbp)
movaps %xmm0, -0x4a0(%rbp)
jmp 0xd63e
movss -0x4a4(%rbp), %xmm0
movaps -0x4a0(%rbp), %xmm1
movlpd %xmm1, -0x210(%rbp)
movss %xmm0, -0x208(%rbp)
movl -0x208(%rbp), %eax
movl %eax, -0x1f8(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x4c4(%rbp)
movaps %xmm0, -0x4c0(%rbp)
jmp 0xd69b
movss -0x4c4(%rbp), %xmm0
movaps -0x4c0(%rbp), %xmm1
movlpd %xmm1, -0x220(%rbp)
movss %xmm0, -0x218(%rbp)
movl -0x218(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x1a4(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x8e00
jmp 0xd6e9
movl -0xc(%rbp), %eax
shrl %eax
movl %eax, -0x224(%rbp)
movl $0x0, -0x228(%rbp)
movl -0x228(%rbp), %eax
cmpl -0x224(%rbp), %eax
jae 0xd89f
movq -0x348(%rbp), %rax
movq 0x38(%rax), %rax
addq $0x68, %rax
movq %rax, -0x4f0(%rbp)
movl -0x228(%rbp), %eax
cvtsi2ss %rax, %xmm0
movl -0x224(%rbp), %eax
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x254(%rbp)
leaq -0x1a4(%rbp), %rdi
leaq -0x11c(%rbp), %rsi
callq 0x8d60
movss %xmm1, -0x4e4(%rbp)
movaps %xmm0, -0x4e0(%rbp)
jmp 0xd76c
movss -0x4e4(%rbp), %xmm0
movaps -0x4e0(%rbp), %xmm1
movlpd %xmm1, -0x270(%rbp)
movss %xmm0, -0x268(%rbp)
movl -0x268(%rbp), %eax
movl %eax, -0x258(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x254(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x13c30
movss %xmm1, -0x504(%rbp)
movaps %xmm0, -0x500(%rbp)
jmp 0xd7c9
movss -0x504(%rbp), %xmm0
movaps -0x500(%rbp), %xmm1
movlpd %xmm1, -0x280(%rbp)
movss %xmm0, -0x278(%rbp)
movl -0x278(%rbp), %eax
movl %eax, -0x248(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x11c(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x13b90
movss %xmm1, -0x524(%rbp)
movaps %xmm0, -0x520(%rbp)
jmp 0xd826
movss -0x524(%rbp), %xmm0
movaps -0x520(%rbp), %xmm1
movlpd %xmm1, -0x290(%rbp)
movss %xmm0, -0x288(%rbp)
movl -0x288(%rbp), %eax
movl %eax, -0x238(%rbp)
movq -0x290(%rbp), %rax
movq %rax, -0x240(%rbp)
leaq -0x234(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x8e00
jmp 0xd874
movq -0x4f0(%rbp), %rdi
leaq -0x234(%rbp), %rsi
callq 0x13b60
jmp 0xd889
jmp 0xd88b
movl -0x228(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x228(%rbp)
jmp 0xd6fe
movq -0x348(%rbp), %rax
movq 0x38(%rax), %rcx
movb $0x0, 0x3a(%rcx)
movq 0x38(%rax), %rcx
movb $0x1, 0x38(%rcx)
movq 0x38(%rax), %rcx
movb $0x1, 0x39(%rcx)
movq 0x38(%rax), %rax
movl $0x3bc49ba6, 0x3c(%rax) # imm = 0x3BC49BA6
movl $0x0, -0x2a0(%rbp)
movl $0x3f800000, -0x2a4(%rbp) # imm = 0x3F800000
movl $0x0, -0x2a8(%rbp)
leaq -0x29c(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x2a4(%rbp), %rdx
leaq -0x2a8(%rbp), %rcx
callq 0x8c30
jmp 0xd90a
movq -0x348(%rbp), %rax
movq 0x38(%rax), %rax
movl -0x294(%rbp), %ecx
movl %ecx, 0x28(%rax)
movq -0x29c(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x0, -0x2b8(%rbp)
movl $0x3f800000, -0x2bc(%rbp) # imm = 0x3F800000
movl $0x0, -0x2c0(%rbp)
leaq -0x2b4(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
leaq -0x2bc(%rbp), %rdx
leaq -0x2c0(%rbp), %rcx
callq 0x8c30
jmp 0xd96a
movl $0x40, %edi
callq 0x31b0
movq %rax, -0x530(%rbp)
jmp 0xd97d
movq -0x530(%rbp), %rdi
movl -0x114(%rbp), %eax
movl %eax, -0x2c8(%rbp)
movq -0x11c(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movl -0x2ac(%rbp), %eax
movl %eax, -0x2d8(%rbp)
movq -0x2b4(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movl -0x2c8(%rbp), %eax
movl %eax, -0x2e8(%rbp)
movq -0x2d0(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movsd -0x2f0(%rbp), %xmm0
movss -0x2e8(%rbp), %xmm1
movl -0x2d8(%rbp), %eax
movl %eax, -0x2f8(%rbp)
movq -0x2e0(%rbp), %rax
movq %rax, -0x300(%rbp)
movsd -0x300(%rbp), %xmm2
movss -0x2f8(%rbp), %xmm3
callq 0xad10
jmp 0xda13
movq -0x348(%rbp), %rax
movq -0x530(%rbp), %rcx
movq %rcx, 0x40(%rax)
movl $0x40, %edi
callq 0x31b0
movq %rax, -0x538(%rbp)
jmp 0xda38
movq -0x538(%rbp), %rdi
movl -0x19c(%rbp), %eax
movl %eax, -0x308(%rbp)
movq -0x1a4(%rbp), %rax
movq %rax, -0x310(%rbp)
movl -0x2ac(%rbp), %eax
movl %eax, -0x318(%rbp)
movq -0x2b4(%rbp), %rax
movq %rax, -0x320(%rbp)
movl -0x308(%rbp), %eax
movl %eax, -0x328(%rbp)
movq -0x310(%rbp), %rax
movq %rax, -0x330(%rbp)
movsd -0x330(%rbp), %xmm0
movss -0x328(%rbp), %xmm1
movl -0x318(%rbp), %eax
movl %eax, -0x338(%rbp)
movq -0x320(%rbp), %rax
movq %rax, -0x340(%rbp)
movsd -0x340(%rbp), %xmm2
movss -0x338(%rbp), %xmm3
callq 0xad10
jmp 0xdace
movq -0x348(%rbp), %rdi
movq -0x538(%rbp), %rax
movq %rax, 0x48(%rdi)
movq 0x38(%rdi), %rsi
callq 0xb660
jmp 0xdaeb
movq -0x348(%rbp), %rdi
movq 0x40(%rdi), %rsi
callq 0xb660
jmp 0xdafd
movq -0x348(%rbp), %rdi
movq 0x48(%rdi), %rsi
callq 0xb660
jmp 0xdb0f
addq $0x540, %rsp            # imm = 0x540
popq %rbp
retq
movq -0x530(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x3190
jmp 0xdb4a
movq -0x538(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x3190
movq -0x348(%rbp), %rdi
callq 0xb5f0
movq -0x38(%rbp), %rdi
callq 0x3280
nop