// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekprep.c
// Function: initplayersprite
void
initplayersprite(short snum)
{
     int      i;

     if (playersprite[snum] >= 0) return;

     i=jsinsertsprite(cursectnum[snum], 8);
     if( i == -1 ) {
          crashgame("initplayersprite: jsinsertsprite on player %d failed", snum);
     }
     playersprite[snum]=i;
     sprite[i].x=posx[snum];
     sprite[i].y=posy[snum];
     sprite[i].z=posz[snum]+(KENSPLAYERHEIGHT<<8);
     sprite[i].cstat = 0x101;
     sprite[i].shade=0;
     if( option[4] == 0 ) {
          sprite[i].pal=0;
     }
     else {
          sprite[i].pal=snum+16;
     }
     sprite[i].clipdist=32;
     sprite[i].xrepeat=24;
     sprite[i].yrepeat=24;
     sprite[i].xoffset=0;
     sprite[i].yoffset=0;
     sprite[i].picnum=DOOMGUY;
     sprite[i].ang=ang[snum];
     sprite[i].xvel=0;
     sprite[i].yvel=0;
     sprite[i].zvel=0;
     sprite[i].owner=snum+4096;
     sprite[i].sectnum=cursectnum[snum];
     sprite[i].statnum=8;
     sprite[i].lotag=0;
     sprite[i].hitag=0;
     // important to set extra = -1
     sprite[i].extra=-1;

     tekrestoreplayer(snum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x109775(%rip), %rax    # 0x12e710
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x24fa9
jmp 0x2527f
movswq -0x2(%rbp), %rcx
movl $0x8, %esi
leaq 0x109726(%rip), %rax    # 0x12e6e0
movswl (%rax,%rcx,2), %edi
callq 0x2abd0
cwtl
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
jne 0x24fdf
movswl -0x2(%rbp), %esi
leaq 0xb4e02(%rip), %rdi     # 0xd9dda
movb $0x0, %al
callq 0x44240
movl -0x8(%rbp), %eax
movw %ax, %dx
movswq -0x2(%rbp), %rcx
leaq 0x10971f(%rip), %rax    # 0x12e710
movw %dx, (%rax,%rcx,2)
movswq -0x2(%rbp), %rcx
leaq 0x10884f(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x451ad1(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movswq -0x2(%rbp), %rcx
leaq 0x10886c(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x451aae(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x108888(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %ecx
addl $0x2200, %ecx           # imm = 0x2200
movslq -0x8(%rbp), %rdx
leaq 0x451a84(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x451a6f(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x101, 0xc(%rax)       # imm = 0x101
movslq -0x8(%rbp), %rcx
leaq 0x451a57(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x10(%rax)
leaq 0xf4e7d(%rip), %rax     # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0x250bc
movslq -0x8(%rbp), %rcx
leaq 0x451a31(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x11(%rax)
jmp 0x250da
movswl -0x2(%rbp), %eax
addl $0x10, %eax
movb %al, %cl
movslq -0x8(%rbp), %rdx
leaq 0x451a10(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x11(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4519fb(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x20, 0x12(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4519e5(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x18, 0x14(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4519cf(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x18, 0x15(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4519b9(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x16(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4519a3(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x17(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x45198d(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x3e7, 0xe(%rax)       # imm = 0x3E7
movswq -0x2(%rbp), %rcx
leaq 0x1086c4(%rip), %rax    # 0x12d830
movw (%rax,%rcx,2), %cx
movslq -0x8(%rbp), %rdx
leaq 0x451965(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x1c(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x45194f(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x20(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x451937(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x22(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x45191f(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x24(%rax)
movswl -0x2(%rbp), %eax
addl $0x1000, %eax           # imm = 0x1000
movw %ax, %cx
movslq -0x8(%rbp), %rdx
leaq 0x4518fb(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x1e(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x1094e4(%rip), %rax    # 0x12e6e0
movw (%rax,%rcx,2), %cx
movslq -0x8(%rbp), %rdx
leaq 0x4518d5(%rip), %rax    # 0x476ae0
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x18(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4518bf(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x8, 0x1a(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x4518a7(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x26(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x45188f(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x28(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x451877(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0xffff, 0x2a(%rax)     # imm = 0xFFFF
movswl -0x2(%rbp), %edi
callq 0x24d50
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)