// File: /workspace/github_c_makefile_star2_O0/jrrk[P]cbzone/c_explode.c
// Function: explodesalvo
void explodesalvo (g, pl)
     Genericp g;
     Genericp pl;
{
  float mrx[5], mry[5];
  float mrz[5], xmoff[5], ymoff[5], zmoff[5];
  static float gravity = 1.0;
  int i, j;
  Coord2dp point, first;

  if (g->dc[0].last) {
    gprsetdrawvalue(opt->cpi[COLOR_BG]);
    multiline(g->dc[0].points, 5);
  }

  if (g->attr & EXERASE || g->ecount >= 20) {
    g->attr = 0;
    return;
  }

  if (g->attr & IS_NEW) {
    g->ccount = 0;
    g->attr &= ~IS_NEW;
    for (j=0; j<5; j++) {
      g->dc[j].vel.x = frand() * 20.0 - 10.0;
      g->dc[j].vel.y = frand() * 20.0 - 10.0;
      g->dc[j].vel.z = -7.5 - frand() * 5.0;
      g->dc[j].pos.x = 0.0;
      g->dc[j].pos.y = 0.0;
      g->dc[j].pos.z = 0.0;
    }
  }
  if (g->dc[0].seen) {
    if (g->salvo == pl)
      gprsetdrawvalue(opt->cpi[COLOR_PSALVO]);
    else
      gprsetdrawvalue(opt->cpi[COLOR_ESALVO]);
    for (i=0; i<5; i++) {
      g->dc[i].pos.x += g->dc[i].vel.x;
      g->dc[i].pos.y += g->dc[i].vel.y;
      g->dc[i].vel.z += gravity;
      g->dc[i].pos.z -= g->dc[i].vel.z;
    }
    point = g->dc[0].points;
    for (i=0; i<5; i++) {
      xmoff[i] = g->dc[i].pos.x + g->x - pl->x;
      ymoff[i] = g->dc[i].pos.y + g->y - pl->y;
      zmoff[i] = g->dc[i].pos.z;
      mrx[i] =  xmoff[i] * pl->ca + ymoff[i] * pl->sa;
      mry[i] = -xmoff[i] * pl->sa + ymoff[i] * pl->ca;
      mrz[i] =  zmoff[i];
      if (mry[i] < 10.0)
        mry[i] = 10.0;
      first = point++;
      point->x = first->x = 500 + mrx[i] / mry[i] * 450;
      first->y = 260 - mrz[i] / mry[i] * 450;
      point->y = first->y+2;
      point++;
    }
    multiline(g->dc[0].points, 5);
    g->dc[0].last = True;
  }
  else
    g->dc[0].last = False;
  g->ccount++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18c(%rax)
je 0x793f
leaq 0x12049(%rip), %rax     # 0x19960
movq (%rax), %rax
movl 0xf0(%rax), %edi
movb $0x0, %al
callq 0x9e90
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x10, %rdi
movl $0x5, %esi
movb $0x0, %al
callq 0x95e0
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x7958
movq -0x8(%rbp), %rax
cmpl $0x14, 0x44(%rax)
jl 0x7968
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
jmp 0x7fcf
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x7b4e
movq -0x8(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, -0xd8(%rbp)
cmpl $0x5, -0xd8(%rbp)
jge 0x7b4c
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm0
movsd 0xc67e(%rip), %xmm1     # 0x14040
divsd %xmm1, %xmm0
movsd 0xc67a(%rip), %xmm1     # 0x14048
mulsd %xmm1, %xmm0
movsd 0xc676(%rip), %xmm1     # 0x14050
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd8(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss %xmm0, 0x10c(%rax)
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm0
movsd 0xc625(%rip), %xmm1     # 0x14040
divsd %xmm1, %xmm0
movsd 0xc621(%rip), %xmm1     # 0x14048
mulsd %xmm1, %xmm0
movsd 0xc61d(%rip), %xmm1     # 0x14050
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd8(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss %xmm0, 0x110(%rax)
callq 0x5500
andq $0xffff, %rax           # imm = 0xFFFF
cvtsi2sd %rax, %xmm0
movsd 0xc5cc(%rip), %xmm1     # 0x14040
divsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xc5d1(%rip), %xmm1     # 0x14068
mulsd %xmm1, %xmm0
movsd 0xc5cd(%rip), %xmm1     # 0x14070
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd8(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss %xmm0, 0x114(%rax)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd8(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x100(%rax)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd8(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x104(%rax)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd8(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x108(%rax)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x799d
jmp 0x7b4e
movq -0x8(%rbp), %rax
cmpl $0x0, 0x188(%rax)
je 0x7fb4
movq -0x8(%rbp), %rax
movq 0x650(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x7b89
leaq 0x11de9(%rip), %rax     # 0x19960
movq (%rax), %rax
movl 0x100(%rax), %edi
movb $0x0, %al
callq 0x9e90
jmp 0x7ba0
leaq 0x11dd0(%rip), %rax     # 0x19960
movq (%rax), %rax
movl 0x110(%rax), %edi
movb $0x0, %al
callq 0x9e90
movl $0x0, -0xd4(%rbp)
cmpl $0x5, -0xd4(%rbp)
jge 0x7cde
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x10c(%rax), %xmm0
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
addss 0x100(%rax), %xmm0
movss %xmm0, 0x100(%rax)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x110(%rax), %xmm0
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
addss 0x104(%rax), %xmm0
movss %xmm0, 0x104(%rax)
movss 0x10ae9(%rip), %xmm0    # 0x1873c
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
addss 0x114(%rax), %xmm0
movss %xmm0, 0x114(%rax)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x114(%rax), %xmm1
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x108(%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x108(%rax)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x7baa
movq -0x8(%rbp), %rax
addq $0x60, %rax
addq $0x10, %rax
movq %rax, -0xe0(%rbp)
movl $0x0, -0xd4(%rbp)
cmpl $0x5, -0xd4(%rbp)
jge 0x7f8c
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x100(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movslq -0xd4(%rbp), %rax
movss %xmm0, -0x90(%rbp,%rax,4)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x104(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x10(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x10(%rax), %xmm0
movslq -0xd4(%rbp), %rax
movss %xmm0, -0xb0(%rbp,%rax,4)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movslq -0xd4(%rbp), %rcx
imulq $0x130, %rcx, %rcx      # imm = 0x130
addq %rcx, %rax
movss 0x108(%rax), %xmm0
movslq -0xd4(%rbp), %rax
movss %xmm0, -0xd0(%rbp,%rax,4)
movslq -0xd4(%rbp), %rax
movss -0x90(%rbp,%rax,4), %xmm0
movq -0x10(%rbp), %rax
movss 0x24(%rax), %xmm2
movslq -0xd4(%rbp), %rax
movss -0xb0(%rbp,%rax,4), %xmm1
movq -0x10(%rbp), %rax
mulss 0x28(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movslq -0xd4(%rbp), %rax
movss %xmm0, -0x30(%rbp,%rax,4)
movslq -0xd4(%rbp), %rax
movss -0x90(%rbp,%rax,4), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movq -0x10(%rbp), %rax
movss 0x28(%rax), %xmm2
movslq -0xd4(%rbp), %rax
movss -0xb0(%rbp,%rax,4), %xmm1
movq -0x10(%rbp), %rax
mulss 0x24(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movslq -0xd4(%rbp), %rax
movss %xmm0, -0x50(%rbp,%rax,4)
movslq -0xd4(%rbp), %rax
movss -0xd0(%rbp,%rax,4), %xmm0
movslq -0xd4(%rbp), %rax
movss %xmm0, -0x70(%rbp,%rax,4)
movslq -0xd4(%rbp), %rax
movss -0x50(%rbp,%rax,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0xc178(%rip), %xmm0     # 0x14008
ucomisd %xmm1, %xmm0
jbe 0x7eab
movslq -0xd4(%rbp), %rax
movss 0xc173(%rip), %xmm0     # 0x14018
movss %xmm0, -0x50(%rbp,%rax,4)
movq -0xe0(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0xe0(%rbp)
movq %rax, -0xe8(%rbp)
movslq -0xd4(%rbp), %rax
movss -0x30(%rbp,%rax,4), %xmm1
movss -0x50(%rbp,%rax,4), %xmm0
divss %xmm0, %xmm1
movss 0xc136(%rip), %xmm0     # 0x1401c
mulss %xmm0, %xmm1
movss 0xc12e(%rip), %xmm2     # 0x14020
addss %xmm2, %xmm1
cvttss2si %xmm1, %eax
movw %ax, %cx
movq -0xe8(%rbp), %rax
movw %cx, (%rax)
movq -0xe0(%rbp), %rax
movw %cx, (%rax)
movslq -0xd4(%rbp), %rax
movss -0x70(%rbp,%rax,4), %xmm1
movss -0x50(%rbp,%rax,4), %xmm2
divss %xmm2, %xmm1
mulss %xmm0, %xmm1
movss 0xc0f0(%rip), %xmm0     # 0x14024
subss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0xe8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0xe8(%rbp), %rax
movswl 0x2(%rax), %eax
addl $0x2, %eax
movw %ax, %cx
movq -0xe0(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0xe0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xe0(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x7cfb
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x10, %rdi
movl $0x5, %esi
movb $0x0, %al
callq 0x95e0
movq -0x8(%rbp), %rax
movl $0x1, 0x18c(%rax)
jmp 0x7fc2
movq -0x8(%rbp), %rax
movl $0x0, 0x18c(%rax)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x48(%rax)
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)