// File: carlos-urena[P]svg-gen/main.cpp
// Function: main
int main( int argc, char * argv [] )
{
  using namespace std ;

  if ( argc < 3 )
  { cerr << "please specify figure number and name for .svg output file" << endl << flush ;
    return 1 ;
  }

  int arg1 ;
  try
  { arg1 = std::stoi(std::string(argv[1]));
  }
  catch ( std::exception e )
  { cerr << "cannot convert first argument to integer (" << argv[1] << ")" << endl ;
    return 1 ;
  }

  std::string arg2( argv[2] );

  //test_svg_simple( arg1 );
  //test_figura_estrella( arg1 );
  //test_poligonos_estilos( arg1 );

  Figure * fig = nullptr ;

  switch( arg1 )
  {
    case 1 :
      fig = new Figure1_HatBox(  );
      break ;
    case 2 :
      fig = new Figure2_ParamCil(  );
      break ;
    case 3 :
      fig = new Figure3_ParamConPol(  );
      break ;
    case 4 :
      fig = new Figure4_EllipseSectorZ(  );
      break ;
    case 5 :
      fig = new Figure5_EllipseSectorRadial() ;
      break ;
    case 6 :
      fig = new Figure6_SuplPara();
      break ;
    case 7 :
      fig = new Figure7_PSA_shape();
      break ;
    case 8 :
      fig = new Figure8_PSA_ellipse();
      break ;
    case 9 :
      fig = new Figure9_PSA_ellipse_lune();
      break ;
    case 10 :
      fig = new Figure10_PSA_lune();
      break ;
    default:
      cerr << "first argument is an out of range number (" << argv[1] << ")" << endl ;
      return 1 ;
  }

  fig->drawSVG( arg2 );

  return 0 ;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x96ac
movq 0x1497a(%rip), %rdi     # 0x1dff0
leaq 0xdab3(%rip), %rsi      # 0x17130
callq 0x31a0
movq %rax, %rdi
movq 0x1491c(%rip), %rsi     # 0x1dfa8
callq 0x31c0
movq %rax, %rdi
movq 0x1492d(%rip), %rsi     # 0x1dfc8
callq 0x31c0
movl $0x1, -0x4(%rbp)
jmp 0x9cac
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x3290
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3200
jmp 0x96e4
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
movl $0xa, %edx
callq 0x9cd0
movl %eax, -0xa4(%rbp)
jmp 0x96fe
movl -0xa4(%rbp), %eax
movl %eax, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x30f0
leaq -0x39(%rbp), %rdi
callq 0x31d0
jmp 0x9827
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9741
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x30f0
leaq -0x39(%rbp), %rdi
callq 0x31d0
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x9cb8
movq -0x48(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x31e0
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x9d10
movq -0xb8(%rbp), %rdi
callq 0x30b0
movq 0x14867(%rip), %rdi     # 0x1dff0
leaq 0xd9db(%rip), %rsi      # 0x1716b
callq 0x31a0
movq %rax, -0xb0(%rbp)
jmp 0x979e
movq -0xb0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x31a0
movq %rax, -0xc0(%rbp)
jmp 0x97bb
movq -0xc0(%rbp), %rdi
leaq 0xdc27(%rip), %rsi      # 0x173f0
callq 0x31a0
movq %rax, -0xc8(%rbp)
jmp 0x97d7
movq -0xc8(%rbp), %rdi
movq 0x147c3(%rip), %rsi     # 0x1dfa8
callq 0x31c0
jmp 0x97ec
movl $0x1, -0x4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x32d0
callq 0x3260
jmp 0x9cac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x32d0
callq 0x3260
jmp 0x9822
jmp 0x9cb8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xd8(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x3290
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x3200
jmp 0x985f
leaq -0x79(%rbp), %rdi
callq 0x31d0
movq $0x0, -0x88(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xe0(%rbp)
subl $0x9, %eax
ja 0x9bf6
movq -0xe0(%rbp), %rax
leaq 0xd870(%rip), %rcx      # 0x17108
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x31d0
jmp 0x9cb8
movl $0x88, %edi
callq 0x31b0
movq %rax, -0xe8(%rbp)
jmp 0x98ce
movq -0xe8(%rbp), %rdi
callq 0x34a0
jmp 0x98dc
movq -0xe8(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9ca1
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0x88, %edi
callq 0x31b0
movq %rax, -0xf0(%rbp)
jmp 0x9930
movq -0xf0(%rbp), %rdi
callq 0x3a50
jmp 0x993e
movq -0xf0(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0x88, %edi
callq 0x31b0
movq %rax, -0xf8(%rbp)
jmp 0x9981
movq -0xf8(%rbp), %rdi
callq 0x4010
jmp 0x998f
movq -0xf8(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0x88, %edi
callq 0x31b0
movq %rax, -0x100(%rbp)
jmp 0x99d2
movq -0x100(%rbp), %rdi
callq 0x47d0
jmp 0x99e0
movq -0x100(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0x88, %edi
callq 0x31b0
movq %rax, -0x108(%rbp)
jmp 0x9a23
movq -0x108(%rbp), %rdi
callq 0x5170
jmp 0x9a31
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0x88, %edi
callq 0x31b0
movq %rax, -0x110(%rbp)
jmp 0x9a74
movq -0x110(%rbp), %rdi
callq 0x5da0
jmp 0x9a82
movq -0x110(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x110(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0xa8, %edi
callq 0x31b0
movq %rax, -0x118(%rbp)
jmp 0x9ac5
movq -0x118(%rbp), %rdi
callq 0x7b40
jmp 0x9ad3
movq -0x118(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x118(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0xa8, %edi
callq 0x31b0
movq %rax, -0x120(%rbp)
jmp 0x9b16
movq -0x120(%rbp), %rdi
callq 0x7f80
jmp 0x9b24
movq -0x120(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0xa8, %edi
callq 0x31b0
movq %rax, -0x128(%rbp)
jmp 0x9b67
movq -0x128(%rbp), %rdi
callq 0x83c0
jmp 0x9b75
movq -0x128(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x128(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movl $0xa8, %edi
callq 0x31b0
movq %rax, -0x130(%rbp)
jmp 0x9bb8
movq -0x130(%rbp), %rdi
callq 0x8800
jmp 0x9bc6
movq -0x130(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9c73
movq -0x130(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x3190
jmp 0x9ca1
movq 0x143f3(%rip), %rdi     # 0x1dff0
leaq 0xd592(%rip), %rsi      # 0x17196
callq 0x31a0
movq %rax, -0x138(%rbp)
jmp 0x9c12
movq -0x138(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x31a0
movq %rax, -0x140(%rbp)
jmp 0x9c2f
movq -0x140(%rbp), %rdi
leaq 0xd7b3(%rip), %rsi      # 0x173f0
callq 0x31a0
movq %rax, -0x148(%rbp)
jmp 0x9c4b
movq -0x148(%rbp), %rdi
movq 0x1434f(%rip), %rsi     # 0x1dfa8
callq 0x31c0
jmp 0x9c60
movl $0x1, -0x4(%rbp)
movl $0x1, -0x8c(%rbp)
jmp 0x9c96
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x10ac0
jmp 0x9c85
movl $0x0, -0x4(%rbp)
movl $0x1, -0x8c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x30f0
jmp 0x9cac
leaq -0x78(%rbp), %rdi
callq 0x30f0
jmp 0x9cb8
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3280
movq %rax, %rdi
callq 0x91e0
nopl (%rax)