// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: toss
void
toss(short snum)
{
     int       j;

     if( !validplayer(snum) ) {
          crashgame("toss: bad plrnum");
     }
     if( pickup.picnum == 0 ) {
          return;
     }
     j=jsinsertsprite(cursectnum[snum], TOSS);
     if( j != -1 ) {
          if( drawweap[snum] == 0 ) {
               sprptr[j]->x=posx[snum]+(sintable[(ang[snum]+2560+256)&2047]>>6);
               sprptr[j]->y=posy[snum]+(sintable[(ang[snum]+2048+256)&2047]>>6);
          }
          else {
               sprptr[j]->x=posx[snum]-(sintable[(ang[snum]+2560+256)&2047]>>6);
               sprptr[j]->y=posy[snum]-(sintable[(ang[snum]+2048+256)&2047]>>6);
          }
	     sprptr[j]->z=posz[snum]+(4<<8);
	     sprptr[j]->cstat=pickup.cstat;
	     sprptr[j]->shade=pickup.shade;
	     sprptr[j]->pal=pickup.pal;
          sprptr[j]->clipdist=pickup.clipdist;
	     sprptr[j]->xrepeat=pickup.xrepeat;
	     sprptr[j]->yrepeat=pickup.yrepeat;
	     sprptr[j]->xoffset=pickup.xoffset;
	     sprptr[j]->yoffset=pickup.yoffset;
          sprptr[j]->ang=ang[snum];
          switch( pickup.picnum ) {
          case RATPIC:
               sprptr[j]->picnum=RATTHROWPIC;
               break;
          case TUBEBOMB+1:
               sprptr[j]->picnum=TUBEBOMB;
               break;
          case DARTBOMB+1:
               sprptr[j]->picnum=DARTBOMB;
               break;
          default:
               sprptr[j]->picnum=pickup.picnum;
               break;
          }
          sprptr[j]->xvel=sintable[(ang[snum]+2560)&2047]>>6;
          sprptr[j]->yvel=sintable[(ang[snum]+2048)&2047]>>6;
          sprptr[j]->zvel=(80-horiz[snum])<<6;
          sprptr[j]->owner=snum+4096;
          sprptr[j]->sectnum=cursectnum[snum];
          // TOSS will be usin hi/lo tag
          sprptr[j]->lotag=0;
          sprptr[j]->hitag=0;
          sprptr[j]->extra=pickup.extra;
     }
     memset(&pickup, 0, sizeof(pickup));
     pickup.extra=-1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movswl -0x2(%rbp), %edi
callq 0x11c50
cmpl $0x0, %eax
jne 0x2c5cb
leaq 0xadd7d(%rip), %rdi     # 0xda341
movb $0x0, %al
callq 0x44240
movswl 0x2dce4c(%rip), %eax    # 0x30941e
cmpl $0x0, %eax
jne 0x2c5dc
jmp 0x2ca15
movswq -0x2(%rbp), %rcx
movl $0x192, %esi            # imm = 0x192
leaq 0x1020f3(%rip), %rax    # 0x12e6e0
movswl (%rax,%rcx,2), %edi
callq 0x2abd0
cwtl
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
je 0x2c9f9
movswq -0x2(%rbp), %rcx
leaq 0x14bde0(%rip), %rax    # 0x1783f0
cmpl $0x0, (%rax,%rcx,4)
jne 0x2c6c4
movswq -0x2(%rbp), %rcx
leaq 0x10122a(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x1011fb(%rip), %rax    # 0x12d830
movswl (%rax,%rdx,2), %eax
addl $0xa00, %eax            # imm = 0xA00
addl $0x100, %eax            # imm = 0x100
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rdx
leaq 0x59c52e(%rip), %rax    # 0x5c8b80
movswl (%rax,%rdx,2), %eax
sarl $0x6, %eax
addl %eax, %ecx
movslq -0x8(%rbp), %rdx
leaq 0x14db7a(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movswq -0x2(%rbp), %rcx
leaq 0x101218(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x1011a9(%rip), %rax    # 0x12d830
movswl (%rax,%rdx,2), %eax
addl $0x800, %eax            # imm = 0x800
addl $0x100, %eax            # imm = 0x100
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rdx
leaq 0x59c4dc(%rip), %rax    # 0x5c8b80
movswl (%rax,%rdx,2), %eax
sarl $0x6, %eax
addl %eax, %ecx
movslq -0x8(%rbp), %rdx
leaq 0x14db28(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4(%rax)
jmp 0x2c769
movswq -0x2(%rbp), %rcx
leaq 0x101180(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x101151(%rip), %rax    # 0x12d830
movswl (%rax,%rdx,2), %eax
addl $0xa00, %eax            # imm = 0xA00
addl $0x100, %eax            # imm = 0x100
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rdx
leaq 0x59c484(%rip), %rax    # 0x5c8b80
movswl (%rax,%rdx,2), %eax
sarl $0x6, %eax
subl %eax, %ecx
movslq -0x8(%rbp), %rdx
leaq 0x14dad0(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movswq -0x2(%rbp), %rcx
leaq 0x10116e(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x1010ff(%rip), %rax    # 0x12d830
movswl (%rax,%rdx,2), %eax
addl $0x800, %eax            # imm = 0x800
addl $0x100, %eax            # imm = 0x100
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rdx
leaq 0x59c432(%rip), %rax    # 0x5c8b80
movswl (%rax,%rdx,2), %eax
sarl $0x6, %eax
subl %eax, %ecx
movslq -0x8(%rbp), %rdx
leaq 0x14da7e(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x10115b(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %edx
addl $0x400, %edx            # imm = 0x400
movslq -0x8(%rbp), %rcx
leaq 0x14da57(%rip), %rax    # 0x17a1e0
movq %rax, -0x18(%rbp)
movq (%rax,%rcx,8), %rcx
movl %edx, 0x8(%rcx)
movw 0x2dcc81(%rip), %dx     # 0x30941c
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw %dx, 0xc(%rcx)
movb 0x2dcc73(%rip), %dl     # 0x309420
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x10(%rcx)
movb 0x2dcc63(%rip), %dl     # 0x309421
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x11(%rcx)
movb 0x2dcc53(%rip), %dl     # 0x309422
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x12(%rcx)
movb 0x2dcc44(%rip), %dl     # 0x309424
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x14(%rcx)
movb 0x2dcc34(%rip), %dl     # 0x309425
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x15(%rcx)
movb 0x2dcc24(%rip), %dl     # 0x309426
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x16(%rcx)
movb 0x2dcc14(%rip), %dl     # 0x309427
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb %dl, 0x17(%rcx)
movswq -0x2(%rbp), %rdx
leaq 0x101006(%rip), %rcx    # 0x12d830
movw (%rcx,%rdx,2), %cx
movslq -0x8(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movw %cx, 0x1c(%rax)
movswl 0x2dcbdd(%rip), %eax    # 0x30941e
movl %eax, -0xc(%rbp)
subl $0x104, %eax            # imm = 0x104
je 0x2c865
jmp 0x2c84d
movl -0xc(%rbp), %eax
subl $0x1d3, %eax            # imm = 0x1D3
je 0x2c87c
jmp 0x2c859
movl -0xc(%rbp), %eax
subl $0x1d6, %eax            # imm = 0x1D6
je 0x2c893
jmp 0x2c8aa
movslq -0x8(%rbp), %rcx
leaq 0x14d970(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x12b, 0xe(%rax)       # imm = 0x12B
jmp 0x2c8c4
movslq -0x8(%rbp), %rcx
leaq 0x14d959(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x1d2, 0xe(%rax)       # imm = 0x1D2
jmp 0x2c8c4
movslq -0x8(%rbp), %rcx
leaq 0x14d942(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x1d5, 0xe(%rax)       # imm = 0x1D5
jmp 0x2c8c4
movw 0x2dcb6d(%rip), %cx     # 0x30941e
movslq -0x8(%rbp), %rdx
leaq 0x14d924(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xe(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x100f60(%rip), %rax    # 0x12d830
movswl (%rax,%rcx,2), %eax
addl $0xa00, %eax            # imm = 0xA00
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x59c298(%rip), %rax    # 0x5c8b80
movswl (%rax,%rcx,2), %eax
sarl $0x6, %eax
movw %ax, %cx
movslq -0x8(%rbp), %rdx
leaq 0x14d8e3(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x20(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x100f1f(%rip), %rax    # 0x12d830
movswl (%rax,%rcx,2), %eax
addl $0x800, %eax            # imm = 0x800
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x59c257(%rip), %rax    # 0x5c8b80
movswl (%rax,%rcx,2), %eax
sarl $0x6, %eax
movw %ax, %cx
movslq -0x8(%rbp), %rdx
leaq 0x14d8a2(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x22(%rax)
movswq -0x2(%rbp), %rdx
movl $0x50, %eax
leaq 0x101ec9(%rip), %rcx    # 0x12e820
subl (%rcx,%rdx,4), %eax
shll $0x6, %eax
movw %ax, %cx
movslq -0x8(%rbp), %rdx
leaq 0x14d875(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x24(%rax)
movswl -0x2(%rbp), %eax
addl $0x1000, %eax           # imm = 0x1000
movw %ax, %cx
movslq -0x8(%rbp), %rdx
leaq 0x14d856(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x1e(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x101d42(%rip), %rax    # 0x12e6e0
movw (%rax,%rcx,2), %cx
movslq -0x8(%rbp), %rdx
leaq 0x14d833(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x18(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x14d820(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x26(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x14d80b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x28(%rax)
movw 0x2dca54(%rip), %cx     # 0x30943a
movslq -0x8(%rbp), %rdx
leaq 0x14d7ef(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x2a(%rax)
leaq 0x2dca10(%rip), %rdi    # 0x309410
xorl %esi, %esi
movl $0x2c, %edx
callq 0x8410
movw $0xffff, 0x2dca25(%rip) # imm = 0xFFFF
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)