// File: /workspace/github_c_makefile_star2_O0/jrrk[P]cbzone/c_draw.c
// Function: calcpointsII
void calcpointsII(dc, method, index, g, pl)
     DCp dc;
     Methodp method;
     int index;
     Genericp g, pl;
{
  int i;
  float csa, ssa, dx, dy, xn, yn, cn, sn, prx, pry, prz, rx, ry;
  Coord2dp new;
  Coord3dp old;

  old = dc->s->object+index;
  new = dc->points+index;

  csa = cos(g->azm);
  ssa = sin(g->azm);
  dx = pl->x - dc->pos.x;
  dy = pl->y - dc->pos.y;
  xn =  dx * csa + dy * ssa;
  yn = -dx * ssa + dy * csa;
  cn = pl->ca * csa + pl->sa * ssa;
  sn = pl->sa * csa - ssa * pl->ca;
  for (i=0; i<method->num; i++, old++, new++) {
    rx =  old->x - xn;
    ry =  old->y - yn;
    prx =  rx * cn + ry * sn;
    pry = -rx * sn + ry * cn;
    if (pry < 10.0)
      pry = 10.0;
    prz = old->z + dc->pos.z;
    new->x = 500 + prx / pry * 450;
    new->y = 260 - prz / pry * 450;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x51d0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x5570
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x28(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x8(%rbp), %rax
subss 0x100(%rax), %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
subss 0x104(%rax), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm2
movss -0x3c(%rbp), %xmm1
mulss -0x34(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movss -0x38(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss -0x34(%rbp), %xmm2
movss -0x3c(%rbp), %xmm1
mulss -0x30(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x44(%rbp)
movq -0x28(%rbp), %rax
movss 0x24(%rax), %xmm0
movss -0x30(%rbp), %xmm2
movq -0x28(%rbp), %rax
movss 0x28(%rax), %xmm1
mulss -0x34(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x28(%rbp), %rax
movss 0x28(%rax), %xmm0
movss -0x30(%rbp), %xmm2
movss -0x34(%rbp), %xmm1
movq -0x28(%rbp), %rax
mulss 0x24(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x5b6f
movq -0x70(%rbp), %rax
movswl (%rax), %eax
cvtsi2ss %eax, %xmm0
subss -0x40(%rbp), %xmm0
movss %xmm0, -0x5c(%rbp)
movq -0x70(%rbp), %rax
movswl 0x2(%rax), %eax
cvtsi2ss %eax, %xmm0
subss -0x44(%rbp), %xmm0
movss %xmm0, -0x60(%rbp)
movss -0x5c(%rbp), %xmm0
movss -0x48(%rbp), %xmm2
movss -0x60(%rbp), %xmm1
mulss -0x4c(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x50(%rbp)
movss -0x5c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss -0x4c(%rbp), %xmm2
movss -0x60(%rbp), %xmm1
mulss -0x48(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
movss -0x54(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0xe554(%rip), %xmm0     # 0x14008
ucomisd %xmm1, %xmm0
jbe 0x5ac7
movss 0xe556(%rip), %xmm0     # 0x14018
movss %xmm0, -0x54(%rbp)
movq -0x70(%rbp), %rax
movswl 0x4(%rax), %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movss 0x108(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x58(%rbp)
movss -0x50(%rbp), %xmm1
movss -0x54(%rbp), %xmm0
divss %xmm0, %xmm1
movss 0xe51e(%rip), %xmm0     # 0x1401c
mulss %xmm0, %xmm1
movss 0xe516(%rip), %xmm2     # 0x14020
addss %xmm2, %xmm1
cvttss2si %xmm1, %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, (%rax)
movss -0x58(%rbp), %xmm1
movss -0x54(%rbp), %xmm2
divss %xmm2, %xmm1
mulss %xmm0, %xmm1
movss 0xe4ee(%rip), %xmm0     # 0x14024
subss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, 0x2(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x70(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x68(%rbp)
jmp 0x5a1a
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)