// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv4sprite
static int readv4sprite(int fil, struct spritetypev4 *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, 1) != 1) return -1;
	if (kread(fil, &spr->shade, 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->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->tag, 4) != 4) return -1;
	if (kread(fil, &spr->extra, 4) != 4) return -1;

	spr->x = B_LITTLE32(spr->x);
	spr->y = B_LITTLE32(spr->y);
	spr->z = B_LITTLE32(spr->z);
	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->tag = B_LITTLE32(spr->tag);
	spr->extra = B_LITTLE32(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 0x31d2f
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x31d2f
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x31d2f
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31d2f
leaq 0xd(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31d2f
leaq 0xe(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31d2f
leaq 0xf(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31d2f
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x12(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x16(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x1c(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x1e(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31d2f
leaq 0x20(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x31d2f
addq $0x24, %r14
movl %ebp, %edi
movq %r14, %rsi
movl $0x4, %edx
callq 0x20684
xorl %ebx, %ebx
cmpl $0x4, %eax
setne %bl
negl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq