// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv6wall
static int readv6wall(int fil, struct walltypev6 *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->nextsector, 2) != 2) return -1;
	if (kread(fil, &wall->nextwall, 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->pal, 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->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->nextsector = B_LITTLE16(wall->nextsector);
	wall->nextwall = B_LITTLE16(wall->nextwall);
	wall->picnum = B_LITTLE16(wall->picnum);
	wall->overpicnum = B_LITTLE16(wall->overpicnum);
	wall->cstat = B_LITTLE16(wall->cstat);
	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 0x201c2
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x4, %eax
jne 0x31069
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x201c2
cmpl $0x4, %eax
jne 0x31069
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0xa(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0xe(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0x12(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x31069
leaq 0x13(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x31069
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0x16(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x31069
leaq 0x17(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x31069
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x31069
leaq 0x19(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x31069
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
leaq 0x1c(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x31069
addq $0x1e, %r14
movl %ebp, %edi
movq %r14, %rsi
movl $0x2, %edx
callq 0x201c2
xorl %ebx, %ebx
cmpl $0x2, %eax
setne %bl
negl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq