// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: initspritelists
void initspritelists(void)
{
	int i;

	for (i=0;i<MAXSECTORS;i++)     //Init doubly-linked sprite sector lists
		headspritesect[i] = -1;
	headspritesect[MAXSECTORS] = 0;
	for(i=0;i<MAXSPRITES;i++)
	{
		prevspritesect[i] = i-1;
		nextspritesect[i] = i+1;
		sprite[i].sectnum = MAXSECTORS;
	}
	prevspritesect[0] = -1;
	nextspritesect[MAXSPRITES-1] = -1;


	for(i=0;i<MAXSTATUS;i++)      //Init doubly-linked sprite status lists
		headspritestat[i] = -1;
	headspritestat[MAXSTATUS] = 0;
	for(i=0;i<MAXSPRITES;i++)
	{
		prevspritestat[i] = i-1;
		nextspritestat[i] = i+1;
		sprite[i].statnum = MAXSTATUS;
	}
	prevspritestat[0] = -1;
	nextspritestat[MAXSPRITES-1] = -1;
}

// Assembly:
pushq %rax
leaq 0x3868e8(%rip), %rdi    # 0x3ac510
movl $0x2000, %edx           # imm = 0x2000
movl $0xff, %esi
callq 0x62f0
movw $0x0, 0x3888d0(%rip)    # 0x3ae510
movaps 0x4e469(%rip), %xmm0    # 0x740b0
movaps 0x4e472(%rip), %xmm1    # 0x740c0
movaps 0x4e47b(%rip), %xmm2    # 0x740d0
movaps 0x4e484(%rip), %xmm3    # 0x740e0
movdqa 0x4e42c(%rip), %xmm4    # 0x74090
leaq 0x25705d(%rip), %rax    # 0x27ccc8
xorl %ecx, %ecx
pcmpeqd %xmm5, %xmm5
leaq 0x3888a8(%rip), %rdx    # 0x3ae520
leaq 0x3908a1(%rip), %rsi    # 0x3b6520
movw $0x1000, %di            # imm = 0x1000
movdqa 0x4e474(%rip), %xmm8    # 0x74100
movdqa %xmm4, %xmm6
paddw %xmm5, %xmm6
movdqa %xmm6, (%rcx,%rdx)
movaps %xmm3, %xmm6
shufps $0x88, %xmm2, %xmm6     # xmm6 = xmm6[0,2],xmm2[0,2]
pslld $0x10, %xmm6
psrad $0x10, %xmm6
movaps %xmm1, %xmm7
shufps $0x88, %xmm0, %xmm7     # xmm7 = xmm7[0,2],xmm0[0,2]
pslld $0x10, %xmm7
psrad $0x10, %xmm7
packssdw %xmm7, %xmm6
psubw %xmm5, %xmm6
movdqa %xmm6, (%rcx,%rsi)
movw %di, (%rax)
movw %di, 0x2c(%rax)
movw %di, 0x58(%rax)
movw %di, 0x84(%rax)
movw %di, 0xb0(%rax)
movw %di, 0xdc(%rax)
movw %di, 0x108(%rax)
movw %di, 0x134(%rax)
paddq %xmm8, %xmm3
paddq %xmm8, %xmm2
paddq %xmm8, %xmm1
paddq %xmm8, %xmm0
paddw 0x4e38e(%rip), %xmm4    # 0x740a0
addq $0x160, %rax            # imm = 0x160
addq $0x10, %rcx
cmpq $0x8000, %rcx           # imm = 0x8000
jne 0x25c8c
movw $0xffff, %ax            # imm = 0xFFFF
movw %ax, 0x3887ec(%rip)     # 0x3ae520
movw %ax, 0x3987e3(%rip)     # 0x3be51e
leaq 0x3987de(%rip), %rdi    # 0x3be520
movl $0x800, %edx            # imm = 0x800
movl $0xff, %esi
callq 0x62f0
movdqa 0x4e346(%rip), %xmm9    # 0x740a0
movdqa 0x4e39d(%rip), %xmm8    # 0x74100
movw $0x0, 0x398fb4(%rip)    # 0x3bed20
movaps 0x4e33d(%rip), %xmm0    # 0x740b0
movaps 0x4e346(%rip), %xmm1    # 0x740c0
movaps 0x4e34f(%rip), %xmm2    # 0x740d0
movaps 0x4e358(%rip), %xmm3    # 0x740e0
movdqa 0x4e300(%rip), %xmm4    # 0x74090
leaq 0x256f33(%rip), %rax    # 0x27ccca
xorl %ecx, %ecx
pcmpeqd %xmm5, %xmm5
leaq 0x398f8c(%rip), %rdx    # 0x3bed30
leaq 0x3a0f85(%rip), %rsi    # 0x3c6d30
movw $0x400, %di             # imm = 0x400
movdqa %xmm4, %xmm6
paddw %xmm5, %xmm6
movdqa %xmm6, (%rcx,%rdx)
movaps %xmm3, %xmm6
shufps $0x88, %xmm2, %xmm6     # xmm6 = xmm6[0,2],xmm2[0,2]
pslld $0x10, %xmm6
psrad $0x10, %xmm6
movaps %xmm1, %xmm7
shufps $0x88, %xmm0, %xmm7     # xmm7 = xmm7[0,2],xmm0[0,2]
pslld $0x10, %xmm7
psrad $0x10, %xmm7
packssdw %xmm7, %xmm6
psubw %xmm5, %xmm6
movdqa %xmm6, (%rcx,%rsi)
movw %di, (%rax)
movw %di, 0x2c(%rax)
movw %di, 0x58(%rax)
movw %di, 0x84(%rax)
movw %di, 0xb0(%rax)
movw %di, 0xdc(%rax)
movw %di, 0x108(%rax)
movw %di, 0x134(%rax)
paddq %xmm8, %xmm3
paddq %xmm8, %xmm2
paddq %xmm8, %xmm1
paddq %xmm8, %xmm0
paddw %xmm9, %xmm4
addq $0x160, %rax            # imm = 0x160
addq $0x10, %rcx
cmpq $0x8000, %rcx           # imm = 0x8000
jne 0x25daf
movw $0xffff, %ax            # imm = 0xFFFF
movw %ax, 0x398edc(%rip)     # 0x3bed30
movw %ax, 0x3a8ed3(%rip)     # 0x3ced2e
popq %rax
retq