// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv6sprite
static int readv6sprite(int fil, struct spritetypev6 *spr)
{
	if (kread(fil, &spr->x, 4) != 4) return -1;
	if (kread(fil, &spr->y, 4) != 4) return -1;
	if (kread(fil, &spr->z, 4) != 4) return -1;
	if (kread(fil, &spr->cstat, 2) != 2) return -1;
	if (kread(fil, &spr->shade, 1) != 1) return -1;
	if (kread(fil, &spr->pal, 1) != 1) return -1;
	if (kread(fil, &spr->clipdist, 1) != 1) return -1;
	if (kread(fil, &spr->xrepeat, 1) != 1) return -1;
	if (kread(fil, &spr->yrepeat, 1) != 1) return -1;
	if (kread(fil, &spr->xoffset, 1) != 1) return -1;
	if (kread(fil, &spr->yoffset, 1) != 1) return -1;
	if (kread(fil, &spr->picnum, 2) != 2) return -1;
	if (kread(fil, &spr->ang, 2) != 2) return -1;
	if (kread(fil, &spr->xvel, 2) != 2) return -1;
	if (kread(fil, &spr->yvel, 2) != 2) return -1;
	if (kread(fil, &spr->zvel, 2) != 2) return -1;
	if (kread(fil, &spr->owner, 2) != 2) return -1;
	if (kread(fil, &spr->sectnum, 2) != 2) return -1;
	if (kread(fil, &spr->statnum, 2) != 2) return -1;
	if (kread(fil, &spr->lotag, 2) != 2) return -1;
	if (kread(fil, &spr->hitag, 2) != 2) return -1;
	if (kread(fil, &spr->extra, 2) != 2) return -1;

	spr->x = B_LITTLE32(spr->x);
	spr->y = B_LITTLE32(spr->y);
	spr->z = B_LITTLE32(spr->z);
	spr->cstat = B_LITTLE16(spr->cstat);
	spr->picnum = B_LITTLE16(spr->picnum);
	spr->ang = B_LITTLE16(spr->ang);
	spr->xvel = B_LITTLE16(spr->xvel);
	spr->yvel = B_LITTLE16(spr->yvel);
	spr->zvel = B_LITTLE16(spr->zvel);
	spr->owner = B_LITTLE16(spr->owner);
	spr->sectnum = B_LITTLE16(spr->sectnum);
	spr->statnum = B_LITTLE16(spr->statnum);
	spr->lotag = B_LITTLE16(spr->lotag);
	spr->hitag = B_LITTLE16(spr->hitag);
	spr->extra = B_LITTLE16(spr->extra);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x4, %edx
callq 0x20684
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x4, %eax
jne 0x321b4
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x321b4
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x321b4
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0xe(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0xf(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0x11(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0x12(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0x13(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x321b4
leaq 0x16(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x1c(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x1e(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x20(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x22(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x24(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x26(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
leaq 0x28(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x321b4
addq $0x2a, %r14
movl %ebp, %edi
movq %r14, %rsi
movl $0x2, %edx
callq 0x20684
xorl %ebx, %ebx
cmpl $0x2, %eax
setne %bl
negl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq