// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv5sprite
static int readv5sprite(int fil, struct spritetypev5 *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->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->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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x302b0
cmpl $0x4, %eax
je 0x490d1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
movl $0x4, %edx
callq 0x302b0
cmpl $0x4, %eax
je 0x490f7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movl $0x4, %edx
callq 0x302b0
cmpl $0x4, %eax
je 0x4911d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x49143
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0xd, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x49169
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0xe, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x4918f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0xf, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x491b5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x491db
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x12, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x49201
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x14, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x49227
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x16, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x4924d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x49273
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x1a, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x49299
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x1c, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x492bf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x1e, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x492e5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x4930b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x22, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x49331
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x24, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x49357
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49436
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movw 0x10(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x10(%rax)
movq -0x10(%rbp), %rax
movw 0x12(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x12(%rax)
movq -0x10(%rbp), %rax
movw 0x14(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x14(%rax)
movq -0x10(%rbp), %rax
movw 0x16(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x16(%rax)
movq -0x10(%rbp), %rax
movw 0x18(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x18(%rax)
movq -0x10(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x1a(%rax)
movq -0x10(%rbp), %rax
movw 0x1c(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movw 0x1e(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x1e(%rax)
movq -0x10(%rbp), %rax
movw 0x20(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x20(%rax)
movq -0x10(%rbp), %rax
movw 0x22(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x22(%rax)
movq -0x10(%rbp), %rax
movw 0x24(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x24(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop