// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv5wall
static int readv5wall(int fil, struct walltypev5 *wall)
{
	if (kread(fil, &wall->x, 4) != 4) return -1;
	if (kread(fil, &wall->y, 4) != 4) return -1;
	if (kread(fil, &wall->point2, 2) != 2) return -1;
	if (kread(fil, &wall->picnum, 2) != 2) return -1;
	if (kread(fil, &wall->overpicnum, 2) != 2) return -1;
	if (kread(fil, &wall->shade, 1) != 1) return -1;
	if (kread(fil, &wall->cstat, 2) != 2) return -1;
	if (kread(fil, &wall->xrepeat, 1) != 1) return -1;
	if (kread(fil, &wall->yrepeat, 1) != 1) return -1;
	if (kread(fil, &wall->xpanning, 1) != 1) return -1;
	if (kread(fil, &wall->ypanning, 1) != 1) return -1;
	if (kread(fil, &wall->nextsector1, 2) != 2) return -1;
	if (kread(fil, &wall->nextwall1, 2) != 2) return -1;
	if (kread(fil, &wall->nextsector2, 2) != 2) return -1;
	if (kread(fil, &wall->nextwall2, 2) != 2) return -1;
	if (kread(fil, &wall->lotag, 2) != 2) return -1;
	if (kread(fil, &wall->hitag, 2) != 2) return -1;
	if (kread(fil, &wall->extra, 2) != 2) return -1;

	wall->x = B_LITTLE32(wall->x);
	wall->y = B_LITTLE32(wall->y);
	wall->point2 = B_LITTLE16(wall->point2);
	wall->picnum = B_LITTLE16(wall->picnum);
	wall->overpicnum = B_LITTLE16(wall->overpicnum);
	wall->cstat = B_LITTLE16(wall->cstat);
	wall->nextsector1 = B_LITTLE16(wall->nextsector1);
	wall->nextwall1 = B_LITTLE16(wall->nextwall1);
	wall->nextsector2 = B_LITTLE16(wall->nextsector2);
	wall->nextwall2 = B_LITTLE16(wall->nextwall2);
	wall->lotag = B_LITTLE16(wall->lotag);
	wall->hitag = B_LITTLE16(wall->hitag);
	wall->extra = B_LITTLE16(wall->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 0x319df
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x319df
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0xa(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0xe(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x319df
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0x12(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x319df
leaq 0x13(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x319df
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x319df
leaq 0x15(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x319df
leaq 0x16(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0x1c(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0x1e(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
leaq 0x20(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x319df
addq $0x22, %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