// File: /workspace/github_c_makefile_star2_O0/jrrk[P]cbzone/c_move.c
// Function: movelander
void movelander(g, pl)
     Genericp g;
     Genericp pl;
{
  float dx, dy, theta;

  if (++g->pcount > 20) {
    g->pcount = 0;

    if (g->range <= 750.0) {
      dx = g->x - pl->x;
      dy = g->y - pl->y;
      theta = atan (dy / (fabs(dx) + 1.0));
      if (dx <= 0.0)
        theta = PI - theta;
      /* the original fortran went to all the trouble of calculating
       * theta above, but never used it.  perhaps the following
       * statement was left out.
       */
      g->azm = theta;
    }

    if (frand() >= 0.5) {
      g->azm += frand() * PI / 4.0;
    }
    else {
      g->azm -= frand() * PI / 4.0;
    }
    g->speed = frand() * 20.0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movl 0x4c(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rcx)
cmpl $0x14, %eax
jle 0x12654
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movss 0x34(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x23ba(%rip), %xmm0     # 0x14860
ucomisd %xmm1, %xmm0
jb 0x12557
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x10(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x18(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x14(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movaps 0x1b89(%rip), %xmm2     # 0x14080
pand %xmm2, %xmm1
movsd 0x1b8d(%rip), %xmm2     # 0x14090
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x5260
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x12549
movss -0x1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x2444(%rip), %xmm0     # 0x14980
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x20(%rax)
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm0
movsd 0x1ad1(%rip), %xmm1     # 0x14040
divsd %xmm1, %xmm0
movsd 0x1b1d(%rip), %xmm1     # 0x14098
ucomisd %xmm1, %xmm0
jb 0x125d1
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm1
movsd 0x1aa7(%rip), %xmm0     # 0x14040
divsd %xmm0, %xmm1
movsd 0x23db(%rip), %xmm0     # 0x14980
mulsd %xmm0, %xmm1
movsd 0x2487(%rip), %xmm0     # 0x14a38
divsd %xmm0, %xmm1
movq -0x8(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rax)
jmp 0x1261f
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm1
movsd 0x1a57(%rip), %xmm0     # 0x14040
divsd %xmm0, %xmm1
movsd 0x238b(%rip), %xmm0     # 0x14980
mulsd %xmm0, %xmm1
movsd 0x2437(%rip), %xmm0     # 0x14a38
divsd %xmm0, %xmm1
movq -0x8(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rax)
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm0
movsd 0x1a09(%rip), %xmm1     # 0x14040
divsd %xmm1, %xmm0
movsd 0x1a05(%rip), %xmm1     # 0x14048
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x2c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)